Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Touch problems on RPi 4 with Qt 5.15.0 fullscreen application



  • Dear all,

    I am new to Qt and since three days I am desperately trying to get my touchscreen working correctly in my RPi 4 fullscreen application (eglfs backend, Raspbian Buster, OpenGL driver with fake KMS), but in vain. I have set up a cross compilation environment in a Linux VM to develop my application.

    I am currently using a 3,5"(B) waveshare LCD. "ts_calibrate" and "ts_test_mt" work as expected. Touches are translated into mouse events and recognised by my program. However, the coordinates in the mouse events that are generated in response to the touches do not correspond to the positions on the screen. Whatever environment variables I set ( I have got the impression that I have really tried every possible combination), nothing changes. The touchscreen coordinates remain rotated by 90 degrees clockwise compared to the display and the max. values are not correct (the display size is 480 x 320 pixels and the max. values of the touch screen are 1920 x 320, the size of the frame buffer).
    When I try to use evdevtouch instead of libinput by setting QT_QPA_EGLFS_NO_LIBINPUT=1, the touchscreen is recognised but the size is not (min. and max. values are 0) and when I touch the screen the program crashes with a segmentation fault.

    I have also tried using ts_uinput. This creates a new device in /dev/input and all events are doubled but with different values. With QT_QPA_EGLFS_NO_LIBINPUT=1, none of the min. or max. values are recognised.

    Does sombody have an idea what's going wrong here or what I am doing wrong? Why does evdevtouch recognise the touchscreen but does not correctly read the values?

    Any help is appreciated :-)

    Thank you very much,

    Ralf



  • Hey, to match the screen size,
    Try using these parameters QT_QPA_EGLFS_PHYSICAL_WIDTH and QT_QPA_EGLFS_PHYSICAL_HEIGHT

    Addon, seems that you might need to use these; QT_QPA_EGLFS_WIDTH and QT_QPA_EGLFS_HEIGHT
    The ones above with PHYSICAL specifies the screen in MM so not very convinient when the issue is the pixel resolution..



  • Hello,

    that's the first thing I had tried. Unfortunately it did not help.

    However, this morning I have found that this combination solves the problem:

    QT_QPA_EGLFS_NO_LIBINPUT=1
    QT_QPA_EGLFS_TSLIB=1

    Probably the only combination that I had not tried :-) Apparently TSLIB has to be explicitly activated if LIBINPUT is deactivated.

    Kind regards,

    Ralf



  • @DL5EU ok :)

    Glad you got it solved :)


Log in to reply