From 41c0fb4039a48ceab76261fc675d767fb30c949f Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Sat, 7 Nov 2020 21:06:54 +0100 Subject: 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 --- desktop-widgets/filterwidget.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'desktop-widgets') 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(); - 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()); } -- cgit v1.2.3-70-g09d2