QT
development environment example
QtTouchPaintDemo
Demonstrates how to build a Qt
application that allows the user to paint in a window using both the mouse
and touches from a touch-pad or touch-screen, using Qt's touch events.
These events receive touch input from OS calls, such as WM_touch in Windows
and NSTouch in Mac OS X. In this application a simple widget is implemented
called "QPaintWidget", whereby when the user clicks in the window
or generates a touch, a trail of color will follow, with a label
identifying which mouse button is pressed or the index of a touch. The
touches are received as QTouchEvents in the widget.
QtTUIOPaintDemo
Demonstrates how to build a QT
application that allows the user to paint in a window using both the mouse
and touches from a TUIO server. The "QPaintWidget" is used again
in this demo, except this time it has outward facing functions for
receiving touches from any source. This demo shows how to set up a TUIO
client using the demonstration TUIO client implementation available on the
TUIO website, and then pass the received touches to the QPaintWidget.
QtUPDDPaintDemo
Demonstrates how to build a Qt
application that allows the user to paint in a window using both the mouse
and touches received via the UPDD API. The same implementation of
"QPaintWidget" is used as before in QtTUIOPaintDemo, except this
time touches are received from a callback registered with the UPDD and then
passed on to the widget for drawing.
Gesture calculation
The latest QTUPDDPAintDemo
program make use of the UPDD Gesture
API to show the gesture being performed and therefore the gesture
software must be running on the system to see the calculated gesture.
QtTouchPaintDemo uses Qt's own
gesture recognition for gestures. However, it seems that this doesn't work
consistently between platforms. In Windows 7 (not XP as Qt uses the
Windows 7 multitouch API), it will only detect "pinch",
"pan", and "tap" gestures in our touch screen tests. In
OS X, it can detect all gestures that Qt supports, but different ones will
be detected depending on if used with an Apple magic trackpad or a touch
screen with UPDDGestures running. Reading online, other developers are
seeing the same behavior, so we consider this an issue with Qt. We haven't
been able to get it to work at all in Linux so far when testing under
Ubuntu 11.10).
Examples
In this example, run under
Windows XP, the UPDD
server software is running service UPDD TUIO Client applications. Both
the UPDD and TUIO applications have been invoked and placed side-by-side. A
dual touch screen has been touched. TUIO app is drawing via TUIO events and
UPDD is drawing via the UPDD API Callback function.
In this example, with built in
gesture analysis, the rotate anti clockwise movement of the dual touch is
calculated and listed:
Notes
Executables are available for
Mac, Linux and Windows
Windows and Mac apps statically
linked with required libraries, Linux dynamically linked. UPDDPaintDemo
should be run in UPDD folder so as to access correct versions of tbapi.dll
and ACE_UPDD_n.n.n.DLL.
Windows may require you to
install the Microsoft Visual C++ Redistributable
Package. Applications will report that a required .DLL is missing if the
run-time is not installed.
|