Important: Please read the Qt Code of Conduct -

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

                    window.visible = false;
                    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