PDA

View Full Version : Qt 5.15 Multitouch issue



webquinty
12th April 2022, 13:01
Hello everybody.
I have a strange issue that I don't understand and maybe you can help me.

Qt 5.15 compile with multiotuch support.



Qt Gui:
Accessibility .......................... yes
FreeType ............................... yes
Using system FreeType ................ yes
HarfBuzz ............................... no
Using system HarfBuzz ................ no
Fontconfig ............................. yes
Image formats:
GIF .................................. yes
ICO .................................. yes
JPEG ................................. yes
Using system libjpeg ............... yes
PNG .................................. yes
Using system libpng ................ yes
Text formats:
HtmlParser ........................... yes
CssParser ............................ yes
OdfWriter ............................ yes
MarkdownReader ....................... yes
Using system libmd4c ............... no
MarkdownWriter ....................... yes
EGL .................................... yes
OpenVG ................................. no
OpenGL:
Desktop OpenGL ....................... no
OpenGL ES 2.0 ........................ yes
OpenGL ES 3.0 ........................ yes
OpenGL ES 3.1 ........................ yes
OpenGL ES 3.2 ........................ yes
Vulkan ................................. no
Session Management ..................... yes
Features used by QPA backends:
evdev .................................. yes
libinput ............................... no
INTEGRITY HID .......................... no
mtdev .................................. yes
tslib .................................. yes
xkbcommon .............................. yes
X11 specific:
XLib ................................. yes
XCB Xlib ............................. yes
EGL on X11 ........................... no
xkbcommon-x11 ........................ yes
QPA backends:
DirectFB ............................... yes
EGLFS .................................. yes
EGLFS details:
EGLFS OpenWFD ........................ no
EGLFS i.Mx6 .......................... no
EGLFS i.Mx6 Wayland .................. no
EGLFS RCAR ........................... no
EGLFS EGLDevice ...................... yes
EGLFS GBM ............................ yes
EGLFS VSP2 ........................... no
EGLFS Mali ........................... no
EGLFS Raspberry Pi ................... no
EGLFS X11 ............................ no
LinuxFB ................................ yes
VNC .................................... yes
Qt Sql:
SQL item models ........................ yes
Qt Widgets:
GTK+ ................................... no
Styles ................................. Fusion Windows
Qt PrintSupport:
CUPS ................................... no
Qt Sql Drivers:
DB2 (IBM) .............................. no
InterBase .............................. no
MySql .................................. yes
OCI (Oracle) ........................... no
ODBC ................................... no
PostgreSQL ............................. no
SQLite2 ................................ no
SQLite ................................. no
Using system provided SQLite ......... no
TDS (Sybase) ........................... no
Qt Testlib:
Tester for item models ................. yes


The examples in the widgets secction works fine. ( PinchZoom, FingerPaint and Knobs ).
But the issue is when I create a stupid app with 4 buttons and it's impossible to press two of them at the same time.
I enable the "qt.qpa.input" option to see what happen.



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: Adding mouse at /dev/input/event6
qt.qpa.input: create mouse handler for "/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: 4095
qt.qpa.input: evdevtouch: /dev/input/event6: min Y: 0 max Y: 4095
qt.qpa.input: evdevtouch: /dev/input/event6: min pressure: 0 max pressure: 0
qt.qpa.input: evdevtouch: /dev/input/event6: device name: DATA MODUL easyMaxTouch



Qt recognize the device as Touch device and also it detects as MultiTouch Protocol type B.



# evtest /dev/input/event6
Input driver version is 1.0.1
Input device ID: bus 0x3 vendor 0x7374 product 0x1252 version 0x111
Input device name: "DATA MODUL easyMaxTouch"
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 828
Min 0
Max 4095
Resolution 20
Event code 1 (ABS_Y)
Value 1144
Min 0
Max 4095
Resolution 26
Event code 47 (ABS_MT_SLOT)
Value 0
Min 0
Max 15
Event code 53 (ABS_MT_POSITION_X)
Value 0
Min 0
Max 4095
Resolution 20
Event code 54 (ABS_MT_POSITION_Y)
Value 0
Min 0
Max 4095
Resolution 26
Event code 57 (ABS_MT_TRACKING_ID)
Value 0
Min 0
Max 65535
Properties:
Property type 1 (INPUT_PROP_DIRECT)
Testing ... (interrupt to exit)



So far, so good. But at this points, when I try to execute a stupid App with four buttons, just one can press.

What is missing or what is wrong ?
Thank you ver much in advance.

d_stranz
12th April 2022, 18:28
I am pretty sure that the default higher-level behavior for QPushButton (and any class derived from QAbstractButton) is that only one button can be pressed at a time. If you want behavior that allows more than one "button" to be pressed simultaneously, then you will probably have to create your own widget to do this.

Even though multi-touch is enabled, by the time the event gets to a QAbstractButton, only one touch wins the race.

webquinty
13th April 2022, 22:41
Thank you very much for your response.

Maybe there is a mistake in my post. I have used QToolButton instead of QPusButton.
But anyway, QToolButton derives from QAbstractButton and surprisingly I have an application that I made years ago with several QToolButtons and 4 QDials and the multitouch works as expected.

I can press up to 10 QtoolButtons and I can operate 4 QDial with four fingers at the same time.
That's why I say I'm a bit confused, but thanks anyway and I'll try to figure out what I did.

Best regards

d_stranz
14th April 2022, 16:15
Perhaps you have auto-repeat enabled for these buttons and dials. I can't find any property of QAbstractButton that you can set to allow multiple buttons to be active simultaneously.

It is possible that at a higher level, the handler for the buttons is responding to the QAbstractButton::pressed() signals sent by the separate buttons. As long as there have been no QAbstractButton::released() signals in between presses, this would simulate multiple simultaneous button presses.

If your program handles the QAbstractButton::clicked() or QAbstractButton::toggled() signals instead, those correspond to a pressed / released sequence, so it is impossible to detect multiple button presses.