Bug 11666 - Touchscreen with (Py)Qt5 should use tslib instead of evdev
Summary: Touchscreen with (Py)Qt5 should use tslib instead of evdev
Status: RESOLVED WORKSFORME
Alias: None
Product: buildroot
Classification: Unclassified
Component: Other (show other bugs)
Version: 2018.02.9
Hardware: All Linux
: P5 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-02-05 15:45 UTC by Tibor Stolz
Modified: 2019-02-07 09:37 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments
PyQt5 test application (1003 bytes, text/plain)
2019-02-05 15:45 UTC, Tibor Stolz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tibor Stolz 2019-02-05 15:45:58 UTC
Created attachment 7946 [details]
PyQt5 test application

Hello,

I compiled Qt5 with Tslib support (BR2_PACKAGE_QT5BASE_TSLIB=y), and ts_calibrate and ts_test work properly. I also have a /usr/lib/qt/plugins/generic/libqtslibplugin.so, so the compilation part seems to have worked.

I created a tiny PyQt5 test application (see attachment), which creates 4 buttons. When I run this qt5test.py, the y-axis of the touchscreen appears inverted (x-axis ok).

I've read http://lists.busybox.net/pipermail/buildroot/2015-November/143571.html and from that it seems that my PyQt5 application uses evdev instead of tslib for input. I can use an extra environment variable:

~> QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS='rotate=180' ./qt5test.py

Now the touchscreen is indeed rotated by 180 degrees, i.e. the x-axis is inverted while the y-axis is ok. Further trials with 'rotate=90' or 'rotate=270' changed the touchscreen orientation accordingly, but none is usable to cancel the inversion of the y-axis.

What strikes me is that the above is an **evdev** option, despite the fact that I want to use Qt5 with **tslib**. I've read about a "-plugin tslib" command-line option, but that changes nothing with my Python script.

So I'm going to need either a way to switch to tslib (preferred), or a QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS value that just flips the y-axis.^

Any help or info will be really appreciated.

Best regards,
Tibor Stolz
Comment 1 Tibor Stolz 2019-02-07 09:37:08 UTC
Hello,

I found <http://doc.qt.io/qt-5/embedded-linux.html#touch>, which mentions some more settings to be done by means of environment variables:

~> QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS='inverty' ./qt5test.py

This works for me, I get proper touchscreen input. (Hardware: BeagleBoneBlack with 4D Systems gen4-4DCAPE-43T LCD)


There are two options to enable tslib:

~> QT_QPA_FB_TSLIB=1 ./qt5test.py

This seems to completely disable touchscreen input.

~> QT_QPA_EGLFS_TSLIB=1 ./qt5test.py

This seems to have no effect, i.e. touchscreen input works but is still y-wise inverted.

Since there is no need for tslib in my configuration, as y-wise inversion can be done without it, I declare this bug as RESOLVED WORKSFORME.

Best regards,
Tibor Stolz