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. How to link to another qml page via onClicked?

How to link to another qml page via onClicked?

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 2 Posters 238 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.
  • K Offline
    K Offline
    kkai295
    wrote on last edited by
    #1

    MouseArea {
    anchors.fill: parent
    onClicked: {
    // Only change state when two other rectangle color is red
    if ((Qt.colorEqual(rect3.color, "blue") && Qt.colorEqual(rect4.color, "red"))
    {

                       pageLoader.source="common/WinScene.qml"
                   }
    
                   else
                   {
                     stillItchy.visible = true
    
    
    
                       }
    

    As shown above, is it right to state " pageLoader.source="common/WinScene.qml"?? Just to link to another page? My code kinda screwd up..

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      Yes it is OK to load pages via Loader element. Is that what you are asking?

      If you have a set of pages you want to switch between, you can use StackView, SwipeView etc. instead.

      (Z(:^

      1 Reply Last reply
      2

      • Login

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