X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fchatview.cpp;fp=src%2Fqtui%2Fchatview.cpp;h=cb9d740eeada428b69e4d9a0b67c1982c0ae7b1e;hp=7da0847b3dd129723cf404c1f6dd888a1fe080ad;hb=127226e3619358013ef821acdf9e80f615370b12;hpb=5b164bbc62960cea62a31287f679197b623ad7ac diff --git a/src/qtui/chatview.cpp b/src/qtui/chatview.cpp index 7da0847b..cb9d740e 100644 --- a/src/qtui/chatview.cpp +++ b/src/qtui/chatview.cpp @@ -109,7 +109,11 @@ bool ChatView::event(QEvent *event) } } - if (event->type() == QEvent::TouchBegin) { +#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 // Enable scrolling by draging, disable selecting/clicking content setDragMode(QGraphicsView::ScrollHandDrag); setInteractive(false); @@ -145,8 +149,11 @@ bool ChatView::event(QEvent *event) } // Applying the movement happens automatically by the drag-mode } - - if (event->type() == QEvent::Wheel || event->type() == QEvent::TouchBegin || event->type() == QEvent::TouchUpdate) { +#if QT_VERSION >= 0x050000 + if (event->type() == QEvent::Wheel || (event->type() == QEvent::TouchBegin && ((QTouchEvent*)event)->device()->type()==QTouchDevice::TouchScreen) || event->type() == QEvent::TouchUpdate) { +#else + if (event->type() == QEvent::Wheel || (event->type() == QEvent::TouchBegin && ((QTouchEvent*)event)->deviceType()==QTouchEvent::TouchScreen) || event->type() == QEvent::TouchUpdate) { +#endif if (!verticalScrollBar()->isVisible()) { scene()->requestBacklog(); return true;