54 property int animDuration: 150
72 property var _clearItems: []
86 function presentItem(item) {
87 if(typeof item.presentAsRoot ==
"boolean" && item.presentAsRoot) {
88 if(safeReplace(null, item))
109 function closeAction() {
110 if(_presenterStack.currentItem &&
111 typeof _presenterStack.currentItem.closeAction ==
"function") {
112 if(_presenterStack.currentItem.closeAction())
116 if(_presenterStack.depth <= 1)
119 if(_presenterStack.safePop())
138 function safePop(item, operation) {
139 var resItem = pop(item, operation)
141 _clearItems.push(resItem);
161 function safeReplace(target, item, properties, operation) {
163 console.log(
"current depth: ", depth)
164 for(var i = depth -1; i >= 0; i--) {
165 var cItem =
get(i, StackView.ForceLoad);
166 _clearItems.push(cItem);
170 if(replace(target, item, properties, operation))
177 function clearWaitingItems() {
178 _clearItems.forEach(
function(item) {
179 if(typeof item.afterPop ==
"function")
186 pushEnter: Transition {
189 easing.type: Easing.InOutQuad
192 duration: _presenterStack.animDuration
198 duration: _presenterStack.opDuration
201 pushExit: Transition {
203 duration: _presenterStack.animDuration
208 Qt.callLater(clearWaitingItems)
211 popEnter: Transition {
213 duration: _presenterStack.animDuration
216 popExit: Transition {
219 easing.type: Easing.InOutQuad
222 duration: _presenterStack.animDuration
224 SequentialAnimation {
226 duration: _presenterStack.animDuration - _presenterStack.opDuration
233 duration: _presenterStack.opDuration
239 Qt.callLater(clearWaitingItems)
242 replaceEnter: pushEnter
243 replaceExit: pushExit
int opDuration
The duration of the fade out.