summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergio Martins <sergio.martins@kdab.com>2015-07-07 16:52:52 +0100
committerGabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>2015-07-10 08:31:57 +0000
commit835c8459c0448f211e2692dfbfaa65e46cd05fce (patch)
treee611b4269b73e6f9ba1b47a5a0bef1f38c011d2a
parent0f16335bca62234d751fa5090b7c8e04e4a5a348 (diff)
downloadqtquickcontrols-835c8459c0448f211e2692dfbfaa65e46cd05fce.tar.gz
Don't let popups cross screen boundaries.
This was working on Qt 5.4.1 but got broken by de9145dcd90. Can't see nothing fundamentally wrong with that commit, problem was that the code to reposition the popup assumed the contentItem's hight or width would change every time and connected to hightChanged/widthChanged to trigger the repositioning. Since de9145dcd90 those signals are only emitted the first time the popup is shown. Call updateSize() explicitly. Task-number: QTBUG-47092 Change-Id: I303bfae80e5cb72e0c24e26365b8d0faa9ddf400 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
-rw-r--r--src/controls/qquickmenupopupwindow.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/controls/qquickmenupopupwindow.cpp b/src/controls/qquickmenupopupwindow.cpp
index e28e63b1..6a6af0d4 100644
--- a/src/controls/qquickmenupopupwindow.cpp
+++ b/src/controls/qquickmenupopupwindow.cpp
@@ -154,6 +154,9 @@ void QQuickMenuPopupWindow::exposeEvent(QExposeEvent *e)
m_initialPos += m_logicalParentWindow->geometry().topLeft();
}
QQuickPopupWindow::exposeEvent(e);
+
+ if (isExposed())
+ updateSize();
}
QQuickMenu *QQuickMenuPopupWindow::menu() const