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. Nested MultiPointTouchArea and MouseArea: grab and cancel
Forum Updated to NodeBB v4.3 + New Features

Nested MultiPointTouchArea and MouseArea: grab and cancel

Scheduled Pinned Locked Moved QML and Qt Quick
multipointtouchmousearea
1 Posts 1 Posters 1.6k 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.
  • Q Offline
    Q Offline
    qvirol
    wrote on 22 Jul 2015, 09:06 last edited by
    #1

    Hello,

    I have a simple UI with MouseArea and flickable (drag, click and double click) and I want to catch some more complexe gestures with 3 and 4 fingers. I added 2 MultiPointTouchArea to do this job. My code looks like this:

    import QtQuick 2.0
    Rectangle {
        width: 900
        height: 900
        MultiPointTouchArea {
            id: touch4
            anchors.fill: parent
            minimumTouchPoints: 4
            maximumTouchPoints: 4
            onGestureStarted: gesture.grab()
            // Some gesture processing with touchPoints and pressed, released and canceled
            MultiPointTouchArea {
                id: touch3
                anchors.fill: parent
                minimumTouchPoints: 3
                maximumTouchPoints: 3
                onGestureStarted: gesture.grab()
                // Some gesture processing with touchPoints and pressed, released and canceled
                SimpleUI {
                    anchors.fill: parent
                    // Contains MouseArea and flickable
                }
            }
        }
    }
    

    I call gesture.grab() function on signal gestureStarted to prevent drag with MouseArea or flickable in my SimpleUI.
    But grab gesture have variable consequences.
    When touch3 grab gesture, everything seems to work well. But I think I have some issues with touch4.
    When touch4 grab gesture, mouse area in my simpleUI is cancel but not touch3 (touch3 received pressed event, so I think it should be cancel too).
    Some times, touch4 should grab gesture but onGestureStarted is not called and when I release my fingers, touch4 is canceled. In this case, I dont touch the screen any more but the mouseArea still in pressed state. If I touch the screen the mouseArea do nothing. I have to proceed a 4 fingers gesture again, touch4 grab gesture and when I release my fingers, the mouseArea is canceled.

    I expect when a MultiPointTouchArea grab a gesture, all other area previously pressed are canceled and when I release, everyone is released or canceled, but its not :(

    Do I something wrong with my nested system ? Are there bugs in touch event processing ?

    1 Reply Last reply
    0

    1/1

    22 Jul 2015, 09:06

    • Login

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