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. Two MouseAreas for the same real estate?
Forum Updated to NodeBB v4.3 + New Features

Two MouseAreas for the same real estate?

Scheduled Pinned Locked Moved QML and Qt Quick
5 Posts 3 Posters 5.0k 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
    kyleplattner
    wrote on last edited by
    #1

    Do I have a limitation with two MouseAreas being defined for the same space. I have two separate qml documents, a navigation bar being loaded onto a main screen. I want mouseareas in the navigation.qml file to perform color changes and other state changes. I want the mouseareas in the main.qml page to handle navigation when a user clicks on the buttons.

    It seems that only one will work. Is this true?

    1 Reply Last reply
    0
    • D Offline
      D Offline
      DenisKormalev
      wrote on last edited by
      #2

      If they are not overlapping then both should work.

      1 Reply Last reply
      0
      • K Offline
        K Offline
        kyleplattner
        wrote on last edited by
        #3

        They are not overlapping in the same qml files but when they are loaded it would be overlapping.

        1 Reply Last reply
        0
        • D Offline
          D Offline
          DenisKormalev
          wrote on last edited by
          #4

          if they will overlap each other then of course only one (with greater z-order) will work.

          1 Reply Last reply
          0
          • M Offline
            M Offline
            mbrasser
            wrote on last edited by
            #5

            Hi,

            By default, the first item to accept a mouse press "grabs" the mouse (for more on this behavior, see docs "here":http://doc.qt.nokia.com/4.7/qgraphicsitem.html#mousePressEvent). So currently only one MouseArea can actively handle mouse events. We'd like to make this more flexible -- the task tracking this is "QTBUG-13007":http://bugreports.qt.nokia.com/browse/QTBUG-13007

            Regards,
            Michael

            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