Documentation/Source/eric4.E4Gui.E4ModelMenu.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.E4ModelMenu</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.E4ModelMenu</h1>
24 <p>
25 Module implementing a menu populated from a QAbstractItemModel.
26 </p>
27 <h3>Global Attributes</h3>
28 <table>
29 <tr><td>None</td></tr>
30 </table>
31 <h3>Classes</h3>
32 <table>
33 <tr>
34 <td><a href="#E4ModelMenu">E4ModelMenu</a></td>
35 <td>Class implementing a menu populated from a QAbstractItemModel.</td>
36 </tr>
37 </table>
38 <h3>Functions</h3>
39 <table>
40 <tr><td>None</td></tr>
41 </table>
42 <hr /><hr />
43 <a NAME="E4ModelMenu" ID="E4ModelMenu"></a>
44 <h2>E4ModelMenu</h2>
45 <p>
46 Class implementing a menu populated from a QAbstractItemModel.
47 </p><h4>Signals</h4>
48 <dl>
49 <dt>activated(const QModelIndex&)</dt>
50 <dd>
51 emitted when an action has been triggered
52 </dd>
53 </dl>
54 <h3>Derived from</h3>
55 QMenu
56 <h3>Class Attributes</h3>
57 <table>
58 <tr><td>None</td></tr>
59 </table>
60 <h3>Methods</h3>
61 <table>
62 <tr>
63 <td><a href="#E4ModelMenu.__init__">E4ModelMenu</a></td>
64 <td>Constructor</td>
65 </tr><tr>
66 <td><a href="#E4ModelMenu.__aboutToShow">__aboutToShow</a></td>
67 <td>Private slot to show the menu.</td>
68 </tr><tr>
69 <td><a href="#E4ModelMenu.__actionTriggered">__actionTriggered</a></td>
70 <td>Private slot to handle the triggering of an action.</td>
71 </tr><tr>
72 <td><a href="#E4ModelMenu.__makeAction">__makeAction</a></td>
73 <td>Private method to create an action.</td>
74 </tr><tr>
75 <td><a href="#E4ModelMenu.createBaseMenu">createBaseMenu</a></td>
76 <td>Public method to get the menu that is used to populate sub menu's.</td>
77 </tr><tr>
78 <td><a href="#E4ModelMenu.createMenu">createMenu</a></td>
79 <td>Public method to put all the children of a parent into a menu of a given length.</td>
80 </tr><tr>
81 <td><a href="#E4ModelMenu.dragEnterEvent">dragEnterEvent</a></td>
82 <td>Protected method to handle drag enter events.</td>
83 </tr><tr>
84 <td><a href="#E4ModelMenu.dropEvent">dropEvent</a></td>
85 <td>Protected method to handle drop events.</td>
86 </tr><tr>
87 <td><a href="#E4ModelMenu.firstSeparator">firstSeparator</a></td>
88 <td>Public method to get the first separator.</td>
89 </tr><tr>
90 <td><a href="#E4ModelMenu.index">index</a></td>
91 <td>Public method to get the index of an action.</td>
92 </tr><tr>
93 <td><a href="#E4ModelMenu.makeAction">makeAction</a></td>
94 <td>Public method to create an action.</td>
95 </tr><tr>
96 <td><a href="#E4ModelMenu.maxRows">maxRows</a></td>
97 <td>Public method to get the maximum number of entries to show.</td>
98 </tr><tr>
99 <td><a href="#E4ModelMenu.model">model</a></td>
100 <td>Public method to get a reference to the model.</td>
101 </tr><tr>
102 <td><a href="#E4ModelMenu.mouseMoveEvent">mouseMoveEvent</a></td>
103 <td>Protected method to handle mouse move events.</td>
104 </tr><tr>
105 <td><a href="#E4ModelMenu.mousePressEvent">mousePressEvent</a></td>
106 <td>Protected method handling mouse press events.</td>
107 </tr><tr>
108 <td><a href="#E4ModelMenu.mouseReleaseEvent">mouseReleaseEvent</a></td>
109 <td>Protected method handling mouse release events.</td>
110 </tr><tr>
111 <td><a href="#E4ModelMenu.postPopulated">postPopulated</a></td>
112 <td>Public method to add any actions after the tree.</td>
113 </tr><tr>
114 <td><a href="#E4ModelMenu.prePopulated">prePopulated</a></td>
115 <td>Public method to add any actions before the tree.</td>
116 </tr><tr>
117 <td><a href="#E4ModelMenu.removeEntry">removeEntry</a></td>
118 <td>Public method to remove a menu entry.</td>
119 </tr><tr>
120 <td><a href="#E4ModelMenu.resetFlags">resetFlags</a></td>
121 <td>Public method to reset the saved internal state.</td>
122 </tr><tr>
123 <td><a href="#E4ModelMenu.rootIndex">rootIndex</a></td>
124 <td>Public method to get the index of the root item.</td>
125 </tr><tr>
126 <td><a href="#E4ModelMenu.separatorRole">separatorRole</a></td>
127 <td>Public method to get the role of the separator.</td>
128 </tr><tr>
129 <td><a href="#E4ModelMenu.setFirstSeparator">setFirstSeparator</a></td>
130 <td>Public method to set the first separator.</td>
131 </tr><tr>
132 <td><a href="#E4ModelMenu.setMaxRows">setMaxRows</a></td>
133 <td>Public method to set the maximum number of entries to show.</td>
134 </tr><tr>
135 <td><a href="#E4ModelMenu.setModel">setModel</a></td>
136 <td>Public method to set the model for the menu.</td>
137 </tr><tr>
138 <td><a href="#E4ModelMenu.setRootIndex">setRootIndex</a></td>
139 <td>Public method to set the index of the root item.</td>
140 </tr><tr>
141 <td><a href="#E4ModelMenu.setSeparatorRole">setSeparatorRole</a></td>
142 <td>Public method to set the role of the separator.</td>
143 </tr><tr>
144 <td><a href="#E4ModelMenu.setStatusBarTextRole">setStatusBarTextRole</a></td>
145 <td>Public method to set the role of the status bar text.</td>
146 </tr><tr>
147 <td><a href="#E4ModelMenu.statusBarTextRole">statusBarTextRole</a></td>
148 <td>Public method to get the role of the status bar text.</td>
149 </tr>
150 </table>
151 <a NAME="E4ModelMenu.__init__" ID="E4ModelMenu.__init__"></a>
152 <h4>E4ModelMenu (Constructor)</h4>
153 <b>E4ModelMenu</b>(<i>parent = None</i>)
154 <p>
155 Constructor
156 </p><dl>
157 <dt><i>parent</i></dt>
158 <dd>
159 reference to the parent widget (QWidget)
160 </dd>
161 </dl><a NAME="E4ModelMenu.__aboutToShow" ID="E4ModelMenu.__aboutToShow"></a>
162 <h4>E4ModelMenu.__aboutToShow</h4>
163 <b>__aboutToShow</b>(<i></i>)
164 <p>
165 Private slot to show the menu.
166 </p><a NAME="E4ModelMenu.__actionTriggered" ID="E4ModelMenu.__actionTriggered"></a>
167 <h4>E4ModelMenu.__actionTriggered</h4>
168 <b>__actionTriggered</b>(<i>action</i>)
169 <p>
170 Private slot to handle the triggering of an action.
171 </p><dl>
172 <dt><i>action</i></dt>
173 <dd>
174 reference to the action that was triggered (QAction)
175 </dd>
176 </dl><a NAME="E4ModelMenu.__makeAction" ID="E4ModelMenu.__makeAction"></a>
177 <h4>E4ModelMenu.__makeAction</h4>
178 <b>__makeAction</b>(<i>idx</i>)
179 <p>
180 Private method to create an action.
181 </p><dl>
182 <dt><i>idx</i></dt>
183 <dd>
184 index of the item to create an action for (QModelIndex)
185 </dd>
186 </dl><dl>
187 <dt>Returns:</dt>
188 <dd>
189 reference to the created action (QAction)
190 </dd>
191 </dl><a NAME="E4ModelMenu.createBaseMenu" ID="E4ModelMenu.createBaseMenu"></a>
192 <h4>E4ModelMenu.createBaseMenu</h4>
193 <b>createBaseMenu</b>(<i></i>)
194 <p>
195 Public method to get the menu that is used to populate sub menu's.
196 </p><dl>
197 <dt>Returns:</dt>
198 <dd>
199 reference to the menu (E4ModelMenu)
200 </dd>
201 </dl><a NAME="E4ModelMenu.createMenu" ID="E4ModelMenu.createMenu"></a>
202 <h4>E4ModelMenu.createMenu</h4>
203 <b>createMenu</b>(<i>parent, max_, parentMenu = None, menu = None</i>)
204 <p>
205 Public method to put all the children of a parent into a menu of a given length.
206 </p><dl>
207 <dt><i>parent</i></dt>
208 <dd>
209 index of the parent item (QModelIndex)
210 </dd><dt><i>max_</i></dt>
211 <dd>
212 maximum number of entries (integer)
213 </dd><dt><i>parentMenu</i></dt>
214 <dd>
215 reference to the parent menu (QMenu)
216 </dd><dt><i>menu</i></dt>
217 <dd>
218 reference to the menu to be populated (QMenu)
219 </dd>
220 </dl><a NAME="E4ModelMenu.dragEnterEvent" ID="E4ModelMenu.dragEnterEvent"></a>
221 <h4>E4ModelMenu.dragEnterEvent</h4>
222 <b>dragEnterEvent</b>(<i>evt</i>)
223 <p>
224 Protected method to handle drag enter events.
225 </p><dl>
226 <dt><i>evt</i></dt>
227 <dd>
228 reference to the event (QDragEnterEvent)
229 </dd>
230 </dl><a NAME="E4ModelMenu.dropEvent" ID="E4ModelMenu.dropEvent"></a>
231 <h4>E4ModelMenu.dropEvent</h4>
232 <b>dropEvent</b>(<i>evt</i>)
233 <p>
234 Protected method to handle drop events.
235 </p><dl>
236 <dt><i>evt</i></dt>
237 <dd>
238 reference to the event (QDropEvent)
239 </dd>
240 </dl><a NAME="E4ModelMenu.firstSeparator" ID="E4ModelMenu.firstSeparator"></a>
241 <h4>E4ModelMenu.firstSeparator</h4>
242 <b>firstSeparator</b>(<i></i>)
243 <p>
244 Public method to get the first separator.
245 </p><dl>
246 <dt>Returns:</dt>
247 <dd>
248 row number of the first separator (integer)
249 </dd>
250 </dl><a NAME="E4ModelMenu.index" ID="E4ModelMenu.index"></a>
251 <h4>E4ModelMenu.index</h4>
252 <b>index</b>(<i>action</i>)
253 <p>
254 Public method to get the index of an action.
255 </p><dl>
256 <dt><i>action</i></dt>
257 <dd>
258 reference to the action to get the index for (QAction)
259 </dd>
260 </dl><dl>
261 <dt>Returns:</dt>
262 <dd>
263 index of the action (QModelIndex)
264 </dd>
265 </dl><a NAME="E4ModelMenu.makeAction" ID="E4ModelMenu.makeAction"></a>
266 <h4>E4ModelMenu.makeAction</h4>
267 <b>makeAction</b>(<i>icon, text, parent</i>)
268 <p>
269 Public method to create an action.
270 </p><dl>
271 <dt><i>icon</i></dt>
272 <dd>
273 icon of the action (QIcon)
274 </dd><dt><i>text</i></dt>
275 <dd>
276 text of the action (string)
277 </dd><dt><i>reference</i></dt>
278 <dd>
279 to the parent object (QObject)
280 </dd>
281 </dl><dl>
282 <dt>Returns:</dt>
283 <dd>
284 reference to the created action (QAction)
285 </dd>
286 </dl><a NAME="E4ModelMenu.maxRows" ID="E4ModelMenu.maxRows"></a>
287 <h4>E4ModelMenu.maxRows</h4>
288 <b>maxRows</b>(<i></i>)
289 <p>
290 Public method to get the maximum number of entries to show.
291 </p><dl>
292 <dt>Returns:</dt>
293 <dd>
294 maximum number of entries to show (integer)
295 </dd>
296 </dl><a NAME="E4ModelMenu.model" ID="E4ModelMenu.model"></a>
297 <h4>E4ModelMenu.model</h4>
298 <b>model</b>(<i></i>)
299 <p>
300 Public method to get a reference to the model.
301 </p><dl>
302 <dt>Returns:</dt>
303 <dd>
304 reference to the model (QAbstractItemModel)
305 </dd>
306 </dl><a NAME="E4ModelMenu.mouseMoveEvent" ID="E4ModelMenu.mouseMoveEvent"></a>
307 <h4>E4ModelMenu.mouseMoveEvent</h4>
308 <b>mouseMoveEvent</b>(<i>evt</i>)
309 <p>
310 Protected method to handle mouse move events.
311 </p><dl>
312 <dt><i>evt</i></dt>
313 <dd>
314 reference to the event (QMouseEvent)
315 </dd>
316 </dl><a NAME="E4ModelMenu.mousePressEvent" ID="E4ModelMenu.mousePressEvent"></a>
317 <h4>E4ModelMenu.mousePressEvent</h4>
318 <b>mousePressEvent</b>(<i>evt</i>)
319 <p>
320 Protected method handling mouse press events.
321 </p><dl>
322 <dt><i>evt</i></dt>
323 <dd>
324 reference to the event object (QMouseEvent)
325 </dd>
326 </dl><a NAME="E4ModelMenu.mouseReleaseEvent" ID="E4ModelMenu.mouseReleaseEvent"></a>
327 <h4>E4ModelMenu.mouseReleaseEvent</h4>
328 <b>mouseReleaseEvent</b>(<i>evt</i>)
329 <p>
330 Protected method handling mouse release events.
331 </p><dl>
332 <dt><i>evt</i></dt>
333 <dd>
334 reference to the event object (QMouseEvent)
335 </dd>
336 </dl><a NAME="E4ModelMenu.postPopulated" ID="E4ModelMenu.postPopulated"></a>
337 <h4>E4ModelMenu.postPopulated</h4>
338 <b>postPopulated</b>(<i></i>)
339 <p>
340 Public method to add any actions after the tree.
341 </p><a NAME="E4ModelMenu.prePopulated" ID="E4ModelMenu.prePopulated"></a>
342 <h4>E4ModelMenu.prePopulated</h4>
343 <b>prePopulated</b>(<i></i>)
344 <p>
345 Public method to add any actions before the tree.
346 </p><dl>
347 <dt>Returns:</dt>
348 <dd>
349 flag indicating if any actions were added
350 </dd>
351 </dl><a NAME="E4ModelMenu.removeEntry" ID="E4ModelMenu.removeEntry"></a>
352 <h4>E4ModelMenu.removeEntry</h4>
353 <b>removeEntry</b>(<i>idx</i>)
354 <p>
355 Public method to remove a menu entry.
356 </p><dl>
357 <dt><i>idx</i></dt>
358 <dd>
359 index of the entry to be removed (QModelIndex)
360 </dd>
361 </dl><a NAME="E4ModelMenu.resetFlags" ID="E4ModelMenu.resetFlags"></a>
362 <h4>E4ModelMenu.resetFlags</h4>
363 <b>resetFlags</b>(<i></i>)
364 <p>
365 Public method to reset the saved internal state.
366 </p><a NAME="E4ModelMenu.rootIndex" ID="E4ModelMenu.rootIndex"></a>
367 <h4>E4ModelMenu.rootIndex</h4>
368 <b>rootIndex</b>(<i></i>)
369 <p>
370 Public method to get the index of the root item.
371 </p><dl>
372 <dt>Returns:</dt>
373 <dd>
374 index of the root item (QModelIndex)
375 </dd>
376 </dl><a NAME="E4ModelMenu.separatorRole" ID="E4ModelMenu.separatorRole"></a>
377 <h4>E4ModelMenu.separatorRole</h4>
378 <b>separatorRole</b>(<i></i>)
379 <p>
380 Public method to get the role of the separator.
381 </p><dl>
382 <dt>Returns:</dt>
383 <dd>
384 role of the separator (integer)
385 </dd>
386 </dl><a NAME="E4ModelMenu.setFirstSeparator" ID="E4ModelMenu.setFirstSeparator"></a>
387 <h4>E4ModelMenu.setFirstSeparator</h4>
388 <b>setFirstSeparator</b>(<i>offset</i>)
389 <p>
390 Public method to set the first separator.
391 </p><dl>
392 <dt><i>offset</i></dt>
393 <dd>
394 row number of the first separator (integer)
395 </dd>
396 </dl><a NAME="E4ModelMenu.setMaxRows" ID="E4ModelMenu.setMaxRows"></a>
397 <h4>E4ModelMenu.setMaxRows</h4>
398 <b>setMaxRows</b>(<i>rows</i>)
399 <p>
400 Public method to set the maximum number of entries to show.
401 </p><dl>
402 <dt><i>rows</i></dt>
403 <dd>
404 maximum number of entries to show (integer)
405 </dd>
406 </dl><a NAME="E4ModelMenu.setModel" ID="E4ModelMenu.setModel"></a>
407 <h4>E4ModelMenu.setModel</h4>
408 <b>setModel</b>(<i>model</i>)
409 <p>
410 Public method to set the model for the menu.
411 </p><dl>
412 <dt><i>model</i></dt>
413 <dd>
414 reference to the model (QAbstractItemModel)
415 </dd>
416 </dl><a NAME="E4ModelMenu.setRootIndex" ID="E4ModelMenu.setRootIndex"></a>
417 <h4>E4ModelMenu.setRootIndex</h4>
418 <b>setRootIndex</b>(<i>index</i>)
419 <p>
420 Public method to set the index of the root item.
421 </p><dl>
422 <dt><i>index</i></dt>
423 <dd>
424 index of the root item (QModelIndex)
425 </dd>
426 </dl><a NAME="E4ModelMenu.setSeparatorRole" ID="E4ModelMenu.setSeparatorRole"></a>
427 <h4>E4ModelMenu.setSeparatorRole</h4>
428 <b>setSeparatorRole</b>(<i>role</i>)
429 <p>
430 Public method to set the role of the separator.
431 </p><dl>
432 <dt><i>role</i></dt>
433 <dd>
434 role of the separator (integer)
435 </dd>
436 </dl><a NAME="E4ModelMenu.setStatusBarTextRole" ID="E4ModelMenu.setStatusBarTextRole"></a>
437 <h4>E4ModelMenu.setStatusBarTextRole</h4>
438 <b>setStatusBarTextRole</b>(<i>role</i>)
439 <p>
440 Public method to set the role of the status bar text.
441 </p><dl>
442 <dt><i>role</i></dt>
443 <dd>
444 role of the status bar text (integer)
445 </dd>
446 </dl><a NAME="E4ModelMenu.statusBarTextRole" ID="E4ModelMenu.statusBarTextRole"></a>
447 <h4>E4ModelMenu.statusBarTextRole</h4>
448 <b>statusBarTextRole</b>(<i></i>)
449 <p>
450 Public method to get the role of the status bar text.
451 </p><dl>
452 <dt>Returns:</dt>
453 <dd>
454 role of the status bar text (integer)
455 </dd>
456 </dl>
457 <div align="right"><a href="#top">Up</a></div>
458 <hr />
459 </body></html>

eric ide

mercurial