/***************************************************************************
- * 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 *
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;