QML StackView Status.Inactive

时间:2016-05-09 03:52:22

标签: qml qt5 stackview

QML StackView Status.Inactive状态是否意味着当视图进入此状态时,它的可见性是否隐式设置为false?因为性能原因,我不需要明确地将视图的可见性设置为false?

1 个答案:

答案 0 :(得分:1)

您可以通过将以下内容添加到StackView

中的项目来进行验证
onVisibleChanged: print(visible)

code,似乎确实隐藏了它们:

/*! \internal */
function animationFinished()
{
    if (!__currentTransition || __currentTransition.animation.running)
        return

    __currentTransition.animation.runningChanged.disconnect(animationFinished)
    __currentTransition.exitItem.visible = false
    __setStatus(__currentTransition.exitItem, Stack.Inactive);
    __setStatus(__currentTransition.enterItem, Stack.Active);
    __currentTransition.properties.animation = __currentTransition.animation
    root.delegate.transitionFinished(__currentTransition.properties)

    if (!__currentTransition.push || __currentTransition.replace)
        __cleanup(__currentTransition.outElement)

    __currentTransition = null
}