summaryrefslogtreecommitdiffstats
path: root/examples/multitouch/pinchzoom
diff options
context:
space:
mode:
authorBradley T. Hughes <bradley.hughes@nokia.com>2009-06-05 15:36:18 (GMT)
committerBradley T. Hughes <bradley.hughes@nokia.com>2009-06-05 15:36:18 (GMT)
commit66f1080dc931ea024014ab3153ef7b99039540d2 (patch)
tree4ff5c8fbc3ecaf508635fb915fbe7ec33e61646d /examples/multitouch/pinchzoom
parent8d8b3e03cfc36c72665494eaa9bb461ff18072a0 (diff)
downloadQt-66f1080dc931ea024014ab3153ef7b99039540d2.zip
Qt-66f1080dc931ea024014ab3153ef7b99039540d2.tar.gz
Qt-66f1080dc931ea024014ab3153ef7b99039540d2.tar.bz2
Compile after API updates
Diffstat (limited to 'examples/multitouch/pinchzoom')
-rw-r--r--examples/multitouch/pinchzoom/graphicsview.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/examples/multitouch/pinchzoom/graphicsview.cpp b/examples/multitouch/pinchzoom/graphicsview.cpp
index 0856639..b72da77 100644
--- a/examples/multitouch/pinchzoom/graphicsview.cpp
+++ b/examples/multitouch/pinchzoom/graphicsview.cpp
@@ -57,18 +57,18 @@ bool GraphicsView::event(QEvent *event)
case QEvent::TouchUpdate:
case QEvent::TouchEnd:
{
- QList<QTouchEvent::TouchPoint *> touchPoints = static_cast<QTouchEvent *>(event)->touchPoints();
+ QList<QTouchEvent::TouchPoint> touchPoints = static_cast<QTouchEvent *>(event)->touchPoints();
if (touchPoints.count() == 1) {
- const QTouchEvent::TouchPoint *touchPoint = touchPoints.first();
- QPointF delta = touchPoint->pos() - touchPoint->lastPos();
+ const QTouchEvent::TouchPoint &touchPoint = touchPoints.first();
+ QPointF delta = touchPoint.pos() - touchPoint.lastPos();
horizontalScrollBar()->setValue(horizontalScrollBar()->value() - delta.x());
verticalScrollBar()->setValue(verticalScrollBar()->value() - delta.y());
} else if (touchPoints.count() == 2) {
// determine scale factor
- const QTouchEvent::TouchPoint *touchPoint0 = touchPoints.first();
- const QTouchEvent::TouchPoint *touchPoint1 = touchPoints.last();
- const qreal scaleFactor = QLineF(touchPoint0->pos(), touchPoint1->pos()).length()
- / QLineF(touchPoint0->startPos(), touchPoint1->startPos()).length();
+ const QTouchEvent::TouchPoint &touchPoint0 = touchPoints.first();
+ const QTouchEvent::TouchPoint &touchPoint1 = touchPoints.last();
+ const qreal scaleFactor = QLineF(touchPoint0.pos(), touchPoint1.pos()).length()
+ / QLineF(touchPoint0.startPos(), touchPoint1.startPos()).length();
setTransform(QTransform().scale(scaleFactor, scaleFactor));
}
return true;