mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-18 06:28:03 -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:
@@ -1009,13 +1009,13 @@ void TransferListWidget::displayListMenu(const QPoint &)
|
||||
for (const QString &tag : asConst(tags))
|
||||
{
|
||||
auto *action = new TriStateAction(tag, tagsMenu);
|
||||
action->setCloseOnTriggered(false);
|
||||
action->setCloseOnInteraction(false);
|
||||
|
||||
const Qt::CheckState initialState = tagsInAll.contains(tag) ? Qt::Checked
|
||||
: tagsInAny.contains(tag) ? Qt::PartiallyChecked : Qt::Unchecked;
|
||||
action->setCheckState(initialState);
|
||||
|
||||
connect(action, &QAction::triggered, this, [this, tag](const bool checked)
|
||||
connect(action, &QAction::toggled, this, [this, tag](const bool checked)
|
||||
{
|
||||
if (checked)
|
||||
addSelectionTag(tag);
|
||||
|
||||
Reference in New Issue
Block a user