From 584ffbc7091cba907a5da29beb0102f1009dfba5 Mon Sep 17 00:00:00 2001 From: Spiros Date: Wed, 12 Jun 2024 05:19:26 +0300 Subject: [PATCH] Add a custom button --- mainwindow.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mainwindow.cpp b/mainwindow.cpp index 98bb114..450da2a 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -321,10 +321,9 @@ void MainWindow::selfTestHandler(const QString &mode, const QString &name, const msgBox.setWindowTitle(tr("Test Already Running")); msgBox.setText(tr("A self-test is already being performed ") + percentage + tr("\nYou can press the Cancel button in order to abort the test that is currently running")); msgBox.setIcon(QMessageBox::Warning); - - QPushButton *cancelButton = msgBox.addButton(QMessageBox::Cancel); + QPushButton *cancelButton = msgBox.addButton(tr("Cancel"), QMessageBox::ActionRole); + cancelButton->setIcon(qApp->style()->standardIcon(QStyle::SP_DialogCancelButton)); msgBox.addButton(QMessageBox::Ok); - msgBox.exec(); if (msgBox.clickedButton() == cancelButton) {