Problem : Show page from other Qml file



  • I defined a page in xxx.qml
    @import QtQuick 1.0
    import Qt.labs.components.native 1.0

    Page {
    id: filePage
    //property alias message: pageText.text
    Text {
    id: pageText
    anchors.centerIn: parent
    text: "Showed page"
    font.pointSize: 25
    color: "#3c3c0c"
    }
    }@

    When using,
    @ MouseArea {
    id: mouse_area2
    anchors.fill: parent

                onClicked:
                {
                    window.visible = false;
    
                    window.pageStack.push(Qt.resolvedUrl("xxx.qml"))
                    console.log("change page")
                }
            }@
    

    But, I get error :
    Error: Cannot assign QObject* to PageStack_QMLTYPE_18*

    Plz show me the bug!!


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.