Qt 5.5 - Touch / multitouch does not work with Ubuntu 14.04

I am trying to create a Qt Widgets application that supports multi-touch. I am using a tablet with Ubuntu 14.04, QtCreator 3.5.0 and Qt 5.5.0. I'm going right on the tablet.

I tried to compile some of the Qt Quick and Qt Widgets examples like this , this and this . All of them are well compiled, and all of them support mice and events with one touch, but none of them supports multi-touch.

I tried to change the source code of the last of the following examples:

bool ImageWidget::event(QEvent *event) { std::cout << GetEvent(event).toStdString() << std::endl; if (event->type() == QEvent::Gesture) return gestureEvent(static_cast<QGestureEvent*>(event)); return QWidget::event(event); } QString ImageWidget::GetEvent(const QEvent * ev) { static int eventEnumIndex = QEvent::staticMetaObject .indexOfEnumerator("Type"); QString result; result.append("QEvent"); if (ev) { QString name = QEvent::staticMetaObject .enumerator(eventEnumIndex).valueToKey(ev->type()); if (!name.isEmpty()) result.append(name); else result.append(ev->type()); } else { result.append( "foo"); } return result; } 

And all the output that I get when I try to touch the drag and drop of an element is mouse events:

 QEventMouseButtonPress QEventMouseMove QEventMouseMove QEventMouseMove QEventMouseMove QEventMouseMove QEventMouseMove QEventMouseButtonRelease QEventLeave 

Other apps (like Google Chrome or Ubuntu) handle multitouch well, so I think this has something to do with Qt.

XInput points to current versions:

 xinput version 1.6.1 XI version on server: 2.3 

I am relatively new to Qt and Ubuntu in general, so the problem may be quite simple, but googling did not give me any results. Thank you for your help.

UPDATE

In addition, I would appreciate if someone shared their experience using touch with Qt on Ubuntu or other Linux-based distributions, so that I can find out if this is a bug in the OS or something related to the hardware.

+5
source share
1 answer

To implement multiple touches of a single widget, we need different events, not QEventMouseButtonPress, etc. New types of events appear, such as TouchBegin, TouchUpdate, TouchEnd and the new TouchEventsClass.

For a better understanding, follow the link http://www.slideshare.net/qtbynokia/using-multitouch-and-gestures-with-qt

0
source

All Articles