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 /examples/multitouch/knobs | |
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 'examples/multitouch/knobs')
-rw-r--r-- | examples/multitouch/knobs/knob.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/examples/multitouch/knobs/knob.cpp b/examples/multitouch/knobs/knob.cpp index d568167..b62d5b8 100644 --- a/examples/multitouch/knobs/knob.cpp +++ b/examples/multitouch/knobs/knob.cpp @@ -42,7 +42,7 @@ #include "knob.h" #include <QBrush> -#include <QGraphicsSceneTouchEvent> +#include <QTouchEvent> Knob::Knob() : QGraphicsEllipseItem(-50, -50, 100, 100) @@ -62,15 +62,15 @@ Knob::Knob() bool Knob::sceneEvent(QEvent *event) { switch (event->type()) { - case QEvent::GraphicsSceneTouchBegin: - case QEvent::GraphicsSceneTouchUpdate: - case QEvent::GraphicsSceneTouchEnd: + case QEvent::TouchBegin: + case QEvent::TouchUpdate: + case QEvent::TouchEnd: { - QGraphicsSceneTouchEvent *touchEvent = static_cast<QGraphicsSceneTouchEvent *>(event); + QTouchEvent *touchEvent = static_cast<QTouchEvent *>(event); if (touchEvent->touchPoints().count() == 2) { - const QGraphicsSceneTouchEvent::TouchPoint &touchPoint1 = touchEvent->touchPoints().first(); - const QGraphicsSceneTouchEvent::TouchPoint &touchPoint2 = touchEvent->touchPoints().last(); + const QTouchEvent::TouchPoint &touchPoint1 = touchEvent->touchPoints().first(); + const QTouchEvent::TouchPoint &touchPoint2 = touchEvent->touchPoints().last(); QLineF line1(touchPoint1.lastScenePos(), touchPoint2.lastScenePos()); QLineF line2(touchPoint1.scenePos(), touchPoint2.scenePos()); |