QMenu: use QSignalBlocker

Change-Id: I41006d2b6f1454382b8c0bede20999d882b66f26
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
This commit is contained in:
Marc Mutz 2013-10-26 11:07:11 +02:00 committed by The Qt Project
parent 6861fb2577
commit a6f0f07782

View File

@ -435,7 +435,7 @@ void QMenuPrivate::hideMenu(QMenu *menu)
if (!menu) if (!menu)
return; return;
#if !defined(QT_NO_EFFECTS) #if !defined(QT_NO_EFFECTS)
menu->blockSignals(true); QSignalBlocker blocker(menu);
aboutToHide = true; aboutToHide = true;
// Flash item which is about to trigger (if any). // Flash item which is about to trigger (if any).
if (menu->style()->styleHint(QStyle::SH_Menu_FlashTriggeredItem) if (menu->style()->styleHint(QStyle::SH_Menu_FlashTriggeredItem)
@ -455,7 +455,7 @@ void QMenuPrivate::hideMenu(QMenu *menu)
} }
aboutToHide = false; aboutToHide = false;
menu->blockSignals(false); blocker.unblock();
#endif // QT_NO_EFFECTS #endif // QT_NO_EFFECTS
menu->close(); menu->close();
} }