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

RaspberryPi touchscreen does not react to touch in Qt app



  • Hi.
    I compiled Qt5.12.7 natively in RaspberryPi 3B+, Raspbian, EGLFS.
    I have a waveshare 3.5" type C touchscreen, drivers installed and has display output correctly.
    But I can not touch the screen in Qt app. In lxde desktop environment, touchscreen works ok.
    I enabled plugin logging qt.qpa.* and here's the results for default libinput:

    qt.qpa.egldeviceintegration: EGL device integration plugin keys: ("eglfs_brcm", "eglfs_emu")
    qt.qpa.egldeviceintegration: EGL device integration plugin keys (sorted): ("eglfs_brcm", "eglfs_emu")
    qt.qpa.egldeviceintegration: Trying to load device EGL integration "eglfs_brcm"
    qt.qpa.egldeviceintegration: Using EGL device integration "eglfs_brcm"
    Unable to query physical screen size, defaulting to 100 dpi.
    To override, set QT_QPA_EGLFS_PHYSICAL_WIDTH and QT_QPA_EGLFS_PHYSICAL_HEIGHT (in millimeters).
    qt.qpa.input: libinput: event6  - ADS7846 Touchscreen: is tagged by udev as: Touchscreen
    qt.qpa.input: libinput: event6  - ADS7846 Touchscreen: device is a touch device
    qt.qpa.input: libinput: event0  - COMPANY 2.4G Device: is tagged by udev as: Keyboard
    qt.qpa.input: libinput: event0  - COMPANY 2.4G Device: device is a keyboard
    qt.qpa.input: libinput: event1  - COMPANY 2.4G Device Mouse: is tagged by udev as: Mouse
    qt.qpa.input: libinput: event1  - COMPANY 2.4G Device Mouse: device is a pointer
    qt.qpa.input: libinput: event2  - COMPANY 2.4G Device Keyboard: is tagged by udev as: Keyboard
    qt.qpa.input: libinput: event2  - COMPANY 2.4G Device Keyboard: device is a keyboard
    qt.qpa.input: libinput: event3  - COMPANY 2.4G Device: not tagged as supported input device
    qt.qpa.input: libinput: event3  - not using input device '/dev/input/event3'
    qt.qpa.input: libinput: event4  - COMPANY 2.4G Device Consumer Control: is tagged by udev as: Keyboard
    qt.qpa.input: libinput: event4  - COMPANY 2.4G Device Consumer Control: device is a keyboard
    qt.qpa.input: libinput: event5  - COMPANY 2.4G Device System Control: is tagged by udev as: Keyboard
    qt.qpa.input: libinput: event5  - COMPANY 2.4G Device System Control: device is a keyboard
    qt.qpa.input: Using xkbcommon for key mapping
    qt.qpa.input: libinput: registerDevice /dev/input/event6 - ADS7846 Touchscreen
    

    I used evdev, but touch does not work again: (QT_QPA_EGLFS_NO_LIBINPUT=1)

    qt.qpa.egldeviceintegration: EGL device integration plugin keys: ("eglfs_brcm", "eglfs_emu")
    qt.qpa.egldeviceintegration: EGL device integration plugin keys (sorted): ("eglfs_brcm", "eglfs_emu")
    qt.qpa.egldeviceintegration: Trying to load device EGL integration "eglfs_brcm"
    qt.qpa.egldeviceintegration: Using EGL device integration "eglfs_brcm"
    Unable to query physical screen size, defaulting to 100 dpi.
    To override, set QT_QPA_EGLFS_PHYSICAL_WIDTH and QT_QPA_EGLFS_PHYSICAL_HEIGHT (in millimeters).
    qt.qpa.input: evdevkeyboard: Using device discovery
    qt.qpa.input: udev device discovery for type QFlags<QDeviceDiscovery::QDeviceType>(Device_Keyboard)
    qt.qpa.input: Found matching devices ("/dev/input/event0", "/dev/input/event2", "/dev/input/event4", "/dev/input/event5")
    qt.qpa.input: Adding keyboard at "/dev/input/event0"
    qt.qpa.input: Try to create keyboard handler for "/dev/input/event0" ""
    qt.qpa.input: Opening keyboard at "/dev/input/event0"
    qt.qpa.input: Create keyboard handler with for device "/dev/input/event0"
    qt.qpa.input: Unload current keymap and restore built-in
    qt.qpa.input: numlock=0 , capslock=0, scrolllock=0
    qt.qpa.input: Adding keyboard at "/dev/input/event2"
    qt.qpa.input: Try to create keyboard handler for "/dev/input/event2" ""
    qt.qpa.input: Opening keyboard at "/dev/input/event2"
    qt.qpa.input: Create keyboard handler with for device "/dev/input/event2"
    qt.qpa.input: Unload current keymap and restore built-in
    qt.qpa.input: numlock=0 , capslock=0, scrolllock=0
    qt.qpa.input: Adding keyboard at "/dev/input/event4"
    qt.qpa.input: Try to create keyboard handler for "/dev/input/event4" ""
    qt.qpa.input: Opening keyboard at "/dev/input/event4"
    qt.qpa.input: Create keyboard handler with for device "/dev/input/event4"
    qt.qpa.input: Unload current keymap and restore built-in
    qt.qpa.input: numlock=0 , capslock=0, scrolllock=0
    qt.qpa.input: Adding keyboard at "/dev/input/event5"
    qt.qpa.input: Try to create keyboard handler for "/dev/input/event5" ""
    qt.qpa.input: Opening keyboard at "/dev/input/event5"
    qt.qpa.input: Create keyboard handler with for device "/dev/input/event5"
    qt.qpa.input: Unload current keymap and restore built-in
    qt.qpa.input: numlock=0 , capslock=0, scrolllock=0
    qt.qpa.input: evdevmouse: Using device discovery
    qt.qpa.input: udev device discovery for type QFlags<QDeviceDiscovery::QDeviceType>(Device_Mouse|Device_Touchpad)
    qt.qpa.input: Found matching devices ("/dev/input/event1")
    qt.qpa.input: Adding mouse at "/dev/input/event1"
    qt.qpa.input: create mouse handler for "/dev/input/event1" ""
    qt.qpa.input: evdevtouch: Using device discovery
    qt.qpa.input: udev device discovery for type QFlags<QDeviceDiscovery::QDeviceType>(Device_Touchpad|Device_Touchscreen)
    qt.qpa.input: Found matching devices ("/dev/input/event6")
    qt.qpa.input: evdevtouch: Adding device at "/dev/input/event6"
    qt.qpa.input: evdevtouch: Using device /dev/input/event6
    qt.qpa.input: evdevtouch: /dev/input/event6: Protocol type B (mtdev) (multi), filtered=no
    qt.qpa.input: evdevtouch: /dev/input/event6: min X: 0 max X: 0
    qt.qpa.input: evdevtouch: /dev/input/event6: min Y: 0 max Y: 0
    qt.qpa.input: evdevtouch: /dev/input/event6: min pressure: 0 max pressure: 255
    qt.qpa.input: evdevtouch: /dev/input/event6: device name: ADS7846 Touchscreen
    qt.qpa.input: evdevtouch: Updating QInputDeviceManager device count: 1  touch devices, 0 pending handler(s)
    

    I don't know what might be the problem, Is it related to these lines?

    qt.qpa.input: evdevtouch: /dev/input/event6: min X: 0 max X: 0
    qt.qpa.input: evdevtouch: /dev/input/event6: min Y: 0 max Y: 0
    

    Thanks



  • Same behavior (driver ADS7846)
    I thought problem is that min and max value is 0

    qt.qpa.input: evdevtouch: /dev/input/event6: min X: 0 max X: 0
    qt.qpa.input: evdevtouch: /dev/input/event6: min Y: 0 max Y: 0

    But evtest work correctly.

    Input device name: "ADS7846 Touchscreen"
    Supported events:
      Event type 0 (EV_SYN)
      Event type 1 (EV_KEY)
        Event code 330 (BTN_TOUCH)
      Event type 3 (EV_ABS)
        Event code 0 (ABS_X)
          Value   2911
          Min        0
          Max     4095
        Event code 1 (ABS_Y)
          Value   3039
          Min        0
          Max     4095
        Event code 24 (ABS_PRESSURE)
          Value      0
          Min        0
          Max      255
    

    Don't know how to solve this.
    Thank for any help.



  • when I compile QT from fresh source, it work....



  • Hi all.
    I have the same problem with Rpi 3b, Qt 5.8.0 and ELGFS, compiled from fresh.

    I get
    qt.qpa.input: evdevtouch: /dev/input/event0: min X: 0 max X: 0

    and if I touch on the screen nothing happens.
    evtest works fine


Log in to reply