From 7a215265994bca72bbc7fcc198048c2f6bb7527a Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Wed, 28 Oct 2009 12:05:26 +0100 Subject: Removed obsolete private field from the QGesture and fixed the doc. Reviewed-by: Thomas Zander --- src/gui/kernel/qgesture.cpp | 11 +++++------ src/gui/kernel/qgesture_p.h | 5 +---- src/gui/kernel/qgesturerecognizer.cpp | 2 +- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/src/gui/kernel/qgesture.cpp b/src/gui/kernel/qgesture.cpp index c302c51..b72fae0 100644 --- a/src/gui/kernel/qgesture.cpp +++ b/src/gui/kernel/qgesture.cpp @@ -69,10 +69,9 @@ QT_BEGIN_NAMESPACE \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. + A QGesture instance is implicitely created when needed and is owned by Qt, + so application developer should never destroy them or store a pointer to a + QGesture object. The registered gesture recognizer monitors the input events for the target object via its \l{QGestureRecognizer::}{filterEvent()} function, updating the @@ -133,8 +132,8 @@ QGesture::~QGesture() QWidget::mapFromGlobal() or QGestureEvent::mapToScene() to get a local hot-spot. - If the hot-spot is not set, the targetObject is used as the receiver of the - gesture event. + The hot-spot should be set by the gesture recognizer to allow gesture event + delivery to a QGraphicsObject. */ /*! diff --git a/src/gui/kernel/qgesture_p.h b/src/gui/kernel/qgesture_p.h index d2ef8a7..34fbb26 100644 --- a/src/gui/kernel/qgesture_p.h +++ b/src/gui/kernel/qgesture_p.h @@ -68,9 +68,7 @@ class QGesturePrivate : public QObjectPrivate public: QGesturePrivate() : gestureType(Qt::CustomGesture), state(Qt::NoGesture), - targetObject(0), - isHotSpotSet(false), - gestureCancelPolicy(0) + isHotSpotSet(false), gestureCancelPolicy(0) { } @@ -78,7 +76,6 @@ public: Qt::GestureType gestureType; Qt::GestureState state; QPointF hotSpot; - QObject *targetObject; uint isHotSpotSet : 1; uint gestureCancelPolicy : 2; }; diff --git a/src/gui/kernel/qgesturerecognizer.cpp b/src/gui/kernel/qgesturerecognizer.cpp index c2b26f0..2673be3 100644 --- a/src/gui/kernel/qgesturerecognizer.cpp +++ b/src/gui/kernel/qgesturerecognizer.cpp @@ -178,7 +178,7 @@ void QGestureRecognizer::reset(QGesture *gesture) QGesturePrivate *d = gesture->d_func(); d->state = Qt::NoGesture; d->hotSpot = QPointF(); - d->targetObject = 0; + d->isHotSpotSet = false; } } -- cgit v0.12