From 23f34af03420cdeb65efaaff8b3637bcc5701723 Mon Sep 17 00:00:00 2001 From: Roy Qu Date: Thu, 17 Mar 2022 17:07:28 +0800 Subject: [PATCH] - enhancement: auto convert project icon to ico format --- NEWS.md | 1 + RedPandaIDE/settingsdialog/projectgeneralwidget.cpp | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index 4fcbbefe..26178002 100644 --- a/NEWS.md +++ b/NEWS.md @@ -35,6 +35,7 @@ Red Panda C++ Version 1.0.0 - enhancement: ctrl+enter insert a new line at the end of current line - enhancement: create file in files view - fix: hits in the search view not correctly displayed (overlapped with others) + - enhancement: auto convert project icon to ico format Red Panda C++ Version 0.14.5 - fix: the "gnu c++ 20" option in compiler set options is wrong diff --git a/RedPandaIDE/settingsdialog/projectgeneralwidget.cpp b/RedPandaIDE/settingsdialog/projectgeneralwidget.cpp index 7ac1b5e2..54df9e4b 100644 --- a/RedPandaIDE/settingsdialog/projectgeneralwidget.cpp +++ b/RedPandaIDE/settingsdialog/projectgeneralwidget.cpp @@ -24,6 +24,8 @@ #include #include +#include +#include #include #include @@ -117,7 +119,10 @@ void ProjectGeneralWidget::doSave() QMessageBox::Ok); } } - QFile::copy(mIconPath, iconPath); + if (QImageWriter::supportedImageFormats().contains("ico")) { + ui->lbIcon->pixmap()->save(iconPath,"ico"); + } else + QFile::copy(mIconPath, iconPath); project->options().icon = iconPath; mIconPath = iconPath; refreshIcon();