I have two QML files
Level1.qml and level2.qml
in main.qml,
StackView {
id: idMyStackView
focus: true
anchors.fill: parent
initialItem: Level1{
focus: true
}
}
in Level1.qml
Component.onCompleted:
{
idMyStackView.push(idLevel2.qml)
}
In this case I am getting error like
W] (file:///C:/Qt/5.13.0/msvc2017/qml/QtQuick/Controls/StackView.qml:790) Warning: StackView: You cannot push/pop recursively! [D] (file:///C:/Qt/5.13.0/msvc2017/qml/QtQuick/Controls/StackView.qml:791) __recursionGuard (file:///C:/Qt/5.13.0/msvc2017/qml/QtQuick/Controls/StackView.qml:791) push (file:///C:/Qt/5.13.0/msvc2017/qml/QtQuick/Controls/StackView.qml:568) onCompleted (qrc:/setup/qml/setup_menu/setup_top/SetupTop.qml:250) __loadElement (file:///C:/Qt/5.13.0/msvc2017/qml/QtQuick/Controls/StackView.qml:825) __performTransition (file:///C:/Qt/5.13.0/msvc2017/qml/QtQuick/Controls/StackView.qml:911) push (file:///C:/Qt/5.13.0/msvc2017/qml/QtQuick/Controls/StackView.qml:605) expression for onCompleted (file:///C:/Qt/5.13.0/msvc2017/qml/QtQuick/Controls/StackView.qml:777)