]> Nutra Git (v1) - gamesguru/feather.git/commitdiff
Qt 6.7 + handles checkbox status change differently
authorgg <chown_tee@proton.me>
Tue, 13 Jan 2026 03:37:38 +0000 (22:37 -0500)
committergg <chown_tee@proton.me>
Tue, 13 Jan 2026 03:37:38 +0000 (22:37 -0500)
src/dialog/QrCodeDialog.cpp
src/widgets/NodeWidget.cpp

index 1710ae26cc87cd25972701b1ee7367bba9271662..6025d6f4728416005bf6cb38cd1f7c330d92bf0f 100644 (file)
@@ -40,7 +40,10 @@ void QrCodeDialog::saveImage() {
     }
 
     QFile file(filename);
-    file.open(QIODevice::WriteOnly);
+    if (!file.open(QIODevice::WriteOnly)) {
+        QMessageBox::critical(this, "Error", "Could not open file for writing.");
+        return;
+    }
     m_pixmap.save(&file, "PNG");
     QMessageBox::information(this, "Information", "QR code saved to file");
 }
index 995f07f463e1996265aaeea05a08ca89e1e8798d..49b2a6b4a1e77022dcb8dc3b388ab5a243d06947 100644 (file)
@@ -3,6 +3,7 @@
 
 #include "NodeWidget.h"
 #include "ui_NodeWidget.h"
+#include <QtGlobal>
 
 #include <QAction>
 #include <QDesktopServices>
@@ -21,8 +22,13 @@ NodeWidget::NodeWidget(QWidget *parent)
 
     connect(ui->btn_addCustomNodes, &QPushButton::clicked, this, &NodeWidget::onCustomAddClicked);
 
+#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0)
+    connect(ui->checkBox_websocketList, &QCheckBox::checkStateChanged, [this](Qt::CheckState state){
+        bool custom = (state == Qt::Unchecked);
+#else
     connect(ui->checkBox_websocketList, &QCheckBox::stateChanged, [this](int state){
         bool custom = (state == Qt::Unchecked);
+#endif
         ui->stackedWidget->setCurrentIndex(custom);
         ui->frame_addCustomNodes->setVisible(custom);
         conf()->set(Config::nodeSource, custom);