From b5626bbb4463bcfba47b43c383cf28dbba8c1450 Mon Sep 17 00:00:00 2001 From: Elivicti Date: Thu, 28 Jul 2022 15:11:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=8A=A0=E8=BD=BD=E9=A2=84?= =?UTF-8?q?=E8=AE=BE=E6=97=B6=E7=82=B9=E5=8F=96=E6=B6=88=E4=BC=9A=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=E9=94=99=E8=AF=AF=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PngPortrait2DDS/PngPortrait2DDS.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PngPortrait2DDS/PngPortrait2DDS.cpp b/PngPortrait2DDS/PngPortrait2DDS.cpp index 633243c..5cebaba 100644 --- a/PngPortrait2DDS/PngPortrait2DDS.cpp +++ b/PngPortrait2DDS/PngPortrait2DDS.cpp @@ -78,7 +78,8 @@ PngPortrait2DDS::PngPortrait2DDS(QWidget *parent) connect(ui->actionSavePreset, &QAction::triggered, this, &PngPortrait2DDS::savePresetAsJson); connect(ui->actionLoadPreset, &QAction::triggered, [this]() { QString filename(QFileDialog::getOpenFileName(this, tr("Select Preset"), "./", tr("Json File(*.json)"))); - this->loadPresetFromJson(filename); + if (!filename.isEmpty()) + this->loadPresetFromJson(filename); }); this->setAcceptDrops(true);