summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis Dzyubenko <denis.dzyubenko@nokia.com>2009-10-28 11:05:26 (GMT)
committerDenis Dzyubenko <denis.dzyubenko@nokia.com>2009-10-28 12:49:30 (GMT)
commit7a215265994bca72bbc7fcc198048c2f6bb7527a (patch)
tree26744ebac42ecda400d35e7e85095dcfec136a68
parent4f4c4fda9925f585128175796d04926863943dad (diff)
downloadQt-7a215265994bca72bbc7fcc198048c2f6bb7527a.zip
Qt-7a215265994bca72bbc7fcc198048c2f6bb7527a.tar.gz
Qt-7a215265994bca72bbc7fcc198048c2f6bb7527a.tar.bz2
Removed obsolete private field from the QGesture and fixed the doc.
Reviewed-by: Thomas Zander
-rw-r--r--src/gui/kernel/qgesture.cpp11
-rw-r--r--src/gui/kernel/qgesture_p.h5
-rw-r--r--src/gui/kernel/qgesturerecognizer.cpp2
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;
}
}