diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-02-12 15:21:36 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-02-14 11:47:46 +0000 |
commit | 2bfafb673c9658c8056e78253fd16ebee521ed06 (patch) | |
tree | 1635170357ed8f50e7568af4b8a90115319b0755 /src/widgets/widgets | |
parent | 7b72810801236cc0c25d0d515d2039db071c95bd (diff) |
Fix typo in code handling Qt::AA_DontShowShortcutsInContextMenus
Use Qt::AA_DontShowShortcutsInContextMenus instead of
Qt::AA_DontShowIconsInMenus in the getters and helpers for
formatting the action text. Streamline the code and use
static method invocation.
Amends c2c3452ba5b4c32d0c2d5df9193bf89986623ab5.
Task-number: QTBUG-49435
Change-Id: I8827c2dc757e5899e5a26ffbf2d0b5018aa7544a
Reviewed-by: David Faure <david.faure@kdab.com>
Diffstat (limited to 'src/widgets/widgets')
-rw-r--r-- | src/widgets/widgets/qlineedit.cpp | 5 | ||||
-rw-r--r-- | src/widgets/widgets/qwidgettextcontrol.cpp | 5 |
2 files changed, 4 insertions, 6 deletions
diff --git a/src/widgets/widgets/qlineedit.cpp b/src/widgets/widgets/qlineedit.cpp index e3b348f0ef..bdeef7cdf7 100644 --- a/src/widgets/widgets/qlineedit.cpp +++ b/src/widgets/widgets/qlineedit.cpp @@ -80,9 +80,8 @@ #include "private/qapplication_p.h" #include "private/qshortcutmap_p.h" #include "qkeysequence.h" -#define ACCEL_KEY(k) ((qApp->testAttribute(Qt::AA_DontShowIconsInMenus) \ - ? false \ - : qApp->styleHints()->showShortcutsInContextMenus()) \ +#define ACCEL_KEY(k) ((!QCoreApplication::testAttribute(Qt::AA_DontShowIconsInMenus) \ + && QGuiApplication::styleHints()->showShortcutsInContextMenus()) \ && !qApp->d_func()->shortcutMap.hasShortcutForKeySequence(k) ? \ QLatin1Char('\t') + QKeySequence(k).toString(QKeySequence::NativeText) : QString()) #else diff --git a/src/widgets/widgets/qwidgettextcontrol.cpp b/src/widgets/widgets/qwidgettextcontrol.cpp index 93158dcdba..d3203e180b 100644 --- a/src/widgets/widgets/qwidgettextcontrol.cpp +++ b/src/widgets/widgets/qwidgettextcontrol.cpp @@ -93,9 +93,8 @@ #include "private/qapplication_p.h" #include "private/qshortcutmap_p.h" #include <qkeysequence.h> -#define ACCEL_KEY(k) ((qApp->testAttribute(Qt::AA_DontShowIconsInMenus) \ - ? false \ - : qApp->styleHints()->showShortcutsInContextMenus()) \ +#define ACCEL_KEY(k) ((!QCoreApplication::testAttribute(Qt::AA_DontShowShortcutsInContextMenus) \ + && QGuiApplication::styleHints()->showShortcutsInContextMenus()) \ && !qApp->d_func()->shortcutMap.hasShortcutForKeySequence(k) ? \ QLatin1Char('\t') + QKeySequence(k).toString(QKeySequence::NativeText) : QString()) |