Означает ли QML StackView Status.Inactive
status, что когда представление входит в это состояние, его видимость неявно устанавливается в false? Так что мне не нужно явно устанавливать видимость представления в false из соображений производительности?
Статус QML StackView. Неактивен
Ответы (1)
Вы можете проверить, добавив следующее к элементу в StackView
:
onVisibleChanged: print(visible)
Глядя на код, кажется, что они действительно скрыты:
/*! \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
}
person
Mitch
schedule
09.05.2016
Спасибо @Mitch за подтверждение! Часть кода говорит сама за себя. Хотя распечатать переменную тоже было хорошей идеей, стоило подумать об этом.
- person Silex; 09.05.2016