I want to test my QTreeView items. At the moment when I click on the items my UI is transitioning from one state to another. I want to do the same thing by simulating the mouse click.
I want to test my QTreeView items. At the moment when I click on the items my UI is transitioning from one state to another. I want to do the same thing by simulating the mouse click.
You can post a mouse press/mouse release event pair to the widget using QCoreApplication::postEvent()
I got the solution. If someone wants to simulate a mouse click on QTreeView items, you can use QTest::mouseClick( QWidget * widget, Qt::MouseButton button, Qt::KeyboardModifiers modifier = 0, QPoint pos = QPoint(), int delay = -1 ) function.For me it works like a charm.
Bookmarks