Deep Tech Performance Optimizations Qt Quick Qt Roadmap Today Qt Roadmap Tomorrow UI/UX

Pointer Events and Handlers in Qt Quick


Berlin Room October 20, 2016 1:30 pm - 1:55 pm

Bookmark and Share

Shawn Rutledge

A walkthrough of the new Handler classes which are planned as a Tech Preview release in Qt 5.8, and the use cases for them: taps, pinches, drags, flicks, and custom touchpoint handling. In previous versions of QtQuick, we had a few Items specialized for handling pointing device events, such as MouseArea, Flickable, PinchArea, and MultiPointTouchArea. Some of them are limited to handling mouse events, so when you use a touchscreen, they rely on receiving synthesized mouse events. This precludes touch interaction with multiple Items, because of the assumption that there is only one mouse – despite the fact that you are using a multi-touch screen. At the 2015 Qt Contributors’ Summit, we discussed a potential solution to the problem, from which the present implementation has evolved. The solution is to have one type of event (a synthetic wrapper in Qt 5, and a common base class in Qt 6) for all pointing-device events, and a new larger set of lightweight Handler objects, focused purely on handling events. They can be device-agnostic, or can filter events from specific kinds of devices. They are not Items themselves, but pointer-handling aspects of Items. This talk will be an exploration of these Handlers and their use cases: how to achieve fluid, multiple-touch, multiple-user UIs in Qt Quick.