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