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();