Skip to content
Snippets Groups Projects
Commit 7d480a5d authored by Fatih Uzunoğlu's avatar Fatih Uzunoğlu Committed by Felix Paul Kühne
Browse files

qt: use exclusive action group in SortMenu

Sorting type is exclusive, but currently it is
not indicated as such.
parent d1d0a507
No related branches found
No related tags found
1 merge request!6590qt: use exclusive action group in SortMenu
Pipeline #551972 passed with stage
in 13 minutes and 40 seconds
......@@ -101,12 +101,16 @@ void SortMenu::popup(const QPoint &point, const bool popupAbovePoint, const QVar
shownChanged();
} );
const auto actionGroup = new QActionGroup(m_menu.get());
actionGroup->setExclusive(true);
// model => [{text: "", checked: <bool>, order: <sort order> if checked else <invalid>}...]
for (int i = 0; i != model.size(); ++i)
{
const auto obj = model[i].toMap();
auto action = m_menu->addAction(obj.value("text").toString());
action->setActionGroup(actionGroup);
action->setCheckable(true);
const bool checked = obj.value("checked").toBool();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment