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


  • Qt Champions 2016

    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
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.