Hi, everyone
I use QTest/QTestEventList to simulate mouse events, but only succeed in mouseMoving.
mouseClick has not effect...
Hi, everyone
I use QTest/QTestEventList to simulate mouse events, but only succeed in mouseMoving.
mouseClick has not effect...
Hi,
Did you reimplement the mouse move, press and release event in your widget class?
Hi, thanks first.
I don't reimplement the mouse events, and I don't know how.
Now I know Qt does process mouseClick, but maybe it just sends the event to the specified widget instead of really clicking at the position given.
Now I'm confused about how to make it click....thanks again.
To give a statement in detail, I use QTestEventList to addMouseMove, addMouseClick and addKeyClick(Qt::Key_Tab).
When run the program, mouse moved and focus passed to the next unit, but I really can not find mouseClick...
Hi, code below
eventList.addDelay(2000);
eventList.addMouseMove(pos);
eventList.addDelay(2000);
eventList.addMouseClick(Qt::LeftButton);
eventList.addDelay(2000);
eventList.addKeyClick(Qt::Key_Tab);
eventList.addDelay(2000);
eventList.addMouseClick(Qt::LeftButton);
eventList.addDelay(2000);
eventList.addKeyClick(Qt::Key_Tab);
eventList.addDelay(2000);
eventList.addMouseClick(Qt::RightButton);
eventList.addDelay(2000);
eventList.addKeyClick(Qt::Key_Tab);
eventList.addDelay(2000);
eventList.addKeyClick(Qt::Key_A);
eventList.addDelay(2000);
eventList.addKeyClick(Qt::Key_0);
eventList.simulate(this);
Bookmarks