diff options
author | David Boddie <dboddie@trolltech.com> | 2009-10-13 17:20:40 (GMT) |
---|---|---|
committer | David Boddie <dboddie@trolltech.com> | 2009-10-16 15:15:19 (GMT) |
commit | 0266b3d62eb9f091c93dc6b2c59eaad0f64ddedc (patch) | |
tree | de3da46df6b0086a7228c174c7963d9b30e165cb /src/gui/kernel/qgesture.cpp | |
parent | 06d1c12c24c38b0cd8822b1faf2694c7331f75cb (diff) | |
download | Qt-0266b3d62eb9f091c93dc6b2c59eaad0f64ddedc.zip Qt-0266b3d62eb9f091c93dc6b2c59eaad0f64ddedc.tar.gz Qt-0266b3d62eb9f091c93dc6b2c59eaad0f64ddedc.tar.bz2 |
Doc: Gesture API documentation review and improvements.
Reviewed-by: Trust Me
Diffstat (limited to 'src/gui/kernel/qgesture.cpp')
-rw-r--r-- | src/gui/kernel/qgesture.cpp | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/src/gui/kernel/qgesture.cpp b/src/gui/kernel/qgesture.cpp index 3639a45..6231d19 100644 --- a/src/gui/kernel/qgesture.cpp +++ b/src/gui/kernel/qgesture.cpp @@ -51,11 +51,14 @@ QT_BEGIN_NAMESPACE \brief The QGesture class represents a gesture, containing properties that describe the corresponding user input. - QGesture objects are delivered to widgets and \l{QGraphicsObject}s with - \l{QGestureEvent}s. + Gesture objects are not constructed directly by developers. They are created by + the QGestureRecognizer object that is registered with the application; see + QApplication::registerGestureRecognizer(). + + \section1 Gesture Properties The class has a list of properties that can be queried by the user to get - some gesture-specific arguments. For example, the QPinchGesture gesture has a scale + some gesture-specific arguments. For example, the pinch gesture has a scale factor that is exposed as a property. Developers of custom gesture recognizers can add additional properties in @@ -63,6 +66,23 @@ QT_BEGIN_NAMESPACE by adding new dynamic properties to a QGesture object, or by subclassing the QGesture class (or one of its subclasses). + \section1 Lifecycle of a Gesture Object + + A QGesture instance is created when the application calls QWidget::grabGesture() + or QGraphicsObject::grabGesture() to configure a widget or graphics object (the + target object) for gesture input. One gesture object is created for each target + object. + + The registered gesture recognizer monitors the input events for the target + object via its \l{QGestureRecognizer::}{filterEvent()} function, updating the + properties of the gesture object as required. + + The gesture object may be delivered to the target object in a QGestureEvent if + the corresponding gesture is active or has just been canceled. Each event that + is delivered contains a list of gesture objects, since support for more than + one gesture may be enabled for the target object. Due to the way events are + handled in Qt, gesture events may be filtered by other objects. + \sa QGestureEvent, QGestureRecognizer */ |