Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Touchscreen not working (Ntrig/Wacom)
cemos last edited by
Problem in short form:
I have a Sony Vaio Duo with an Ntrig Digitizer with touchscreen and Stylus. However, my Qt5 application is not receiving touch events,
Platform is Linux/X11, with Xinput2.2, using PyQt5, and the Ntrig is running with the Wacom Tablet driver (XInput Multitouch driver does not really support stylus).
My application does get tablet events, but these are of no use with the QScroller...
My main point is that everything works fine in GTK3 . For example in Evince, I can select with mouse/touchpad/stylus, but scroll with my fingers. This is exactly the behavior that i'd like to have.
My Python Code:
from PyQt5.QtWebKitWidgets import *
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
app = QApplication(sys.argv)
def eventFilter(self, target, event):
if event.type() == QEvent.ScrollPrepare:
p = view.page()
f = p.frameAt(event.startPos().toPoint())
self.f = f
pos = QPointF(f.scrollBarValue(1), f.scrollBarValue(0))
rang = QRectF(QPointF(0,0), QPointF(f.scrollBarMaximum(1), f.scrollBarMaximum(0)))
self.ev = event
if event.type() == QEvent.Scroll:
self.ev = event
print event return False
view = QWebView()
f = Filter()
This works so far, but I'd like to set the QScroller to take only touch events, or make it react to TabletEvents.
(As a note by, QScroller with WebVew seems broken, the qtwebkit-examples/examples/webkitwidgets/scroller/plot/ example does not not work and there does not seem to be any code in QtWebView for handling of a QScroller, thats why I handle these events in the Filter class.)
thanks in advance,