Qt: Support ampersand in profile name
An ampersand in the menu item text is used as shortcut, so use "&&" to get a real ampersand. Change-Id: I333c65bb55cfa01ab60d41df20f443701067e42d Reviewed-on: https://code.wireshark.org/review/35851 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
This commit is contained in:
parent
0f57ad35c8
commit
e9031028fc
|
@ -495,6 +495,11 @@ void MainStatusBar::showProfileMenu(const QPoint &global_pos, Qt::MouseButton bu
|
|||
|
||||
QAction * pa = Q_NULLPTR;
|
||||
QString name = idx.data().toString();
|
||||
|
||||
// An ampersand in the menu item's text sets Alt+F as a shortcut for this menu.
|
||||
// Use "&&" to get a real ampersand in the menu bar.
|
||||
name.replace('&', "&&");
|
||||
|
||||
if (idx.data(ProfileModel::DATA_IS_DEFAULT).toBool())
|
||||
{
|
||||
pa = profile_menu_.addAction(name);
|
||||
|
|
Loading…
Reference in New Issue