mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-01-07 08:02:30 -06:00
Don't close tags menu when toggling items (#15098)
The issue was resolved by using QAction::toggled signal instead of QAction::triggered. In QT 5.15+ the latter signal causes a QMenu to close, whereas the former does not. Closes #13492.
This commit is contained in:
@@ -37,7 +37,7 @@ class TriStateWidget;
|
||||
|
||||
// TriStateWidget is responsible for checkbox state (tri-state) and paint events while
|
||||
// TriStateAction will keep in sync with it. This allows connecting with the usual
|
||||
// QAction::triggered slot.
|
||||
// QAction::triggered or QAction::toggled slots.
|
||||
class TriStateAction : public QWidgetAction
|
||||
{
|
||||
public:
|
||||
@@ -46,7 +46,12 @@ public:
|
||||
// should use this function instead of QAction::setChecked(bool)
|
||||
void setCheckState(Qt::CheckState checkState);
|
||||
|
||||
void setCloseOnTriggered(bool enabled);
|
||||
// When set to 'true' toggling the checkbox will emit a signal on
|
||||
// QAction::triggered. When placed in a QMenu, this causes the menu to close.
|
||||
// When set to 'false' emits a signal on QAction::toggled instead, leaving the
|
||||
// menu open.
|
||||
// Default value: 'true'.
|
||||
void setCloseOnInteraction(bool enabled);
|
||||
|
||||
private:
|
||||
TriStateWidget *m_triStateWidget;
|
||||
|
||||
Reference in New Issue
Block a user