mardi 15 avril 2014

C++/QT: Check for a QMessageBox and close it


Vote count:

0




I need to automate gui tests in c++ qt using qtest (in eclipse) I have given a function that adds some tabs to a tabwidget (up to max 9) and if you try to open a 10th tab, a QMessageBox appears:



QMessageBox::critical(this, "MAX9",
tr("Only a maximum of 9 tabs can be opened.\n"));


Because the whole menu with the "add tab" function and everything is private, I had to access the method using slots and signals from my testclass.


Now my question is, is there a way I can check whether there are ANY QMessageBoxes open and if yes, automatically close them?



asked 20 secs ago






Aucun commentaire:

Enregistrer un commentaire