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>
This commit is contained in:
parent
7b72810801
commit
2bfafb673c
@ -1332,9 +1332,8 @@ bool QAction::isShortcutVisibleInContextMenu() const
|
|||||||
{
|
{
|
||||||
Q_D(const QAction);
|
Q_D(const QAction);
|
||||||
if (d->shortcutVisibleInContextMenu == -1) {
|
if (d->shortcutVisibleInContextMenu == -1) {
|
||||||
if (QApplication::instance()->testAttribute(Qt::AA_DontShowIconsInMenus))
|
return !QCoreApplication::testAttribute(Qt::AA_DontShowShortcutsInContextMenus)
|
||||||
return false;
|
&& QGuiApplication::styleHints()->showShortcutsInContextMenus();
|
||||||
return qApp->styleHints()->showShortcutsInContextMenus();
|
|
||||||
}
|
}
|
||||||
return d->shortcutVisibleInContextMenu;
|
return d->shortcutVisibleInContextMenu;
|
||||||
}
|
}
|
||||||
|
@ -80,9 +80,8 @@
|
|||||||
#include "private/qapplication_p.h"
|
#include "private/qapplication_p.h"
|
||||||
#include "private/qshortcutmap_p.h"
|
#include "private/qshortcutmap_p.h"
|
||||||
#include "qkeysequence.h"
|
#include "qkeysequence.h"
|
||||||
#define ACCEL_KEY(k) ((qApp->testAttribute(Qt::AA_DontShowIconsInMenus) \
|
#define ACCEL_KEY(k) ((!QCoreApplication::testAttribute(Qt::AA_DontShowIconsInMenus) \
|
||||||
? false \
|
&& QGuiApplication::styleHints()->showShortcutsInContextMenus()) \
|
||||||
: qApp->styleHints()->showShortcutsInContextMenus()) \
|
|
||||||
&& !qApp->d_func()->shortcutMap.hasShortcutForKeySequence(k) ? \
|
&& !qApp->d_func()->shortcutMap.hasShortcutForKeySequence(k) ? \
|
||||||
QLatin1Char('\t') + QKeySequence(k).toString(QKeySequence::NativeText) : QString())
|
QLatin1Char('\t') + QKeySequence(k).toString(QKeySequence::NativeText) : QString())
|
||||||
#else
|
#else
|
||||||
|
@ -93,9 +93,8 @@
|
|||||||
#include "private/qapplication_p.h"
|
#include "private/qapplication_p.h"
|
||||||
#include "private/qshortcutmap_p.h"
|
#include "private/qshortcutmap_p.h"
|
||||||
#include <qkeysequence.h>
|
#include <qkeysequence.h>
|
||||||
#define ACCEL_KEY(k) ((qApp->testAttribute(Qt::AA_DontShowIconsInMenus) \
|
#define ACCEL_KEY(k) ((!QCoreApplication::testAttribute(Qt::AA_DontShowShortcutsInContextMenus) \
|
||||||
? false \
|
&& QGuiApplication::styleHints()->showShortcutsInContextMenus()) \
|
||||||
: qApp->styleHints()->showShortcutsInContextMenus()) \
|
|
||||||
&& !qApp->d_func()->shortcutMap.hasShortcutForKeySequence(k) ? \
|
&& !qApp->d_func()->shortcutMap.hasShortcutForKeySequence(k) ? \
|
||||||
QLatin1Char('\t') + QKeySequence(k).toString(QKeySequence::NativeText) : QString())
|
QLatin1Char('\t') + QKeySequence(k).toString(QKeySequence::NativeText) : QString())
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user