I have a QDialog with QDialogButtonBox widgets and I connected the received button signal to the slot in my QDialog subclass, for example:
void MyDialog::on_buttonBox_accepted() { QString errorString = this->inputErrorString(); if (errorString.isEmpty()) { // Do work here // code code code... this->accept(); } else { QMessageBox::critical(this, tr("Error"), tr("The following input errors have occurred:") + errorString); } }
However, the dialog closes after the message box is displayed; Obviously, the button automatically connects the received signal to the QDialog input jack (I want to name this slot manually). How can I prevent this, so I can take the manual approach described above?
source share