Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QtWebEngine
  4. Send Mouse Click to WebEngineView

Send Mouse Click to WebEngineView

Scheduled Pinned Locked Moved Solved QtWebEngine
2 Posts 2 Posters 1.9k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • updatesvcU Offline
    updatesvcU Offline
    updatesvc
    wrote on last edited by updatesvc
    #1

    I am making a WebAutomation tool,I would like to know how I could send mouse events to the WebEngineView.
    Here are some things I have tried but haven't work.

    event= createMouseEvent(QEvent::MouseButtonPress, QPoint(mouse_x,mouse_y), Qt::LeftButton, Qt::LeftButton, Qt::NoModifier);
    QApplication::instance()->sendEvent(view,event);
    

    and

    QTestEventList eventos;
    eventos.addMouseClick(Qt::LeftButton, 0, QPoint(mouse_x,mouse_y), -1);
        eventos.simulate(view);
    

    where view is a QWebEngine View.
    I know that one can use javascript methods for clicking .But i would like to provide the user with a method of using mouse coordinates instead.

    i would prefer a solution thats cross platform and can work when the window is minimised or not in view.

    A noob friendly explanation will be greatly apprecieated.
    Please help.
    Thanks in advance.

    1 Reply Last reply
    0
    • T Offline
      T Offline
      ThatDud3
      wrote on last edited by
      #2

      You can try the suggested solution here

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved