summaryrefslogtreecommitdiffstats
path: root/src/controls/qquickpopupwindow.cpp
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@theqtcompany.com>2014-10-14 10:44:40 +0200
committerJ-P Nurmi <jpnurmi@theqtcompany.com>2014-10-14 19:59:27 +0200
commit770b776fb4edac713883a09c0942677dbb9df065 (patch)
treed801239006eb89ba411e91cb167248bcc3022e89 /src/controls/qquickpopupwindow.cpp
parent774f2aa14e8742d77bb92968b06fab4dc35d79b4 (diff)
Revert "QQuickPopupWindow: don't create 1x1 windows"
The change broke menu popups with QQuickWidget (eg. Qt Creator). We need to investigate other ways of fixing QTBUG-41617 and QTBUG-41181. This reverts commit b022bece5488c9c43906b1de6989b57f801b2114. Task-number: QTBUG-41900 Change-Id: Ife74019d08683ef74e6176db3f3de68ca84bfa5a Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
Diffstat (limited to 'src/controls/qquickpopupwindow.cpp')
-rw-r--r--src/controls/qquickpopupwindow.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/controls/qquickpopupwindow.cpp b/src/controls/qquickpopupwindow.cpp
index 17ef4fa13..cef7519df 100644
--- a/src/controls/qquickpopupwindow.cpp
+++ b/src/controls/qquickpopupwindow.cpp
@@ -84,13 +84,13 @@ void QQuickPopupWindow::show()
posy += offset.y() + parentWindowOffset.y();
}
- QSize initialSize;
- if (m_contentItem)
- initialSize = QSize(m_contentItem->width(), m_contentItem->height());
- if (!initialSize.isEmpty())
- setGeometry(posx, posy, initialSize.width(), initialSize.height());
- else
+ if (m_contentItem) {
+ qreal initialWidth = qMax(qreal(1), m_contentItem->width());
+ qreal initialHeight = qMax(qreal(1), m_contentItem->height());
+ setGeometry(posx, posy, initialWidth, initialHeight);
+ } else {
setPosition(posx, posy);
+ }
emit geometryChanged();
if (!qobject_cast<QQuickPopupWindow *>(transientParent())) { // No need for parent menu windows