src/eric7/Documentation/Source/eric7.EricWidgets.EricIconBar.html

branch
eric7
changeset 9209
b99e7fd55fd3
parent 8773
3dd81b827455
child 9298
8863f3e970a2
equal deleted inserted replaced
9208:3fc8dfeb6ebe 9209:b99e7fd55fd3
1 <!DOCTYPE html>
2 <html><head>
3 <title>eric7.EricWidgets.EricIconBar</title>
4 <meta charset="UTF-8">
5 <link rel="stylesheet" href="styles.css">
6 </head>
7 <body>
8 <a NAME="top" ID="top"></a>
9 <h1>eric7.EricWidgets.EricIconBar</h1>
10
11 <p>
12 Module implementing a bar widget showing just icons.
13 </p>
14 <h3>Global Attributes</h3>
15
16 <table>
17 <tr><td>None</td></tr>
18 </table>
19 <h3>Classes</h3>
20
21 <table>
22
23 <tr>
24 <td><a href="#EricIconBar">EricIconBar</a></td>
25 <td>Class implementing a bar widget showing just icons.</td>
26 </tr>
27 </table>
28 <h3>Functions</h3>
29
30 <table>
31 <tr><td>None</td></tr>
32 </table>
33 <hr />
34 <hr />
35 <a NAME="EricIconBar" ID="EricIconBar"></a>
36 <h2>EricIconBar</h2>
37
38 <p>
39 Class implementing a bar widget showing just icons.
40 </p>
41 <h3>Signals</h3>
42 <dl>
43
44 <dt>currentChanged(index)</dt>
45 <dd>
46 emitted to indicate a change of the current
47 index
48 </dd>
49 <dt>currentClicked(index)</dt>
50 <dd>
51 emitted to indicate, that the current icon
52 was clicked
53 </dd>
54 </dl>
55 <h3>Derived from</h3>
56 QWidget
57 <h3>Class Attributes</h3>
58
59 <table>
60 <tr><td>BarSizes</td></tr><tr><td>DefaultBarSize</td></tr><tr><td>LabelStyleSheetTemplate</td></tr><tr><td>MenuStyleSheetTemplate</td></tr><tr><td>MoreLabelAspect</td></tr><tr><td>WidgetStyleSheetTemplate</td></tr>
61 </table>
62 <h3>Class Methods</h3>
63
64 <table>
65 <tr><td>None</td></tr>
66 </table>
67 <h3>Methods</h3>
68
69 <table>
70
71 <tr>
72 <td><a href="#EricIconBar.__init__">EricIconBar</a></td>
73 <td>Constructor</td>
74 </tr>
75 <tr>
76 <td><a href="#EricIconBar.__adjustIconLabels">__adjustIconLabels</a></td>
77 <td>Private method to adjust the visibility of the icon labels.</td>
78 </tr>
79 <tr>
80 <td><a href="#EricIconBar.__createAndAddMoreLabel">__createAndAddMoreLabel</a></td>
81 <td>Private method to create the label to be shown for too many icons.</td>
82 </tr>
83 <tr>
84 <td><a href="#EricIconBar.__createIcon">__createIcon</a></td>
85 <td>Private method to creat an icon label.</td>
86 </tr>
87 <tr>
88 <td><a href="#EricIconBar.__iconClicked">__iconClicked</a></td>
89 <td>Private slot to handle an icon been clicked.</td>
90 </tr>
91 <tr>
92 <td><a href="#EricIconBar.__moreLabelClicked">__moreLabelClicked</a></td>
93 <td>Private slot to handle a click onto the 'More' label.</td>
94 </tr>
95 <tr>
96 <td><a href="#EricIconBar.addIcon">addIcon</a></td>
97 <td>Public method to add an icon to the bar.</td>
98 </tr>
99 <tr>
100 <td><a href="#EricIconBar.barSize">barSize</a></td>
101 <td>Public method to get the icon bar size.</td>
102 </tr>
103 <tr>
104 <td><a href="#EricIconBar.color">color</a></td>
105 <td>Public method to return the current color.</td>
106 </tr>
107 <tr>
108 <td><a href="#EricIconBar.count">count</a></td>
109 <td>Public method to get the number of icon labels.</td>
110 </tr>
111 <tr>
112 <td><a href="#EricIconBar.currentIndex">currentIndex</a></td>
113 <td>Public method to get the current index.</td>
114 </tr>
115 <tr>
116 <td><a href="#EricIconBar.insertIcon">insertIcon</a></td>
117 <td>Public method to insert an icon into the bar.</td>
118 </tr>
119 <tr>
120 <td><a href="#EricIconBar.nextIcon">nextIcon</a></td>
121 <td>Public slot to set the icon after the current one.</td>
122 </tr>
123 <tr>
124 <td><a href="#EricIconBar.orientation">orientation</a></td>
125 <td>Public method to get the orientation of the widget.</td>
126 </tr>
127 <tr>
128 <td><a href="#EricIconBar.previousIcon">previousIcon</a></td>
129 <td>Public slot to set the icon before the current one.</td>
130 </tr>
131 <tr>
132 <td><a href="#EricIconBar.removeIcon">removeIcon</a></td>
133 <td>Public method to remove an icon from the bar.</td>
134 </tr>
135 <tr>
136 <td><a href="#EricIconBar.resizeEvent">resizeEvent</a></td>
137 <td>Protected method to handle resizing of the icon bar.</td>
138 </tr>
139 <tr>
140 <td><a href="#EricIconBar.setBarSize">setBarSize</a></td>
141 <td>Public method to set the icon bar size.</td>
142 </tr>
143 <tr>
144 <td><a href="#EricIconBar.setColor">setColor</a></td>
145 <td>Public method to set the color of the widget.</td>
146 </tr>
147 <tr>
148 <td><a href="#EricIconBar.setCurrentIndex">setCurrentIndex</a></td>
149 <td>Public method to set the current index.</td>
150 </tr>
151 <tr>
152 <td><a href="#EricIconBar.setOrientation">setOrientation</a></td>
153 <td>Public method to set the widget orientation.</td>
154 </tr>
155 <tr>
156 <td><a href="#EricIconBar.wheelEvent">wheelEvent</a></td>
157 <td>Protected method to handle a wheel event.</td>
158 </tr>
159 </table>
160 <h3>Static Methods</h3>
161
162 <table>
163 <tr><td>None</td></tr>
164 </table>
165
166 <a NAME="EricIconBar.__init__" ID="EricIconBar.__init__"></a>
167 <h4>EricIconBar (Constructor)</h4>
168 <b>EricIconBar</b>(<i>orientation=Qt.Orientation.Horizontal, barSize=DefaultBarSize, parent=None</i>)
169
170 <p>
171 Constructor
172 </p>
173 <dl>
174
175 <dt><i>orientation</i> (Qt.Orientation)</dt>
176 <dd>
177 orientation for the widget
178 </dd>
179 <dt><i>barSize</i> (str)</dt>
180 <dd>
181 size category for the bar (one of 'xs', 'sm', 'md',
182 'lg', 'xl', 'xxl')
183 </dd>
184 <dt><i>parent</i> (QWidget (optional))</dt>
185 <dd>
186 reference to the parent widget (defaults to None)
187 </dd>
188 </dl>
189 <a NAME="EricIconBar.__adjustIconLabels" ID="EricIconBar.__adjustIconLabels"></a>
190 <h4>EricIconBar.__adjustIconLabels</h4>
191 <b>__adjustIconLabels</b>(<i></i>)
192
193 <p>
194 Private method to adjust the visibility of the icon labels.
195 </p>
196 <a NAME="EricIconBar.__createAndAddMoreLabel" ID="EricIconBar.__createAndAddMoreLabel"></a>
197 <h4>EricIconBar.__createAndAddMoreLabel</h4>
198 <b>__createAndAddMoreLabel</b>(<i></i>)
199
200 <p>
201 Private method to create the label to be shown for too many icons.
202 </p>
203 <a NAME="EricIconBar.__createIcon" ID="EricIconBar.__createIcon"></a>
204 <h4>EricIconBar.__createIcon</h4>
205 <b>__createIcon</b>(<i>icon, label=""</i>)
206
207 <p>
208 Private method to creat an icon label.
209 </p>
210 <dl>
211
212 <dt><i>icon</i> (QIcon)</dt>
213 <dd>
214 reference to the icon
215 </dd>
216 <dt><i>label</i> (str (optional))</dt>
217 <dd>
218 label text to be shown as a tooltip (defaults to "")
219 </dd>
220 </dl>
221 <dl>
222 <dt>Return:</dt>
223 <dd>
224 created and connected label
225 </dd>
226 </dl>
227 <dl>
228 <dt>Return Type:</dt>
229 <dd>
230 EricClickableLabel
231 </dd>
232 </dl>
233 <a NAME="EricIconBar.__iconClicked" ID="EricIconBar.__iconClicked"></a>
234 <h4>EricIconBar.__iconClicked</h4>
235 <b>__iconClicked</b>(<i>label</i>)
236
237 <p>
238 Private slot to handle an icon been clicked.
239 </p>
240 <dl>
241
242 <dt><i>label</i> (EricClickableLabel)</dt>
243 <dd>
244 reference to the clicked label
245 </dd>
246 </dl>
247 <a NAME="EricIconBar.__moreLabelClicked" ID="EricIconBar.__moreLabelClicked"></a>
248 <h4>EricIconBar.__moreLabelClicked</h4>
249 <b>__moreLabelClicked</b>(<i></i>)
250
251 <p>
252 Private slot to handle a click onto the 'More' label.
253 </p>
254 <a NAME="EricIconBar.addIcon" ID="EricIconBar.addIcon"></a>
255 <h4>EricIconBar.addIcon</h4>
256 <b>addIcon</b>(<i>icon, label=""</i>)
257
258 <p>
259 Public method to add an icon to the bar.
260 </p>
261 <dl>
262
263 <dt><i>icon</i> (QIcon)</dt>
264 <dd>
265 reference to the icon
266 </dd>
267 <dt><i>label</i> (str (optional))</dt>
268 <dd>
269 label text to be shown as a tooltip (defaults to "")
270 </dd>
271 </dl>
272 <a NAME="EricIconBar.barSize" ID="EricIconBar.barSize"></a>
273 <h4>EricIconBar.barSize</h4>
274 <b>barSize</b>(<i></i>)
275
276 <p>
277 Public method to get the icon bar size.
278 </p>
279 <dl>
280 <dt>Return:</dt>
281 <dd>
282 barSize size category for the bar (one of 'xs', 'sm', 'md',
283 'lg', 'xl', 'xxl')
284 </dd>
285 </dl>
286 <dl>
287 <dt>Return Type:</dt>
288 <dd>
289 str
290 </dd>
291 </dl>
292 <a NAME="EricIconBar.color" ID="EricIconBar.color"></a>
293 <h4>EricIconBar.color</h4>
294 <b>color</b>(<i></i>)
295
296 <p>
297 Public method to return the current color.
298 </p>
299 <dl>
300 <dt>Return:</dt>
301 <dd>
302 current color
303 </dd>
304 </dl>
305 <dl>
306 <dt>Return Type:</dt>
307 <dd>
308 QColor
309 </dd>
310 </dl>
311 <a NAME="EricIconBar.count" ID="EricIconBar.count"></a>
312 <h4>EricIconBar.count</h4>
313 <b>count</b>(<i></i>)
314
315 <p>
316 Public method to get the number of icon labels.
317 </p>
318 <dl>
319 <dt>Return:</dt>
320 <dd>
321 number of icon labels
322 </dd>
323 </dl>
324 <dl>
325 <dt>Return Type:</dt>
326 <dd>
327 int
328 </dd>
329 </dl>
330 <a NAME="EricIconBar.currentIndex" ID="EricIconBar.currentIndex"></a>
331 <h4>EricIconBar.currentIndex</h4>
332 <b>currentIndex</b>(<i></i>)
333
334 <p>
335 Public method to get the current index.
336 </p>
337 <dl>
338 <dt>Return:</dt>
339 <dd>
340 current index
341 </dd>
342 </dl>
343 <dl>
344 <dt>Return Type:</dt>
345 <dd>
346 int
347 </dd>
348 </dl>
349 <a NAME="EricIconBar.insertIcon" ID="EricIconBar.insertIcon"></a>
350 <h4>EricIconBar.insertIcon</h4>
351 <b>insertIcon</b>(<i>index, icon, label=""</i>)
352
353 <p>
354 Public method to insert an icon into the bar.
355 </p>
356 <dl>
357
358 <dt><i>index</i> (int)</dt>
359 <dd>
360 position to insert the icon at
361 </dd>
362 <dt><i>icon</i> (QIcon)</dt>
363 <dd>
364 reference to the icon
365 </dd>
366 <dt><i>label</i> (str (optional))</dt>
367 <dd>
368 label text to be shown as a tooltip (defaults to "")
369 </dd>
370 </dl>
371 <a NAME="EricIconBar.nextIcon" ID="EricIconBar.nextIcon"></a>
372 <h4>EricIconBar.nextIcon</h4>
373 <b>nextIcon</b>(<i></i>)
374
375 <p>
376 Public slot to set the icon after the current one.
377 </p>
378 <a NAME="EricIconBar.orientation" ID="EricIconBar.orientation"></a>
379 <h4>EricIconBar.orientation</h4>
380 <b>orientation</b>(<i></i>)
381
382 <p>
383 Public method to get the orientation of the widget.
384 </p>
385 <dl>
386 <dt>Return:</dt>
387 <dd>
388 orientation of the widget
389 </dd>
390 </dl>
391 <dl>
392 <dt>Return Type:</dt>
393 <dd>
394 Qt.Orientation
395 </dd>
396 </dl>
397 <a NAME="EricIconBar.previousIcon" ID="EricIconBar.previousIcon"></a>
398 <h4>EricIconBar.previousIcon</h4>
399 <b>previousIcon</b>(<i></i>)
400
401 <p>
402 Public slot to set the icon before the current one.
403 </p>
404 <a NAME="EricIconBar.removeIcon" ID="EricIconBar.removeIcon"></a>
405 <h4>EricIconBar.removeIcon</h4>
406 <b>removeIcon</b>(<i>index</i>)
407
408 <p>
409 Public method to remove an icon from the bar.
410 </p>
411 <dl>
412
413 <dt><i>index</i> (int)</dt>
414 <dd>
415 index of the icon to be removed
416 </dd>
417 </dl>
418 <a NAME="EricIconBar.resizeEvent" ID="EricIconBar.resizeEvent"></a>
419 <h4>EricIconBar.resizeEvent</h4>
420 <b>resizeEvent</b>(<i>evt</i>)
421
422 <p>
423 Protected method to handle resizing of the icon bar.
424 </p>
425 <dl>
426
427 <dt><i>evt</i> (QResizeEvent)</dt>
428 <dd>
429 reference to the event object
430 </dd>
431 </dl>
432 <a NAME="EricIconBar.setBarSize" ID="EricIconBar.setBarSize"></a>
433 <h4>EricIconBar.setBarSize</h4>
434 <b>setBarSize</b>(<i>barSize</i>)
435
436 <p>
437 Public method to set the icon bar size.
438 </p>
439 <dl>
440
441 <dt><i>barSize</i> (str)</dt>
442 <dd>
443 size category for the bar (one of 'xs', 'sm', 'md',
444 'lg', 'xl', 'xxl')
445 </dd>
446 </dl>
447 <a NAME="EricIconBar.setColor" ID="EricIconBar.setColor"></a>
448 <h4>EricIconBar.setColor</h4>
449 <b>setColor</b>(<i>color</i>)
450
451 <p>
452 Public method to set the color of the widget.
453 </p>
454 <dl>
455
456 <dt><i>color</i> (QColor)</dt>
457 <dd>
458 color of the widget
459 </dd>
460 </dl>
461 <a NAME="EricIconBar.setCurrentIndex" ID="EricIconBar.setCurrentIndex"></a>
462 <h4>EricIconBar.setCurrentIndex</h4>
463 <b>setCurrentIndex</b>(<i>index</i>)
464
465 <p>
466 Public method to set the current index.
467 </p>
468 <dl>
469
470 <dt><i>index</i> (int)</dt>
471 <dd>
472 current index to be set
473 </dd>
474 </dl>
475 <a NAME="EricIconBar.setOrientation" ID="EricIconBar.setOrientation"></a>
476 <h4>EricIconBar.setOrientation</h4>
477 <b>setOrientation</b>(<i>orientation</i>)
478
479 <p>
480 Public method to set the widget orientation.
481 </p>
482 <dl>
483
484 <dt><i>orientation</i> (Qt.Orientation)</dt>
485 <dd>
486 orientation to be set
487 </dd>
488 </dl>
489 <a NAME="EricIconBar.wheelEvent" ID="EricIconBar.wheelEvent"></a>
490 <h4>EricIconBar.wheelEvent</h4>
491 <b>wheelEvent</b>(<i>evt</i>)
492
493 <p>
494 Protected method to handle a wheel event.
495 </p>
496 <dl>
497
498 <dt><i>evt</i> (QWheelEvent)</dt>
499 <dd>
500 reference to the wheel event
501 </dd>
502 </dl>
503 <div align="right"><a href="#top">Up</a></div>
504 <hr />
505 </body></html>

eric ide

mercurial