0

I would like to inject touch events such as "touchstart", "touchmove", "touchend" into the QWebEngineView. Then, I should be able to capture the events in my html page running in the webview for example using jquery like below :

$(document).on("touchstart",function() {
  console.log("Touchstart");
});

I tried using QMouseEvents as explained in this SO answer and it works. But not the QTouchEvents.

Any suggestions ?

  • Did you try to accept touch events by setting `setAttribute(Qt::WA_AcceptTouchEvents, true);` in your mainwindow? – Simon Aug 18 '17 at 11:30
  • Yes. I did ! still doesn't work. – Raghavendra L Aug 18 '17 at 11:45
  • Here is my code snippet : QTouchEvent *touch = new QTouchEvent(QEvent::TouchBegin, Q_NULLPTR, Qt::NoModifier, Qt::TouchPointStates(), touchPoints); QCoreApplication::postEvent(eventsReciverWidget, touch); – Raghavendra L Aug 18 '17 at 11:47

0 Answers0