Skip to content

Commit c067a62

Browse files
committed
Qt Designer Plugins
0 parents  commit c067a62

File tree

2,749 files changed

+923287
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,749 files changed

+923287
-0
lines changed

.gitignore

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
*.pyc
2+
*.pyo
3+
*.7z*
4+
.idea
5+
.settings
6+
.project
7+
.pydevproject
8+
__pycache__
9+
Docs
10+
Patch*
11+
*.tar.gz

Designer/Linux/plugins/designer/CustomWidgets/PyQt Plugin Dir

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,195 @@
1+
#!/usr/bin/env python
2+
3+
"""
4+
analogclockplugin.py
5+
6+
An analog clock custom widget plugin for Qt Designer.
7+
8+
Copyright (C) 2006 David Boddie <[email protected]>
9+
Copyright (C) 2005-2006 Trolltech ASA. All rights reserved.
10+
11+
This program is free software; you can redistribute it and/or modify
12+
it under the terms of the GNU General Public License as published by
13+
the Free Software Foundation; either version 2 of the License, or
14+
(at your option) any later version.
15+
16+
This program is distributed in the hope that it will be useful,
17+
but WITHOUT ANY WARRANTY; without even the implied warranty of
18+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19+
GNU General Public License for more details.
20+
21+
You should have received a copy of the GNU General Public License
22+
along with this program; if not, write to the Free Software
23+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24+
"""
25+
26+
from PyQt5.QtGui import QIcon, QPixmap
27+
from PyQt5.QtDesigner import QPyDesignerCustomWidgetPlugin
28+
29+
from pluginwidgets.analogclock import PyAnalogClock
30+
31+
32+
class PyAnalogClockPlugin(QPyDesignerCustomWidgetPlugin):
33+
"""PyAnalogClockPlugin(QPyDesignerCustomWidgetPlugin)
34+
35+
Provides a Python custom plugin for Qt Designer by implementing the
36+
QDesignerCustomWidgetPlugin via a PyQt-specific custom plugin class.
37+
"""
38+
39+
# The __init__() method is only used to set up the plugin and define its
40+
# initialized variable.
41+
def __init__(self, parent=None):
42+
43+
super(PyAnalogClockPlugin, self).__init__(parent)
44+
45+
self.initialized = False
46+
47+
# The initialize() and isInitialized() methods allow the plugin to set up
48+
# any required resources, ensuring that this can only happen once for each
49+
# plugin.
50+
def initialize(self, core):
51+
52+
if self.initialized:
53+
return
54+
55+
self.initialized = True
56+
57+
def isInitialized(self):
58+
59+
return self.initialized
60+
61+
# This factory method creates new instances of our custom widget with the
62+
# appropriate parent.
63+
def createWidget(self, parent):
64+
return PyAnalogClock(parent)
65+
66+
# This method returns the name of the custom widget class that is provided
67+
# by this plugin.
68+
def name(self):
69+
return "PyAnalogClock"
70+
71+
# Returns the name of the group in Qt Designer's widget box that this
72+
# widget belongs to.
73+
def group(self):
74+
return "PyQt Examples"
75+
76+
# Returns the icon used to represent the custom widget in Qt Designer's
77+
# widget box.
78+
def icon(self):
79+
return QIcon(_logo_pixmap)
80+
81+
# Returns a short description of the custom widget for use in a tool tip.
82+
def toolTip(self):
83+
return ""
84+
85+
# Returns a short description of the custom widget for use in a "What's
86+
# This?" help message for the widget.
87+
def whatsThis(self):
88+
return ""
89+
90+
# Returns True if the custom widget acts as a container for other widgets;
91+
# otherwise returns False. Note that plugins for custom containers also
92+
# need to provide an implementation of the QDesignerContainerExtension
93+
# interface if they need to add custom editing support to Qt Designer.
94+
def isContainer(self):
95+
return False
96+
97+
# Returns an XML description of a custom widget instance that describes
98+
# default values for its properties. Each custom widget created by this
99+
# plugin will be configured using this description.
100+
def domXml(self):
101+
return '<widget class="PyAnalogClock" name="analogClock">\n' \
102+
' <property name="toolTip">\n' \
103+
' <string>The current time</string>\n' \
104+
' </property>\n' \
105+
' <property name="whatsThis">\n' \
106+
' <string>The analog clock widget displays the current ' \
107+
'time.</string>\n' \
108+
' </property>\n' \
109+
'</widget>\n'
110+
111+
# Returns the module containing the custom widget class. It may include
112+
# a module path.
113+
def includeFile(self):
114+
return "analogclock"
115+
116+
117+
# Define the image used for the icon.
118+
_logo_16x16_xpm = [
119+
"16 16 58 1",
120+
"L c #2d2d2d",
121+
"N c #4f4f4f",
122+
"K c #636363",
123+
"J c #666666",
124+
"I c #696969",
125+
"D c #727272",
126+
"F c #737373",
127+
"O c #757575",
128+
"G c #7f7f7f",
129+
"o c #878787",
130+
"t c #888888",
131+
"Y c #898989",
132+
"c c #8a8a8a",
133+
"d c #8b8b8b",
134+
"H c #8d8d8d",
135+
"Q c #8f8f8f",
136+
"b c #909090",
137+
"M c #959595",
138+
"g c #979797",
139+
"n c #989898",
140+
"x c #999999",
141+
"0 c #9a9a9a",
142+
"X c #9b9b9b",
143+
"a c #9d9d9d",
144+
"E c #9e9e9e",
145+
"1 c #9f9f9f",
146+
"T c #a0a0a0",
147+
"v c #a1a1a1",
148+
"r c #a2a2a2",
149+
"B c #a6a6a6",
150+
"R c #a7a7a7",
151+
"3 c #a8a8a8",
152+
"z c #aaaaaa",
153+
"A c #ababab",
154+
"m c #acacac",
155+
"h c #adadad",
156+
"u c #b1b1b1",
157+
"q c #b2b2b2",
158+
"V c #bfbfbf",
159+
"W c #c6c6c6",
160+
"w c #c7c7c7",
161+
"s c #c8c8c8",
162+
"p c #c9c9c9",
163+
"k c #cdcdcd",
164+
"l c #cfcfcf",
165+
"2 c #d3d3d3",
166+
"S c #d4d4d4",
167+
"C c #d5d5d5",
168+
"y c #d8d8d8",
169+
"# c #d9d9d9",
170+
"e c #dadada",
171+
"i c #dbdbdb",
172+
"P c #dcdcdc",
173+
"U c #dfdfdf",
174+
"j c #e1e1e1",
175+
"f c #fbfbfb",
176+
"Z c #fcfcfc",
177+
". c #ffffff",
178+
"....#abcdbae....",
179+
"..fghijkljimnf..",
180+
".fopjjjqrjjjstf.",
181+
".gsjjjjuvjjjjwx.",
182+
"yvjjjjjzbjjjjjAi",
183+
"BCjjjjjaDjjjjjiE",
184+
"bjjjjjjEFjjjjjjG",
185+
"HjjjjjjIJjjjjjjc",
186+
"HjjjjjjnKLtjjjjc",
187+
"bjjjjjjj#MNOPjjQ",
188+
"RSjjjjjjjj#mdPiE",
189+
"#TjjjjjjjjjjUjzP",
190+
".nVjjjjjjjjjjWX.",
191+
".fEVjjjjjjjjWYZ.",
192+
"..f012jjjj2EXZ..",
193+
"....i3QccQ3P...."]
194+
195+
_logo_pixmap = QPixmap(_logo_16x16_xpm)

0 commit comments

Comments
 (0)