[Resolved] Touch Screen does not work for Qt5.3.2 app
-
-
Is this what you got when calling your application with -plugin tslib ?
By the way, your paths look a bit strange. How did you install Qt on your board ?
-
That's a bit messy, you should install it in a dedicated subdir e.g. /usr/local/Qt5
What do you get if you call ldd on the plugin ?
-
Finally get the ldd utility work. Here is the output:
./ldd /usr/plugins/generic/libqtslibplugin.so
@libts-0.0.so.0 => /usr/lib/libts-0.0.so.0 (0x4000e000)
libQt5Gui.so.5 => /usr/lib/libQt5Gui.so.5 (0x40018000)
libQt5Core.so.5 => /usr/lib/libQt5Core.so.5 (0x4052d000)
librt.so.1 => /lib/librt.so.1 (0x40b15000)
libdl.so.2 => /lib/libdl.so.2 (0x40b24000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x40b2f000)
libGL.so.1 => /usr/lib/libGL.so.1 (0x40b42000)
libOSMesa.so.7 => /usr/lib/libOSMesa.so.7 (0x40de3000)
libpthread.so.0 => /lib/libpthread.so.0 (0x40df6000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x40e16000)
libm.so.6 => /lib/libm.so.6 (0x40eea000)
libc.so.6 => /lib/libc.so.6 (0x40f95000)
libpng.so.3 => /usr/lib/libpng.so.3 (0x410ba000)
libz.so.1 => /usr/lib/libz.so.1 (0x410e4000)
/lib/ld-linux.so.3 (0x2a000000)
libX11.so.6 => /usr/lib/libX11.so.6 (0x410fe000)
libXext.so.6 => /usr/lib/libXext.so.6 (0x411c6000)@./ldd ./test-ts
@libQt5Widgets.so.5 => /usr/lib/libQt5Widgets.so.5 (0x40026000) libQt5Gui.so.5 => /usr/lib/libQt5Gui.so.5 (0x40624000) libQt5Core.so.5 => /usr/lib/libQt5Core.so.5 (0x40b39000) librt.so.1 => /lib/librt.so.1 (0x41120000) libdl.so.2 => /lib/libdl.so.2 (0x4112f000) libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x4113a000) libGL.so.1 => /usr/lib/libGL.so.1 (0x4114d000) libOSMesa.so.7 => /usr/lib/libOSMesa.so.7 (0x413ee000) libpthread.so.0 => /lib/libpthread.so.0 (0x41401000) libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x41420000) libm.so.6 => /lib/libm.so.6 (0x414f4000) libc.so.6 => /lib/libc.so.6 (0x4159f000) libpng.so.3 => /usr/lib/libpng.so.3 (0x416c4000) libz.so.1 => /usr/lib/libz.so.1 (0x416ee000) /lib/ld-linux.so.3 (0x40000000) libX11.so.6 => /usr/lib/libX11.so.6 (0x41707000) libXext.so.6 => /usr/lib/libXext.so.6 (0x417cf000)@
-
Looks good, did you check the rights on the device ?
-
Are you running your software as root ?
-
We use the knobs example (located in Qt5.3.2-opensource/Examples/Qt-5.3/touch/knobs) as a test case to debug the touch screen problem. We found the following things:
Touchpad events from the tslib plugin are treated as mouse events, not touchpad events. Typically a touch action results in a Mouse Button press, possibly some Mouse Move events, and a Mouse Release event. (Qt events are defined in an enum in qtbase/src/corelib/kernel/coreevent.h)
I typically see event types 2, 3, 5 (MouseButtonPress, MouseButtonRelease and MouseMove) and 155, 156 and 157 (GraphicsSceneMouseMove, GraphicsSceneMousePress and GraphicsSceneMouseRelease). The Knobs event handler (knob.cpp: Knob::sceneEvent) is looking for event types 194, 195 and 196 (TouchBegin, TouchUpdate and TouchEnd)and will never respond to mouse events.
Knob is a class derived from QGraphicsItem. The knob is added into a QGraphicsScene object and this object provides event handling for the QGraphicsItem in its event() method.
I see the Type 155, 156 and 157 events in the event() method but only the 156 event shows up in the Knob::sceneEvent() function.
So in summary, I have three problems:
-
The tslib implementation is producing simulated mouse events for the touchpad but the Knob::sceneEvent() function is looking for Touchpad events.
-
Only one of the three events I see being generated are being reported to
Knob::sceneEvent(). -
In my original test case, there is no QGraphics / view involved. Why the MouseButtonPress event does not pass to the QPushButton objects?
We use linuxfb as QT_QPA_PLATFORM.
Any help is great appreciated.
-