ProxyAction: Break endless loop

Updating the ProxyAction first disconnects from the action and then
connects again. Looks like reconnecting while being in
QMetaObject::activate can lead to never ending handling of the
activation, so use a QueuedConnection instead.

Change-Id: Ia06f926413fd4492d847dfea4461f2ccfdd37ffc
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
This commit is contained in:
hjk
2016-03-14 12:10:13 +01:00
committed by Eike Ziller
parent 3d82a67484
commit c3772bfd4c

View File

@@ -72,7 +72,8 @@ void ProxyAction::disconnectAction()
void ProxyAction::connectAction()
{
if (m_action) {
connect(m_action.data(), &QAction::changed, this, &ProxyAction::actionChanged);
connect(m_action.data(), &QAction::changed, this, &ProxyAction::actionChanged,
Qt::QueuedConnection);
connect(this, &QAction::triggered, m_action.data(), &QAction::triggered);
connect(this, &ProxyAction::toggled, m_action.data(), &QAction::setChecked);
}