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:
tgregerson 2021-06-16 09:57:56 -05:00 committed by GitHub
parent 2bd2490539
commit e74ad86f14
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 20 additions and 16 deletions

View file

@ -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);