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

branch
eric7
changeset 9209
b99e7fd55fd3
parent 8752
3c1ea4dfb691
child 9298
8863f3e970a2
equal deleted inserted replaced
9208:3fc8dfeb6ebe 9209:b99e7fd55fd3
1 <!DOCTYPE html>
2 <html><head>
3 <title>eric7.EricWidgets.EricSideBar</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.EricSideBar</h1>
10
11 <p>
12 Module implementing a sidebar class.
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="#EricSideBar">EricSideBar</a></td>
25 <td>Class implementing a sidebar with a widget area, that is hidden or shown, if the current tab is clicked again.</td>
26 </tr>
27 <tr>
28 <td><a href="#EricSideBarSide">EricSideBarSide</a></td>
29 <td>Class defining the sidebar sides.</td>
30 </tr>
31 </table>
32 <h3>Functions</h3>
33
34 <table>
35 <tr><td>None</td></tr>
36 </table>
37 <hr />
38 <hr />
39 <a NAME="EricSideBar" ID="EricSideBar"></a>
40 <h2>EricSideBar</h2>
41
42 <p>
43 Class implementing a sidebar with a widget area, that is hidden or shown,
44 if the current tab is clicked again.
45 </p>
46 <h3>Derived from</h3>
47 QWidget
48 <h3>Class Attributes</h3>
49
50 <table>
51 <tr><td>Version</td></tr>
52 </table>
53 <h3>Class Methods</h3>
54
55 <table>
56 <tr><td>None</td></tr>
57 </table>
58 <h3>Methods</h3>
59
60 <table>
61
62 <tr>
63 <td><a href="#EricSideBar.__init__">EricSideBar</a></td>
64 <td>Constructor</td>
65 </tr>
66 <tr>
67 <td><a href="#EricSideBar.__currentIconChanged">__currentIconChanged</a></td>
68 <td>Private slot to handle a change of the current icon.</td>
69 </tr>
70 <tr>
71 <td><a href="#EricSideBar.__currentIconClicked">__currentIconClicked</a></td>
72 <td>Private slot to handle a click of the current icon.</td>
73 </tr>
74 <tr>
75 <td><a href="#EricSideBar.__expandIt">__expandIt</a></td>
76 <td>Private method to expand the sidebar.</td>
77 </tr>
78 <tr>
79 <td><a href="#EricSideBar.__shrinkIt">__shrinkIt</a></td>
80 <td>Private method to shrink the sidebar.</td>
81 </tr>
82 <tr>
83 <td><a href="#EricSideBar.addTab">addTab</a></td>
84 <td>Public method to add a tab to the sidebar.</td>
85 </tr>
86 <tr>
87 <td><a href="#EricSideBar.barSize">barSize</a></td>
88 <td>Public method to get the icon bar size.</td>
89 </tr>
90 <tr>
91 <td><a href="#EricSideBar.clear">clear</a></td>
92 <td>Public method to remove all tabs.</td>
93 </tr>
94 <tr>
95 <td><a href="#EricSideBar.count">count</a></td>
96 <td>Public method to get the number of tabs.</td>
97 </tr>
98 <tr>
99 <td><a href="#EricSideBar.currentIndex">currentIndex</a></td>
100 <td>Public method to get the index of the current tab.</td>
101 </tr>
102 <tr>
103 <td><a href="#EricSideBar.currentWidget">currentWidget</a></td>
104 <td>Public method to get a reference to the current widget.</td>
105 </tr>
106 <tr>
107 <td><a href="#EricSideBar.iconBarColor">iconBarColor</a></td>
108 <td>Public method to get the icon bar color.</td>
109 </tr>
110 <tr>
111 <td><a href="#EricSideBar.indexOf">indexOf</a></td>
112 <td>Public method to get the index of the given widget.</td>
113 </tr>
114 <tr>
115 <td><a href="#EricSideBar.insertTab">insertTab</a></td>
116 <td>Public method to insert a tab into the sidebar.</td>
117 </tr>
118 <tr>
119 <td><a href="#EricSideBar.isMinimized">isMinimized</a></td>
120 <td>Public method to check the minimized state.</td>
121 </tr>
122 <tr>
123 <td><a href="#EricSideBar.nextTab">nextTab</a></td>
124 <td>Public slot used to show the next tab.</td>
125 </tr>
126 <tr>
127 <td><a href="#EricSideBar.orientation">orientation</a></td>
128 <td>Public method to get the orientation of the sidebar.</td>
129 </tr>
130 <tr>
131 <td><a href="#EricSideBar.prevTab">prevTab</a></td>
132 <td>Public slot used to show the previous tab.</td>
133 </tr>
134 <tr>
135 <td><a href="#EricSideBar.removeTab">removeTab</a></td>
136 <td>Public method to remove a tab.</td>
137 </tr>
138 <tr>
139 <td><a href="#EricSideBar.restoreState">restoreState</a></td>
140 <td>Public method to restore the state of the sidebar.</td>
141 </tr>
142 <tr>
143 <td><a href="#EricSideBar.saveState">saveState</a></td>
144 <td>Public method to save the state of the sidebar.</td>
145 </tr>
146 <tr>
147 <td><a href="#EricSideBar.setCurrentIndex">setCurrentIndex</a></td>
148 <td>Public slot to set the current index.</td>
149 </tr>
150 <tr>
151 <td><a href="#EricSideBar.setCurrentWidget">setCurrentWidget</a></td>
152 <td>Public slot to set the current widget.</td>
153 </tr>
154 <tr>
155 <td><a href="#EricSideBar.setIconBarColor">setIconBarColor</a></td>
156 <td>Public method to set the icon bar color.</td>
157 </tr>
158 <tr>
159 <td><a href="#EricSideBar.setIconBarSize">setIconBarSize</a></td>
160 <td>Public method to set the icon bar size.</td>
161 </tr>
162 <tr>
163 <td><a href="#EricSideBar.setOrientation">setOrientation</a></td>
164 <td>Public method to set the orientation of the sidebar.</td>
165 </tr>
166 <tr>
167 <td><a href="#EricSideBar.widget">widget</a></td>
168 <td>Public method to get a reference to the widget associated with a tab.</td>
169 </tr>
170 </table>
171 <h3>Static Methods</h3>
172
173 <table>
174 <tr><td>None</td></tr>
175 </table>
176
177 <a NAME="EricSideBar.__init__" ID="EricSideBar.__init__"></a>
178 <h4>EricSideBar (Constructor)</h4>
179 <b>EricSideBar</b>(<i>orientation=None, iconBarSize=EricIconBar.DefaultBarSize, parent=None</i>)
180
181 <p>
182 Constructor
183 </p>
184 <dl>
185
186 <dt><i>orientation</i> (EricSideBarSide)</dt>
187 <dd>
188 orientation of the sidebar widget
189 </dd>
190 <dt><i>iconBarSize</i> (str)</dt>
191 <dd>
192 size category for the bar (one of 'xs', 'sm', 'md',
193 'lg', 'xl', 'xxl')
194 </dd>
195 <dt><i>parent</i> (QWidget)</dt>
196 <dd>
197 parent widget
198 </dd>
199 </dl>
200 <a NAME="EricSideBar.__currentIconChanged" ID="EricSideBar.__currentIconChanged"></a>
201 <h4>EricSideBar.__currentIconChanged</h4>
202 <b>__currentIconChanged</b>(<i>index</i>)
203
204 <p>
205 Private slot to handle a change of the current icon.
206 </p>
207 <dl>
208
209 <dt><i>index</i> (int)</dt>
210 <dd>
211 index of the current icon
212 </dd>
213 </dl>
214 <a NAME="EricSideBar.__currentIconClicked" ID="EricSideBar.__currentIconClicked"></a>
215 <h4>EricSideBar.__currentIconClicked</h4>
216 <b>__currentIconClicked</b>(<i>index</i>)
217
218 <p>
219 Private slot to handle a click of the current icon.
220 </p>
221 <dl>
222
223 <dt><i>index</i> (int)</dt>
224 <dd>
225 index of the clicked icon
226 </dd>
227 </dl>
228 <a NAME="EricSideBar.__expandIt" ID="EricSideBar.__expandIt"></a>
229 <h4>EricSideBar.__expandIt</h4>
230 <b>__expandIt</b>(<i></i>)
231
232 <p>
233 Private method to expand the sidebar.
234 </p>
235 <a NAME="EricSideBar.__shrinkIt" ID="EricSideBar.__shrinkIt"></a>
236 <h4>EricSideBar.__shrinkIt</h4>
237 <b>__shrinkIt</b>(<i></i>)
238
239 <p>
240 Private method to shrink the sidebar.
241 </p>
242 <a NAME="EricSideBar.addTab" ID="EricSideBar.addTab"></a>
243 <h4>EricSideBar.addTab</h4>
244 <b>addTab</b>(<i>widget, icon, label=None</i>)
245
246 <p>
247 Public method to add a tab to the sidebar.
248 </p>
249 <dl>
250
251 <dt><i>widget</i> (QWidget)</dt>
252 <dd>
253 reference to the widget to add
254 </dd>
255 <dt><i>icon</i> (QIcon)</dt>
256 <dd>
257 reference to the icon of the widget
258 </dd>
259 <dt><i>label</i> (str)</dt>
260 <dd>
261 the label text of the widget
262 </dd>
263 </dl>
264 <a NAME="EricSideBar.barSize" ID="EricSideBar.barSize"></a>
265 <h4>EricSideBar.barSize</h4>
266 <b>barSize</b>(<i></i>)
267
268 <p>
269 Public method to get the icon bar size.
270 </p>
271 <dl>
272 <dt>Return:</dt>
273 <dd>
274 barSize size category for the bar (one of 'xs', 'sm', 'md',
275 'lg', 'xl', 'xxl')
276 </dd>
277 </dl>
278 <dl>
279 <dt>Return Type:</dt>
280 <dd>
281 str
282 </dd>
283 </dl>
284 <a NAME="EricSideBar.clear" ID="EricSideBar.clear"></a>
285 <h4>EricSideBar.clear</h4>
286 <b>clear</b>(<i></i>)
287
288 <p>
289 Public method to remove all tabs.
290 </p>
291 <a NAME="EricSideBar.count" ID="EricSideBar.count"></a>
292 <h4>EricSideBar.count</h4>
293 <b>count</b>(<i></i>)
294
295 <p>
296 Public method to get the number of tabs.
297 </p>
298 <dl>
299 <dt>Return:</dt>
300 <dd>
301 number of tabs in the sidebar (integer)
302 </dd>
303 </dl>
304 <a NAME="EricSideBar.currentIndex" ID="EricSideBar.currentIndex"></a>
305 <h4>EricSideBar.currentIndex</h4>
306 <b>currentIndex</b>(<i></i>)
307
308 <p>
309 Public method to get the index of the current tab.
310 </p>
311 <dl>
312 <dt>Return:</dt>
313 <dd>
314 index of the current tab (integer)
315 </dd>
316 </dl>
317 <a NAME="EricSideBar.currentWidget" ID="EricSideBar.currentWidget"></a>
318 <h4>EricSideBar.currentWidget</h4>
319 <b>currentWidget</b>(<i></i>)
320
321 <p>
322 Public method to get a reference to the current widget.
323 </p>
324 <dl>
325 <dt>Return:</dt>
326 <dd>
327 reference to the current widget (QWidget)
328 </dd>
329 </dl>
330 <a NAME="EricSideBar.iconBarColor" ID="EricSideBar.iconBarColor"></a>
331 <h4>EricSideBar.iconBarColor</h4>
332 <b>iconBarColor</b>(<i></i>)
333
334 <p>
335 Public method to get the icon bar color.
336 </p>
337 <dl>
338 <dt>Return:</dt>
339 <dd>
340 icon bar color
341 </dd>
342 </dl>
343 <dl>
344 <dt>Return Type:</dt>
345 <dd>
346 QColor
347 </dd>
348 </dl>
349 <a NAME="EricSideBar.indexOf" ID="EricSideBar.indexOf"></a>
350 <h4>EricSideBar.indexOf</h4>
351 <b>indexOf</b>(<i>widget</i>)
352
353 <p>
354 Public method to get the index of the given widget.
355 </p>
356 <dl>
357
358 <dt><i>widget</i></dt>
359 <dd>
360 reference to the widget to get the index of (QWidget)
361 </dd>
362 </dl>
363 <dl>
364 <dt>Return:</dt>
365 <dd>
366 index of the given widget (integer)
367 </dd>
368 </dl>
369 <a NAME="EricSideBar.insertTab" ID="EricSideBar.insertTab"></a>
370 <h4>EricSideBar.insertTab</h4>
371 <b>insertTab</b>(<i>index, widget, icon, label=None</i>)
372
373 <p>
374 Public method to insert a tab into the sidebar.
375 </p>
376 <dl>
377
378 <dt><i>index</i> (int)</dt>
379 <dd>
380 the index to insert the tab at
381 </dd>
382 <dt><i>widget</i> (QWidget)</dt>
383 <dd>
384 reference to the widget to insert
385 </dd>
386 <dt><i>icon</i> (QIcon)</dt>
387 <dd>
388 reference to the icon of the widget
389 </dd>
390 <dt><i>label</i> (str)</dt>
391 <dd>
392 the label text of the widget
393 </dd>
394 </dl>
395 <a NAME="EricSideBar.isMinimized" ID="EricSideBar.isMinimized"></a>
396 <h4>EricSideBar.isMinimized</h4>
397 <b>isMinimized</b>(<i></i>)
398
399 <p>
400 Public method to check the minimized state.
401 </p>
402 <dl>
403 <dt>Return:</dt>
404 <dd>
405 flag indicating the minimized state (boolean)
406 </dd>
407 </dl>
408 <a NAME="EricSideBar.nextTab" ID="EricSideBar.nextTab"></a>
409 <h4>EricSideBar.nextTab</h4>
410 <b>nextTab</b>(<i></i>)
411
412 <p>
413 Public slot used to show the next tab.
414 </p>
415 <a NAME="EricSideBar.orientation" ID="EricSideBar.orientation"></a>
416 <h4>EricSideBar.orientation</h4>
417 <b>orientation</b>(<i></i>)
418
419 <p>
420 Public method to get the orientation of the sidebar.
421 </p>
422 <dl>
423 <dt>Return:</dt>
424 <dd>
425 orientation of the sidebar
426 </dd>
427 </dl>
428 <dl>
429 <dt>Return Type:</dt>
430 <dd>
431 EricSideBarSide
432 </dd>
433 </dl>
434 <a NAME="EricSideBar.prevTab" ID="EricSideBar.prevTab"></a>
435 <h4>EricSideBar.prevTab</h4>
436 <b>prevTab</b>(<i></i>)
437
438 <p>
439 Public slot used to show the previous tab.
440 </p>
441 <a NAME="EricSideBar.removeTab" ID="EricSideBar.removeTab"></a>
442 <h4>EricSideBar.removeTab</h4>
443 <b>removeTab</b>(<i>index</i>)
444
445 <p>
446 Public method to remove a tab.
447 </p>
448 <dl>
449
450 <dt><i>index</i> (int)</dt>
451 <dd>
452 the index of the tab to remove
453 </dd>
454 </dl>
455 <a NAME="EricSideBar.restoreState" ID="EricSideBar.restoreState"></a>
456 <h4>EricSideBar.restoreState</h4>
457 <b>restoreState</b>(<i>state</i>)
458
459 <p>
460 Public method to restore the state of the sidebar.
461 </p>
462 <dl>
463
464 <dt><i>state</i></dt>
465 <dd>
466 byte array containing the saved state (QByteArray)
467 </dd>
468 </dl>
469 <dl>
470 <dt>Return:</dt>
471 <dd>
472 flag indicating success (boolean)
473 </dd>
474 </dl>
475 <a NAME="EricSideBar.saveState" ID="EricSideBar.saveState"></a>
476 <h4>EricSideBar.saveState</h4>
477 <b>saveState</b>(<i></i>)
478
479 <p>
480 Public method to save the state of the sidebar.
481 </p>
482 <dl>
483 <dt>Return:</dt>
484 <dd>
485 saved state as a byte array (QByteArray)
486 </dd>
487 </dl>
488 <a NAME="EricSideBar.setCurrentIndex" ID="EricSideBar.setCurrentIndex"></a>
489 <h4>EricSideBar.setCurrentIndex</h4>
490 <b>setCurrentIndex</b>(<i>index</i>)
491
492 <p>
493 Public slot to set the current index.
494 </p>
495 <dl>
496
497 <dt><i>index</i></dt>
498 <dd>
499 the index to set as the current index (integer)
500 </dd>
501 </dl>
502 <a NAME="EricSideBar.setCurrentWidget" ID="EricSideBar.setCurrentWidget"></a>
503 <h4>EricSideBar.setCurrentWidget</h4>
504 <b>setCurrentWidget</b>(<i>widget</i>)
505
506 <p>
507 Public slot to set the current widget.
508 </p>
509 <dl>
510
511 <dt><i>widget</i></dt>
512 <dd>
513 reference to the widget to become the current widget
514 (QWidget)
515 </dd>
516 </dl>
517 <a NAME="EricSideBar.setIconBarColor" ID="EricSideBar.setIconBarColor"></a>
518 <h4>EricSideBar.setIconBarColor</h4>
519 <b>setIconBarColor</b>(<i>color</i>)
520
521 <p>
522 Public method to set the icon bar color.
523 </p>
524 <dl>
525
526 <dt><i>color</i> (QColor)</dt>
527 <dd>
528 icon bar color
529 </dd>
530 </dl>
531 <a NAME="EricSideBar.setIconBarSize" ID="EricSideBar.setIconBarSize"></a>
532 <h4>EricSideBar.setIconBarSize</h4>
533 <b>setIconBarSize</b>(<i>barSize</i>)
534
535 <p>
536 Public method to set the icon bar size.
537 </p>
538 <dl>
539
540 <dt><i>barSize</i> (str)</dt>
541 <dd>
542 size category for the bar (one of 'xs', 'sm', 'md',
543 'lg', 'xl', 'xxl')
544 </dd>
545 </dl>
546 <a NAME="EricSideBar.setOrientation" ID="EricSideBar.setOrientation"></a>
547 <h4>EricSideBar.setOrientation</h4>
548 <b>setOrientation</b>(<i>orient</i>)
549
550 <p>
551 Public method to set the orientation of the sidebar.
552 </p>
553 <dl>
554
555 <dt><i>orient</i> (EricSideBarSide)</dt>
556 <dd>
557 orientation of the sidebar
558 </dd>
559 </dl>
560 <a NAME="EricSideBar.widget" ID="EricSideBar.widget"></a>
561 <h4>EricSideBar.widget</h4>
562 <b>widget</b>(<i>index</i>)
563
564 <p>
565 Public method to get a reference to the widget associated with a tab.
566 </p>
567 <dl>
568
569 <dt><i>index</i></dt>
570 <dd>
571 index of the tab (integer)
572 </dd>
573 </dl>
574 <dl>
575 <dt>Return:</dt>
576 <dd>
577 reference to the widget (QWidget)
578 </dd>
579 </dl>
580 <div align="right"><a href="#top">Up</a></div>
581 <hr />
582 <hr />
583 <a NAME="EricSideBarSide" ID="EricSideBarSide"></a>
584 <h2>EricSideBarSide</h2>
585
586 <p>
587 Class defining the sidebar sides.
588 </p>
589 <h3>Derived from</h3>
590 enum.Enum
591 <h3>Class Attributes</h3>
592
593 <table>
594 <tr><td>EAST</td></tr><tr><td>NORTH</td></tr><tr><td>SOUTH</td></tr><tr><td>WEST</td></tr>
595 </table>
596 <h3>Class Methods</h3>
597
598 <table>
599 <tr><td>None</td></tr>
600 </table>
601 <h3>Methods</h3>
602
603 <table>
604 <tr><td>None</td></tr>
605 </table>
606 <h3>Static Methods</h3>
607
608 <table>
609 <tr><td>None</td></tr>
610 </table>
611
612 <div align="right"><a href="#top">Up</a></div>
613 <hr />
614 </body></html>

eric ide

mercurial