- enhancement: auto convert project icon to ico format

This commit is contained in:
Roy Qu 2022-03-17 17:07:28 +08:00
parent 55126ebebe
commit 23f34af034
2 changed files with 7 additions and 1 deletions

View File

@ -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: ctrl+enter insert a new line at the end of current line
- enhancement: create file in files view - enhancement: create file in files view
- fix: hits in the search view not correctly displayed (overlapped with others) - 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 Red Panda C++ Version 0.14.5
- fix: the "gnu c++ 20" option in compiler set options is wrong - fix: the "gnu c++ 20" option in compiler set options is wrong

View File

@ -24,6 +24,8 @@
#include <QFileDialog> #include <QFileDialog>
#include <QIcon> #include <QIcon>
#include <QImageWriter>
#include <QImageWriter>
#include <QMessageBox> #include <QMessageBox>
#include <QTextCodec> #include <QTextCodec>
@ -117,7 +119,10 @@ void ProjectGeneralWidget::doSave()
QMessageBox::Ok); 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; project->options().icon = iconPath;
mIconPath = iconPath; mIconPath = iconPath;
refreshIcon(); refreshIcon();