summaryrefslogtreecommitdiff
path: root/quacker/letterbox.cpp
diff options
context:
space:
mode:
authorJohn Fultz <jfultz@wolfram.com>2023-07-19 22:30:09 -0500
committerJohn Fultz <jfultz@wolfram.com>2023-07-19 22:38:25 -0500
commit320c83c069f5fb2adb7fa9deeef1e16fe55232ae (patch)
tree963d585a2825897e40ce6d4a17ab6e1cc479f0cb /quacker/letterbox.cpp
parenteb8deb67284b5950a4748a091f52d1eb11284c39 (diff)
Fix QMessageBox deprecations.
Qt6 complains about the versions of the static function signatures we’re using for generating various QMessageBoxes. Except for the “Show plaintext board” dialog, which seems to be having some “special” issues in Qt6.
Diffstat (limited to 'quacker/letterbox.cpp')
-rw-r--r--quacker/letterbox.cpp25
1 files changed, 14 insertions, 11 deletions
diff --git a/quacker/letterbox.cpp b/quacker/letterbox.cpp
index 91c2ad9..2df5e55 100644
--- a/quacker/letterbox.cpp
+++ b/quacker/letterbox.cpp
@@ -65,16 +65,17 @@ bool Letterbox::tryToClose()
{
switch (askToSave())
{
- case 0:
+ case QMessageBox::Save:
qApp->processEvents();
writeFile();
// fall through
- case 1:
+ case QMessageBox::Discard:
return true;
- case 2:
+ case QMessageBox::Cancel:
+ default:
return false;
}
}
@@ -115,13 +116,14 @@ void Letterbox::open()
{
switch (askToSave())
{
- case 0:
+ case QMessageBox::Save:
writeFile();
- case 1:
+ case QMessageBox::Discard:
break;
- case 2:
+ case QMessageBox::Cancel:
+ default:
return;
}
}
@@ -145,13 +147,14 @@ void Letterbox::openParticularFile(const QString &filename)
{
switch (askToSave())
{
- case 0:
+ case QMessageBox::Save:
writeFile();
- case 1:
+ case QMessageBox::Discard:
break;
- case 2:
+ case QMessageBox::Cancel:
+ default:
return;
}
}
@@ -186,9 +189,9 @@ bool Letterbox::dictCheck()
return true;
}
-int Letterbox::askToSave()
+QMessageBox::StandardButton Letterbox::askToSave()
{
- return QMessageBox::warning(this, tr("Unsaved Results - Quackle Letterbox"), tr("There are unsaved results in the current Letterbox list. Save them?"), tr("&Save"), tr("&Discard"), tr("&Cancel"), 0, 2);
+ return QMessageBox::warning(this, tr("Unsaved Results - Quackle Letterbox"), tr("There are unsaved results in the current Letterbox list. Save them?"), QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel, QMessageBox::Save);
}
void Letterbox::generateList()