X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fuisupport%2Ftreeviewtouch.cpp;h=96845ac4721c7e9eb11b3c9b03575c793f76388d;hb=7fccb74ec00f505d3a5485ad9592c37248c1e8c6;hp=0ef3b36630c24a730ae507c994dd646fa62b3af2;hpb=5b164bbc62960cea62a31287f679197b623ad7ac;p=quassel.git diff --git a/src/uisupport/treeviewtouch.cpp b/src/uisupport/treeviewtouch.cpp index 0ef3b366..96845ac4 100644 --- a/src/uisupport/treeviewtouch.cpp +++ b/src/uisupport/treeviewtouch.cpp @@ -33,7 +33,11 @@ TreeViewTouch::TreeViewTouch(QWidget *parent) bool TreeViewTouch::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 // 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;