From a72e6d351f136e0cd5e0f9c178e5f09eb70ca2db Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Mon, 16 Mar 2009 16:04:13 +0100 Subject: Removed the use of QSharedPointer from gesture api - since QGesture are QObject now everything is much simplier. --- src/gui/graphicsview/qgraphicssceneevent.cpp | 8 ++++---- src/gui/graphicsview/qgraphicssceneevent.h | 7 +++---- src/gui/kernel/qevent.cpp | 6 +++--- src/gui/kernel/qevent.h | 5 ++--- src/gui/kernel/qgesture.h | 1 - 5 files changed, 12 insertions(+), 15 deletions(-) diff --git a/src/gui/graphicsview/qgraphicssceneevent.cpp b/src/gui/graphicsview/qgraphicssceneevent.cpp index c79e30b..b26f8cf 100644 --- a/src/gui/graphicsview/qgraphicssceneevent.cpp +++ b/src/gui/graphicsview/qgraphicssceneevent.cpp @@ -1773,7 +1773,7 @@ QList QGraphicsSceneGestureEvent::gestureTypes() const */ const QGesture* QGraphicsSceneGestureEvent::gesture(const QString &type) const { - return m_gestures.value(type, QSharedPointer()).data(); + return m_gestures.value(type, 0); } /*! @@ -1787,7 +1787,7 @@ const QGesture* QGraphicsSceneGestureEvent::gesture(Qt::GestureType type) const /*! Returns extended information about all gestures in the event. */ -QList > QGraphicsSceneGestureEvent::gestures() const +QList QGraphicsSceneGestureEvent::gestures() const { return m_gestures.values(); } @@ -1884,9 +1884,9 @@ QPolygonF QGraphicsSceneGestureEvent::mapToItem(const QRect &rect, QGraphicsItem /*! Set a list of gesture objects containing extended information about \a gestures. */ -void QGraphicsSceneGestureEvent::setGestures(const QList > &gestures) +void QGraphicsSceneGestureEvent::setGestures(const QList &gestures) { - foreach(const QSharedPointer &g, gestures) + foreach(QGesture *g, gestures) m_gestures.insert(g->gestureType(), g); } diff --git a/src/gui/graphicsview/qgraphicssceneevent.h b/src/gui/graphicsview/qgraphicssceneevent.h index d1a301e..244c25e 100644 --- a/src/gui/graphicsview/qgraphicssceneevent.h +++ b/src/gui/graphicsview/qgraphicssceneevent.h @@ -48,7 +48,6 @@ #include #include #include -#include QT_BEGIN_HEADER @@ -324,8 +323,8 @@ public: const QGesture* gesture(Qt::GestureType type) const; const QGesture* gesture(const QString &type) const; - QList > gestures() const; - void setGestures(const QList > &gestures); + QList gestures() const; + void setGestures(const QList &gestures); QSet cancelledGestures() const; void setCancelledGestures(const QSet &cancelledGestures); @@ -336,7 +335,7 @@ public: QPolygonF mapToItem(const QRect &rect, QGraphicsItem *item) const; protected: - QHash > m_gestures; + QHash m_gestures; QSet m_cancelledGestures; }; diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp index dbfe528..23a45b5 100644 --- a/src/gui/kernel/qevent.cpp +++ b/src/gui/kernel/qevent.cpp @@ -3537,7 +3537,7 @@ QGestureEvent::QGestureEvent(const QList &gestures, : QEvent(QEvent::Gesture), m_cancelledGestures(cancelledGestures) { foreach(QGesture *r, gestures) - m_gestures.insert(r->gestureType(), QSharedPointer(r)); + m_gestures.insert(r->gestureType(), r); } /*! @@ -3586,13 +3586,13 @@ const QGesture* QGestureEvent::gesture(Qt::GestureType type) const */ const QGesture* QGestureEvent::gesture(const QString &type) const { - return m_gestures.value(type, QSharedPointer()).data(); + return m_gestures.value(type, 0); } /*! Returns extended information about all gestures in the event. */ -QList > QGestureEvent::gestures() const +QList QGestureEvent::gestures() const { return m_gestures.values(); } diff --git a/src/gui/kernel/qevent.h b/src/gui/kernel/qevent.h index 41005d8..280ca79 100644 --- a/src/gui/kernel/qevent.h +++ b/src/gui/kernel/qevent.h @@ -54,7 +54,6 @@ #include #include #include -#include #include QT_BEGIN_HEADER @@ -728,12 +727,12 @@ public: const QGesture* gesture(Qt::GestureType type) const; const QGesture* gesture(const QString &type) const; - QList > gestures() const; + QList gestures() const; QSet cancelledGestures() const; protected: - QHash > m_gestures; + QHash m_gestures; QSet m_cancelledGestures; friend class QApplication; diff --git a/src/gui/kernel/qgesture.h b/src/gui/kernel/qgesture.h index b9e86a3..d4b2165 100644 --- a/src/gui/kernel/qgesture.h +++ b/src/gui/kernel/qgesture.h @@ -47,7 +47,6 @@ #include "qdatetime.h" #include "qpoint.h" #include "qrect.h" -#include "qsharedpointer.h" #include "qmetatype.h" QT_BEGIN_HEADER -- cgit v0.12