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
5 changed files with 20 additions and 16 deletions

View File

@@ -45,8 +45,7 @@ TriStateAction::TriStateAction(const QString &text, QWidget *parent)
m_triStateWidget->setCheckState(checked ? Qt::Checked : Qt::Unchecked);
});
connect(m_triStateWidget, &TriStateWidget::triggered, this, &QAction::setChecked);
connect(m_triStateWidget, &TriStateWidget::triggered, this, &QAction::triggered);
connect(m_triStateWidget, &TriStateWidget::triggered, this, &QAction::toggled);
setDefaultWidget(m_triStateWidget);
}
@@ -56,7 +55,7 @@ void TriStateAction::setCheckState(const Qt::CheckState checkState)
m_triStateWidget->setCheckState(checkState);
}
void TriStateAction::setCloseOnTriggered(const bool enabled)
void TriStateAction::setCloseOnInteraction(const bool enabled)
{
m_triStateWidget->setCloseOnTriggered(enabled);
m_triStateWidget->setCloseOnInteraction(enabled);
}