}
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");
}
#include "NodeWidget.h"
#include "ui_NodeWidget.h"
+#include <QtGlobal>
#include <QAction>
#include <QDesktopServices>
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);