diff options
author | Laszlo Agocs <laszlo.agocs@digia.com> | 2014-09-09 10:34:00 +0200 |
---|---|---|
committer | Jani Heikkinen <jani.heikkinen@digia.com> | 2014-09-09 15:54:03 +0200 |
commit | bc91574cca8b6f24968ab4e1cc11fe1fd10f3061 (patch) | |
tree | ec03cbfba2c9eca5a6a3ce0c30b5080023239f52 | |
parent | a7d03f54eeac78326753fa069b6a60557201904f (diff) |
Fix wrong menu popup window parenting
When embedded into a widget-based UI in a window container,
extra care is needed to find the correct top-level because
the QQuickWindow is not it.
Task-number: QTBUG-40883
Change-Id: I8d5a91f23c405e14b0994f08aa74581742f6482b
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
-rw-r--r-- | src/controls/qquickmenupopupwindow.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/controls/qquickmenupopupwindow.cpp b/src/controls/qquickmenupopupwindow.cpp index 508b6b275..e07a41d67 100644 --- a/src/controls/qquickmenupopupwindow.cpp +++ b/src/controls/qquickmenupopupwindow.cpp @@ -88,6 +88,8 @@ void QQuickMenuPopupWindow::setItemAt(QQuickItem *menuItem) void QQuickMenuPopupWindow::setParentWindow(QWindow *effectiveParentWindow, QQuickWindow *parentWindow) { + while (effectiveParentWindow && effectiveParentWindow->parent()) + effectiveParentWindow = effectiveParentWindow->parent(); if (transientParent() != effectiveParentWindow) setTransientParent(effectiveParentWindow); if (parentWindow) { |