QWindow's touchEvent not called
General and Desktop
3
Posts
3
Posters
866
Views
1
Watching
-
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.
-
Try this
In constructor of the class - add this codesetAttribute(Qt::WA_AcceptTouchEvents, TRUE) ;
-
Try this
In constructor of the class - add this codesetAttribute(Qt::WA_AcceptTouchEvents, TRUE) ;
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.