There are two ways to change the content:
1) set one item visible while setting the old one invisble. you do that already.
2) Using a Loader and changing its source or sourceComponent
For your code, instead of the Rectangle with the id "idthisLogin" you could have a Loader will the main item
QtCPPSearchV4 {
Loader {
anchors.fill: parent
property bool loginSuccess: false
source: loginSuccess ? "MainView.qml" : "Login.qml"
}
}
QtCPPSearchV4 {
Loader {
anchors.fill: parent
property bool loginSuccess: false
source: loginSuccess ? "MainView.qml" : "Login.qml"
}
}
To copy to clipboard, switch view to plain text mode
When the loginSuccess property changes, then the Loader's content changes.
Cheers,
_
Bookmarks