16 |
16 |
17 a { color: #BA6D36; } |
17 a { color: #BA6D36; } |
18 |
18 |
19 </style> |
19 </style> |
20 </head> |
20 </head> |
21 <body><a NAME="top" ID="top"></a> |
21 <body> |
|
22 <a NAME="top" ID="top"></a> |
22 <h1>eric6.E5Gui.E5Action</h1> |
23 <h1>eric6.E5Gui.E5Action</h1> |
|
24 |
23 <p> |
25 <p> |
24 Module implementing an Action class extending QAction. |
26 Module implementing an Action class extending QAction. |
25 </p><p> |
27 </p> |
|
28 <p> |
26 This extension is necessary in order to support alternate keyboard |
29 This extension is necessary in order to support alternate keyboard |
27 shortcuts. |
30 shortcuts. |
28 </p> |
31 </p> |
29 <h3>Global Attributes</h3> |
32 <h3>Global Attributes</h3> |
|
33 |
30 <table> |
34 <table> |
31 <tr><td>None</td></tr> |
35 <tr><td>None</td></tr> |
32 </table> |
36 </table> |
33 <h3>Classes</h3> |
37 <h3>Classes</h3> |
34 <table> |
38 |
|
39 <table> |
|
40 |
35 <tr> |
41 <tr> |
36 <td><a href="#ArgumentsError">ArgumentsError</a></td> |
42 <td><a href="#ArgumentsError">ArgumentsError</a></td> |
37 <td>Class implementing an exception, which is raised, if the wrong number of arguments are given.</td> |
43 <td>Class implementing an exception, which is raised, if the wrong number of arguments are given.</td> |
38 </tr><tr> |
44 </tr> |
|
45 <tr> |
39 <td><a href="#E5Action">E5Action</a></td> |
46 <td><a href="#E5Action">E5Action</a></td> |
40 <td>Class implementing an Action class extending QAction.</td> |
47 <td>Class implementing an Action class extending QAction.</td> |
41 </tr> |
48 </tr> |
42 </table> |
49 </table> |
43 <h3>Functions</h3> |
50 <h3>Functions</h3> |
44 <table> |
51 |
|
52 <table> |
|
53 |
45 <tr> |
54 <tr> |
46 <td><a href="#addActions">addActions</a></td> |
55 <td><a href="#addActions">addActions</a></td> |
47 <td>Module function to add a list of actions to a widget.</td> |
56 <td>Module function to add a list of actions to a widget.</td> |
48 </tr><tr> |
57 </tr> |
|
58 <tr> |
49 <td><a href="#createActionGroup">createActionGroup</a></td> |
59 <td><a href="#createActionGroup">createActionGroup</a></td> |
50 <td>Module function to create an action group.</td> |
60 <td>Module function to create an action group.</td> |
51 </tr> |
61 </tr> |
52 </table> |
62 </table> |
53 <hr /><hr /> |
63 <hr /> |
|
64 <hr /> |
54 <a NAME="ArgumentsError" ID="ArgumentsError"></a> |
65 <a NAME="ArgumentsError" ID="ArgumentsError"></a> |
55 <h2>ArgumentsError</h2> |
66 <h2>ArgumentsError</h2> |
|
67 |
56 <p> |
68 <p> |
57 Class implementing an exception, which is raised, if the wrong number of |
69 Class implementing an exception, which is raised, if the wrong number of |
58 arguments are given. |
70 arguments are given. |
59 </p> |
71 </p> |
60 <h3>Derived from</h3> |
72 <h3>Derived from</h3> |
61 RuntimeError |
73 RuntimeError |
62 <h3>Class Attributes</h3> |
74 <h3>Class Attributes</h3> |
|
75 |
63 <table> |
76 <table> |
64 <tr><td>None</td></tr> |
77 <tr><td>None</td></tr> |
65 </table> |
78 </table> |
66 <h3>Class Methods</h3> |
79 <h3>Class Methods</h3> |
|
80 |
67 <table> |
81 <table> |
68 <tr><td>None</td></tr> |
82 <tr><td>None</td></tr> |
69 </table> |
83 </table> |
70 <h3>Methods</h3> |
84 <h3>Methods</h3> |
71 <table> |
85 |
|
86 <table> |
|
87 |
72 <tr> |
88 <tr> |
73 <td><a href="#ArgumentsError.__init__">ArgumentsError</a></td> |
89 <td><a href="#ArgumentsError.__init__">ArgumentsError</a></td> |
74 <td>Constructor</td> |
90 <td>Constructor</td> |
75 </tr><tr> |
91 </tr> |
|
92 <tr> |
76 <td><a href="#ArgumentsError.__repr__">__repr__</a></td> |
93 <td><a href="#ArgumentsError.__repr__">__repr__</a></td> |
77 <td>Special method returning a representation of the exception.</td> |
94 <td>Special method returning a representation of the exception.</td> |
78 </tr><tr> |
95 </tr> |
|
96 <tr> |
79 <td><a href="#ArgumentsError.__str__">__str__</a></td> |
97 <td><a href="#ArgumentsError.__str__">__str__</a></td> |
80 <td>Special method returning a string representation of the exception.</td> |
98 <td>Special method returning a string representation of the exception.</td> |
81 </tr> |
99 </tr> |
82 </table> |
100 </table> |
83 <h3>Static Methods</h3> |
101 <h3>Static Methods</h3> |
84 <table> |
102 |
85 <tr><td>None</td></tr> |
103 <table> |
86 </table> |
104 <tr><td>None</td></tr> |
|
105 </table> |
|
106 |
87 <a NAME="ArgumentsError.__init__" ID="ArgumentsError.__init__"></a> |
107 <a NAME="ArgumentsError.__init__" ID="ArgumentsError.__init__"></a> |
88 <h4>ArgumentsError (Constructor)</h4> |
108 <h4>ArgumentsError (Constructor)</h4> |
89 <b>ArgumentsError</b>(<i>error</i>) |
109 <b>ArgumentsError</b>(<i>error</i>) |
|
110 |
90 <p> |
111 <p> |
91 Constructor |
112 Constructor |
92 </p><dl> |
113 </p> |
|
114 <dl> |
|
115 |
93 <dt><i>error</i></dt> |
116 <dt><i>error</i></dt> |
94 <dd> |
117 <dd> |
95 error message of the exception (string) |
118 error message of the exception (string) |
96 </dd> |
119 </dd> |
97 </dl><a NAME="ArgumentsError.__repr__" ID="ArgumentsError.__repr__"></a> |
120 </dl> |
|
121 <a NAME="ArgumentsError.__repr__" ID="ArgumentsError.__repr__"></a> |
98 <h4>ArgumentsError.__repr__</h4> |
122 <h4>ArgumentsError.__repr__</h4> |
99 <b>__repr__</b>(<i></i>) |
123 <b>__repr__</b>(<i></i>) |
|
124 |
100 <p> |
125 <p> |
101 Special method returning a representation of the exception. |
126 Special method returning a representation of the exception. |
102 </p><dl> |
127 </p> |
|
128 <dl> |
103 <dt>Returns:</dt> |
129 <dt>Returns:</dt> |
104 <dd> |
130 <dd> |
105 string representing the error message |
131 string representing the error message |
106 </dd> |
132 </dd> |
107 </dl><a NAME="ArgumentsError.__str__" ID="ArgumentsError.__str__"></a> |
133 </dl> |
|
134 <a NAME="ArgumentsError.__str__" ID="ArgumentsError.__str__"></a> |
108 <h4>ArgumentsError.__str__</h4> |
135 <h4>ArgumentsError.__str__</h4> |
109 <b>__str__</b>(<i></i>) |
136 <b>__str__</b>(<i></i>) |
|
137 |
110 <p> |
138 <p> |
111 Special method returning a string representation of the exception. |
139 Special method returning a string representation of the exception. |
112 </p><dl> |
140 </p> |
|
141 <dl> |
113 <dt>Returns:</dt> |
142 <dt>Returns:</dt> |
114 <dd> |
143 <dd> |
115 string representing the error message |
144 string representing the error message |
116 </dd> |
145 </dd> |
117 </dl> |
146 </dl> |
118 <div align="right"><a href="#top">Up</a></div> |
147 <div align="right"><a href="#top">Up</a></div> |
119 <hr /><hr /> |
148 <hr /> |
|
149 <hr /> |
120 <a NAME="E5Action" ID="E5Action"></a> |
150 <a NAME="E5Action" ID="E5Action"></a> |
121 <h2>E5Action</h2> |
151 <h2>E5Action</h2> |
|
152 |
122 <p> |
153 <p> |
123 Class implementing an Action class extending QAction. |
154 Class implementing an Action class extending QAction. |
124 </p> |
155 </p> |
125 <h3>Derived from</h3> |
156 <h3>Derived from</h3> |
126 QAction |
157 QAction |
127 <h3>Class Attributes</h3> |
158 <h3>Class Attributes</h3> |
|
159 |
128 <table> |
160 <table> |
129 <tr><td>None</td></tr> |
161 <tr><td>None</td></tr> |
130 </table> |
162 </table> |
131 <h3>Class Methods</h3> |
163 <h3>Class Methods</h3> |
|
164 |
132 <table> |
165 <table> |
133 <tr><td>None</td></tr> |
166 <tr><td>None</td></tr> |
134 </table> |
167 </table> |
135 <h3>Methods</h3> |
168 <h3>Methods</h3> |
136 <table> |
169 |
|
170 <table> |
|
171 |
137 <tr> |
172 <tr> |
138 <td><a href="#E5Action.__init__">E5Action</a></td> |
173 <td><a href="#E5Action.__init__">E5Action</a></td> |
139 <td>Constructor</td> |
174 <td>Constructor</td> |
140 </tr><tr> |
175 </tr> |
|
176 <tr> |
141 <td><a href="#E5Action.__ammendToolTip">__ammendToolTip</a></td> |
177 <td><a href="#E5Action.__ammendToolTip">__ammendToolTip</a></td> |
142 <td>Private slot to add the primary keyboard accelerator to the tooltip.</td> |
178 <td>Private slot to add the primary keyboard accelerator to the tooltip.</td> |
143 </tr><tr> |
179 </tr> |
|
180 <tr> |
144 <td><a href="#E5Action.alternateShortcut">alternateShortcut</a></td> |
181 <td><a href="#E5Action.alternateShortcut">alternateShortcut</a></td> |
145 <td>Public method to retrieve the alternative keyboard shortcut.</td> |
182 <td>Public method to retrieve the alternative keyboard shortcut.</td> |
146 </tr><tr> |
183 </tr> |
|
184 <tr> |
147 <td><a href="#E5Action.setAlternateShortcut">setAlternateShortcut</a></td> |
185 <td><a href="#E5Action.setAlternateShortcut">setAlternateShortcut</a></td> |
148 <td>Public slot to set the alternative keyboard shortcut.</td> |
186 <td>Public slot to set the alternative keyboard shortcut.</td> |
149 </tr><tr> |
187 </tr> |
|
188 <tr> |
150 <td><a href="#E5Action.setIconText">setIconText</a></td> |
189 <td><a href="#E5Action.setIconText">setIconText</a></td> |
151 <td>Public slot to set the icon text of the action.</td> |
190 <td>Public slot to set the icon text of the action.</td> |
152 </tr><tr> |
191 </tr> |
|
192 <tr> |
153 <td><a href="#E5Action.setShortcut">setShortcut</a></td> |
193 <td><a href="#E5Action.setShortcut">setShortcut</a></td> |
154 <td>Public slot to set the keyboard shortcut.</td> |
194 <td>Public slot to set the keyboard shortcut.</td> |
155 </tr><tr> |
195 </tr> |
|
196 <tr> |
156 <td><a href="#E5Action.setShortcuts">setShortcuts</a></td> |
197 <td><a href="#E5Action.setShortcuts">setShortcuts</a></td> |
157 <td>Public slot to set the list of keyboard shortcuts.</td> |
198 <td>Public slot to set the list of keyboard shortcuts.</td> |
158 </tr> |
199 </tr> |
159 </table> |
200 </table> |
160 <h3>Static Methods</h3> |
201 <h3>Static Methods</h3> |
161 <table> |
202 |
162 <tr><td>None</td></tr> |
203 <table> |
163 </table> |
204 <tr><td>None</td></tr> |
|
205 </table> |
|
206 |
164 <a NAME="E5Action.__init__" ID="E5Action.__init__"></a> |
207 <a NAME="E5Action.__init__" ID="E5Action.__init__"></a> |
165 <h4>E5Action (Constructor)</h4> |
208 <h4>E5Action (Constructor)</h4> |
166 <b>E5Action</b>(<i>*args</i>) |
209 <b>E5Action</b>(<i>*args</i>) |
|
210 |
167 <p> |
211 <p> |
168 Constructor |
212 Constructor |
169 </p><dl> |
213 </p> |
|
214 <dl> |
|
215 |
170 <dt><i>args</i></dt> |
216 <dt><i>args</i></dt> |
171 <dd> |
217 <dd> |
172 argument list of the constructor. This list is one of |
218 argument list of the constructor. This list is one of |
173 <ul> |
219 <ul> |
174 <li>text (string), icon (QIcon), menu text (string), |
220 <li>text (string), icon (QIcon), menu text (string), |
185 <li>text (string), menu text (string), |
231 <li>text (string), menu text (string), |
186 accelarator (QKeySequence), alternative accelerator |
232 accelarator (QKeySequence), alternative accelerator |
187 (QKeySequence), parent (QObject), name (string)</li> |
233 (QKeySequence), parent (QObject), name (string)</li> |
188 </ul> |
234 </ul> |
189 </dd> |
235 </dd> |
190 </dl><dl> |
236 </dl> |
|
237 <dl> |
|
238 |
191 <dt>Raises <b>ArgumentsError</b>:</dt> |
239 <dt>Raises <b>ArgumentsError</b>:</dt> |
192 <dd> |
240 <dd> |
193 raised to indicate invalid arguments |
241 raised to indicate invalid arguments |
194 </dd> |
242 </dd> |
195 </dl><a NAME="E5Action.__ammendToolTip" ID="E5Action.__ammendToolTip"></a> |
243 </dl> |
|
244 <a NAME="E5Action.__ammendToolTip" ID="E5Action.__ammendToolTip"></a> |
196 <h4>E5Action.__ammendToolTip</h4> |
245 <h4>E5Action.__ammendToolTip</h4> |
197 <b>__ammendToolTip</b>(<i></i>) |
246 <b>__ammendToolTip</b>(<i></i>) |
|
247 |
198 <p> |
248 <p> |
199 Private slot to add the primary keyboard accelerator to the tooltip. |
249 Private slot to add the primary keyboard accelerator to the tooltip. |
200 </p><a NAME="E5Action.alternateShortcut" ID="E5Action.alternateShortcut"></a> |
250 </p> |
|
251 <a NAME="E5Action.alternateShortcut" ID="E5Action.alternateShortcut"></a> |
201 <h4>E5Action.alternateShortcut</h4> |
252 <h4>E5Action.alternateShortcut</h4> |
202 <b>alternateShortcut</b>(<i></i>) |
253 <b>alternateShortcut</b>(<i></i>) |
|
254 |
203 <p> |
255 <p> |
204 Public method to retrieve the alternative keyboard shortcut. |
256 Public method to retrieve the alternative keyboard shortcut. |
205 </p><dl> |
257 </p> |
|
258 <dl> |
206 <dt>Returns:</dt> |
259 <dt>Returns:</dt> |
207 <dd> |
260 <dd> |
208 the alternative accelerator (QKeySequence) |
261 the alternative accelerator (QKeySequence) |
209 </dd> |
262 </dd> |
210 </dl><a NAME="E5Action.setAlternateShortcut" ID="E5Action.setAlternateShortcut"></a> |
263 </dl> |
|
264 <a NAME="E5Action.setAlternateShortcut" ID="E5Action.setAlternateShortcut"></a> |
211 <h4>E5Action.setAlternateShortcut</h4> |
265 <h4>E5Action.setAlternateShortcut</h4> |
212 <b>setAlternateShortcut</b>(<i>shortcut, removeEmpty=False</i>) |
266 <b>setAlternateShortcut</b>(<i>shortcut, removeEmpty=False</i>) |
|
267 |
213 <p> |
268 <p> |
214 Public slot to set the alternative keyboard shortcut. |
269 Public slot to set the alternative keyboard shortcut. |
215 </p><dl> |
270 </p> |
|
271 <dl> |
|
272 |
216 <dt><i>shortcut</i></dt> |
273 <dt><i>shortcut</i></dt> |
217 <dd> |
274 <dd> |
218 the alternative accelerator (QKeySequence) |
275 the alternative accelerator (QKeySequence) |
219 </dd><dt><i>removeEmpty</i></dt> |
276 </dd> |
|
277 <dt><i>removeEmpty</i></dt> |
220 <dd> |
278 <dd> |
221 flag indicating to remove the alternate shortcut, |
279 flag indicating to remove the alternate shortcut, |
222 if it is empty (boolean) |
280 if it is empty (boolean) |
223 </dd> |
281 </dd> |
224 </dl><a NAME="E5Action.setIconText" ID="E5Action.setIconText"></a> |
282 </dl> |
|
283 <a NAME="E5Action.setIconText" ID="E5Action.setIconText"></a> |
225 <h4>E5Action.setIconText</h4> |
284 <h4>E5Action.setIconText</h4> |
226 <b>setIconText</b>(<i>text</i>) |
285 <b>setIconText</b>(<i>text</i>) |
|
286 |
227 <p> |
287 <p> |
228 Public slot to set the icon text of the action. |
288 Public slot to set the icon text of the action. |
229 </p><dl> |
289 </p> |
|
290 <dl> |
|
291 |
230 <dt><i>text</i></dt> |
292 <dt><i>text</i></dt> |
231 <dd> |
293 <dd> |
232 new icon text (string) |
294 new icon text (string) |
233 </dd> |
295 </dd> |
234 </dl><a NAME="E5Action.setShortcut" ID="E5Action.setShortcut"></a> |
296 </dl> |
|
297 <a NAME="E5Action.setShortcut" ID="E5Action.setShortcut"></a> |
235 <h4>E5Action.setShortcut</h4> |
298 <h4>E5Action.setShortcut</h4> |
236 <b>setShortcut</b>(<i>shortcut</i>) |
299 <b>setShortcut</b>(<i>shortcut</i>) |
|
300 |
237 <p> |
301 <p> |
238 Public slot to set the keyboard shortcut. |
302 Public slot to set the keyboard shortcut. |
239 </p><dl> |
303 </p> |
|
304 <dl> |
|
305 |
240 <dt><i>shortcut</i></dt> |
306 <dt><i>shortcut</i></dt> |
241 <dd> |
307 <dd> |
242 the accelerator (QKeySequence) |
308 the accelerator (QKeySequence) |
243 </dd> |
309 </dd> |
244 </dl><a NAME="E5Action.setShortcuts" ID="E5Action.setShortcuts"></a> |
310 </dl> |
|
311 <a NAME="E5Action.setShortcuts" ID="E5Action.setShortcuts"></a> |
245 <h4>E5Action.setShortcuts</h4> |
312 <h4>E5Action.setShortcuts</h4> |
246 <b>setShortcuts</b>(<i>shortcuts</i>) |
313 <b>setShortcuts</b>(<i>shortcuts</i>) |
|
314 |
247 <p> |
315 <p> |
248 Public slot to set the list of keyboard shortcuts. |
316 Public slot to set the list of keyboard shortcuts. |
249 </p><dl> |
317 </p> |
|
318 <dl> |
|
319 |
250 <dt><i>shortcuts</i></dt> |
320 <dt><i>shortcuts</i></dt> |
251 <dd> |
321 <dd> |
252 list of keyboard accelerators (list of QKeySequence) |
322 list of keyboard accelerators (list of QKeySequence) |
253 or key for a platform dependent list of accelerators |
323 or key for a platform dependent list of accelerators |
254 (QKeySequence.StandardKey) |
324 (QKeySequence.StandardKey) |
255 </dd> |
325 </dd> |
256 </dl> |
326 </dl> |
257 <div align="right"><a href="#top">Up</a></div> |
327 <div align="right"><a href="#top">Up</a></div> |
258 <hr /><hr /> |
328 <hr /> |
|
329 <hr /> |
259 <a NAME="addActions" ID="addActions"></a> |
330 <a NAME="addActions" ID="addActions"></a> |
260 <h2>addActions</h2> |
331 <h2>addActions</h2> |
261 <b>addActions</b>(<i>target, actions</i>) |
332 <b>addActions</b>(<i>target, actions</i>) |
|
333 |
262 <p> |
334 <p> |
263 Module function to add a list of actions to a widget. |
335 Module function to add a list of actions to a widget. |
264 </p><dl> |
336 </p> |
|
337 <dl> |
|
338 |
265 <dt><i>target</i></dt> |
339 <dt><i>target</i></dt> |
266 <dd> |
340 <dd> |
267 reference to the target widget (QWidget) |
341 reference to the target widget (QWidget) |
268 </dd><dt><i>actions</i></dt> |
342 </dd> |
|
343 <dt><i>actions</i></dt> |
269 <dd> |
344 <dd> |
270 list of actions to be added to the target. A |
345 list of actions to be added to the target. A |
271 None indicates a separator (list of QActions) |
346 None indicates a separator (list of QActions) |
272 </dd> |
347 </dd> |
273 </dl> |
348 </dl> |
274 <div align="right"><a href="#top">Up</a></div> |
349 <div align="right"><a href="#top">Up</a></div> |
275 <hr /><hr /> |
350 <hr /> |
|
351 <hr /> |
276 <a NAME="createActionGroup" ID="createActionGroup"></a> |
352 <a NAME="createActionGroup" ID="createActionGroup"></a> |
277 <h2>createActionGroup</h2> |
353 <h2>createActionGroup</h2> |
278 <b>createActionGroup</b>(<i>parent, name=None, exclusive=False</i>) |
354 <b>createActionGroup</b>(<i>parent, name=None, exclusive=False</i>) |
|
355 |
279 <p> |
356 <p> |
280 Module function to create an action group. |
357 Module function to create an action group. |
281 </p><dl> |
358 </p> |
|
359 <dl> |
|
360 |
282 <dt><i>parent</i></dt> |
361 <dt><i>parent</i></dt> |
283 <dd> |
362 <dd> |
284 parent object of the action group (QObject) |
363 parent object of the action group (QObject) |
285 </dd><dt><i>name</i></dt> |
364 </dd> |
|
365 <dt><i>name</i></dt> |
286 <dd> |
366 <dd> |
287 name of the action group object (string) |
367 name of the action group object (string) |
288 </dd><dt><i>exclusive</i></dt> |
368 </dd> |
|
369 <dt><i>exclusive</i></dt> |
289 <dd> |
370 <dd> |
290 flag indicating an exclusive action group (boolean) |
371 flag indicating an exclusive action group (boolean) |
291 </dd> |
372 </dd> |
292 </dl><dl> |
373 </dl> |
|
374 <dl> |
293 <dt>Returns:</dt> |
375 <dt>Returns:</dt> |
294 <dd> |
376 <dd> |
295 reference to the created action group (QActionGroup) |
377 reference to the created action group (QActionGroup) |
296 </dd> |
378 </dd> |
297 </dl> |
379 </dl> |