Inconsistent Touch Handling on Specific Qt Widgets

Because PySide6 cannot run on TorizonCore 32-bit OS for i.MX7, we are using PySide6’s Qt Designer to create the UI and then converting it to a Python file using pyside6-uic.

While running the application, touch input on some PushButtons and ComboBoxes sometimes does not work correctly.

I then tried using PySide2’s Qt Designer and converted the UI to Python using the pyside2-uic converter, but the touch issue remains the same. All LineEdits, SpinBoxes, and similar widgets work correctly throughout all phases.

Mouse clicks work correctly for all widgets throughout all phases, but touch input is problematic only for PushButtons and ComboBoxes.

What could be the cause of this problematic touch behavior for PushButtons and ComboBoxes ? @ToradexAI

Hi, I’m the Toradex AI Assistant.

I might make mistakes or occasionally get you wrong. Our support team will step in if needed.


I’d be glad to help troubleshoot your touch input issues! To provide the most accurate guidance, could you let me know which OS and version you are using on your i.MX7 device?

You can get this information by running the tdx-info command on your device. For more details about this command, please see: tdx-info

The touch behavior you’re describing - where mouse clicks work correctly but touch input is problematic specifically for PushButtons and ComboBoxes - could be related to touch event handling configuration in your Torizon OS setup. Once I know your specific platform details, I can provide targeted guidance for your configuration.

Best regards,
Toradex AI Assistant.


Did you like my answer? :+1: :-1:

If I answered your question, please tick the “Solution” checkbox.

For follow-up questions to me, please use @ToradexAI in your post.

from “tdx-info” result :

Distro name: NAME=“Torizon OS Upstream”
Distro version: VERSION_ID=7.4.0-build.28

Thank you for providing the platform details! With Torizon OS 7.4.0-build.28 on your i.MX7 device, the touch input issues you’re experiencing with PushButtons and ComboBoxes are likely related to touch event handling configuration.

Touch Input Configuration for Qt Applications

The issue where mouse clicks work but touch input is problematic for specific widgets typically stems from how touch events are processed and converted to mouse events in the Wayland environment (1).

Touch2Pointer Solution

For Qt applications that don’t handle touch events natively (like QtWidgets), you may need to use touch2pointer - an application created by Toradex that operates directly on the touchscreen’s evdev interface and creates a virtual pointer device (1).

Here’s how to configure it:

  1. Create a udev rule to make Weston/libinput ignore the touch device by adding ENV{LIBINPUT_IGNORE_DEVICE}="1" (1):
SUBSYSTEM=="input", KERNEL=="event0", ENV{ID_INPUT_TOUCHSCREEN}=="1", ENV{LIBINPUT_CALIBRATION_MATRIX}="1.034599 -0.008149 -0.013808 0.026801 -1.130055 1.058165"
SUBSYSTEM=="input", KERNEL=="event0", ENV{LIBINPUT_IGNORE_DEVICE}="1"

(1)

  1. Start touch2pointer with touchscreen as an argument (1).

Note that while this solution enables touch functionality for non-touch-aware applications, you will lose some touchscreen capabilities like multitouch (1).

Alternative: Weston Configuration

You can also try enabling virtual terminal switching in your Weston configuration by modifying the weston.ini file (1):

[keyboard]
vt-switching=true

(1)

Hardware Access Considerations

Ensure your container has proper access to input devices. The torizon user should be part of the input group to allow access to input devices (2). The default Torizon containers include the torizon user mapped to several groups including input (2).

This configuration should resolve the touch input issues you’re experiencing with PushButtons and ComboBoxes while maintaining proper functionality for other widgets.

Best regards,
Toradex AI Assistant.


Did you like my answer? :+1: :-1:

If I answered your question, please tick the “Solution” checkbox.

For follow-up questions to me, please use @ToradexAI in your post.

Hi @Coders!

I recommend asking on Qt’s forums, since it seems to be something related to the PySide itself, and we don’t have the in-house expertise to provide support on Qt-related issues.

Best regards.