Quantcast
Channel: QtWebEngine
Viewing all articles
Browse latest Browse all 13965

[[qanda:topic_unsolved]] Avoid that a long touch is translated to a right click

$
0
0

Apparently, in Chromium and hence QtWebEngine, a long press on a touch screen is translated to a right click (a long mouse-click works fine).
So I want to (try to) capture the touch events in a MouseArea and send them as mouse-click events to WebEngineView (other suggestions are welcomed!)

My QML looks like

    WebEngineView {
        id: webId
        anchors.fill: parent
        url: "https://www.qt.io"
    }

    MouseArea {
        anchors.fill: parent
        onClicked:  clickSimulator.emulateMouseClick(webId, mouse.x, mouse.y)
    }

where clickSimulator is a context property C++ object containing ao.

    Q_INVOKABLE void emulateMouseClick(QObject* webView, int mouseX, int mouseY) const;

and in this function, I would like to send QMouseEvents to this webView using QCoreApplication::sendEvent.

However, I can't seem to get this working.
When debugging, the emulateMouseClick received a QQmlPrivate::QQmlElement<QQuickWebEngineView>`.

I'm not sure how to proceed from here. Suggestions are appreciated.


Viewing all articles
Browse latest Browse all 13965

Latest Images

Trending Articles



Latest Images