Felix Paul Kühne pushed to branch master at VideoLAN / VLC


Commits:
7d480a5d by Fatih Uzunoglu at 2025-01-05T10:46:43+00:00
qt: use exclusive action group in SortMenu

Sorting type is exclusive, but currently it is
not indicated as such.

- - - - -


1 changed file:

- modules/gui/qt/menus/qml_menu_wrapper.cpp


Changes:

=====================================
modules/gui/qt/menus/qml_menu_wrapper.cpp
=====================================
@@ -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();



View it on GitLab: 
https://code.videolan.org/videolan/vlc/-/commit/7d480a5d86446b6515a375e080daa809e077f96f

-- 
View it on GitLab: 
https://code.videolan.org/videolan/vlc/-/commit/7d480a5d86446b6515a375e080daa809e077f96f
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance
_______________________________________________
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to