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 c2c3452ba5.
Task-number: QTBUG-49435
Change-Id: I8827c2dc757e5899e5a26ffbf2d0b5018aa7544a
Reviewed-by: David Faure <david.faure@kdab.com>
bb10
parent
7b72810801
commit
2bfafb673c
|
|
@ -1332,9 +1332,8 @@ bool QAction::isShortcutVisibleInContextMenu() const
|
|||
{
|
||||
Q_D(const QAction);
|
||||
if (d->shortcutVisibleInContextMenu == -1) {
|
||||
if (QApplication::instance()->testAttribute(Qt::AA_DontShowIconsInMenus))
|
||||
return false;
|
||||
return qApp->styleHints()->showShortcutsInContextMenus();
|
||||
return !QCoreApplication::testAttribute(Qt::AA_DontShowShortcutsInContextMenus)
|
||||
&& QGuiApplication::styleHints()->showShortcutsInContextMenus();
|
||||
}
|
||||
return d->shortcutVisibleInContextMenu;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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())
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue