diff options
author | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2009-05-26 14:04:14 (GMT) |
---|---|---|
committer | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2009-05-27 16:04:30 (GMT) |
commit | 66ad0efd1fbec94436f09fb8e2abb8c94bb89a44 (patch) | |
tree | 75c0f85d36f4dfc46d86d4b10fa2a39326b884b0 /src | |
parent | 2a2ffa9231ce4f7bcb3c7e4ae93337b9e4cb2772 (diff) | |
download | Qt-66ad0efd1fbec94436f09fb8e2abb8c94bb89a44.zip Qt-66ad0efd1fbec94436f09fb8e2abb8c94bb89a44.tar.gz Qt-66ad0efd1fbec94436f09fb8e2abb8c94bb89a44.tar.bz2 |
Replaced ?: operator with a switch statement to make it more explicit
Reviewed-By: Bradley T. Hughes
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/graphicsview/qgraphicsview.cpp | 16 |
1 files 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, |