I'm trying to run Qt applications on a Raspberry Pi 3 that have a Waveshare LCD Touchscreen (with resistive touch) as IO. The Qt version I'm using is 5.12 and the Raspberry Pi's Operating System is Raspbian Stretch. The input driver is evdev and the touch events are being sent correctly to the OS. I'm sure of that because I ran some tests with evtest.

Everything works fine when I use the mouse to click the widgets, but when I click them through the touch panel I have some problems.

Touchscreen clicks are generating mouse events (as I expected) but not every event is delivered in time. MouseReleases are delivered immediately after widget releases, but MousePress events are delivered after some delay.

If I press some widget and hold it down, then QWidget::mousePressEvent(QMouseEvent*) will be called only after ~1s.

If I release the widget before the MousePress event, then MouseRelease will anticipate it and both will be delivered together.

Is there a way to get rid of the MousePress event latency?

P.S. I know I could use TouchEvents instead of MouseEvents, but MouseEvents are easier to use.