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. Overlapping QML
Forum Updated to NodeBB v4.3 + New Features

Overlapping QML

Scheduled Pinned Locked Moved QML and Qt Quick
8 Posts 4 Posters 6.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.
  • E Offline
    E Offline
    eirnanG
    wrote on last edited by
    #1

    @ //choose2chiuaua.qml

    import QtQuick 1.0

    Rectangle {
    width: choose_chiuaua.width; height: choose_chiuaua.height

    Loader {
    id: mainLoader
    anchors.fill: parent

    MouseArea {
    id: cchoose2menu
    x: 162
    y: 272
    width: 78
    height: 44
    onClicked: {mainLoader.source = "menu.qml";}
    }

    MouseArea {
    id: cchoose2name
    x: 0
    y: 272
    width: 78
    height: 44
    onClicked: {mainLoader.source = "naming_pet.qml";}
    }

    MouseArea {
    id: chiuaua_next
    x: 191
    y: 178
    width: 43
    height: 44
    onClicked: {mainLoader.source = "choose2shitzu.qml";}

    }

    MouseArea {
    id: chiuaua_back
    x: 12
    y: 179
    width: 43
    height: 44
    onClicked: {mainLoader.source = "choose2aspin.qml";}

    }

    AnimatedImage { id: choose_chiuaua; x: 0; y: 0; width: 240; height: 316;
    source: "Choose Pet (Chiuaua)" } // GIF FILE
    }
    }@

    @// choose2aspin.qml

    import QtQuick 1.0

    Rectangle {
    width: choose_aspin.width; height: choose_aspin.height

    Loader {
    id: mainLoader
    anchors.fill: parent

    MouseArea {
    id: achoose2menu
    x: 162
    y: 272
    width: 78
    height: 44
    onClicked: {mainLoader.source = "menu.qml";}
    }

    MouseArea {
    id: achoose2name
    x: 0
    y: 272
    width: 78
    height: 44
    onClicked: {mainLoader.source = "naming_pet.qml";}
    }

    MouseArea {
    id: aspin_next
    x: 191
    y: 178
    width: 43
    height: 44
    onClicked: {mainLoader.source = "choose2chiuaua.qml";}
    }

    MouseArea {
    id: aspin_back
    x: 12
    y: 179
    width: 43
    height: 44
    onClicked: {mainLoader.source = "choose2shitzu.qml";}

    }

    AnimatedImage { id: choose_aspin; x: 0; y: 0; width: 240; height: 316;
    source: "Choose Pet (Aspin)" } //GIF FILE
    }
    }
    @

    @//choose2shitzu.qml

    import QtQuick 1.0

    Rectangle {
    width: choose_shitzu.width; height: choose_shitzu.height

    Loader {
    id: mainLoader
    anchors.fill: parent

    MouseArea {
    id: schoose2menu
    x: 162
    y: 272
    width: 78
    height: 44
    onClicked: {mainLoader.source = "menu.qml";}
    }

    MouseArea {
    id: schoose2name
    x: 0
    y: 272
    width: 78
    height: 44
    onClicked: {mainLoader.source = "naming_pet.qml";}
    }

    MouseArea {
    id: shitzu_next
    x: 191
    y: 178
    width: 43
    height: 44
    onClicked: {mainLoader.source = "choose2aspin.qml";}

    }

    MouseArea {
    id: shitzu_back
    x: 12
    y: 179
    width: 43
    height: 44
    onClicked: {mainLoader.source = "choose2chiuaua.qml";}

    }

    AnimatedImage { id: choose_shitzu; x: 0; y: 0; width: 240; height: 316;
    source: "Choose Pet (Shih Tzu)" }

    }
    

    }
    @

    Hi to all!

    Here are some of my codes in QML. Its working and the MouseArea(s) are working too. But the thing is, its only overlapping the previous QML and the previous MouseArea(s) is still in the new called QML.

    Please help me. Thanks in Advance

    EDIT: moved to forum Qt Quick, Gerolf

    1 Reply Last reply
    0
    • T Offline
      T Offline
      TobbY
      wrote on last edited by
      #2

      i think, you have to close the previous qml.

      1 Reply Last reply
      0
      • E Offline
        E Offline
        eirnanG
        wrote on last edited by
        #3

        im trying.. and im still looking for a code to close the previous qml.. but i failed.. :(

        1 Reply Last reply
        0
        • T Offline
          T Offline
          thisisbhaskar
          wrote on last edited by
          #4

          [quote author="eirnanG" date="1308715713"]@ //choose2chiuaua.qml

          Here are some of my codes in QML. Its working and the MouseArea(s) are working too. But the thing is, its only overlapping the previous QML and the previous MouseArea(s) is still in the new called QML.

          Please help me. Thanks in Advance[/quote]

          Your previous MoseArea(s) will still be active as your are not making then invisible or reducing the size to zero.

          @http://doc.qt.nokia.com/4.7-snapshot/qml-loader.html#source-prop@
          According to the doc, setting new source should unload previous item and load the new one. If this does not happen then its a bug.

          }

          1 Reply Last reply
          0
          • C Offline
            C Offline
            cmer4
            wrote on last edited by
            #5

            Maybe try adding the enabled property to the MouseAreas or to the Loader and then enabled: false the once you don't need??
            Not sure if it works with those elements though...

            1 Reply Last reply
            0
            • E Offline
              E Offline
              eirnanG
              wrote on last edited by
              #6

              cmer4 and Vijay thanks!! it works..
              it makes me enjoy more in using QT :)

              1 Reply Last reply
              0
              • T Offline
                T Offline
                thisisbhaskar
                wrote on last edited by
                #7

                you are welcome. So only thing you did was making MouseArea disabled when you don't need them?

                1 Reply Last reply
                0
                • E Offline
                  E Offline
                  eirnanG
                  wrote on last edited by
                  #8

                  yea.. it helps a lot, because we're using almost 20 QMLs.... :)

                  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