From 3e66760c26faf62e6d4c10f06a6ece36aa33d88c Mon Sep 17 00:00:00 2001 From: Andreas Suter Date: Wed, 11 Dec 2024 14:06:32 +0100 Subject: [PATCH] adopted for custom button handling qt5. --- src/musredit_qt5/musredit/PTextEdit.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/musredit_qt5/musredit/PTextEdit.cpp b/src/musredit_qt5/musredit/PTextEdit.cpp index 4841a742..b89c7a37 100644 --- a/src/musredit_qt5/musredit/PTextEdit.cpp +++ b/src/musredit_qt5/musredit/PTextEdit.cpp @@ -1418,18 +1418,18 @@ void PTextEdit::fileSavePrefs() QString msg(""); QMessageBox msgBox; msgBox.setText("Which Preferences do you want to open?"); - msgBox.addButton("Default", QMessageBox::AcceptRole); - msgBox.addButton("Custom", QMessageBox::AcceptRole); + QAbstractButton *def = msgBox.addButton("Default", QMessageBox::AcceptRole); + QAbstractButton *cust = msgBox.addButton("Custom", QMessageBox::AcceptRole); msgBox.setStandardButtons(QMessageBox::Cancel); int result = msgBox.exec(); if (result == QMessageBox::Cancel) { return; - } else if (result == 0) { // default dir + } else if (msgBox.clickedButton() == def) { // default dir fln = fAdmin->getDefaultPrefPathName(); msg = QString("Current Default Preferences Path-Name:\n") + fln; if (QMessageBox::information(this, "Info", msg, QMessageBox::Ok, QMessageBox::Cancel) == QMessageBox::Cancel) return; - } else if (result == 1) { // custom dir + } else if (msgBox.clickedButton() == cust) { // custom dir fln = QFileDialog::getSaveFileName( this, tr( "Save Prefs As" ), "musredit_startup.xml", tr( "xml-Files (*.xml);;All Files (*)" ) );