|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric7.EricWidgets.EricToolButton</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> |
|
22 <a NAME="top" ID="top"></a> |
|
23 <h1>eric7.EricWidgets.EricToolButton</h1> |
|
24 |
|
25 <p> |
|
26 Module implementing a specialized tool button subclass. |
|
27 </p> |
|
28 <h3>Global Attributes</h3> |
|
29 |
|
30 <table> |
|
31 <tr><td>None</td></tr> |
|
32 </table> |
|
33 <h3>Classes</h3> |
|
34 |
|
35 <table> |
|
36 |
|
37 <tr> |
|
38 <td><a href="#EricToolButton">EricToolButton</a></td> |
|
39 <td>Class implementing a specialized tool button subclass.</td> |
|
40 </tr> |
|
41 <tr> |
|
42 <td><a href="#EricToolButtonOptions">EricToolButtonOptions</a></td> |
|
43 <td>Class defining the tool button options.</td> |
|
44 </tr> |
|
45 </table> |
|
46 <h3>Functions</h3> |
|
47 |
|
48 <table> |
|
49 <tr><td>None</td></tr> |
|
50 </table> |
|
51 <hr /> |
|
52 <hr /> |
|
53 <a NAME="EricToolButton" ID="EricToolButton"></a> |
|
54 <h2>EricToolButton</h2> |
|
55 |
|
56 <p> |
|
57 Class implementing a specialized tool button subclass. |
|
58 </p> |
|
59 <h3>Signals</h3> |
|
60 <dl> |
|
61 |
|
62 <dt>aboutToHideMenu()</dt> |
|
63 <dd> |
|
64 emitted before the tool button menu is hidden |
|
65 </dd> |
|
66 <dt>aboutToShowMenu()</dt> |
|
67 <dd> |
|
68 emitted before the tool button menu is shown |
|
69 </dd> |
|
70 <dt>controlClicked()</dt> |
|
71 <dd> |
|
72 emitted when the left mouse button was |
|
73 clicked while pressing the Ctrl key |
|
74 </dd> |
|
75 <dt>doubleClicked()</dt> |
|
76 <dd> |
|
77 emitted when the left mouse button was |
|
78 double clicked |
|
79 </dd> |
|
80 <dt>middleClicked()</dt> |
|
81 <dd> |
|
82 emitted when the middle mouse button was clicked |
|
83 </dd> |
|
84 </dl> |
|
85 <h3>Derived from</h3> |
|
86 QToolButton |
|
87 <h3>Class Attributes</h3> |
|
88 |
|
89 <table> |
|
90 <tr><td>None</td></tr> |
|
91 </table> |
|
92 <h3>Class Methods</h3> |
|
93 |
|
94 <table> |
|
95 <tr><td>None</td></tr> |
|
96 </table> |
|
97 <h3>Methods</h3> |
|
98 |
|
99 <table> |
|
100 |
|
101 <tr> |
|
102 <td><a href="#EricToolButton.__init__">EricToolButton</a></td> |
|
103 <td>Constructor</td> |
|
104 </tr> |
|
105 <tr> |
|
106 <td><a href="#EricToolButton.__menuAboutToHide">__menuAboutToHide</a></td> |
|
107 <td>Private slot to handle the tool button menu about to be hidden.</td> |
|
108 </tr> |
|
109 <tr> |
|
110 <td><a href="#EricToolButton.__showMenu">__showMenu</a></td> |
|
111 <td>Private slot to show the tool button menu.</td> |
|
112 </tr> |
|
113 <tr> |
|
114 <td><a href="#EricToolButton.badgeText">badgeText</a></td> |
|
115 <td>Public method to get the badge text.</td> |
|
116 </tr> |
|
117 <tr> |
|
118 <td><a href="#EricToolButton.contextMenuEvent">contextMenuEvent</a></td> |
|
119 <td>Protected method to handle context menu events.</td> |
|
120 </tr> |
|
121 <tr> |
|
122 <td><a href="#EricToolButton.menu">menu</a></td> |
|
123 <td>Public method to get a reference to the tool button menu.</td> |
|
124 </tr> |
|
125 <tr> |
|
126 <td><a href="#EricToolButton.mouseDoubleClickEvent">mouseDoubleClickEvent</a></td> |
|
127 <td>Protected method to handle mouse double click events.</td> |
|
128 </tr> |
|
129 <tr> |
|
130 <td><a href="#EricToolButton.mousePressEvent">mousePressEvent</a></td> |
|
131 <td>Protected method to handle mouse press events.</td> |
|
132 </tr> |
|
133 <tr> |
|
134 <td><a href="#EricToolButton.mouseReleaseEvent">mouseReleaseEvent</a></td> |
|
135 <td>Protected method to handle mouse release events.</td> |
|
136 </tr> |
|
137 <tr> |
|
138 <td><a href="#EricToolButton.setBadgeText">setBadgeText</a></td> |
|
139 <td>Public method to set the badge text.</td> |
|
140 </tr> |
|
141 <tr> |
|
142 <td><a href="#EricToolButton.setMenu">setMenu</a></td> |
|
143 <td>Public method to set the tool button menu.</td> |
|
144 </tr> |
|
145 <tr> |
|
146 <td><a href="#EricToolButton.setShowMenuInside">setShowMenuInside</a></td> |
|
147 <td>Public method to set a flag to show the menu edge aligned with the button.</td> |
|
148 </tr> |
|
149 <tr> |
|
150 <td><a href="#EricToolButton.setToolbarButtonLook">setToolbarButtonLook</a></td> |
|
151 <td>Public method to set the toolbar look state.</td> |
|
152 </tr> |
|
153 <tr> |
|
154 <td><a href="#EricToolButton.showMenuInside">showMenuInside</a></td> |
|
155 <td>Public method to check, if the menu edge shall be aligned with the button.</td> |
|
156 </tr> |
|
157 <tr> |
|
158 <td><a href="#EricToolButton.toolbarButtonLook">toolbarButtonLook</a></td> |
|
159 <td>Public method to check, if the button has the toolbar look.</td> |
|
160 </tr> |
|
161 </table> |
|
162 <h3>Static Methods</h3> |
|
163 |
|
164 <table> |
|
165 <tr><td>None</td></tr> |
|
166 </table> |
|
167 |
|
168 <a NAME="EricToolButton.__init__" ID="EricToolButton.__init__"></a> |
|
169 <h4>EricToolButton (Constructor)</h4> |
|
170 <b>EricToolButton</b>(<i>parent=None</i>) |
|
171 |
|
172 <p> |
|
173 Constructor |
|
174 </p> |
|
175 <dl> |
|
176 |
|
177 <dt><i>parent</i> (QWidget)</dt> |
|
178 <dd> |
|
179 reference to the parent widget |
|
180 </dd> |
|
181 </dl> |
|
182 <a NAME="EricToolButton.__menuAboutToHide" ID="EricToolButton.__menuAboutToHide"></a> |
|
183 <h4>EricToolButton.__menuAboutToHide</h4> |
|
184 <b>__menuAboutToHide</b>(<i></i>) |
|
185 |
|
186 <p> |
|
187 Private slot to handle the tool button menu about to be hidden. |
|
188 </p> |
|
189 <a NAME="EricToolButton.__showMenu" ID="EricToolButton.__showMenu"></a> |
|
190 <h4>EricToolButton.__showMenu</h4> |
|
191 <b>__showMenu</b>(<i></i>) |
|
192 |
|
193 <p> |
|
194 Private slot to show the tool button menu. |
|
195 </p> |
|
196 <a NAME="EricToolButton.badgeText" ID="EricToolButton.badgeText"></a> |
|
197 <h4>EricToolButton.badgeText</h4> |
|
198 <b>badgeText</b>(<i></i>) |
|
199 |
|
200 <p> |
|
201 Public method to get the badge text. |
|
202 </p> |
|
203 <dl> |
|
204 <dt>Return:</dt> |
|
205 <dd> |
|
206 badge text |
|
207 </dd> |
|
208 </dl> |
|
209 <dl> |
|
210 <dt>Return Type:</dt> |
|
211 <dd> |
|
212 str |
|
213 </dd> |
|
214 </dl> |
|
215 <a NAME="EricToolButton.contextMenuEvent" ID="EricToolButton.contextMenuEvent"></a> |
|
216 <h4>EricToolButton.contextMenuEvent</h4> |
|
217 <b>contextMenuEvent</b>(<i>evt</i>) |
|
218 |
|
219 <p> |
|
220 Protected method to handle context menu events. |
|
221 </p> |
|
222 <dl> |
|
223 |
|
224 <dt><i>evt</i> (QContextMenuEvent)</dt> |
|
225 <dd> |
|
226 reference to the context menu event |
|
227 </dd> |
|
228 </dl> |
|
229 <a NAME="EricToolButton.menu" ID="EricToolButton.menu"></a> |
|
230 <h4>EricToolButton.menu</h4> |
|
231 <b>menu</b>(<i></i>) |
|
232 |
|
233 <p> |
|
234 Public method to get a reference to the tool button menu. |
|
235 </p> |
|
236 <dl> |
|
237 <dt>Return:</dt> |
|
238 <dd> |
|
239 reference to the tool button menu |
|
240 </dd> |
|
241 </dl> |
|
242 <dl> |
|
243 <dt>Return Type:</dt> |
|
244 <dd> |
|
245 QMenu |
|
246 </dd> |
|
247 </dl> |
|
248 <a NAME="EricToolButton.mouseDoubleClickEvent" ID="EricToolButton.mouseDoubleClickEvent"></a> |
|
249 <h4>EricToolButton.mouseDoubleClickEvent</h4> |
|
250 <b>mouseDoubleClickEvent</b>(<i>evt</i>) |
|
251 |
|
252 <p> |
|
253 Protected method to handle mouse double click events. |
|
254 </p> |
|
255 <dl> |
|
256 |
|
257 <dt><i>evt</i> (QMouseEvent)</dt> |
|
258 <dd> |
|
259 reference to the mouse event |
|
260 </dd> |
|
261 </dl> |
|
262 <a NAME="EricToolButton.mousePressEvent" ID="EricToolButton.mousePressEvent"></a> |
|
263 <h4>EricToolButton.mousePressEvent</h4> |
|
264 <b>mousePressEvent</b>(<i>evt</i>) |
|
265 |
|
266 <p> |
|
267 Protected method to handle mouse press events. |
|
268 </p> |
|
269 <dl> |
|
270 |
|
271 <dt><i>evt</i> (QMouseEvent)</dt> |
|
272 <dd> |
|
273 reference to the mouse event |
|
274 </dd> |
|
275 </dl> |
|
276 <a NAME="EricToolButton.mouseReleaseEvent" ID="EricToolButton.mouseReleaseEvent"></a> |
|
277 <h4>EricToolButton.mouseReleaseEvent</h4> |
|
278 <b>mouseReleaseEvent</b>(<i>evt</i>) |
|
279 |
|
280 <p> |
|
281 Protected method to handle mouse release events. |
|
282 </p> |
|
283 <dl> |
|
284 |
|
285 <dt><i>evt</i> (QMouseEvent)</dt> |
|
286 <dd> |
|
287 reference to the mouse event |
|
288 </dd> |
|
289 </dl> |
|
290 <a NAME="EricToolButton.setBadgeText" ID="EricToolButton.setBadgeText"></a> |
|
291 <h4>EricToolButton.setBadgeText</h4> |
|
292 <b>setBadgeText</b>(<i>text</i>) |
|
293 |
|
294 <p> |
|
295 Public method to set the badge text. |
|
296 </p> |
|
297 <dl> |
|
298 |
|
299 <dt><i>text</i> (str)</dt> |
|
300 <dd> |
|
301 badge text to be set |
|
302 </dd> |
|
303 </dl> |
|
304 <a NAME="EricToolButton.setMenu" ID="EricToolButton.setMenu"></a> |
|
305 <h4>EricToolButton.setMenu</h4> |
|
306 <b>setMenu</b>(<i>menu</i>) |
|
307 |
|
308 <p> |
|
309 Public method to set the tool button menu. |
|
310 </p> |
|
311 <dl> |
|
312 |
|
313 <dt><i>menu</i> (QMenu)</dt> |
|
314 <dd> |
|
315 reference to the tool button menu |
|
316 </dd> |
|
317 </dl> |
|
318 <a NAME="EricToolButton.setShowMenuInside" ID="EricToolButton.setShowMenuInside"></a> |
|
319 <h4>EricToolButton.setShowMenuInside</h4> |
|
320 <b>setShowMenuInside</b>(<i>enable</i>) |
|
321 |
|
322 <p> |
|
323 Public method to set a flag to show the menu edge aligned with |
|
324 the button. |
|
325 </p> |
|
326 <dl> |
|
327 |
|
328 <dt><i>enable</i> (bool)</dt> |
|
329 <dd> |
|
330 flag indicating to align the menu edge to the button |
|
331 </dd> |
|
332 </dl> |
|
333 <a NAME="EricToolButton.setToolbarButtonLook" ID="EricToolButton.setToolbarButtonLook"></a> |
|
334 <h4>EricToolButton.setToolbarButtonLook</h4> |
|
335 <b>setToolbarButtonLook</b>(<i>enable</i>) |
|
336 |
|
337 <p> |
|
338 Public method to set the toolbar look state. |
|
339 </p> |
|
340 <dl> |
|
341 |
|
342 <dt><i>enable</i> (bool)</dt> |
|
343 <dd> |
|
344 flag indicating toolbar look |
|
345 </dd> |
|
346 </dl> |
|
347 <a NAME="EricToolButton.showMenuInside" ID="EricToolButton.showMenuInside"></a> |
|
348 <h4>EricToolButton.showMenuInside</h4> |
|
349 <b>showMenuInside</b>(<i></i>) |
|
350 |
|
351 <p> |
|
352 Public method to check, if the menu edge shall be aligned with |
|
353 the button. |
|
354 </p> |
|
355 <dl> |
|
356 <dt>Return:</dt> |
|
357 <dd> |
|
358 flag indicating that the menu edge shall be aligned |
|
359 </dd> |
|
360 </dl> |
|
361 <dl> |
|
362 <dt>Return Type:</dt> |
|
363 <dd> |
|
364 bool |
|
365 </dd> |
|
366 </dl> |
|
367 <a NAME="EricToolButton.toolbarButtonLook" ID="EricToolButton.toolbarButtonLook"></a> |
|
368 <h4>EricToolButton.toolbarButtonLook</h4> |
|
369 <b>toolbarButtonLook</b>(<i></i>) |
|
370 |
|
371 <p> |
|
372 Public method to check, if the button has the toolbar look. |
|
373 </p> |
|
374 <dl> |
|
375 <dt>Return:</dt> |
|
376 <dd> |
|
377 flag indicating toolbar look |
|
378 </dd> |
|
379 </dl> |
|
380 <dl> |
|
381 <dt>Return Type:</dt> |
|
382 <dd> |
|
383 bool |
|
384 </dd> |
|
385 </dl> |
|
386 <div align="right"><a href="#top">Up</a></div> |
|
387 <hr /> |
|
388 <hr /> |
|
389 <a NAME="EricToolButtonOptions" ID="EricToolButtonOptions"></a> |
|
390 <h2>EricToolButtonOptions</h2> |
|
391 |
|
392 <p> |
|
393 Class defining the tool button options. |
|
394 </p> |
|
395 <h3>Derived from</h3> |
|
396 enum.IntEnum |
|
397 <h3>Class Attributes</h3> |
|
398 |
|
399 <table> |
|
400 <tr><td>DEFAULT</td></tr><tr><td>SHOW_MENU_INSIDE</td></tr><tr><td>TOOLBAR_LOOKUP</td></tr> |
|
401 </table> |
|
402 <h3>Class Methods</h3> |
|
403 |
|
404 <table> |
|
405 <tr><td>None</td></tr> |
|
406 </table> |
|
407 <h3>Methods</h3> |
|
408 |
|
409 <table> |
|
410 <tr><td>None</td></tr> |
|
411 </table> |
|
412 <h3>Static Methods</h3> |
|
413 |
|
414 <table> |
|
415 <tr><td>None</td></tr> |
|
416 </table> |
|
417 |
|
418 <div align="right"><a href="#top">Up</a></div> |
|
419 <hr /> |
|
420 </body></html> |