From 1dd3f43c8ae1dfac6ebfdc400590e1bddd927db7 Mon Sep 17 00:00:00 2001 From: gg Date: Mon, 12 Jan 2026 22:37:38 -0500 Subject: [PATCH] Qt 6.7 + handles checkbox status change differently --- src/dialog/QrCodeDialog.cpp | 5 ++++- src/widgets/NodeWidget.cpp | 6 ++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/dialog/QrCodeDialog.cpp b/src/dialog/QrCodeDialog.cpp index 1710ae26..6025d6f4 100644 --- a/src/dialog/QrCodeDialog.cpp +++ b/src/dialog/QrCodeDialog.cpp @@ -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"); } diff --git a/src/widgets/NodeWidget.cpp b/src/widgets/NodeWidget.cpp index 995f07f4..49b2a6b4 100644 --- a/src/widgets/NodeWidget.cpp +++ b/src/widgets/NodeWidget.cpp @@ -3,6 +3,7 @@ #include "NodeWidget.h" #include "ui_NodeWidget.h" +#include #include #include @@ -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); -- 2.52.0