summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis Dzyubenko <denis.dzyubenko@nokia.com>2009-05-26 14:04:14 (GMT)
committerDenis Dzyubenko <denis.dzyubenko@nokia.com>2009-05-27 16:04:30 (GMT)
commit66ad0efd1fbec94436f09fb8e2abb8c94bb89a44 (patch)
tree75c0f85d36f4dfc46d86d4b10fa2a39326b884b0
parent2a2ffa9231ce4f7bcb3c7e4ae93337b9e4cb2772 (diff)
downloadQt-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
-rw-r--r--src/gui/graphicsview/qgraphicsview.cpp16
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,