PDA

View Full Version : Propegate issue with mousearea and multitoucharea



Cheppie
5th April 2017, 12:57
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 }
]
}
}

john_god
10th May 2017, 00:20
Hi
Just tried your example and it works for me, but I'm using MouseArea and MultiPointTouchArea inside a Rectangle in a QQuickView app.
Maybe it's some issue with Window, please try messing around with some Window flags, or maybe you can use a QQuickView ?