Touchscreen not working with any Qt based application. But it works fine with GTK ones.
Unsolved
General and Desktop
-
I can't get touch to work with Qt widgets or QML based applications. The touchscreen (part of a multi-monitor setup) does work with GTK no problem. But any tap on a Qt based application gets completely ignored.
I'm trying to develop a touch-based application on Fedora Linux using Qt Creator. Any idea what could be causing this problem?
-
Have you done this on your widget:
setAttribute(Qt::WA_AcceptTouchEvents);
-
Also, please share a minimal example of what you try to do
-
@Asperamanca I have set that flag in QML. But even if that was the only problem in my case, I don't understand why Qt based apps don't even register taps as clicks by default like GTK does.
Here's the code for my simple app.
import QtQuick import QtQuick.Window import QtQuick.Controls import QtQuick.Dialogs Window { width: 640 height: 480 visible: true title: qsTr("Hello World") flags: Qt.WA_AcceptTouchEvents Rectangle { id: button signal clicked property alias text: buttonLabel.text height: 50 width: 150 radius: 3 color: "gray" TapHandler { id: tapHandler onTapped: console.log("clicked2") } MouseArea { anchors.fill: parent onClicked: console.log("clicked") } Text { id: buttonLabel text: "Click Me" color: palette.buttonText anchors.centerIn: parent } } }