aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2016-09-20 17:23:16 +0200
committerJ-P Nurmi <jpnurmi@qt.io>2016-09-21 21:39:31 +0000
commit3ed4944a7e21191ee726ca31c4e50bd055f9d25b (patch)
tree32a6d49e881413b6c5758078fb039468abc4ebdf /src
parent8a4af9e87704f7b8ed269114d3ab75430bd61998 (diff)
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 <mitch.curtis@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/quicktemplates2/qquickpopup.cpp10
1 files changed, 10 insertions, 0 deletions
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();
}
/*!