diff options
author | Eike Ziller <eike.ziller@qt.io> | 2019-08-06 10:07:19 +0200 |
---|---|---|
committer | Eike Ziller <eike.ziller@qt.io> | 2019-08-09 12:45:38 +0000 |
commit | 63c9c5124ec3cb5bdda3d78dafc12ab18a3bf2e9 (patch) | |
tree | 1b30debf2148547cef73e5da85a61fd0b5bdc629 /src/libs/utils/proxyaction.cpp | |
parent | 16b8ab2461fb5172b001271024331ca28e2be344 (diff) |
Use common functions for handling ampersands/accelerators
Change-Id: I4c74a041a656ed547db0a7406f4306008a513879
Reviewed-by: hjk <hjk@qt.io>
Diffstat (limited to 'src/libs/utils/proxyaction.cpp')
-rw-r--r-- | src/libs/utils/proxyaction.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/libs/utils/proxyaction.cpp b/src/libs/utils/proxyaction.cpp index bc17dea5803..99595da3ced 100644 --- a/src/libs/utils/proxyaction.cpp +++ b/src/libs/utils/proxyaction.cpp @@ -25,6 +25,8 @@ #include "proxyaction.h" +#include "stringutils.h" + using namespace Utils; ProxyAction::ProxyAction(QObject *parent) : @@ -167,10 +169,9 @@ void ProxyAction::updateToolTipWithKeySequence() QString ProxyAction::stringWithAppendedShortcut(const QString &str, const QKeySequence &shortcut) { - QString s = str; - s.replace(QLatin1String("&&"), QLatin1String("&")); - return QString::fromLatin1("%1 <span style=\"color: gray; font-size: small\">%2</span>"). - arg(s, shortcut.toString(QKeySequence::NativeText)); + const QString s = stripAccelerator(str); + return QString::fromLatin1("%1 <span style=\"color: gray; font-size: small\">%2</span>") + .arg(s, shortcut.toString(QKeySequence::NativeText)); } ProxyAction *ProxyAction::proxyActionWithIcon(QAction *original, const QIcon &newIcon) |