1 QString filename = QFileDialog::getOpenFileName(this, tr("选择要添加的程序"),
2 qApp->applicationDirPath(), tr("Excutable(*.*)"));
3 if(filename.isEmpty())
4 {
5 return;
6 }
7 QFileInfo fileInfo(filename);
8 QFileIconProvider seekIcon;
9 QIcon icon = seekIcon.icon(fileInfo);
10 QPixmap pixmap=icon.pixmap(QSize(15,15));
11 if(!pixmap.save(tr("%1.png").arg(fileInfo.baseName()),"png"))
12 {
13 qDebug()<<"Save icon failed!!"

 

相关文章:

  • 2021-08-03
  • 2021-07-30
  • 2021-10-30
  • 2022-12-23
  • 2022-12-23
  • 2022-01-30
  • 2021-08-03
猜你喜欢
  • 2021-09-06
  • 2022-12-23
  • 2021-06-14
  • 2022-12-23
  • 2022-12-23
  • 2022-01-10
相关资源
相似解决方案