diff options
author | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-10-24 12:48:39 +0200 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-10-24 12:48:42 +0200 |
commit | 840f6a40e6218992b5b9d451ee3c0886a4846c89 (patch) | |
tree | 2b808decc7adf5218b810d2de6b45c5a8b4cfc42 /src/gui/kernel/qevent.cpp | |
parent | 109bf980b37fed405c6c1eb14cb9c83ff897e389 (diff) | |
parent | 2e3870fe37d36ccf4bd84eb90e1d5e08ad00c1bc (diff) |
Merge remote-tracking branch 'origin/stable' into dev
Change-Id: Ie56539b2e0be611a363b5f15ae5412a78d6945a2
Diffstat (limited to 'src/gui/kernel/qevent.cpp')
-rw-r--r-- | src/gui/kernel/qevent.cpp | 115 |
1 files changed, 115 insertions, 0 deletions
diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp index 15ed79c981..816419d155 100644 --- a/src/gui/kernel/qevent.cpp +++ b/src/gui/kernel/qevent.cpp @@ -2281,6 +2281,121 @@ QTabletEvent::~QTabletEvent() #endif // QT_NO_TABLETEVENT +/*! + \class QNativeGestureEvent + \since 5.2 + \brief The QNativeGestureEvent class contains parameters that describe a gesture event. + \inmodule QtGui + \ingroup events + + Native gesture events are generated by the operating system, typically by + interpreting touch events. Gesture events are high-level events such + as zoom or rotate. + + \table + \header + \li Event Type + \li Description + \li Touch equence + \row + \li Qt::ZoomNativeGesture + \li Magnification delta in percent. + \li OS X: Two-finger pinch. + \row + \li Qt::SmartZoomNativeGesture + \li Boolean magnification state. + \li OS X: Two-finger douple tap (trackpad) / One-finger douple tap (magic mouse). + \row + \li Qt::RotateNativeGesture + \li Rotation delta in degrees. + \li OS X: Two-finger rotate. + \endtable + + + In addition, BeginNativeGesture and EndNativeGesture are sent before and after + gesture event streams: + + BeginNativeGesture + ZoomNativeGesture + ZoomNativeGesture + ZoomNativeGesture + EndNativeGesture + + \sa Qt::NativeGestureType, QGestureEvent +*/ + +/*! + Constructs a native gesture event of type \a type. + + The points \a localPos, \a windowPos and \a screenPos specify the + gesture position relative to the receiving widget or item, + window, and screen, respectively. + + \a realValue is the OS X event parameter, \a sequenceId and \a intValue are the Windows event parameters. +*/ +QNativeGestureEvent::QNativeGestureEvent(Qt::NativeGestureType type, const QPointF &localPos, const QPointF &windowPos, + const QPointF &screenPos, qreal realValue, ulong sequenceId, quint64 intValue) + : QInputEvent(QEvent::NativeGesture), mGestureType(type), + mLocalPos(localPos), mWindowPos(windowPos), mScreenPos(screenPos), mRealValue(realValue), + mSequenceId(sequenceId), mIntValue(intValue) +{ } + +/*! + \fn QNativeGestureEvent::gestureType() const + \since 5.2 + + Returns the gesture type. +*/ + +/*! + \fn QNativeGestureEvent::value() const + \since 5.2 + + Returns the gesture value. The value should be interpreted based on the + gesture type. For example, a Zoom gesture provides a scale factor while a Rotate + gesture provides a rotation delta. + + \sa QNativeGestureEvent, gestureType() +*/ + +/*! + \fn QPoint QNativeGestureEvent::globalPos() const + \since 5.2 + + Returns the position of the gesture as a QPointF in screen coordinates +*/ + +/*! + \fn QPoint QNativeGestureEvent::pos() const + \since 5.2 + + Returns the position of the mouse cursor, relative to the widget + or item that received the event. +*/ + +/*! + \fn QPointF QNativeGestureEvent::localPos() const + \since 5.2 + + Returns the position of the gesture as a QPointF, relative to the + widget or item that received the event. +*/ + +/*! + \fn QPointF QNativeGestureEvent::screenPos() const + \since 5.2 + + Returns the position of the gesture as a QPointF in screen coordinates. +*/ + +/*! + \fn QPointF QNativeGestureEvent::windowPos() const + \since 5.2 + + Returns the position of the gesture as a QPointF, relative to the + window that received the event. +*/ + #ifndef QT_NO_DRAGANDDROP /*! Creates a QDragMoveEvent of the required \a type indicating |