X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fuisupport%2Ftreeviewtouch.cpp;h=4aae13d009487018d24ae9918800562e6599a808;hb=2c8434f74c68194d56f2084f637419123e61d18b;hp=067ac13b99ccaa337675fba365f00150081e0dee;hpb=68878dc8366f2f4a0afe132847aad9a51a80cdbf;p=quassel.git diff --git a/src/uisupport/treeviewtouch.cpp b/src/uisupport/treeviewtouch.cpp index 067ac13b..4aae13d0 100644 --- a/src/uisupport/treeviewtouch.cpp +++ b/src/uisupport/treeviewtouch.cpp @@ -33,11 +33,7 @@ TreeViewTouch::TreeViewTouch(QWidget *parent) bool TreeViewTouch::event(QEvent *event) { -#if QT_VERSION >= 0x050000 if (event->type() == QEvent::TouchBegin && ((QTouchEvent*)event)->device()->type()==QTouchDevice::TouchScreen) { -#else - if (event->type() == QEvent::TouchBegin && ((QTouchEvent*)event)->deviceType()==QTouchEvent::TouchScreen) { -#endif // Register that we may be scrolling, set the scroll mode to scroll-per-pixel // and accept the event (return true) so that we will receive TouchUpdate and TouchEnd/TouchCancel _touchScrollInProgress = true; @@ -62,11 +58,7 @@ bool TreeViewTouch::event(QEvent *event) { return true; } -#if QT_VERSION >= 0x050000 if (event->type() == QEvent::TouchEnd || event->type() == QEvent::TouchCancel) { -#else - if (event->type() == QEvent::TouchEnd) { -#endif // End scroll and reset variables _touchScrollInProgress = false; _firstTouchUpdateHappened = false; @@ -86,4 +78,4 @@ void TreeViewTouch::mousePressEvent(QMouseEvent *event) { void TreeViewTouch::mouseMoveEvent(QMouseEvent *event) { if (!_touchScrollInProgress) QTreeView::mouseMoveEvent(event); -}; +}