PDA

View Full Version : Simulating mouseclick on a HbAction from qtestlib



LearningCurve
3rd December 2009, 12:37
Hello Cute(Qt) friends,

Is it possible to simulate a mouse click on a HbAction which derives from QAction (considering that it is not a widget)?

Well, to add a bit of background information. I am trying to automate tests for a Qt application in the s60 environment. I am using the qtestlib framework.

I have a HbMenu(which is a QWidget) which has few HbAction's. I am able to simulate a mouse click on the HbMenu using,
void QTest::mouseClick ( QWidget * widget, Qt::MouseButton button, Qt::KeyboardModifiers modifier = 0, QPoint pos = QPoint(), int delay = -1 )

Now, when clicking the Menu, the drop down appears with items, which are HbAction's.

Now my question is how do I simulate a mouse click on an HbAction (which derives from QAction)?

Is it really possible Or is there another way to do it ? Any help would be much appreciated.

Thanks,
LC.

ecanela
4th December 2009, 01:16
the follow link whot the autotest class for the QAction class.

http://qt.gitorious.org/qt/qt/blobs/master/tests/auto/qaction/tst_qaction.cpp

the code to test a QAction subclass must be similiar to this.