Hi,
I am trying to simulate the mouse click-move-release events without actually touch the mouse on a drawing application. What I did is
I find that it's easy to make the click and move events happen with a timer. However, the mouse move event took place instantly. I couldn't see the process while the mouse was moving. How could I simulate the mouse move event more accurately, just like I drag a mouse when clicked. I would like to make the mouse move by itself at different speed and in different path. I hope I've made myself clear enough.Code:QMouseEvent event_click(QEvent::MouseButtonPress, old_pos, Qt::LeftButton, Qt::LeftButton, Qt::NoModifier); QApplication::sendEvent(label, &event_click); QMouseEvent event_move(QEvent::MouseMove, new_pos, Qt::NoButton, Qt::LeftButton, Qt::NoModifier); QApplication::sendEvent(label, &event_move);
Thank you.


Reply With Quote

