diff --git a/mainwindow.cpp b/mainwindow.cpp index a3e4396..ae79de8 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -170,21 +170,20 @@ void MainWindow::onReplaceLast(QString text, QString suffix) { } } - for (int i=0; iupdateStatus->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())); }