import QtQuick 2.9 import QtQuick.Controls 2.2 ApplicationWindow { visible: true StackView { id: stackView anchors.fill: parent popExit: Transition {} replaceExit: Transition {} } Component { id: blue Rectangle { color: "blue" Button { anchors.centerIn: parent text: "Replace Red" onClicked: stackView.replace(red) } } } Component { id: red Rectangle { color: "red" Button { anchors.centerIn: parent text: "Replace Blue" onClicked: stackView.replace(blue) } } } Component.onCompleted: { stackView.replace(blue) } }