QTouchEvent::TouchPoint pressure information
-
Hello,
I'm interrested in implementation of a QML Multitouch application
detecting the pressure level of the touch point.
When looking at the QTouchEvent::TouchPoint I can see the
pressure() method returning a real value between 0 and 1
Does anybody know wich kind of terminal (smartphone, tablet, ...)
is able to give back such information up to the Qt level.
Is there any standardisation for the driver encoding of such event.Thanks in advance
[moved to the qt quick subforum, Eddy]
-
I think QTouchEvent is deprecated
-
[quote author="aabc" date="1337527653"]I think QTouchEvent is deprecated[/quote]
QTouchEvent is certainly not deprecated. As for the pressure, QTouchEvent tries to hide the platform/driver differences by presenting a normalized value in range 0..1 with 1 being the maximum pressure.
-
How can I use QTouchEvent::TouchPoint in QML ?
-
Qt 5 has MultiPointTouchArea.
For Qt 4 there is no built-in solution but you can always handle the touch events in C++ and expose them to QML yourself. Alternatively there used to be a separate, experimental TouchArea element, see http://labs.qt.nokia.com/2011/02/08/a-toucharea-for-qml
-
How can I handle the touch events in C++ and expose them to QML myself ?
-
Implement a custom declarative item, reimplement event() and handle the touch events. This item can then have some signals to indicate a touch event has occured and a number of properties that provide the touch point data (position, etc.). This is exactly what QQuickMultiPointTouchArea (the implementation of MultiPointTouchArea) does in Qt 5.
Alternatively, if a custom item is not desired, you could still install an event filter on the declarative view and expose the events/data to QML via a QObject.