Documentation/Source/eric4.E4Gui.E4Led.html

changeset 3
0d9daebf5b8c
equal deleted inserted replaced
2:bc6196164237 3:0d9daebf5b8c
1 <?xml version="1.0" encoding="utf-8"?>
2 <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
3 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
4 <html><head>
5 <title>eric4.E4Gui.E4Led</title>
6 <style>
7 body {
8 background:white;
9 margin: 0em 1em 10em 1em;
10 color: black;
11 }
12
13 h1 { color: white; background: #4FA4FF; }
14 h2 { color: white; background: #4FA4FF; }
15 h3 { color: white; background: #00557F; }
16 h4 { color: white; background: #00557F; }
17
18 a { color: #AA5500; }
19
20 </style>
21 </head>
22 <body><a NAME="top" ID="top"></a>
23 <h1>eric4.E4Gui.E4Led</h1>
24 <p>
25 Module implementing a LED widget.
26 </p><p>
27 It was inspired by KLed.
28 </p>
29 <h3>Global Attributes</h3>
30 <table>
31 <tr><td>E4LedCircular</td></tr><tr><td>E4LedRectangular</td></tr>
32 </table>
33 <h3>Classes</h3>
34 <table>
35 <tr>
36 <td><a href="#E4Led">E4Led</a></td>
37 <td>Class implementing a LED widget.</td>
38 </tr>
39 </table>
40 <h3>Functions</h3>
41 <table>
42 <tr><td>None</td></tr>
43 </table>
44 <hr /><hr />
45 <a NAME="E4Led" ID="E4Led"></a>
46 <h2>E4Led</h2>
47 <p>
48 Class implementing a LED widget.
49 </p>
50 <h3>Derived from</h3>
51 QWidget
52 <h3>Class Attributes</h3>
53 <table>
54 <tr><td>None</td></tr>
55 </table>
56 <h3>Methods</h3>
57 <table>
58 <tr>
59 <td><a href="#E4Led.__init__">E4Led</a></td>
60 <td>Constructor</td>
61 </tr><tr>
62 <td><a href="#E4Led.__getBestRoundSize">__getBestRoundSize</a></td>
63 <td>Private method to calculate the width of the LED.</td>
64 </tr><tr>
65 <td><a href="#E4Led.__paintRectangular">__paintRectangular</a></td>
66 <td>Private method to paint a rectangular raised LED.</td>
67 </tr><tr>
68 <td><a href="#E4Led.__paintRound">__paintRound</a></td>
69 <td>Private method to paint a round raised LED.</td>
70 </tr><tr>
71 <td><a href="#E4Led.color">color</a></td>
72 <td>Public method to return the LED color.</td>
73 </tr><tr>
74 <td><a href="#E4Led.darkFactor">darkFactor</a></td>
75 <td>Public method to return the dark factor.</td>
76 </tr><tr>
77 <td><a href="#E4Led.isFramed">isFramed</a></td>
78 <td>Public method to return the framed state.</td>
79 </tr><tr>
80 <td><a href="#E4Led.isOn">isOn</a></td>
81 <td>Public method to return the LED state.</td>
82 </tr><tr>
83 <td><a href="#E4Led.minimumSizeHint">minimumSizeHint</a></td>
84 <td>Public method to give a hint about our minimum size.</td>
85 </tr><tr>
86 <td><a href="#E4Led.off">off</a></td>
87 <td>Public slot to set the LED to off.</td>
88 </tr><tr>
89 <td><a href="#E4Led.on">on</a></td>
90 <td>Public slot to set the LED to on.</td>
91 </tr><tr>
92 <td><a href="#E4Led.paintEvent">paintEvent</a></td>
93 <td>Protected slot handling the paint event.</td>
94 </tr><tr>
95 <td><a href="#E4Led.ratio">ratio</a></td>
96 <td>Public method to return the LED rectangular ratio (width / height).</td>
97 </tr><tr>
98 <td><a href="#E4Led.setColor">setColor</a></td>
99 <td>Public method to set the LED color.</td>
100 </tr><tr>
101 <td><a href="#E4Led.setDarkFactor">setDarkFactor</a></td>
102 <td>Public method to set the dark factor.</td>
103 </tr><tr>
104 <td><a href="#E4Led.setFramed">setFramed</a></td>
105 <td>Public slot to set the __framedLed attribute.</td>
106 </tr><tr>
107 <td><a href="#E4Led.setOn">setOn</a></td>
108 <td>Public method to set the LED to on.</td>
109 </tr><tr>
110 <td><a href="#E4Led.setRatio">setRatio</a></td>
111 <td>Public method to set the LED rectangular ratio (width / height).</td>
112 </tr><tr>
113 <td><a href="#E4Led.setShape">setShape</a></td>
114 <td>Public method to set the LED shape.</td>
115 </tr><tr>
116 <td><a href="#E4Led.shape">shape</a></td>
117 <td>Public method to return the LED shape.</td>
118 </tr><tr>
119 <td><a href="#E4Led.sizeHint">sizeHint</a></td>
120 <td>Public method to give a hint about our desired size.</td>
121 </tr><tr>
122 <td><a href="#E4Led.toggle">toggle</a></td>
123 <td>Public slot to toggle the LED state.</td>
124 </tr>
125 </table>
126 <a NAME="E4Led.__init__" ID="E4Led.__init__"></a>
127 <h4>E4Led (Constructor)</h4>
128 <b>E4Led</b>(<i>parent = None, color = None, shape = E4LedCircular, rectRatio = 1</i>)
129 <p>
130 Constructor
131 </p><dl>
132 <dt><i>parent</i></dt>
133 <dd>
134 reference to parent widget (QWidget)
135 </dd><dt><i>color</i></dt>
136 <dd>
137 color of the LED (QColor)
138 </dd><dt><i>shape</i></dt>
139 <dd>
140 shape of the LED (E4LedCircular, E4LedRectangular)
141 </dd><dt><i>rectRation</i></dt>
142 <dd>
143 ratio width to height, if shape is rectangular (float)
144 </dd>
145 </dl><a NAME="E4Led.__getBestRoundSize" ID="E4Led.__getBestRoundSize"></a>
146 <h4>E4Led.__getBestRoundSize</h4>
147 <b>__getBestRoundSize</b>(<i></i>)
148 <p>
149 Private method to calculate the width of the LED.
150 </p><dl>
151 <dt>Returns:</dt>
152 <dd>
153 new width of the LED (integer)
154 </dd>
155 </dl><a NAME="E4Led.__paintRectangular" ID="E4Led.__paintRectangular"></a>
156 <h4>E4Led.__paintRectangular</h4>
157 <b>__paintRectangular</b>(<i></i>)
158 <p>
159 Private method to paint a rectangular raised LED.
160 </p><a NAME="E4Led.__paintRound" ID="E4Led.__paintRound"></a>
161 <h4>E4Led.__paintRound</h4>
162 <b>__paintRound</b>(<i></i>)
163 <p>
164 Private method to paint a round raised LED.
165 </p><a NAME="E4Led.color" ID="E4Led.color"></a>
166 <h4>E4Led.color</h4>
167 <b>color</b>(<i></i>)
168 <p>
169 Public method to return the LED color.
170 </p><dl>
171 <dt>Returns:</dt>
172 <dd>
173 color of the LED (QColor)
174 </dd>
175 </dl><a NAME="E4Led.darkFactor" ID="E4Led.darkFactor"></a>
176 <h4>E4Led.darkFactor</h4>
177 <b>darkFactor</b>(<i></i>)
178 <p>
179 Public method to return the dark factor.
180 </p><dl>
181 <dt>Returns:</dt>
182 <dd>
183 the current dark factor (integer)
184 </dd>
185 </dl><a NAME="E4Led.isFramed" ID="E4Led.isFramed"></a>
186 <h4>E4Led.isFramed</h4>
187 <b>isFramed</b>(<i></i>)
188 <p>
189 Public method to return the framed state.
190 </p><dl>
191 <dt>Returns:</dt>
192 <dd>
193 flag indicating the current framed state (boolean)
194 </dd>
195 </dl><a NAME="E4Led.isOn" ID="E4Led.isOn"></a>
196 <h4>E4Led.isOn</h4>
197 <b>isOn</b>(<i></i>)
198 <p>
199 Public method to return the LED state.
200 </p><dl>
201 <dt>Returns:</dt>
202 <dd>
203 flag indicating the light state (boolean)
204 </dd>
205 </dl><a NAME="E4Led.minimumSizeHint" ID="E4Led.minimumSizeHint"></a>
206 <h4>E4Led.minimumSizeHint</h4>
207 <b>minimumSizeHint</b>(<i></i>)
208 <p>
209 Public method to give a hint about our minimum size.
210 </p><dl>
211 <dt>Returns:</dt>
212 <dd>
213 size hint (QSize)
214 </dd>
215 </dl><a NAME="E4Led.off" ID="E4Led.off"></a>
216 <h4>E4Led.off</h4>
217 <b>off</b>(<i></i>)
218 <p>
219 Public slot to set the LED to off.
220 </p><a NAME="E4Led.on" ID="E4Led.on"></a>
221 <h4>E4Led.on</h4>
222 <b>on</b>(<i></i>)
223 <p>
224 Public slot to set the LED to on.
225 </p><a NAME="E4Led.paintEvent" ID="E4Led.paintEvent"></a>
226 <h4>E4Led.paintEvent</h4>
227 <b>paintEvent</b>(<i>evt</i>)
228 <p>
229 Protected slot handling the paint event.
230 </p><dl>
231 <dt><i>evt</i></dt>
232 <dd>
233 paint event object (QPaintEvent)
234 </dd>
235 </dl><dl>
236 <dt>Raises <b>TypeError</b>:</dt>
237 <dd>
238 The E4Led has an unsupported shape type.
239 </dd>
240 </dl><a NAME="E4Led.ratio" ID="E4Led.ratio"></a>
241 <h4>E4Led.ratio</h4>
242 <b>ratio</b>(<i></i>)
243 <p>
244 Public method to return the LED rectangular ratio (width / height).
245 </p><dl>
246 <dt>Returns:</dt>
247 <dd>
248 LED rectangular ratio (float)
249 </dd>
250 </dl><a NAME="E4Led.setColor" ID="E4Led.setColor"></a>
251 <h4>E4Led.setColor</h4>
252 <b>setColor</b>(<i>color</i>)
253 <p>
254 Public method to set the LED color.
255 </p><dl>
256 <dt><i>color</i></dt>
257 <dd>
258 color for the LED (QColor)
259 </dd>
260 </dl><a NAME="E4Led.setDarkFactor" ID="E4Led.setDarkFactor"></a>
261 <h4>E4Led.setDarkFactor</h4>
262 <b>setDarkFactor</b>(<i>darkfactor</i>)
263 <p>
264 Public method to set the dark factor.
265 </p><dl>
266 <dt><i>darkfactor</i></dt>
267 <dd>
268 value to set for the dark factor (integer)
269 </dd>
270 </dl><a NAME="E4Led.setFramed" ID="E4Led.setFramed"></a>
271 <h4>E4Led.setFramed</h4>
272 <b>setFramed</b>(<i>framed</i>)
273 <p>
274 Public slot to set the __framedLed attribute.
275 </p><dl>
276 <dt><i>framed</i></dt>
277 <dd>
278 flag indicating the framed state (boolean)
279 </dd>
280 </dl><a NAME="E4Led.setOn" ID="E4Led.setOn"></a>
281 <h4>E4Led.setOn</h4>
282 <b>setOn</b>(<i>state</i>)
283 <p>
284 Public method to set the LED to on.
285 </p><dl>
286 <dt><i>state</i></dt>
287 <dd>
288 new state of the LED (boolean)
289 </dd>
290 </dl><a NAME="E4Led.setRatio" ID="E4Led.setRatio"></a>
291 <h4>E4Led.setRatio</h4>
292 <b>setRatio</b>(<i>ratio</i>)
293 <p>
294 Public method to set the LED rectangular ratio (width / height).
295 </p><dl>
296 <dt><i>ratio</i></dt>
297 <dd>
298 new LED rectangular ratio (float)
299 </dd>
300 </dl><a NAME="E4Led.setShape" ID="E4Led.setShape"></a>
301 <h4>E4Led.setShape</h4>
302 <b>setShape</b>(<i>shape</i>)
303 <p>
304 Public method to set the LED shape.
305 </p><dl>
306 <dt><i>shape</i></dt>
307 <dd>
308 new LED shape (E4LedCircular, E4LedRectangular)
309 </dd>
310 </dl><a NAME="E4Led.shape" ID="E4Led.shape"></a>
311 <h4>E4Led.shape</h4>
312 <b>shape</b>(<i></i>)
313 <p>
314 Public method to return the LED shape.
315 </p><dl>
316 <dt>Returns:</dt>
317 <dd>
318 LED shape (E4LedCircular, E4LedRectangular)
319 </dd>
320 </dl><a NAME="E4Led.sizeHint" ID="E4Led.sizeHint"></a>
321 <h4>E4Led.sizeHint</h4>
322 <b>sizeHint</b>(<i></i>)
323 <p>
324 Public method to give a hint about our desired size.
325 </p><dl>
326 <dt>Returns:</dt>
327 <dd>
328 size hint (QSize)
329 </dd>
330 </dl><a NAME="E4Led.toggle" ID="E4Led.toggle"></a>
331 <h4>E4Led.toggle</h4>
332 <b>toggle</b>(<i></i>)
333 <p>
334 Public slot to toggle the LED state.
335 </p>
336 <div align="right"><a href="#top">Up</a></div>
337 <hr />
338 </body></html>

eric ide

mercurial