forked from qt-creator/qt-creator
Use common functions for handling ampersands/accelerators
Change-Id: I4c74a041a656ed547db0a7406f4306008a513879 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user