diff options
author | J-P Nurmi <jpnurmi@theqtcompany.com> | 2015-12-16 16:34:34 +0100 |
---|---|---|
committer | J-P Nurmi <jpnurmi@theqtcompany.com> | 2015-12-16 16:57:29 +0000 |
commit | 9a65b10e827b9bb09911feb9bd06ed10312463fc (patch) | |
tree | 722c817efff54946d77d12e0572441525aca7aac /src/templates | |
parent | 235bcc4bc6a24e5e0b79359e76ef28fb5b77f62b (diff) |
Fix StackView resizing
Change-Id: Ib09996a9f12b669ae10fb7197f1e5b443540f7b0
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
Diffstat (limited to 'src/templates')
-rw-r--r-- | src/templates/qquickstackview.cpp | 9 | ||||
-rw-r--r-- | src/templates/qquickstackview_p.cpp | 10 | ||||
-rw-r--r-- | src/templates/qquickstackview_p_p.h | 2 |
3 files changed, 7 insertions, 14 deletions
diff --git a/src/templates/qquickstackview.cpp b/src/templates/qquickstackview.cpp index 2dcae1a1..8ce04b30 100644 --- a/src/templates/qquickstackview.cpp +++ b/src/templates/qquickstackview.cpp @@ -870,15 +870,10 @@ void QQuickStackView::geometryChanged(const QRectF &newGeometry, const QRectF &o Q_D(QQuickStackView); foreach (QQuickStackElement *element, d->elements) { if (element->item) { - QQuickItemPrivate *p = QQuickItemPrivate::get(element->item); - if (!p->widthValid) { + if (!element->widthValid) element->item->setWidth(newGeometry.width()); - p->widthValid = false; - } - if (!p->heightValid) { + if (!element->heightValid) element->item->setHeight(newGeometry.height()); - p->heightValid = false; - } } } } diff --git a/src/templates/qquickstackview_p.cpp b/src/templates/qquickstackview_p.cpp index 92bfcbf4..06c605d2 100644 --- a/src/templates/qquickstackview_p.cpp +++ b/src/templates/qquickstackview_p.cpp @@ -69,7 +69,7 @@ private: }; QQuickStackElement::QQuickStackElement() : QQuickItemViewTransitionableItem(Q_NULLPTR), - index(-1), init(false), removal(false), ownItem(false), ownComponent(false), + index(-1), init(false), removal(false), ownItem(false), ownComponent(false), widthValid(false), heightValid(false), context(Q_NULLPTR), component(Q_NULLPTR), incubator(Q_NULLPTR), view(Q_NULLPTR), status(QQuickStackView::Inactive) { @@ -162,14 +162,10 @@ void QQuickStackElement::initialize() return; QQuickItemPrivate *p = QQuickItemPrivate::get(item); - if (!p->widthValid) { + if (!(widthValid = p->widthValid)) item->setWidth(view->width()); - p->widthValid = false; - } - if (!p->heightValid) { + if (!(heightValid = p->heightValid)) item->setHeight(view->height()); - p->heightValid = false; - } item->setParentItem(view); p->addItemChangeListener(this, QQuickItemPrivate::Destroyed); diff --git a/src/templates/qquickstackview_p_p.h b/src/templates/qquickstackview_p_p.h index 94919939..d37334d8 100644 --- a/src/templates/qquickstackview_p_p.h +++ b/src/templates/qquickstackview_p_p.h @@ -89,6 +89,8 @@ public: bool removal; bool ownItem; bool ownComponent; + bool widthValid; + bool heightValid; QQmlContext *context; QQmlComponent *component; QQmlIncubator *incubator; |