Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Combining MouseArea and MultiPoint TouchArea
pderocco last edited by pderocco
I have a QML app that uses a lot of MouseArea objects. Under Windows, I can run it on a touchscreen, and rely on Windows to translate single-touch events into mouse events, which work as expected. There are some problems, though:
- I'd like to be able to tap two buttons at once.
- I'd prefer it if using touch didn't cause the mouse cursor to move over onto the app, but stay where it is.
- I'd also prefer it if using touch didn't even give my app focus, so I could continue to do other things like type into another app.
I'm not sure the last one is doable, but the first two certainly are. But I'm looking for a simple way to do it that doesn't involve a major rewrite, so I'm thinking of creating a MouseTouchArea object that I could quickly substitute for all my MouseArea objects. It would be implemented as a MouseArea object with a MultiPointTouchArea as a child, with signals from the latter translated into signals in the former. In the latter, I could set maximumTouchPoints and minimumTouchPoints to 1, and mouseEnabled to false, but it has a rather different API because its signals emit lists of TouchPoints rather than single MouseEvent objects.