aboutsummaryrefslogtreecommitdiffstats
path: root/src/templates
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@theqtcompany.com>2016-02-10 12:25:39 +0100
committerJ-P Nurmi <jpnurmi@theqtcompany.com>2016-02-10 14:05:24 +0000
commit1cf60c89a8711103a37b0511f4e91ee28d984b45 (patch)
treea6b8e295d27762872697d3ec3de4fb0aad4a7b76 /src/templates
parent405c3a16169dae95864ed074d4dd4e344d143497 (diff)
Fix accessing StackView attached properties via popped item
Change-Id: I98d84668ce42687577539cb6356b87be9e2bdd98 Task-number: QTBUG-50937 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
Diffstat (limited to 'src/templates')
-rw-r--r--src/templates/qquickstackview.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/templates/qquickstackview.cpp b/src/templates/qquickstackview.cpp
index 87cbfe31..a45612f8 100644
--- a/src/templates/qquickstackview.cpp
+++ b/src/templates/qquickstackview.cpp
@@ -901,7 +901,8 @@ void QQuickStackAttachedPrivate::itemParentChanged(QQuickItem *item, QQuickItem
QQuickStackView::Status oldStatus = element ? element->status : QQuickStackView::Inactive;
QQuickStackView *newView = qobject_cast<QQuickStackView *>(parent);
- element = newView ? QQuickStackViewPrivate::get(newView)->findElement(item) : Q_NULLPTR;
+ if (newView)
+ element = QQuickStackViewPrivate::get(newView)->findElement(item);
int newIndex = element ? element->index : -1;
QQuickStackView::Status newStatus = element ? element->status : QQuickStackView::Inactive;