X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fuisupport%2Ftreeviewtouch.cpp;h=4aae13d009487018d24ae9918800562e6599a808;hp=0ef3b36630c24a730ae507c994dd646fa62b3af2;hb=00e1a9c29e792ba4d65dba21b7ba04131bcb13bc;hpb=5b164bbc62960cea62a31287f679197b623ad7ac diff --git a/src/uisupport/treeviewtouch.cpp b/src/uisupport/treeviewtouch.cpp index 0ef3b366..4aae13d0 100644 --- a/src/uisupport/treeviewtouch.cpp +++ b/src/uisupport/treeviewtouch.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2016 by the Quassel Project * + * Copyright (C) 2005-2018 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -33,7 +33,7 @@ TreeViewTouch::TreeViewTouch(QWidget *parent) bool TreeViewTouch::event(QEvent *event) { - if (event->type() == QEvent::TouchBegin) { + if (event->type() == QEvent::TouchBegin && ((QTouchEvent*)event)->device()->type()==QTouchDevice::TouchScreen) { // 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; @@ -58,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; @@ -82,4 +78,4 @@ void TreeViewTouch::mousePressEvent(QMouseEvent *event) { void TreeViewTouch::mouseMoveEvent(QMouseEvent *event) { if (!_touchScrollInProgress) QTreeView::mouseMoveEvent(event); -}; +}