[Qt-interest] Qt embeded and touch events.
Thomas McGuire
thomas.mcguire at kdab.com
Fri Oct 21 02:12:12 CEST 2011
Hi Tom,
QWS does not support touch events.If you look at the tslib mouse driver plugin
from QWS [1], you'll see that touch events are translated to mouse events, so
the UI process only receives mouse events.
registerTouchWindow() does not exist on Linux. Basically it tells the window
system to deliver touch events if possible.
Also, even if the QWS tslib mouse driver would deliver touch events, tslib
does not support multitouch.
What you can do is write your own QWS mouse driver plugin that sends proper
touch events, not mouse events, to the UI process.
See also http://developer.qt.nokia.com/forums/viewthread/5052/#31134.
Qt 4.8 has a linuxinput driver that experimentally supports touch events, see
http://qt.gitorious.org/qt/qt/blobs/4.8/src/plugins/generic/linuxinput/qlinuxinput.cpp.
I heard it is not quite ready for prime-time though and has some bugs
regarding calibration. That is why QT_QPA_EXPERIMENTAL_TOUCHEVENT is not
defined by default.
So regardless of whether you use Qt 4.7 or 4.8, you need to change the
mouse/input driver to get touch to work.
Regards,
Thomas
[1] src/gui/embedded/qmousetslib_qws.cpp
On Thursday 20 October 2011 23:57:05 Tom Green wrote:
> I have qt-everywhere-opensource-src-4.7.1 built and installed on my system.
> I've configured it as an embedded system and enabled the tslib touch
> screen driver in the build. When in a widget I try to capture touch
> events or gesture events I never receive them. I explicitly set
> Qt::WA_AcceptTouchEvents in my widget. I have also looked at the code for
> the gesture system. It also attempts to set the AcceptTouchEvents flag.
> As I further look at the QT source in qwidget.cpp, at the bottom of
> setAttribute() the code to register a touch window is surrounded like so:
>
> #if defined (Q_WS_WIN) || defined(Q_WS_MAC) || defined (Q_OS_SYMBIAN)
> if (on)
> d->registerTouchWindow();
> #endif
>
> so, since my program is embedded and it is Q_WS_QWS it never performs the
> registration, and thus I never receive touch events. What do I need to do
> in an embedded system to be able to actually catch touch events?
--
Thomas McGuire | thomas.mcguire at kdab.com | Software Engineer
KDAB (Deutschland) GmbH&Co KG, a KDAB Group company
Tel. Germany +49-30-521325470, Sweden (HQ) +46-563-540090
KDAB - Qt Experts - Platform-independent software solutions
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3637 bytes
Desc: not available
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20111021/be2d209a/attachment.bin
More information about the Qt-interest-old
mailing list