13 from PyQt4.QtGui import QAction, QActionGroup, QIcon, QKeySequence, qApp |
13 from PyQt4.QtGui import QAction, QActionGroup, QIcon, QKeySequence, qApp |
14 |
14 |
15 |
15 |
16 class ArgumentsError(RuntimeError): |
16 class ArgumentsError(RuntimeError): |
17 """ |
17 """ |
18 Class implementing an exception, which is raised, if the wrong number of arguments |
18 Class implementing an exception, which is raised, if the wrong number of |
19 are given. |
19 arguments are given. |
20 """ |
20 """ |
21 def __init__(self, error): |
21 def __init__(self, error): |
22 """ |
22 """ |
23 Constructor |
23 Constructor |
24 |
24 |
52 Constructor |
52 Constructor |
53 |
53 |
54 @param args argument list of the constructor. This list is one of |
54 @param args argument list of the constructor. This list is one of |
55 <ul> |
55 <ul> |
56 <li>text (string), icon (QIcon), menu text (string), |
56 <li>text (string), icon (QIcon), menu text (string), |
57 accelarator (QKeySequence), alternative accelerator (QKeySequence), |
57 accelarator (QKeySequence), alternative accelerator |
58 parent (QObject), name (string), toggle (boolean)</li> |
58 (QKeySequence), parent (QObject), name (string), toggle |
|
59 (boolean)</li> |
59 <li>text (string), icon (QIcon), menu text (string), |
60 <li>text (string), icon (QIcon), menu text (string), |
60 accelarator (QKeySequence), alternative accelerator (QKeySequence), |
61 accelarator (QKeySequence), alternative accelerator |
61 parent (QObject), name (string)</li> |
62 (QKeySequence), parent (QObject), name (string)</li> |
62 <li>text (string), menu text (string), |
63 <li>text (string), menu text (string), |
63 accelarator (QKeySequence), alternative accelerator (QKeySequence), |
64 accelarator (QKeySequence), alternative accelerator |
64 parent (QObject), name (string), toggle (boolean)</li> |
65 (QKeySequence), parent (QObject), name (string), toggle |
|
66 (boolean)</li> |
65 <li>text (string), menu text (string), |
67 <li>text (string), menu text (string), |
66 accelarator (QKeySequence), alternative accelerator (QKeySequence), |
68 accelarator (QKeySequence), alternative accelerator |
67 parent (QObject), name (string)</li> |
69 (QKeySequence), parent (QObject), name (string)</li> |
68 </ul> |
70 </ul> |
69 @exception ArgumentsError raised to indicate invalid arguments |
71 @exception ArgumentsError raised to indicate invalid arguments |
70 """ |
72 """ |
71 if isinstance(args[1], QIcon): |
73 if isinstance(args[1], QIcon): |
72 icon = args[1] |
74 icon = args[1] |