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. Event propegation issue between MouseArea and MultiPointTouchArea

Event propegation issue between MouseArea and MultiPointTouchArea

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
3 Posts 3 Posters 1.6k 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.
  • C Offline
    C Offline
    Cheppie
    wrote on last edited by
    #1

    Hello,

    I have a question regarding the following problem that I'm having between mouse area and multitouch area. The problem that I'm having
    is that mouse area does not detect the onClicked. There is a mouseEnabled property that allows you to handle mouse events(if true) or
    allow pass through of the events so that they can be handled by other items underneath(if false). This pass through isn't working in my
    situation.

    Does anybody have an idea why the multitouch area does not propegate the events to the mouse area.

    Thank you in advance for the help.

    Qml code(main.qml):

    Window {
    
        id: mainWindow
    
        width: 1024
        height:  768
        minimumWidth: width
        minimumHeight: height
        maximumWidth: width
        maximumHeight: height
    
        MouseArea {
            anchors.fill: parent
            onClicked: {
                console.log(mouse.x)
            }
        }
    
        MultiPointTouchArea {
            anchors.fill: parent
            mouseEnabled: false
    
            onTouchUpdated: {
                console.log("onTouchUpdated")
            }
    
            onPressed: {
                console.log("onPressed")
            }
    
            onReleased: {
                console.log("onReleased")
            }
    
            onUpdated: {
                console.log("onUpdated")
            }
    
            minimumTouchPoints: 2
            maximumTouchPoints: 2
    
            touchPoints: [
                TouchPoint { id: point1 },
                TouchPoint { id: point2 }
            ]
        }
    }
    
    1 Reply Last reply
    0
    • johngodJ Offline
      johngodJ Offline
      johngod
      wrote on last edited by
      #2

      Just did some testings with your code and it works for me, if the Window is a top level, else it will fail, not sure if it's a bug. Also works if the window is a Rectangle. Maybe you can change to Rectangle ?

      1 Reply Last reply
      0
      • T Offline
        T Offline
        Tony Clifton
        wrote on last edited by
        #3

        Your code works for me. Are you using a touchscreen for testing? From my experience a MultiPointTouchArea can distinguish between a mouse click and a "touch click". The mouseEnabled property only works for actual mouse clicks, not a touch.

        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