Emit QMenu::aboutToShow() before platform specific code
Send the aboutToShow() signal to QMenu before synchronising the widgets for the menu items. This fixes a bug where if new QWidgetActions are added to the menu from a slot triggered by the menu's aboutToShow() signal, then such new actions do not shows up correctly on Mac. Other platforms are not affected by the change. Fixes: QTBUG-75826 Change-Id: Ic245d3fbc7ddde6944cca6cdb8e8951380c846ec Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
parent
1f04b09446
commit
a4bd4565cc
|
|
@ -1485,6 +1485,8 @@ void QMenuPrivate::_q_platformMenuAboutToShow()
|
|||
{
|
||||
Q_Q(QMenu);
|
||||
|
||||
emit q->aboutToShow();
|
||||
|
||||
#ifdef Q_OS_OSX
|
||||
if (platformMenu) {
|
||||
const auto actions = q->actions();
|
||||
|
|
@ -1498,8 +1500,6 @@ void QMenuPrivate::_q_platformMenuAboutToShow()
|
|||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
emit q->aboutToShow();
|
||||
}
|
||||
|
||||
bool QMenuPrivate::hasMouseMoved(const QPoint &globalPos)
|
||||
|
|
|
|||
Loading…
Reference in New Issue