How to achieve mouse click in a QDialog while testing?

251 Views Asked by At

That's automated testing in Qt.

I've got an table of a class inheriting QAbstractItemView, which I get this way from a QDialog dialog:

    auto *table = window->findChild<QAbstractItemView *>("myTable");

I've got a point to click, which proves to be correct, QPoint clickPosition{x,y};. However, the click won't work:

    QTest::mouseClick(table, Qt::LeftButton, Qt::NoModifier,
                       clickPosition);

Any suggestions how to make it work?

0

There are 0 best solutions below