Avoid crash in menu that was previously shown as submenu
Reset sloppyState for the previous submenu, so that if it will be shown as a menu, it will not use an incorrect pointer. Fixes: QTBUG-80528 Change-Id: If2ba8c3a664983ee76eb90d2c9a8096e2bd0a4e6 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>bb10
parent
009abcd7b6
commit
8339ce2155
|
|
@ -789,6 +789,8 @@ void QMenuSloppyState::setSubMenuPopup(const QRect &actionRect, QAction *resetAc
|
|||
m_use_reset_action = true;
|
||||
m_time.stop();
|
||||
m_action_rect = actionRect;
|
||||
if (m_sub_menu)
|
||||
QMenuPrivate::get(m_sub_menu)->sloppyState.m_parent = nullptr;
|
||||
m_sub_menu = subMenu;
|
||||
QMenuPrivate::get(subMenu)->sloppyState.m_parent = this;
|
||||
m_reset_action = resetAction;
|
||||
|
|
|
|||
Loading…
Reference in New Issue