Quantcast
Channel: Qt DevNet forums: Qt Quick 1283365070**
Viewing all articles
Browse latest Browse all 4972

How to switch from page1.qml (on image click) by sending a string to page2.qml and vice-a-versa?

$
0
0
You need to use a Loader and Connections. Item {             id: mainItem             width: 600             height: 400             Component.onCompleted: pageLoader.setSource("Page1.qml")               signal loadPage(string pageName)               Loader {                 id: pageLoader                   anchors.fill: parent             }               Connections {                 id: pageConnections                 ignoreUnknownSignals: true                 target: pageLoader.item                   onLoadPage: {                     pageLoader.source = pageName;                 }             } } Try something like this. I don’t have time to test this but Connections and Loader are what you’ll need.

Viewing all articles
Browse latest Browse all 4972

Trending Articles