Qt/patches: delete message boxes on close

This commit is contained in:
Megamouse 2024-08-14 19:34:37 +02:00
parent 76c0df849a
commit ce5ae56f67

View File

@ -1069,6 +1069,7 @@ void patch_manager_dialog::dropEvent(QDropEvent* event)
QMessageBox* mb = new QMessageBox(QMessageBox::Icon::Critical, tr("Validation failed"), message, QMessageBox::Ok, this);
mb->setInformativeText(tr("To see the error log, please click \"Show Details\"."));
mb->setDetailedText(tr("%0").arg(summary));
mb->setAttribute(Qt::WA_DeleteOnClose);
// Smartass hack to make the unresizeable message box wide enough for the changelog
const int log_width = QLabel(summary).sizeHint().width();
@ -1281,6 +1282,7 @@ bool patch_manager_dialog::handle_json(const QByteArray& data)
QMessageBox* mb = new QMessageBox(QMessageBox::Icon::Critical, tr("Validation failed"), message, QMessageBox::Ok, this);
mb->setInformativeText(tr("To see the error log, please click \"Show Details\"."));
mb->setDetailedText(tr("%0").arg(summary));
mb->setAttribute(Qt::WA_DeleteOnClose);
// Smartass hack to make the unresizeable message box wide enough for the changelog
const int log_width = QLabel(message).sizeHint().width();