Touchscreen "HOLD" (long-press) event gets converted to a right-mouse-button press
-
Short and long on-screen "button presses" using a mouse work as expected -- that is, we see a difference between a short activation (call it a "tap") vs. a long one of 0.5 seconds or longer (a "hold").
However, we can't see the expected differentiation between short/long activations when using touch screens. Qt converts touchscreen events into mouse events, but a touchscreen hold (long press) appears to become a right button press.
We're using Qt 5.14.2. The application is running on Windows 11.
Any advice would be appreciated. For example, if a newer version of the underlying Qt function works but the older one doesn't, we could presumably write our own function that mimics the changes, etc.
Thanks
-
Hi and welcome to devnet,
Did you already test with Qt 6 ?
-
No, we haven’t tested with QT6. This particular product is fairly mature, with a lot of associated software that also uses an older QT version. It would be very disruptive to change versions in this case.
I was hoping someone would be familiar with this bug and have a suggestion for a workaround. Perhaps a different function? A modification drawing on changes in a newer QT version? Etc.
Thanks
-
If memory serves well, this has been a long standing issue since the old days of Qt 4.
The underlying problem is that converting touch events into mouse events is a compromise. Making everything work as expected for all touch screen types is like nailing jelly to a tree :-)
I that particular case, nobody ever added reproducing steps to the bug report, so it was closed. I remember to have experienced it in Qt5 (probably 5.15.x), but not in Qt 6.Qt 5.14 is really outdated. The only workaround that comes to mind, is to actually implement touch behavior without relying on mouse event translation. That requires specific implementation for each platform, by using native event filters.