Hi All,
I am trying to simulate a button click signal on an external event (presently I trying with Keyboard)
I tried sending an mouse event on the focused widget by the code given below. This code is not able to call the corresponding slot initialized in the constructor.
QMouseEvent mouseEvent(QEvent::MouseButtonPress,QCursor :: Pos(),Qt::LeftButton,Qt::LeftButton,Qt::NoModifier );
QApplication::sendEvent(this->focusWidget(), &mouseEvent);
And also I am not able to call mouse click simulation using QTest methods.
QTest::mouseClick(this->focusWidget(),Qt::LeftButton,Qt::NoModifier,QCurs or ::Pos());
Kindly give your valuable suggestion and help me in fixing this issue.
Thanks in Advance.
Ratheendran
Bookmarks