I'm very new to Qt, and I need to simulate a click using the QTest Namespace and QTest::mouseClick. My problem is I would like to click a QMenu entry, defined as a QAction, but the mouseClick function doesn't allow me to pass this as an argument (only QWidgets or QWindows).
What could I do here?
You may use another way such direct triggers of your QAction's as far as you have them:
qAction->trigger();
This should have the same impact as mouse clicks in testing purposes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With