diff options
author | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2009-11-02 18:26:44 (GMT) |
---|---|---|
committer | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2009-11-03 10:26:08 (GMT) |
commit | 93e9bc06427c6a8e1b6d6f939cf53ae5c95e0827 (patch) | |
tree | b4e677abcb3b69dc602e29fe113041895f1e0e5f /src/corelib | |
parent | cfcfae65778f2e1e7fc3936c66689e3685f1cc77 (diff) | |
download | Qt-93e9bc06427c6a8e1b6d6f939cf53ae5c95e0827.zip Qt-93e9bc06427c6a8e1b6d6f939cf53ae5c95e0827.tar.gz Qt-93e9bc06427c6a8e1b6d6f939cf53ae5c95e0827.tar.bz2 |
Gesture api review.
Changes to the gesture api after the review.
Reviewed-by: Jasmin Blanchette
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/global/qnamespace.h | 17 | ||||
-rw-r--r-- | src/corelib/global/qnamespace.qdoc | 36 |
2 files changed, 18 insertions, 35 deletions
diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h index 561ffc1..efa6cc7 100644 --- a/src/corelib/global/qnamespace.h +++ b/src/corelib/global/qnamespace.h @@ -1715,19 +1715,12 @@ public: LastGestureType = ~0u }; - enum GestureContextFlag + enum GestureFlag { - WidgetGesture = 0, - WidgetWithChildrenGesture = 3, - - ItemGesture = WidgetGesture, - ItemWithChildrenGesture = WidgetWithChildrenGesture, - - GestureContext_Mask = 0x00ff, - AcceptPartialGesturesHint = 0x0100, - GestureContextHint_Mask = 0xff00 + DontStartGestureOnChildren = 0x01, + ReceivePartialGestures = 0x02 }; - Q_DECLARE_FLAGS(GestureContext, GestureContextFlag) + Q_DECLARE_FLAGS(GestureFlags, GestureFlag) enum NavigationMode { @@ -1762,7 +1755,7 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(Qt::MatchFlags) Q_DECLARE_OPERATORS_FOR_FLAGS(Qt::TextInteractionFlags) Q_DECLARE_OPERATORS_FOR_FLAGS(Qt::InputMethodHints) Q_DECLARE_OPERATORS_FOR_FLAGS(Qt::TouchPointStates) -Q_DECLARE_OPERATORS_FOR_FLAGS(Qt::GestureContext) +Q_DECLARE_OPERATORS_FOR_FLAGS(Qt::GestureFlags) typedef bool (*qInternalCallback)(void **); diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc index f2a8882..a00a72b 100644 --- a/src/corelib/global/qnamespace.qdoc +++ b/src/corelib/global/qnamespace.qdoc @@ -2910,45 +2910,35 @@ \value PanGesture A Pan gesture. \value PinchGesture A Pinch gesture. \value SwipeGesture A Swipe gesture. - \value CustomGesture User-defined gesture ID. - \value LastGestureType Last user gesture ID. + \value CustomGesture A flag that can be used to test if the gesture is a + user-defined gesture ID. + \omitvalue LastGestureType User-defined gestures are registered with the - QApplication::registerGestureRecognizer() function which generates a custom gesture ID - in the range of values from CustomGesture to LastGestureType. + QGestureRecognizer::registerRecognizer() function which generates a custom + gesture ID with the Qt::CustomGesture flag set. \sa QGesture, QWidget::grabGesture(), QGraphicsObject::grabGesture() */ /*! - \enum Qt::GestureContextFlag + \enum Qt::GestureFlag \since 4.6 - This enum type describes the context of a gesture. + This enum type describes additional flags that can be used when subscribing + to a gesture. - For a QGesture to trigger, the gesture recognizer should filter events for - a widget tree. This enum describes for which widget the gesture recognizer - should filter events: + \value DontStartGestureOnChildren By default gestures can start on the + widget or over any of its children. Use this flag to disable this and allow + a gesture to start on the widget only. - \value WidgetGesture Gestures can only start over the widget itself. - \value WidgetWithChildrenGesture Gestures can start on the widget or over - any of its children. - \value ItemGesture Gestures can only start over the item itself. - \value ItemWithChildrenGesture Gestures can start on the item or over - any of its children. - - \value AcceptPartialGesturesHint Allows any ignored gesture events to be + \value ReceivePartialGestures Allows any ignored gesture events to be propagated to parent widgets which have specified this hint. By default only gestures that are in the Qt::GestureStarted state are propagated and - the widget only gets the full gesture sequence starting with a gesture in + the widget always gets the full gesture sequence starting with a gesture in the Qt::GestureStarted state and ending with a gesture in the Qt::GestureFinished or Qt::GestureCanceled states. - \value GestureContext_Mask A mask for extracting the context type of the - context flags. - \value GestureContextHint_Mask A mask for extracting additional hints for - the context. - \sa QWidget::grabGesture(), QGraphicsObject::grabGesture() */ |