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. Using 2 MouseAreas not overlapped, at the same time
Forum Updated to NodeBB v4.3 + New Features

Using 2 MouseAreas not overlapped, at the same time

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
5 Posts 4 Posters 1.1k 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.
  • johngodJ Offline
    johngodJ Offline
    johngod
    wrote on last edited by
    #1

    I'm working on a small game, where I have one MouseArea at bottom right and another at the bottom left, they dont overlap. One moves a spaceship when pressing and moving, the other fires a shots when pressed.
    The problem is fires dont get shot if the spaceship is being moved, it seems the mouseareas dont work at same. I didnt find anything at the docs about using 2 mouseareas at the same time, only when they are overlapped, wich is not the case.
    Any ideias to solve this ?

    1 Reply Last reply
    0
    • JerwinprabuJ Offline
      JerwinprabuJ Offline
      Jerwinprabu
      wrote on last edited by
      #2

      Can you post your example code. It will help to find a solution.

      1 Reply Last reply
      0
      • dheerendraD Offline
        dheerendraD Offline
        dheerendra
        Qt Champions 2022
        wrote on last edited by
        #3

        They don't have to overlap. It should work fine. Sample code on how you defined the MouseArea will help. Looks like at some point of time mouse Areas are overlapped. This must be causing the issue for you.

        Dheerendra
        @Community Service
        Certified Qt Specialist
        http://www.pthinks.com

        1 Reply Last reply
        4
        • johngodJ Offline
          johngodJ Offline
          johngod
          wrote on last edited by
          #4

          Thanks for your replays. Here is a sample code projetc it will run out of the box in QtCreator with a android kit.
          https://drive.google.com/open?id=0BxfZ8-hFx1rCSWVfWXE4ZlZIdk0
          CommandTouchPad.qml is the left MouseArea that moves the spaceship. Button.qml is the right mousearea that fires the shots.
          Cheers

          1 Reply Last reply
          1
          • RajeeshRaveendranR Offline
            RajeeshRaveendranR Offline
            RajeeshRaveendran
            wrote on last edited by
            #5

            Hi,

            I think you should use multi point touch area to handle multiple touch events at the same time.

            http://doc.qt.io/qt-5/qml-qtquick-multipointtoucharea.html

            Regards,
            Rajeesh Raveendran

            1 Reply Last reply
            1

            • Login

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