Always show a submenu on its parent menu's screen
QWidget::screen() was added in b455a863a1df61337f36f2e8b43101ca21514697 and this is another good use for it (in 5.15 and newer). Amends c068edcecf6876c7b57abbe302ad8b1347e4445e Pick-to: 5.15 Fixes: QTCREATORBUG-24195 Task-number: QTBUG-76162 Change-Id: Ifaafe9b45fafaae220da54bbf3bc7a568e7953f9 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io> Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
This commit is contained in:
parent
4ab5432081
commit
0a2e3ce85c
@ -2395,7 +2395,7 @@ void QMenuPrivate::popup(const QPoint &p, QAction *atAction, PositionFunction po
|
||||
} else if (QMenu *parentMenu = qobject_cast<QMenu *>(parent)) {
|
||||
// a submenu is always opened from an open parent menu,
|
||||
// so show it on the same screen where the parent is. (QTBUG-76162)
|
||||
if (setScreen(QMenuPrivate::get(parentMenu)->windowHandle()->screen()))
|
||||
if (setScreen(parentMenu->screen()))
|
||||
itemsDirty = true;
|
||||
screenSet = true;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user