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