manage the case loading is not immediate

This commit is contained in:
Marco Martin 2013-12-23 16:00:40 +01:00
parent fba45d9360
commit 3b24340cc8

View File

@ -66,6 +66,12 @@ Item {
onWhenChanged: loadTimer.restart()
onConditionalSourceChanged: loadTimer.restart()
onLoaded: {
loader.oldConditionalSource = loader.conditionalSource
loader.item.visible = true
loader.item.anchors.fill = loader.item.parent
loadTimer.stop()
}
Timer {
id: loadTimer
interval: 0
@ -79,9 +85,6 @@ Item {
} else {
loader.sourceComponent = loader.conditionalSource
}
loader.oldConditionalSource = loader.conditionalSource
loader.item.visible = true
loader.item.anchors.fill = loader.item.parent
}
}
}