aboutsummaryrefslogtreecommitdiffstats
path: root/src/controls
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@theqtcompany.com>2015-08-26 15:14:23 +0200
committerJ-P Nurmi <jpnurmi@theqtcompany.com>2015-08-27 14:04:07 +0000
commit162ae5c4a7ffa45f63911801a094fe049750cdc3 (patch)
treeb523735df9d27aaf57ac71e237499364144bc99b /src/controls
parent6fc6304036b8dcef73c5fc889a4abded41b382a6 (diff)
Fix StackView: pushed items still showed up after being popped
This is a partial revert of 6ee9612. The idea was to keep items visible until both transitions had finished. StackView { pushExit: null pushEnter: Transition { ... } } When both transitions had finished, all stack elements (except the current one) were hid. The problem was that in pop & replace operations the exiting item was no longer part of the stack (because it had been already popped out) and therefore was never hid. This change restores the original (intended) behavior that a null transition would equal to an immediate operation. This keeps the code simpler, and makes the behavior consistent in a sense that all items are hidden as soon the respective transition finishes. PauseAnimation can be used to wait if desired. Change-Id: Ia9e78506754bdc18949676f061dbfff28a7128b7 Task-number: QTBUG-47317 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
Diffstat (limited to 'src/controls')
-rw-r--r--src/controls/qquickstackview_p.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/controls/qquickstackview_p.cpp b/src/controls/qquickstackview_p.cpp
index 85c57832..6568d344 100644
--- a/src/controls/qquickstackview_p.cpp
+++ b/src/controls/qquickstackview_p.cpp
@@ -489,8 +489,8 @@ void QQuickStackViewPrivate::completeTransition(QQuickStackElement *element, QQu
QQuickAbstractAnimation *anim = animations.at(&animations, i);
anim->complete();
}
- viewItemTransitionFinished(element);
}
+ viewItemTransitionFinished(element);
}
void QQuickStackViewPrivate::viewItemTransitionFinished(QQuickItemViewTransitionableItem *transitionable)
@@ -500,17 +500,14 @@ void QQuickStackViewPrivate::viewItemTransitionFinished(QQuickItemViewTransition
element->setStatus(QQuickStackView::Active);
} else if (element->status == QQuickStackView::Deactivating) {
element->setStatus(QQuickStackView::Inactive);
+ if (element->item)
+ element->item->setVisible(false);
if (element->removal || element->isPendingRemoval())
delete element;
}
- if (transitioner->runningJobs.isEmpty()) {
- int i = elements.count() - 1;
- while (--i >= 0)
- if (QQuickItem *item = elements[i]->item)
- item->setVisible(false);
+ if (transitioner->runningJobs.isEmpty())
setBusy(false);
- }
}
void QQuickStackViewPrivate::setBusy(bool busy)