Which code decides the target widget is for a touch point
-
I'm currently debugging a strange touch-event bug in an application that mixes widgets and QML GUI elements.
In
QGuiApplicationPrivate::processTouchEvent
, the touch points delivered within the TouchEvent contain a target widget.So somewhere between the QPA event handler implemented in
qwindowsysteminterface.cpp
andQGuiApplicationPrivate::processTouchEvent
, the system decides the target widget for a touch point.Can you please point me to the corresponding Qt code for this assignment?
I want to understand this better.
Thanks
-
I'm currently debugging a strange touch-event bug in an application that mixes widgets and QML GUI elements.
In
QGuiApplicationPrivate::processTouchEvent
, the touch points delivered within the TouchEvent contain a target widget.So somewhere between the QPA event handler implemented in
qwindowsysteminterface.cpp
andQGuiApplicationPrivate::processTouchEvent
, the system decides the target widget for a touch point.Can you please point me to the corresponding Qt code for this assignment?
I want to understand this better.
Thanks
@mdb977
It would be good to understand more about the bug you are investigating.
processTouchEvent
is probably a good start. The touch event already knows, to whichQWindow
the event has been delivered. That is not up to Qt to determine. The decision is made on the underlying window system, e.g. X11 or Windows.QGuiApplication
doesn't know about widgets or quick windows. It delivers events on aQWindow
level.So what goes wrong in your application?
-
@mdb977
It would be good to understand more about the bug you are investigating.
processTouchEvent
is probably a good start. The touch event already knows, to whichQWindow
the event has been delivered. That is not up to Qt to determine. The decision is made on the underlying window system, e.g. X11 or Windows.QGuiApplication
doesn't know about widgets or quick windows. It delivers events on aQWindow
level.So what goes wrong in your application?
Thanks for your message.
You are talking about the target of the touch event.
I'm, however, talking about the target of the touchpoints.This target is sometimes corrected for touch-press in
translateRawTouchEvent
inqapplication.cpp
.https://codebrowser.dev/qt6/qtbase/src/widgets/kernel/qapplication.cpp.html#3856
I want to know who is setting the target for the touchpoints.
Regarding my problem: In a particular case, I have a pair of touch events (press and corresponding release). The press event is synthesized into a mouse click as it should in
processTouchEvent
. However, the release is delivered to my quick widget, which accepts the release (so the release is not synthesized).I have a hacky patch solving my problem, but I want to understand it better.
I also have a small standalone Qt example showing the problem, but I wonder if I should open a ticket in bugreports.qt.io for a bug I do not fully understand.
-
Thanks for your message.
You are talking about the target of the touch event.
I'm, however, talking about the target of the touchpoints.This target is sometimes corrected for touch-press in
translateRawTouchEvent
inqapplication.cpp
.https://codebrowser.dev/qt6/qtbase/src/widgets/kernel/qapplication.cpp.html#3856
I want to know who is setting the target for the touchpoints.
Regarding my problem: In a particular case, I have a pair of touch events (press and corresponding release). The press event is synthesized into a mouse click as it should in
processTouchEvent
. However, the release is delivered to my quick widget, which accepts the release (so the release is not synthesized).I have a hacky patch solving my problem, but I want to understand it better.
I also have a small standalone Qt example showing the problem, but I wonder if I should open a ticket in bugreports.qt.io for a bug I do not fully understand.
@mdb977 said in Which code decides the target widget is for a touch point:
Could it be, that your problem is related to this?
I am asking, because a colleague of mine implemented a great fix recently, where we swallowed touch events. In parallel, I'll look into our code for setting the target of touch points. -
@mdb977 said in Which code decides the target widget is for a touch point:
Could it be, that your problem is related to this?
I am asking, because a colleague of mine implemented a great fix recently, where we swallowed touch events. In parallel, I'll look into our code for setting the target of touch points.Thanks for the link.
At a glance, it is unrelated. -
I'm still interested in the code for setting the target of touchpoints.
Meanwhile, I managed to reproduce the issue with a handful of lines of code on a desktop Qt application using Qt 6.6.1. So, I think this is a Qt Bug.Regards
-
I'm still interested in the code for setting the target of touchpoints.
Meanwhile, I managed to reproduce the issue with a handful of lines of code on a desktop Qt application using Qt 6.6.1. So, I think this is a Qt Bug.Regards
@mdb977
File a bug report, I am getting curious.