How to use QTest :: mouseClick with QAction

I am very new to Qt and I need to simulate a click using the namespace QTestand QTest::mouseClick. My problem is that I would like to click on a record QMenudefined as QAction, but the function mouseClickdoes not allow passing it as an argument (only QWidgetsor QWindows).

What can i do here?

+4
source share
2 answers

You can use another method of direct direct triggers of yours QAction's, as far as possible:

qAction->trigger();

This should have the same effect as mouse clicks for testing purposes.

+3
source

A QAction , .

, . QMenu QToolBar, .

, , , , .

0

Source: https://habr.com/ru/post/1657376/


All Articles