QML page transition
-
What is the most efficient method of transitioning between QML pages? I did it with the Loader class, but the transition is very slow and inefficient.
Loader {
id: dynamicLoader
anchors.fill: parent
visible: false
}
// Buton
Rectangle {
id: startButtonContainer
width: parent.width * 0.1
height: 50
color: "#388E3C"
radius: 20
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: passwordFieldContainer.bottom
anchors.topMargin: 40
MouseArea {
anchors.fill: parent
onClicked: {
if(usernameField.text === "" || passwordField.text === ""){
errorMessage.text = "kullanıcı adı veya şifre boş bırakılamaz!"
errorMessage.visible = true
}
else if (usernameField.text === "cnş" && passwordField.text === "1234") {
dynamicLoader.source = "qrc:/qml/MainRootWindow.qml"
dynamicLoader.visible = true
screen.visible = false
} else {
// Hatalı giriş mesajı
errorMessage.text = "kullanıcı adı veya şifre yanlış!"
errorMessage.visible = true
}
}
} -
StackView
has a better API for changing pages and has support for transitions (custom and default). -
StackView
has a better API for changing pages and has support for transitions (custom and default).@GrecKo
Thank you I will try.