Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Problem : Show page from other Qml file
Forum Updated to NodeBB v4.3 + New Features

Problem : Show page from other Qml file

Scheduled Pinned Locked Moved QML and Qt Quick
1 Posts 1 Posters 2.3k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    music.exe
    wrote on last edited by
    #1

    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!!

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved