Qt 4.8
|
The TouchPoint class provides information about a touch point in a QTouchEvent. More...
#include <qevent.h>
Public Functions | |
int | id () const |
Returns the id number of this touch point. More... | |
bool | isPrimary () const |
Returns true if this touch point is the primary touch point. More... | |
QPointF | lastNormalizedPos () const |
Returns the normalized position of this touch point from the previous touch event. More... | |
QPointF | lastPos () const |
Returns the position of this touch point from the previous touch event, relative to the widget or QGraphicsItem that received the event. More... | |
QPointF | lastScenePos () const |
Returns the scene position of this touch point from the previous touch event. More... | |
QPointF | lastScreenPos () const |
Returns the screen position of this touch point from the previous touch event. More... | |
QPointF | normalizedPos () const |
Returns the normalized position of this touch point. More... | |
QTouchEvent::TouchPoint & | operator= (const QTouchEvent::TouchPoint &other) |
QPointF | pos () const |
Returns the position of this touch point, relative to the widget or QGraphicsItem that received the event. More... | |
qreal | pressure () const |
Returns the pressure of this touch point. More... | |
QRectF | rect () const |
Returns the rect for this touch point, relative to the widget or QGraphicsItem that received the event. More... | |
QPointF | scenePos () const |
Returns the scene position of this touch point. More... | |
QRectF | sceneRect () const |
Returns the rect for this touch point in scene coordinates. More... | |
QPointF | screenPos () const |
Returns the screen position of this touch point. More... | |
QRectF | screenRect () const |
Returns the rect for this touch point in screen coordinates. More... | |
void | setId (int id) |
void | setLastNormalizedPos (const QPointF &lastNormalizedPos) |
void | setLastPos (const QPointF &lastPos) |
void | setLastScenePos (const QPointF &lastScenePos) |
void | setLastScreenPos (const QPointF &lastScreenPos) |
void | setNormalizedPos (const QPointF &normalizedPos) |
void | setPos (const QPointF &pos) |
void | setPressure (qreal pressure) |
void | setRect (const QRectF &rect) |
void | setScenePos (const QPointF &scenePos) |
void | setSceneRect (const QRectF &sceneRect) |
void | setScreenPos (const QPointF &screenPos) |
void | setScreenRect (const QRectF &screenRect) |
void | setStartNormalizedPos (const QPointF &startNormalizedPos) |
void | setStartPos (const QPointF &startPos) |
void | setStartScenePos (const QPointF &startScenePos) |
void | setStartScreenPos (const QPointF &startScreenPos) |
void | setState (Qt::TouchPointStates state) |
QPointF | startNormalizedPos () const |
Returns the normalized starting position of this touch point. More... | |
QPointF | startPos () const |
Returns the starting position of this touch point, relative to the widget or QGraphicsItem that received the event. More... | |
QPointF | startScenePos () const |
Returns the starting scene position of this touch point. More... | |
QPointF | startScreenPos () const |
Returns the starting screen position of this touch point. More... | |
Qt::TouchPointState | state () const |
Returns the current state of this touch point. More... | |
TouchPoint (int id=-1) | |
Constructs a QTouchEvent::TouchPoint for use in a QTouchEvent. More... | |
TouchPoint (const QTouchEvent::TouchPoint &other) | |
Constructs a copy of other. More... | |
~TouchPoint () | |
Destroys the QTouchEvent::TouchPoint. More... | |
Properties | |
QTouchEventTouchPointPrivate * | d |
Friends | |
class | QApplication |
class | QApplicationPrivate |
The TouchPoint class provides information about a touch point in a QTouchEvent.
QTouchEvent::TouchPoint::TouchPoint | ( | int | id = -1 | ) |
Constructs a QTouchEvent::TouchPoint for use in a QTouchEvent.
Definition at line 4408 of file qevent.cpp.
QTouchEvent::TouchPoint::TouchPoint | ( | const QTouchEvent::TouchPoint & | other | ) |
Constructs a copy of other.
Definition at line 4419 of file qevent.cpp.
QTouchEvent::TouchPoint::~TouchPoint | ( | ) |
Destroys the QTouchEvent::TouchPoint.
Definition at line 4432 of file qevent.cpp.
int QTouchEvent::TouchPoint::id | ( | ) | const |
Returns the id number of this touch point.
Id numbers are globally sequential, starting at zero, meaning the first touch point in the application has id 0, the second has id 1, and so on.
Definition at line 4445 of file qevent.cpp.
Referenced by QGraphicsScenePrivate::findClosestTouchPointId(), QApplicationPrivate::findClosestTouchPointId(), QApplication::notify(), QGraphicsScenePrivate::sendTouchBeginEvent(), setId(), QGraphicsScenePrivate::touchEventHandler(), QApplicationPrivate::translateRawTouchEvent(), and QDeclarativePinchArea::updatePinch().
bool QTouchEvent::TouchPoint::isPrimary | ( | ) | const |
Returns true if this touch point is the primary touch point.
The primary touch point is the point for which the windowing system generates mouse events.
Definition at line 4462 of file qevent.cpp.
Referenced by QWidget::event(), and QApplicationPrivate::translateRawTouchEvent().
QPointF QTouchEvent::TouchPoint::lastNormalizedPos | ( | ) | const |
Returns the normalized position of this touch point from the previous touch event.
The coordinates are normalized to the size of the touch device, i.e. (0,0) is the top-left corner and (1,1) is the bottom-right corner.
Definition at line 4612 of file qevent.cpp.
Referenced by setLastNormalizedPos().
QPointF QTouchEvent::TouchPoint::lastPos | ( | ) | const |
Returns the position of this touch point from the previous touch event, relative to the widget or QGraphicsItem that received the event.
Definition at line 4571 of file qevent.cpp.
Referenced by QApplication::notify(), setLastPos(), and QGraphicsViewPrivate::translateTouchEvent().
QPointF QTouchEvent::TouchPoint::lastScenePos | ( | ) | const |
Returns the scene position of this touch point from the previous touch event.
The scene position is the position in QGraphicsScene coordinates if the QTouchEvent is handled by a QGraphicsItem::touchEvent() reimplementation, and identical to the screen position for widgets.
Definition at line 4587 of file qevent.cpp.
Referenced by setLastScenePos(), and QGraphicsScenePrivate::updateTouchPointsForItem().
QPointF QTouchEvent::TouchPoint::lastScreenPos | ( | ) | const |
Returns the screen position of this touch point from the previous touch event.
Definition at line 4598 of file qevent.cpp.
Referenced by QPinchGestureRecognizer::recognize(), setLastScreenPos(), QApplicationPrivate::translateRawTouchEvent(), and QApplicationPrivate::updateTouchPointsForWidget().
QPointF QTouchEvent::TouchPoint::normalizedPos | ( | ) | const |
Returns the normalized position of this touch point.
The coordinates are normalized to the size of the touch device, i.e. (0,0) is the top-left corner and (1,1) is the bottom-right corner.
Definition at line 4511 of file qevent.cpp.
Referenced by setNormalizedPos(), and QApplicationPrivate::translateRawTouchEvent().
QTouchEvent::TouchPoint & QTouchEvent::TouchPoint::operator= | ( | const QTouchEvent::TouchPoint & | other | ) |
Definition at line 4807 of file qevent.cpp.
QPointF QTouchEvent::TouchPoint::pos | ( | ) | const |
Returns the position of this touch point, relative to the widget or QGraphicsItem that received the event.
Definition at line 4473 of file qevent.cpp.
Referenced by QWidget::event(), QPanGestureRecognizer::recognize(), QTapGestureRecognizer::recognize(), QTapAndHoldGestureRecognizer::recognize(), QApplicationPrivate::translateRawTouchEvent(), and QDeclarativePinchArea::updatePinch().
qreal QTouchEvent::TouchPoint::pressure | ( | ) | const |
Returns the pressure of this touch point.
The return value is in the range 0.0 to 1.0.
Definition at line 4657 of file qevent.cpp.
Referenced by setPressure(), and QApplicationPrivate::translateRawTouchEvent().
QRectF QTouchEvent::TouchPoint::rect | ( | ) | const |
Returns the rect for this touch point, relative to the widget or QGraphicsItem that received the event.
The rect is centered around the point returned by pos().
Definition at line 4624 of file qevent.cpp.
Referenced by QApplication::notify(), setRect(), and QGraphicsViewPrivate::translateTouchEvent().
QPointF QTouchEvent::TouchPoint::scenePos | ( | ) | const |
Returns the scene position of this touch point.
The scene position is the position in QGraphicsScene coordinates if the QTouchEvent is handled by a QGraphicsItem::touchEvent() reimplementation, and identical to the screen position for widgets.
Definition at line 4488 of file qevent.cpp.
Referenced by QGraphicsScenePrivate::findClosestTouchPointId(), QGraphicsScenePrivate::sendTouchBeginEvent(), QGraphicsScenePrivate::touchEventHandler(), and QDeclarativePinchArea::updatePinch().
QRectF QTouchEvent::TouchPoint::sceneRect | ( | ) | const |
Returns the rect for this touch point in scene coordinates.
Definition at line 4636 of file qevent.cpp.
Referenced by setSceneRect(), and QGraphicsScenePrivate::updateTouchPointsForItem().
QPointF QTouchEvent::TouchPoint::screenPos | ( | ) | const |
Returns the screen position of this touch point.
Definition at line 4498 of file qevent.cpp.
Referenced by QWidget::event(), QApplicationPrivate::findClosestTouchPointId(), QPinchGestureRecognizer::recognize(), QSwipeGestureRecognizer::recognize(), QTapGestureRecognizer::recognize(), QGraphicsScenePrivate::sendTouchBeginEvent(), QGraphicsScenePrivate::touchEventHandler(), QApplicationPrivate::translateRawTouchEvent(), and QApplicationPrivate::translateTouchEvent().
QRectF QTouchEvent::TouchPoint::screenRect | ( | ) | const |
Returns the rect for this touch point in screen coordinates.
Definition at line 4648 of file qevent.cpp.
Referenced by setScreenRect(), QApplicationPrivate::translateRawTouchEvent(), and QApplicationPrivate::updateTouchPointsForWidget().
void QTouchEvent::TouchPoint::setId | ( | int | id | ) |
Definition at line 4663 of file qevent.cpp.
Referenced by QWindowSystemInterface::handleTouchEvent().
void QTouchEvent::TouchPoint::setLastNormalizedPos | ( | const QPointF & | lastNormalizedPos | ) |
Definition at line 4767 of file qevent.cpp.
void QTouchEvent::TouchPoint::setLastPos | ( | const QPointF & | lastPos | ) |
Definition at line 4743 of file qevent.cpp.
Referenced by QGraphicsScenePrivate::updateTouchPointsForItem().
void QTouchEvent::TouchPoint::setLastScenePos | ( | const QPointF & | lastScenePos | ) |
Definition at line 4751 of file qevent.cpp.
Referenced by QGraphicsViewPrivate::translateTouchEvent().
void QTouchEvent::TouchPoint::setLastScreenPos | ( | const QPointF & | lastScreenPos | ) |
Definition at line 4759 of file qevent.cpp.
void QTouchEvent::TouchPoint::setNormalizedPos | ( | const QPointF & | normalizedPos | ) |
Definition at line 4703 of file qevent.cpp.
Referenced by QWindowSystemInterface::handleTouchEvent(), and QApplicationPrivate::translateTouchEvent().
void QTouchEvent::TouchPoint::setPos | ( | const QPointF & | pos | ) |
Definition at line 4679 of file qevent.cpp.
void QTouchEvent::TouchPoint::setPressure | ( | qreal | pressure | ) |
Definition at line 4799 of file qevent.cpp.
Referenced by QWindowSystemInterface::handleTouchEvent().
void QTouchEvent::TouchPoint::setRect | ( | const QRectF & | rect | ) |
Definition at line 4775 of file qevent.cpp.
Referenced by QWindowSystemInterface::handleTouchEvent(), and QGraphicsScenePrivate::updateTouchPointsForItem().
void QTouchEvent::TouchPoint::setScenePos | ( | const QPointF & | scenePos | ) |
Definition at line 4687 of file qevent.cpp.
void QTouchEvent::TouchPoint::setSceneRect | ( | const QRectF & | sceneRect | ) |
Definition at line 4783 of file qevent.cpp.
Referenced by QGraphicsViewPrivate::translateTouchEvent().
void QTouchEvent::TouchPoint::setScreenPos | ( | const QPointF & | screenPos | ) |
Definition at line 4695 of file qevent.cpp.
Referenced by QWindowSystemInterface::handleTouchEvent(), QTest::QTouchEventSequence::move(), QTest::QTouchEventSequence::press(), and QTest::QTouchEventSequence::release().
void QTouchEvent::TouchPoint::setScreenRect | ( | const QRectF & | screenRect | ) |
Definition at line 4791 of file qevent.cpp.
Referenced by QApplicationPrivate::translateTouchEvent().
void QTouchEvent::TouchPoint::setStartNormalizedPos | ( | const QPointF & | startNormalizedPos | ) |
Definition at line 4735 of file qevent.cpp.
void QTouchEvent::TouchPoint::setStartPos | ( | const QPointF & | startPos | ) |
Definition at line 4711 of file qevent.cpp.
Referenced by QGraphicsScenePrivate::updateTouchPointsForItem().
void QTouchEvent::TouchPoint::setStartScenePos | ( | const QPointF & | startScenePos | ) |
Definition at line 4719 of file qevent.cpp.
Referenced by QGraphicsViewPrivate::translateTouchEvent().
void QTouchEvent::TouchPoint::setStartScreenPos | ( | const QPointF & | startScreenPos | ) |
Definition at line 4727 of file qevent.cpp.
void QTouchEvent::TouchPoint::setState | ( | Qt::TouchPointStates | state | ) |
Definition at line 4671 of file qevent.cpp.
Referenced by QWindowSystemInterface::handleTouchEvent(), QTest::QTouchEventSequence::move(), QTest::QTouchEventSequence::press(), QTest::QTouchEventSequence::release(), QTest::QTouchEventSequence::stationary(), and QApplicationPrivate::translateTouchEvent().
QPointF QTouchEvent::TouchPoint::startNormalizedPos | ( | ) | const |
Returns the normalized starting position of this touch point.
The coordinates are normalized to the size of the touch device, i.e. (0,0) is the top-left corner and (1,1) is the bottom-right corner.
Definition at line 4560 of file qevent.cpp.
Referenced by setStartNormalizedPos(), and QApplicationPrivate::translateRawTouchEvent().
QPointF QTouchEvent::TouchPoint::startPos | ( | ) | const |
Returns the starting position of this touch point, relative to the widget or QGraphicsItem that received the event.
Definition at line 4522 of file qevent.cpp.
Referenced by QApplication::notify(), QPanGestureRecognizer::recognize(), QTapGestureRecognizer::recognize(), QTapAndHoldGestureRecognizer::recognize(), setStartPos(), QApplicationPrivate::translateRawTouchEvent(), and QGraphicsViewPrivate::translateTouchEvent().
QPointF QTouchEvent::TouchPoint::startScenePos | ( | ) | const |
Returns the starting scene position of this touch point.
The scene position is the position in QGraphicsScene coordinates if the QTouchEvent is handled by a QGraphicsItem::touchEvent() reimplementation, and identical to the screen position for widgets.
Definition at line 4537 of file qevent.cpp.
Referenced by setStartScenePos(), and QGraphicsScenePrivate::updateTouchPointsForItem().
QPointF QTouchEvent::TouchPoint::startScreenPos | ( | ) | const |
Returns the starting screen position of this touch point.
Definition at line 4547 of file qevent.cpp.
Referenced by QPanGestureRecognizer::recognize(), QPinchGestureRecognizer::recognize(), QSwipeGestureRecognizer::recognize(), QTapAndHoldGestureRecognizer::recognize(), setStartScreenPos(), QApplicationPrivate::translateRawTouchEvent(), and QApplicationPrivate::updateTouchPointsForWidget().
Qt::TouchPointState QTouchEvent::TouchPoint::state | ( | ) | const |
Returns the current state of this touch point.
Definition at line 4453 of file qevent.cpp.
Referenced by QDeclarativePinchArea::event(), QDeclarativePinchArea::sceneEventFilter(), setState(), QGraphicsScenePrivate::touchEventHandler(), QApplicationPrivate::translateRawTouchEvent(), QDeclarativePinchArea::updatePinch(), and QApplicationPrivate::updateTouchPointsForWidget().
|
friend |
|
friend |
|
private |
Definition at line 800 of file qevent.h.
Referenced by id(), isPrimary(), lastNormalizedPos(), lastPos(), lastScenePos(), lastScreenPos(), normalizedPos(), QApplication::notify(), operator=(), pos(), pressure(), rect(), scenePos(), sceneRect(), screenPos(), screenRect(), setId(), setLastNormalizedPos(), setLastPos(), setLastScenePos(), setLastScreenPos(), setNormalizedPos(), setPos(), setPressure(), setRect(), setScenePos(), setSceneRect(), setScreenPos(), setScreenRect(), setStartNormalizedPos(), setStartPos(), setStartScenePos(), setStartScreenPos(), setState(), startNormalizedPos(), startPos(), startScenePos(), startScreenPos(), state(), TouchPoint(), QApplicationPrivate::translateRawTouchEvent(), QApplicationPrivate::updateTouchPointsForWidget(), and ~TouchPoint().