From 66ad0efd1fbec94436f09fb8e2abb8c94bb89a44 Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Tue, 26 May 2009 16:04:14 +0200 Subject: Replaced ?: operator with a switch statement to make it more explicit Reviewed-By: Bradley T. Hughes --- src/gui/graphicsview/qgraphicsview.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/gui/graphicsview/qgraphicsview.cpp b/src/gui/graphicsview/qgraphicsview.cpp index 8c94451..1c081cf 100644 --- a/src/gui/graphicsview/qgraphicsview.cpp +++ b/src/gui/graphicsview/qgraphicsview.cpp @@ -2888,11 +2888,17 @@ bool QGraphicsView::viewportEvent(QEvent *event) if (d->scene && d->sceneInteractionAllowed) { // Convert and deliver the touch event to the scene. - QEvent::Type eventType = event->type() == QEvent::TouchBegin - ? QEvent::GraphicsSceneTouchBegin - : event->type() == QEvent::TouchEnd - ? QEvent::GraphicsSceneTouchEnd - : QEvent::GraphicsSceneTouchUpdate; + QEvent::Type eventType; + switch(event->type()) { + case QEvent::TouchUpdate: + eventType = QEvent::GraphicsSceneTouchUpdate; + break; + case QEvent::TouchBegin: + eventType = QEvent::GraphicsSceneTouchBegin; + break; + default: + eventType = QEvent::GraphicsSceneTouchEnd; + } QGraphicsSceneTouchEvent touchEvent(eventType); touchEvent.setWidget(viewport()); qt_convertTouchEventToGraphicsSceneTouchEvent(d, -- cgit v0.12