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. [SOLVE]Quiting Problem

[SOLVE]Quiting Problem

Scheduled Pinned Locked Moved QML and Qt Quick
6 Posts 3 Posters 2.4k Views
  • 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.
  • L Offline
    L Offline
    lexan
    wrote on last edited by
    #1

    Hi. I rewrite my codes again and i just noticed something.. I guess it was my problem before and I believed I am stuck with this for a while I forgot to check on this..

    I have a mouseArea on exitIcon... this, obviously quits the game..

    but... let's say when I clicked on the playIcon.. this will load another qml file and start the game proper.. but whenever i intentionally click on the spot or area where the exitIcon has been previously positioned.. the MouseArea with Quit function still works.. How would i disable it??

    @ Image{
    id:exitIcon
    x: 12
    y: -183
    fillMode: Image.PreserveAspectFit
    source:"images/menu/exit.png"
    MouseArea{
    anchors.fill: parent
    onClicked: {
    MouseArea.enabled=false
    onExitClicked:Qt.quit()
    }

        }
    }
    

    @

    1 Reply Last reply
    0
    • J Offline
      J Offline
      jr_jags
      wrote on last edited by
      #2

      hide the mouse area when you click it by changing the visibility of your mousearea after you click it

      @ MouseArea{
      id:exit
      anchors.fill: parent
      onClicked: {
      MouseArea.enabled=false
      onExitClicked:Qt.quit()
      exit.visible = false
      }
      @

      1 Reply Last reply
      0
      • L Offline
        L Offline
        lexan
        wrote on last edited by
        #3

        still not works. :-( i dunno what to do...

        1 Reply Last reply
        0
        • J Offline
          J Offline
          jr_jags
          wrote on last edited by
          #4

          @MouseArea{
          id:exit
          anchors.fill: parent
          onClicked: {
          MouseArea.enabled=false;
          onExitClicked:Qt.quit();
          MouseArea.visible = false;
          }@

          try this maybe it needs ; on each statement ^^

          i only stated MouseArea.visible = false on every mousearea i click to hide it.

          1 Reply Last reply
          0
          • L Offline
            L Offline
            lexan
            wrote on last edited by
            #5

            I have managed to solve it thanks. I just disable the mouseare for quit button the moment i click on playIcon.. :D

            1 Reply Last reply
            0
            • M Offline
              M Offline
              mlong
              wrote on last edited by
              #6

              Be sure and add [Solved] to the beginning of the thread title! Thanks!

              Software Engineer
              My views and opinions do not necessarily reflect those of anyone -- living or dead, real or fictional -- in this universe or any other similar multiverse node. Void where prohibited. Your mileage may vary. Caveat emptor.

              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