Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
QWindow's touchEvent not called
Nethers last edited by
On a Mac with a track pad, my QWindow based app does not get it's touchEvent virtual function override called.
In a similar QWidget based test app, I do get QTouchEvents.
Is there something extra I need to do? The QTouchEvent documentation states that QWindow gets touch events automatically.
BhanuKiranChaluvadi last edited by
In constructor of the class - add this code
setAttribute(Qt::WA_AcceptTouchEvents, TRUE) ;
Joel Bodenmann last edited by
As an addition to what @BhanuKiranChaluvadi mentioned: If the
Qt::WA_AcceptTouchEventsproperty is disabled, the touch events are simply transformed into mouse events:
Qt::WA_AcceptTouchEvents Allows touch events (see QTouchEvent) to be sent to the widget. Must be set on all widgets that can handle touch events. Without this attribute set, events from a touch device will be sent as mouse events.