Despite setting setStandardButtons(0); it doesn't close the msgBox.
QMessageBox msgBox;
msgBox.setText("My List");
msgBox.setStyleSheet("QDialog { border: 1px solid black;}");
msgBox.setStandardButtons(0);
QTimer::singleShot(5000, &msgBox, SLOT(close()));
msgBox.exec();
Use accept instead of close.
msgBox.setStandardButtons(QMessageBox::NoButton);
QTimer::singleShot(5000, &msgBox, &QMessageBox::accept);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With