Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Control Mouse with Qt



  • Hello,
    I want do a simulation of click, double click, scroll of mouse .
    Can you give me a tips or some class i'll need for do that .

    Thanks


  • Lifetime Qt Champion

    hi and welcome
    You can use QTest module

    QTest::mouseMove ( myWidget, QPoint( 70, 100 ), -1 );
    QWidget *btn = myWidget->childAt(70, 100);
    if (btn) {
    QTest::mouseClick ( btn, Qt::LeftButton, Qt::NoModifier, QPoint( 70, 100 ), 100);
    }

    If you goal is an auto clicker of some sort then a tool like
    Autoit3 will be much faster for such task.


Log in to reply