mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-16 02:03:07 -07: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:
parent
2bd2490539
commit
e74ad86f14
5 changed files with 20 additions and 16 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue