From 3ed4944a7e21191ee726ca31c4e50bd055f9d25b Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Tue, 20 Sep 2016 17:23:16 +0200 Subject: Fix QQuickPopup::resetWidth/Height() When reseting the explicit size of a popup, the popup items geometry does not necessarily change. However, it affects the positioning of the popup whether it has explicit size or not. For that reason we must ensure that the popup gets repositioned as appropriate. Change-Id: I2dcd895eb7a1adc9c6a804bed4731edac1d550ec Reviewed-by: Mitch Curtis --- src/quicktemplates2/qquickpopup.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src') diff --git a/src/quicktemplates2/qquickpopup.cpp b/src/quicktemplates2/qquickpopup.cpp index 2a48473a..22b399b1 100644 --- a/src/quicktemplates2/qquickpopup.cpp +++ b/src/quicktemplates2/qquickpopup.cpp @@ -929,8 +929,13 @@ void QQuickPopup::setWidth(qreal width) void QQuickPopup::resetWidth() { Q_D(QQuickPopup); + if (!d->hasWidth) + return; + d->hasWidth = false; d->popupItem->resetWidth(); + if (d->popupItem->isVisible()) + d->reposition(); } /*! @@ -954,8 +959,13 @@ void QQuickPopup::setHeight(qreal height) void QQuickPopup::resetHeight() { Q_D(QQuickPopup); + if (!d->hasHeight) + return; + d->hasHeight = false; d->popupItem->resetHeight(); + if (d->popupItem->isVisible()) + d->reposition(); } /*! -- cgit v1.2.3