How can I get access to a QMessageBox by QTest
问题 I am creating some automated GUI tests in my application using QTest . I can access the widgets from my application using the command: savePushButton = mainWindow->findChild<QPushButton *>("savePushButton"); It is working fine, but now I have to click on the OK button of a QMessageBox . I created the QMessageBox in my application like this: if( something_wrong ) { QMessageBox::warning(new Widget(), "Title", "Something wrong!"); } How can I have access to this QMessageBox , and its buttons?