diff options
author | Bradley T. Hughes <bradley.hughes@nokia.com> | 2009-06-11 12:00:50 (GMT) |
---|---|---|
committer | Bradley T. Hughes <bradley.hughes@nokia.com> | 2009-06-11 12:00:50 (GMT) |
commit | ecc7f07e612bf156afb7fa2dbcbd2288b9b32e79 (patch) | |
tree | 88bbdcb558ef7337d3d3621b3b706f004505c569 /src/gui/graphicsview/qgraphicssceneevent.h | |
parent | 666299f9074235185aa7372729c84a2639224601 (diff) | |
download | Qt-ecc7f07e612bf156afb7fa2dbcbd2288b9b32e79.zip Qt-ecc7f07e612bf156afb7fa2dbcbd2288b9b32e79.tar.gz Qt-ecc7f07e612bf156afb7fa2dbcbd2288b9b32e79.tar.bz2 |
remove duplicated code and API (merge QTouchEvent and QGraphicsSceneTouchEvent)
the API for these 2 classes is identical, the implementation is almost
identical, they share the same data structures, so bite the bullet and
merge them.
this means we go back to using screenPos() instead of globalPos()
again
Diffstat (limited to 'src/gui/graphicsview/qgraphicssceneevent.h')
-rw-r--r-- | src/gui/graphicsview/qgraphicssceneevent.h | 83 |
1 files changed, 1 insertions, 82 deletions
diff --git a/src/gui/graphicsview/qgraphicssceneevent.h b/src/gui/graphicsview/qgraphicssceneevent.h index 3eb5cce..93a7177 100644 --- a/src/gui/graphicsview/qgraphicssceneevent.h +++ b/src/gui/graphicsview/qgraphicssceneevent.h @@ -42,7 +42,7 @@ #ifndef QGRAPHICSSCENEEVENT_H #define QGRAPHICSSCENEEVENT_H -#include <QtGui/qevent.h> +#include <QtCore/qcoreevent.h> #include <QtCore/qpoint.h> #include <QtCore/qrect.h> #include <QtGui/qpolygon.h> @@ -60,7 +60,6 @@ QT_MODULE(Gui) class QMimeData; class QPointF; class QSizeF; -class QRectF; class QWidget; class QGraphicsSceneEventPrivate; @@ -350,86 +349,6 @@ protected: QSet<QString> m_cancelledGestures; }; -class QGraphicsSceneTouchEventPrivate; -class Q_GUI_EXPORT QGraphicsSceneTouchEvent : public QGraphicsSceneEvent -{ -public: - class Q_GUI_EXPORT TouchPoint - { - public: - TouchPoint(int id = -1); - TouchPoint(const TouchPoint &other); - ~TouchPoint(); - - int id() const; - void setId(int id); - - Qt::TouchPointState state() const; - void setState(Qt::TouchPointState state); - - QPointF pos() const; - void setPos(const QPointF &pos); - - QPointF startPos() const; - void setStartPos(const QPointF &startPos); - - QPointF lastPos() const; - void setLastPos(const QPointF &lastPos); - - QPointF scenePos() const; - void setScenePos(const QPointF &scenePos); - - QPointF startScenePos() const; - void setStartScenePos(const QPointF &startScenePos); - - QPointF lastScenePos() const; - void setLastScenePos(const QPointF &lastScenePos); - - QPointF screenPos() const; - void setScreenPos(const QPointF &screenPos); - - QPointF startScreenPos() const; - void setStartScreenPos(const QPointF &startScreenPos); - - QPointF lastScreenPos() const; - void setLastScreenPos(const QPointF &lastScreenPos); - - QRectF rect() const; - void setRect(const QRectF &rect); - - QRectF sceneRect() const; - void setSceneRect(const QRectF &sceneRect); - - QRectF screenRect() const; - void setScreenRect(const QRectF &screenRect); - - qreal pressure() const; - void setPressure(qreal pressure); - - TouchPoint &operator=(const TouchPoint &other); - - private: - TouchPoint(QTouchEventTouchPointPrivate *dd); - QTouchEventTouchPointPrivate *d; - friend class QGraphicsViewPrivate; - }; - - QGraphicsSceneTouchEvent(Type type = None); - ~QGraphicsSceneTouchEvent(); - - Qt::KeyboardModifiers modifiers() const; - void setModifiers(Qt::KeyboardModifiers modifiers); - - Qt::TouchPointStates touchPointStates() const; - void setTouchPointStates(Qt::TouchPointStates touchPointStates); - - const QList<QGraphicsSceneTouchEvent::TouchPoint> &touchPoints() const; - void setTouchPoints(const QList<QGraphicsSceneTouchEvent::TouchPoint> &touchPoints); - -private: - Q_DECLARE_PRIVATE(QGraphicsSceneTouchEvent); -}; - #endif // QT_NO_GRAPHICSVIEW QT_END_NAMESPACE |