/*!
\qmlproperty real QtQuick2::TouchPoint::pressure
+ \qmlproperty vector2d QtQuick2::TouchPoint::velocity
\qmlproperty rectangle QtQuick2::TouchPoint::area
These properties hold additional information about the current state of the touch point.
\list
\i \c pressure is a value in the range of 0.0 to 1.0.
+ \i \c velocity is a vector with magnitude reported in pixels per second.
\i \c area is a rectangle covering the area of the touch point, centered on the current position of the touch point.
\endlist
+
+ Not all touch devices support velocity. If velocity is not supported, it will be reported
+ as 0,0.
*/
void QQuickTouchPoint::setPressure(qreal pressure)
{
emit pressureChanged();
}
+void QQuickTouchPoint::setVelocity(const QVector2D &velocity)
+{
+ if (_velocity == velocity)
+ return;
+ _velocity = velocity;
+ emit velocityChanged();
+}
+
void QQuickTouchPoint::setArea(const QRectF &area)
{
if (_area == area)
dtp->setX(p->pos().x());
dtp->setY(p->pos().y());
dtp->setPressure(p->pressure());
+ dtp->setVelocity(p->velocity());
dtp->setArea(p->rect());
dtp->setStartX(p->startPos().x());
dtp->setStartY(p->startPos().y());
Q_PROPERTY(qreal x READ x NOTIFY xChanged)
Q_PROPERTY(qreal y READ y NOTIFY yChanged)
Q_PROPERTY(qreal pressure READ pressure NOTIFY pressureChanged)
+ Q_PROPERTY(QVector2D velocity READ velocity NOTIFY velocityChanged)
Q_PROPERTY(QRectF area READ area NOTIFY areaChanged)
Q_PROPERTY(qreal startX READ startX NOTIFY startXChanged)
qreal pressure() const { return _pressure; }
void setPressure(qreal pressure);
+ QVector2D velocity() const { return _velocity; }
+ void setVelocity(const QVector2D &velocity);
+
QRectF area() const { return _area; }
void setArea(const QRectF &area);
void xChanged();
void yChanged();
void pressureChanged();
+ void velocityChanged();
void areaChanged();
void startXChanged();
void startYChanged();
qreal _x;
qreal _y;
qreal _pressure;
+ QVector2D _velocity;
QRectF _area;
bool _qmlDefined;
bool _inUse; //whether the point is currently in use (only valid when _qmlDefined == true)