Hide button on error message box.

This commit is contained in:
Gerhard Hoffmann 2023-08-11 11:07:16 +02:00
parent c338884fc7
commit a932ed5471

View File

@ -170,21 +170,20 @@ void MainWindow::onReplaceLast(QString text, QString suffix) {
}
}
for (int i=0; i<lines.size(); ++i) {
qInfo() << lines.at(i);
} qInfo() << ""; qInfo() << "";
Utils::printLineEditInfo(lines);
ui->updateStatus->setText(lines.join('\n').trimmed());
ui->updateStatus->setEnabled(true);
}
void MainWindow::onShowErrorMessage(QString title, QString text) {
text = text.leftJustified(50, ' ');
QMessageBox msgBox(QMessageBox::NoIcon, title,
text, QMessageBox::Ok,
nullptr, Qt::FramelessWindowHint);
msgBox.setDefaultButton(QMessageBox::Ok);
msgBox.setStyleSheet("QDialog {background-color: red;}"
"QPushButton {background-color: blue;}");
msgBox.defaultButton()->setVisible(false);
QTimer *t = new QTimer(this);
connect(t, SIGNAL(timeout()), msgBox.defaultButton(), SLOT(click()));
t->setSingleShot(true);
@ -195,5 +194,4 @@ void MainWindow::onShowErrorMessage(QString title, QString text) {
} else {
// do something else
}
disconnect(t, SIGNAL(timeout()), msgBox.defaultButton(), SLOT(click()));
}