summaryrefslogtreecommitdiffstats
path: root/desktop-widgets
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2020-11-07 21:06:54 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-11-07 14:08:39 -0800
commit41c0fb4039a48ceab76261fc675d767fb30c949f (patch)
tree6e28cc12a09a5fa91b746a10b41419ca7017bdf6 /desktop-widgets
parent5caac4c480bee6d471118101ef10eca7575dd092 (diff)
downloadsubsurface-41c0fb4039a48ceab76261fc675d767fb30c949f.tar.gz
filter: don't escape '&' in filter-preset menu
When constructing an action, '&' is used as the keyboard shortcut marker. Since this mangles preset names, use the setIconText() function of the action instead. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets')
-rw-r--r--desktop-widgets/filterwidget.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/desktop-widgets/filterwidget.cpp b/desktop-widgets/filterwidget.cpp
index ce03a7934..b6a1429fe 100644
--- a/desktop-widgets/filterwidget.cpp
+++ b/desktop-widgets/filterwidget.cpp
@@ -77,7 +77,10 @@ void FilterWidget::updatePresetMenu()
for (int i = 0; i < count; ++i) {
QModelIndex idx = model->index(i, FilterPresetModel::NAME);
QString name = model->data(idx, Qt::DisplayRole).value<QString>();
- loadFilterPresetMenu->addAction(name, [this,i]() { selectPreset(i); });
+ QAction *action = new QAction(loadFilterPresetMenu.get());
+ action->setIconText(name);
+ connect(action, &QAction::triggered, [this,i]() { selectPreset(i); });
+ loadFilterPresetMenu->addAction(action);
}
ui.loadSetButton->setMenu(loadFilterPresetMenu.get());
}