diff options
| author | J-P Nurmi <jpnurmi@theqtcompany.com> | 2014-10-14 10:44:40 +0200 |
|---|---|---|
| committer | J-P Nurmi <jpnurmi@theqtcompany.com> | 2014-10-14 19:59:27 +0200 |
| commit | 770b776fb4edac713883a09c0942677dbb9df065 (patch) | |
| tree | d801239006eb89ba411e91cb167248bcc3022e89 /src/controls/qquickpopupwindow.cpp | |
| parent | 774f2aa14e8742d77bb92968b06fab4dc35d79b4 (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.cpp | 12 |
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 |
