10 shortcuts. |
10 shortcuts. |
11 """ |
11 """ |
12 |
12 |
13 |
13 |
14 from PyQt5.QtGui import QIcon, QKeySequence |
14 from PyQt5.QtGui import QIcon, QKeySequence |
15 from PyQt5.QtWidgets import QAction, QActionGroup, qApp |
15 from PyQt5.QtWidgets import QAction, QActionGroup |
|
16 |
|
17 from E5Gui.E5Application import e5App |
16 |
18 |
17 |
19 |
18 class ArgumentsError(RuntimeError): |
20 class ArgumentsError(RuntimeError): |
19 """ |
21 """ |
20 Class implementing an exception, which is raised, if the wrong number of |
22 Class implementing an exception, which is raised, if the wrong number of |
179 """ |
181 """ |
180 Private slot to add the primary keyboard accelerator to the tooltip. |
182 Private slot to add the primary keyboard accelerator to the tooltip. |
181 """ |
183 """ |
182 shortcut = self.shortcut().toString(QKeySequence.NativeText) |
184 shortcut = self.shortcut().toString(QKeySequence.NativeText) |
183 if shortcut: |
185 if shortcut: |
184 if qApp.isLeftToRight(): |
186 if e5App().isLeftToRight(): |
185 fmt = "{0} ({1})" |
187 fmt = "{0} ({1})" |
186 else: |
188 else: |
187 fmt = "({1}) {0}" |
189 fmt = "({1}) {0}" |
188 self.setToolTip(fmt.format(self.iconText(), shortcut)) |
190 self.setToolTip(fmt.format(self.iconText(), shortcut)) |
189 |
191 |