QList<QDialog*> allDialogs = this->findChildren<QDialog*>();foreach(QDialog* dialog, allDialogs) { dialog->reject();}