[Resolved] Touch Screen does not work for Qt5.3.2 app
-
Hi SGaist:
The following lines are debug output. The tslib plugin looks like loaded. Please let me know is I missed anything. Thanks.
QIconvCodec::convertToUnicode: using Latin-1 for conversion, iconv_open failed
QIconvCodec::convertFromUnicode: using Latin-1 for conversion, iconv_open failed
QFactoryLoader::QFactoryLoader() checking directory path "/mnt/mmc/platforms" ...
QFactoryLoader::QFactoryLoader() checking directory path "/usr/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() looking at "/usr/plugins/platforms/libqlinuxfb.so"
Found metadata in lib /usr/plugins/platforms/libqlinuxfb.so, metadata=
{
"IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.2",
"MetaData": {
"Keys": [
"linuxfb"
]
},
"className": "QLinuxFbIntegrationPlugin",
"debug": false,
"version": 328450
}Got keys from plugin meta data ("linuxfb")
QFactoryLoader::QFactoryLoader() looking at "/usr/plugins/platforms/libqminimal.so"
Found metadata in lib /usr/plugins/platforms/libqminimal.so, metadata=
{
"IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.2",
"MetaData": {
"Keys": [
"minimal"
]
},
"className": "QMinimalIntegrationPlugin",
"debug": false,
"version": 328450
}Got keys from plugin meta data ("minimal")
QFactoryLoader::QFactoryLoader() looking at "/usr/plugins/platforms/libqoffscreen.so"
Found metadata in lib /usr/plugins/platforms/libqoffscreen.so, metadata=
{
"IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.2",
"MetaData": {
"Keys": [
"offscreen"
]
},
"className": "QOffscreenIntegrationPlugin",
"debug": false,
"version": 328450
}Got keys from plugin meta data ("offscreen")
loaded library "/usr/plugins/platforms/libqlinuxfb.so"
QFactoryLoader::QFactoryLoader() checking directory path "/mnt/mmc/platforminputcontexts" ...
QFactoryLoader::QFactoryLoader() checking directory path "/usr/plugins/platforminputcontexts" ...
QFactoryLoader::QFactoryLoader() checking directory path "/mnt/mmc/generic" ...
QFactoryLoader::QFactoryLoader() checking directory path "/usr/plugins/generic" ...
QFactoryLoader::QFactoryLoader() looking at "/usr/plugins/generic/libqevdevkeyboardplugin.so"
Found metadata in lib /usr/plugins/generic/libqevdevkeyboardplugin.so, metadata=
{
"IID": "org.qt-project.Qt.QGenericPluginFactoryInterface",
"MetaData": {
"Keys": [
"EvdevKeyboard"
]
},
"className": "QEvdevKeyboardPlugin",
"debug": false,
"version": 328450
}Got keys from plugin meta data ("evdevkeyboard")
QFactoryLoader::QFactoryLoader() looking at "/usr/plugins/generic/libqevdevmouseplugin.so"
Found metadata in lib /usr/plugins/generic/libqevdevmouseplugin.so, metadata=
{
"IID": "org.qt-project.Qt.QGenericPluginFactoryInterface
"MetaData": {
"Keys": [
"EvdevMouse"
]
},
"className": "QEvdevMousePlugin",
"debug": false,
"version": 328450
}Got keys from plugin meta data ("evdevmouse")
QFactoryLoader::QFactoryLoader() looking at "/usr/plugins/generic/libqevdevtabletplugin.so"
Found metadata in lib /usr/plugins/generic/libqevdevtabletplugin.so, metadata=
{
"IID": "org.qt-project.Qt.QGenericPluginFactoryInterface",
"MetaData": {
"Keys": [
"EvdevTablet"
]
},
"className": "QEvdevTabletPlugin",
"debug": false,
"version": 328450
}Got keys from plugin meta data ("evdevtablet")
QFactoryLoader::QFactoryLoader() looking at "/usr/plugins/generic/libqevdevtouchplugin.so"
Found metadata in lib /usr/plugins/generic/libqevdevtouchplugin.so, metadata=
{
"IID": "org.qt-project.Qt.QGenericPluginFactor: {
"Keys": [
"EvdevTouch"
]
},
"className": "QEvdevTouchScreenPlugin",
"debug": false,
"version": 328450
}Got keys from plugin meta data ("evdevtouch")
QFactoryLoader::QFactoryLoader() looking at "/usr/plugins/generic/libqtslibplugin.so"
Found metadata in lib /usr/plugins/generic/libqtslibplugin.so, metadata=
{
"IID": "org.qt-project.Qt.QGenericPluginFactoryInterface",
"MetaData": {
"Keys": [
"Tslib",
"TslibRaw"
]
},
"cl": "QTsLibPlugin",
"debug": false,
"version": 328450
}Got keys from plugin meta data ("tslib", "tslibraw")
QFactoryLoader::QFactoryLoader() checking directory path "/mnt/mmc/styles" ...
QFactoryLoader::QFactoryLoader() checking directory path "/usr/plugins/styles" ... -
-
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.
-