QQuickWindow::tabletEvent() no longer works in Qt6
-
I'm in the process of porting over a (QML) Qt5 app I wrote to Qt6. And it makes use of wacom pen input. For my project, I had to make a subclass of
QQuickWindowand then override thetabletEvent()method to process wacom pen input. Which I would then have the app dispatch to the appropriate QML object. So my code was as followsclass AppWindow : public QQuickWindow { Q_OBJECT // ... protected: /**Handle wacom pen events */ virtual void tabletEvent(QTabletEvent *event) override; }; /// ...And then in the overridden
tabletEvent()method I had all of my logic that does the handling. When updating to Qt6, I saw that nothing was happening when I tried to use the Wacom pen. I inserted aqDebug()statement right at the top of the body of the function and I saw nothing print out. Then I built the same code against Qt5 and I saw the output of theqDebug().I did try out the Tablet painting example (build against Qt6) to verify it wacom pen support is still there; it worked for me. The one thing I noticed about it is that it has a
QWidgetsubclass withQt::WA_TabletTrackingflipped on. I don't think that will work for me.Is this a known bug? Or did something change in Qt6 for how I should have a window handle Wacom pen input? E.g. a new QML/QtQuick control for tablet stuffs?
-
I filed a bug report that has some sample code illustrating the issue: https://bugreports.qt.io/browse/QTBUG-97859