Details
-
Bug
-
Resolution: Done
-
P2: Important
-
None
-
5.13.0 Beta 1, 5.13.0 Beta2
-
None
-
-
7db9e02ad11c391c1d616defd11e7deb2718d60a
Description
Single tap on mobile browsers (tested with firefox and chrome) generates additional mouse press event, making everything double click.
This is the log of an even filter (generated by one tap):
QEvent::TouchBegin QEvent::TouchBegin QEvent::TouchEnd QEvent::TouchEnd QEvent::UpdateRequest QEvent::MouseMove QEvent::MouseButtonPress QEvent::MouseButtonPress QEvent::MouseButtonRelease QEvent::MouseButtonRelease QEvent::UpdateRequest QEvent::Expose
There's also a >350ms delay between the touch and mouse events.
#include <QGuiApplication> #include <QQmlApplicationEngine> #include <QDebug> class WASMTouchFilter : public QObject { public: bool eventFilter(QObject *watched, QEvent *event) { if (event->type() >= QEvent::TouchBegin && event->type() <= QEvent::NativeGesture || event->type() >= QEvent::MouseButtonPress && event->type() <= QEvent::MouseMove) qDebug() << event->type(); return false; } }; int main(int argc, char *argv[]) { QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QGuiApplication app(argc, argv); app.installEventFilter(new WASMTouchFilter()); QQmlApplicationEngine engine; engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); if (engine.rootObjects().isEmpty()) return -1; return app.exec(); }
Unable to find source-code formatter for language: qml. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
import QtQuick 2.12 import QtQuick.Controls 2.4 ApplicationWindow { visible: true width: 640 height: 480 title: qsTr("Hello World") Button { onClicked: console.debug("click") } }