|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric6.E5Gui.E5TabWidget</title> |
|
4 <meta charset="UTF-8"> |
|
5 <style> |
|
6 body { |
|
7 background: #EDECE6; |
|
8 margin: 0em 1em 10em 1em; |
|
9 color: black; |
|
10 } |
|
11 |
|
12 h1 { color: white; background: #85774A; } |
|
13 h2 { color: white; background: #85774A; } |
|
14 h3 { color: white; background: #9D936E; } |
|
15 h4 { color: white; background: #9D936E; } |
|
16 |
|
17 a { color: #BA6D36; } |
|
18 |
|
19 </style> |
|
20 </head> |
|
21 <body><a NAME="top" ID="top"></a> |
|
22 <h1>eric6.E5Gui.E5TabWidget</h1> |
|
23 <p> |
|
24 Module implementing a TabWidget class substituting QTabWidget. |
|
25 </p> |
|
26 <h3>Global Attributes</h3> |
|
27 <table> |
|
28 <tr><td>None</td></tr> |
|
29 </table> |
|
30 <h3>Classes</h3> |
|
31 <table> |
|
32 <tr> |
|
33 <td><a href="#E5DnDTabBar">E5DnDTabBar</a></td> |
|
34 <td>Class implementing a tab bar class substituting QTabBar.</td> |
|
35 </tr><tr> |
|
36 <td><a href="#E5TabWidget">E5TabWidget</a></td> |
|
37 <td>Class implementing a tab widget class substituting QTabWidget.</td> |
|
38 </tr><tr> |
|
39 <td><a href="#E5WheelTabBar">E5WheelTabBar</a></td> |
|
40 <td>Class implementing a tab bar class substituting QTabBar to support wheel events.</td> |
|
41 </tr> |
|
42 </table> |
|
43 <h3>Functions</h3> |
|
44 <table> |
|
45 <tr><td>None</td></tr> |
|
46 </table> |
|
47 <hr /><hr /> |
|
48 <a NAME="E5DnDTabBar" ID="E5DnDTabBar"></a> |
|
49 <h2>E5DnDTabBar</h2> |
|
50 <p> |
|
51 Class implementing a tab bar class substituting QTabBar. |
|
52 </p><h3>Signals</h3> |
|
53 <dl> |
|
54 <dt>tabMoveRequested(int, int)</dt> |
|
55 <dd> |
|
56 emitted to signal a tab move request |
|
57 giving the old and new index position |
|
58 </dd> |
|
59 </dl> |
|
60 <h3>Derived from</h3> |
|
61 E5WheelTabBar |
|
62 <h3>Class Attributes</h3> |
|
63 <table> |
|
64 <tr><td>None</td></tr> |
|
65 </table> |
|
66 <h3>Class Methods</h3> |
|
67 <table> |
|
68 <tr><td>None</td></tr> |
|
69 </table> |
|
70 <h3>Methods</h3> |
|
71 <table> |
|
72 <tr> |
|
73 <td><a href="#E5DnDTabBar.__init__">E5DnDTabBar</a></td> |
|
74 <td>Constructor</td> |
|
75 </tr><tr> |
|
76 <td><a href="#E5DnDTabBar.dragEnterEvent">dragEnterEvent</a></td> |
|
77 <td>Protected method to handle drag enter events.</td> |
|
78 </tr><tr> |
|
79 <td><a href="#E5DnDTabBar.dropEvent">dropEvent</a></td> |
|
80 <td>Protected method to handle drop events.</td> |
|
81 </tr><tr> |
|
82 <td><a href="#E5DnDTabBar.mouseMoveEvent">mouseMoveEvent</a></td> |
|
83 <td>Protected method to handle mouse move events.</td> |
|
84 </tr><tr> |
|
85 <td><a href="#E5DnDTabBar.mousePressEvent">mousePressEvent</a></td> |
|
86 <td>Protected method to handle mouse press events.</td> |
|
87 </tr> |
|
88 </table> |
|
89 <h3>Static Methods</h3> |
|
90 <table> |
|
91 <tr><td>None</td></tr> |
|
92 </table> |
|
93 <a NAME="E5DnDTabBar.__init__" ID="E5DnDTabBar.__init__"></a> |
|
94 <h4>E5DnDTabBar (Constructor)</h4> |
|
95 <b>E5DnDTabBar</b>(<i>parent=None</i>) |
|
96 <p> |
|
97 Constructor |
|
98 </p><dl> |
|
99 <dt><i>parent</i></dt> |
|
100 <dd> |
|
101 reference to the parent widget (QWidget) |
|
102 </dd> |
|
103 </dl><a NAME="E5DnDTabBar.dragEnterEvent" ID="E5DnDTabBar.dragEnterEvent"></a> |
|
104 <h4>E5DnDTabBar.dragEnterEvent</h4> |
|
105 <b>dragEnterEvent</b>(<i>event</i>) |
|
106 <p> |
|
107 Protected method to handle drag enter events. |
|
108 </p><dl> |
|
109 <dt><i>event</i></dt> |
|
110 <dd> |
|
111 reference to the drag enter event (QDragEnterEvent) |
|
112 </dd> |
|
113 </dl><a NAME="E5DnDTabBar.dropEvent" ID="E5DnDTabBar.dropEvent"></a> |
|
114 <h4>E5DnDTabBar.dropEvent</h4> |
|
115 <b>dropEvent</b>(<i>event</i>) |
|
116 <p> |
|
117 Protected method to handle drop events. |
|
118 </p><dl> |
|
119 <dt><i>event</i></dt> |
|
120 <dd> |
|
121 reference to the drop event (QDropEvent) |
|
122 </dd> |
|
123 </dl><a NAME="E5DnDTabBar.mouseMoveEvent" ID="E5DnDTabBar.mouseMoveEvent"></a> |
|
124 <h4>E5DnDTabBar.mouseMoveEvent</h4> |
|
125 <b>mouseMoveEvent</b>(<i>event</i>) |
|
126 <p> |
|
127 Protected method to handle mouse move events. |
|
128 </p><dl> |
|
129 <dt><i>event</i></dt> |
|
130 <dd> |
|
131 reference to the mouse move event (QMouseEvent) |
|
132 </dd> |
|
133 </dl><a NAME="E5DnDTabBar.mousePressEvent" ID="E5DnDTabBar.mousePressEvent"></a> |
|
134 <h4>E5DnDTabBar.mousePressEvent</h4> |
|
135 <b>mousePressEvent</b>(<i>event</i>) |
|
136 <p> |
|
137 Protected method to handle mouse press events. |
|
138 </p><dl> |
|
139 <dt><i>event</i></dt> |
|
140 <dd> |
|
141 reference to the mouse press event (QMouseEvent) |
|
142 </dd> |
|
143 </dl> |
|
144 <div align="right"><a href="#top">Up</a></div> |
|
145 <hr /><hr /> |
|
146 <a NAME="E5TabWidget" ID="E5TabWidget"></a> |
|
147 <h2>E5TabWidget</h2> |
|
148 <p> |
|
149 Class implementing a tab widget class substituting QTabWidget. |
|
150 </p><p> |
|
151 It provides slots to show the previous and next tab and give |
|
152 them the input focus and it allows to have a context menu for the tabs. |
|
153 </p><h3>Signals</h3> |
|
154 <dl> |
|
155 <dt>customTabContextMenuRequested(const QPoint & point, int index)</dt> |
|
156 <dd> |
|
157 emitted when a context menu for a tab is requested |
|
158 </dd> |
|
159 </dl> |
|
160 <h3>Derived from</h3> |
|
161 QTabWidget |
|
162 <h3>Class Attributes</h3> |
|
163 <table> |
|
164 <tr><td>None</td></tr> |
|
165 </table> |
|
166 <h3>Class Methods</h3> |
|
167 <table> |
|
168 <tr><td>None</td></tr> |
|
169 </table> |
|
170 <h3>Methods</h3> |
|
171 <table> |
|
172 <tr> |
|
173 <td><a href="#E5TabWidget.__init__">E5TabWidget</a></td> |
|
174 <td>Constructor</td> |
|
175 </tr><tr> |
|
176 <td><a href="#E5TabWidget.__currentChanged">__currentChanged</a></td> |
|
177 <td>Private slot to handle the currentChanged signal.</td> |
|
178 </tr><tr> |
|
179 <td><a href="#E5TabWidget.__freeSide">__freeSide</a></td> |
|
180 <td>Private method to determine the free side of a tab.</td> |
|
181 </tr><tr> |
|
182 <td><a href="#E5TabWidget.__handleTabCustomContextMenuRequested">__handleTabCustomContextMenuRequested</a></td> |
|
183 <td>Private slot to handle the context menu request for the tabbar.</td> |
|
184 </tr><tr> |
|
185 <td><a href="#E5TabWidget.animationLabel">animationLabel</a></td> |
|
186 <td>Public slot to set an animated icon.</td> |
|
187 </tr><tr> |
|
188 <td><a href="#E5TabWidget.moveTab">moveTab</a></td> |
|
189 <td>Public method to move a tab to a new index.</td> |
|
190 </tr><tr> |
|
191 <td><a href="#E5TabWidget.nextTab">nextTab</a></td> |
|
192 <td>Public slot used to show the next tab.</td> |
|
193 </tr><tr> |
|
194 <td><a href="#E5TabWidget.prevTab">prevTab</a></td> |
|
195 <td>Public slot used to show the previous tab.</td> |
|
196 </tr><tr> |
|
197 <td><a href="#E5TabWidget.resetAnimation">resetAnimation</a></td> |
|
198 <td>Public slot to reset an animated icon.</td> |
|
199 </tr><tr> |
|
200 <td><a href="#E5TabWidget.selectTab">selectTab</a></td> |
|
201 <td>Public method to get the index of a tab given a position.</td> |
|
202 </tr><tr> |
|
203 <td><a href="#E5TabWidget.setCustomTabBar">setCustomTabBar</a></td> |
|
204 <td>Public method to set a custom tab bar.</td> |
|
205 </tr><tr> |
|
206 <td><a href="#E5TabWidget.setTabContextMenuPolicy">setTabContextMenuPolicy</a></td> |
|
207 <td>Public method to set the context menu policy of the tab.</td> |
|
208 </tr><tr> |
|
209 <td><a href="#E5TabWidget.switchTab">switchTab</a></td> |
|
210 <td>Public slot used to switch between the current and the previous current tab.</td> |
|
211 </tr> |
|
212 </table> |
|
213 <h3>Static Methods</h3> |
|
214 <table> |
|
215 <tr><td>None</td></tr> |
|
216 </table> |
|
217 <a NAME="E5TabWidget.__init__" ID="E5TabWidget.__init__"></a> |
|
218 <h4>E5TabWidget (Constructor)</h4> |
|
219 <b>E5TabWidget</b>(<i>parent=None, dnd=False</i>) |
|
220 <p> |
|
221 Constructor |
|
222 </p><dl> |
|
223 <dt><i>parent</i></dt> |
|
224 <dd> |
|
225 reference to the parent widget (QWidget) |
|
226 </dd><dt><i>dnd=</i></dt> |
|
227 <dd> |
|
228 flag indicating the support for Drag & Drop (boolean) |
|
229 </dd> |
|
230 </dl><a NAME="E5TabWidget.__currentChanged" ID="E5TabWidget.__currentChanged"></a> |
|
231 <h4>E5TabWidget.__currentChanged</h4> |
|
232 <b>__currentChanged</b>(<i>index</i>) |
|
233 <p> |
|
234 Private slot to handle the currentChanged signal. |
|
235 </p><dl> |
|
236 <dt><i>index</i></dt> |
|
237 <dd> |
|
238 index of the current tab |
|
239 </dd> |
|
240 </dl><a NAME="E5TabWidget.__freeSide" ID="E5TabWidget.__freeSide"></a> |
|
241 <h4>E5TabWidget.__freeSide</h4> |
|
242 <b>__freeSide</b>(<i></i>) |
|
243 <p> |
|
244 Private method to determine the free side of a tab. |
|
245 </p><dl> |
|
246 <dt>Returns:</dt> |
|
247 <dd> |
|
248 free side (QTabBar.ButtonPosition) |
|
249 </dd> |
|
250 </dl><a NAME="E5TabWidget.__handleTabCustomContextMenuRequested" ID="E5TabWidget.__handleTabCustomContextMenuRequested"></a> |
|
251 <h4>E5TabWidget.__handleTabCustomContextMenuRequested</h4> |
|
252 <b>__handleTabCustomContextMenuRequested</b>(<i>point</i>) |
|
253 <p> |
|
254 Private slot to handle the context menu request for the tabbar. |
|
255 </p><dl> |
|
256 <dt><i>point</i></dt> |
|
257 <dd> |
|
258 point the context menu was requested (QPoint) |
|
259 </dd> |
|
260 </dl><a NAME="E5TabWidget.animationLabel" ID="E5TabWidget.animationLabel"></a> |
|
261 <h4>E5TabWidget.animationLabel</h4> |
|
262 <b>animationLabel</b>(<i>index, animationFile, speed=100</i>) |
|
263 <p> |
|
264 Public slot to set an animated icon. |
|
265 </p><dl> |
|
266 <dt><i>index</i></dt> |
|
267 <dd> |
|
268 tab index (integer) |
|
269 </dd><dt><i>animationFile</i></dt> |
|
270 <dd> |
|
271 name of the file containing the animation (string) |
|
272 </dd><dt><i>speed</i></dt> |
|
273 <dd> |
|
274 animation speed of the icon in percent of the original |
|
275 icon's speed (integer) |
|
276 </dd> |
|
277 </dl><dl> |
|
278 <dt>Returns:</dt> |
|
279 <dd> |
|
280 reference to the created label (QLabel) |
|
281 </dd> |
|
282 </dl><a NAME="E5TabWidget.moveTab" ID="E5TabWidget.moveTab"></a> |
|
283 <h4>E5TabWidget.moveTab</h4> |
|
284 <b>moveTab</b>(<i>curIndex, newIndex</i>) |
|
285 <p> |
|
286 Public method to move a tab to a new index. |
|
287 </p><dl> |
|
288 <dt><i>curIndex</i></dt> |
|
289 <dd> |
|
290 index of tab to be moved (integer) |
|
291 </dd><dt><i>newIndex</i></dt> |
|
292 <dd> |
|
293 index the tab should be moved to (integer) |
|
294 </dd> |
|
295 </dl><a NAME="E5TabWidget.nextTab" ID="E5TabWidget.nextTab"></a> |
|
296 <h4>E5TabWidget.nextTab</h4> |
|
297 <b>nextTab</b>(<i></i>) |
|
298 <p> |
|
299 Public slot used to show the next tab. |
|
300 </p><a NAME="E5TabWidget.prevTab" ID="E5TabWidget.prevTab"></a> |
|
301 <h4>E5TabWidget.prevTab</h4> |
|
302 <b>prevTab</b>(<i></i>) |
|
303 <p> |
|
304 Public slot used to show the previous tab. |
|
305 </p><a NAME="E5TabWidget.resetAnimation" ID="E5TabWidget.resetAnimation"></a> |
|
306 <h4>E5TabWidget.resetAnimation</h4> |
|
307 <b>resetAnimation</b>(<i>index</i>) |
|
308 <p> |
|
309 Public slot to reset an animated icon. |
|
310 </p><dl> |
|
311 <dt><i>index</i></dt> |
|
312 <dd> |
|
313 tab index (integer) |
|
314 </dd> |
|
315 </dl><a NAME="E5TabWidget.selectTab" ID="E5TabWidget.selectTab"></a> |
|
316 <h4>E5TabWidget.selectTab</h4> |
|
317 <b>selectTab</b>(<i>pos</i>) |
|
318 <p> |
|
319 Public method to get the index of a tab given a position. |
|
320 </p><dl> |
|
321 <dt><i>pos</i></dt> |
|
322 <dd> |
|
323 position determining the tab index (QPoint) |
|
324 </dd> |
|
325 </dl><dl> |
|
326 <dt>Returns:</dt> |
|
327 <dd> |
|
328 index of the tab (integer) |
|
329 </dd> |
|
330 </dl><a NAME="E5TabWidget.setCustomTabBar" ID="E5TabWidget.setCustomTabBar"></a> |
|
331 <h4>E5TabWidget.setCustomTabBar</h4> |
|
332 <b>setCustomTabBar</b>(<i>dnd, tabBar</i>) |
|
333 <p> |
|
334 Public method to set a custom tab bar. |
|
335 </p><dl> |
|
336 <dt><i>dnd</i></dt> |
|
337 <dd> |
|
338 flag indicating the support for Drag & Drop (boolean) |
|
339 </dd><dt><i>tabBar</i></dt> |
|
340 <dd> |
|
341 reference to the tab bar to set (QTabBar) |
|
342 </dd> |
|
343 </dl><a NAME="E5TabWidget.setTabContextMenuPolicy" ID="E5TabWidget.setTabContextMenuPolicy"></a> |
|
344 <h4>E5TabWidget.setTabContextMenuPolicy</h4> |
|
345 <b>setTabContextMenuPolicy</b>(<i>policy</i>) |
|
346 <p> |
|
347 Public method to set the context menu policy of the tab. |
|
348 </p><dl> |
|
349 <dt><i>policy</i></dt> |
|
350 <dd> |
|
351 context menu policy to set (Qt.ContextMenuPolicy) |
|
352 </dd> |
|
353 </dl><a NAME="E5TabWidget.switchTab" ID="E5TabWidget.switchTab"></a> |
|
354 <h4>E5TabWidget.switchTab</h4> |
|
355 <b>switchTab</b>(<i></i>) |
|
356 <p> |
|
357 Public slot used to switch between the current and the previous |
|
358 current tab. |
|
359 </p> |
|
360 <div align="right"><a href="#top">Up</a></div> |
|
361 <hr /><hr /> |
|
362 <a NAME="E5WheelTabBar" ID="E5WheelTabBar"></a> |
|
363 <h2>E5WheelTabBar</h2> |
|
364 <p> |
|
365 Class implementing a tab bar class substituting QTabBar to support wheel |
|
366 events. |
|
367 </p> |
|
368 <h3>Derived from</h3> |
|
369 QTabBar |
|
370 <h3>Class Attributes</h3> |
|
371 <table> |
|
372 <tr><td>None</td></tr> |
|
373 </table> |
|
374 <h3>Class Methods</h3> |
|
375 <table> |
|
376 <tr><td>None</td></tr> |
|
377 </table> |
|
378 <h3>Methods</h3> |
|
379 <table> |
|
380 <tr> |
|
381 <td><a href="#E5WheelTabBar.__init__">E5WheelTabBar</a></td> |
|
382 <td>Constructor</td> |
|
383 </tr><tr> |
|
384 <td><a href="#E5WheelTabBar.wheelEvent">wheelEvent</a></td> |
|
385 <td>Protected slot to support wheel events.</td> |
|
386 </tr> |
|
387 </table> |
|
388 <h3>Static Methods</h3> |
|
389 <table> |
|
390 <tr><td>None</td></tr> |
|
391 </table> |
|
392 <a NAME="E5WheelTabBar.__init__" ID="E5WheelTabBar.__init__"></a> |
|
393 <h4>E5WheelTabBar (Constructor)</h4> |
|
394 <b>E5WheelTabBar</b>(<i>parent=None</i>) |
|
395 <p> |
|
396 Constructor |
|
397 </p><dl> |
|
398 <dt><i>parent</i></dt> |
|
399 <dd> |
|
400 reference to the parent widget (QWidget) |
|
401 </dd> |
|
402 </dl><a NAME="E5WheelTabBar.wheelEvent" ID="E5WheelTabBar.wheelEvent"></a> |
|
403 <h4>E5WheelTabBar.wheelEvent</h4> |
|
404 <b>wheelEvent</b>(<i>event</i>) |
|
405 <p> |
|
406 Protected slot to support wheel events. |
|
407 </p><dl> |
|
408 <dt><i>event</i></dt> |
|
409 <dd> |
|
410 reference to the wheel event (QWheelEvent) |
|
411 </dd> |
|
412 </dl> |
|
413 <div align="right"><a href="#top">Up</a></div> |
|
414 <hr /> |
|
415 </body></html> |