static void addLinkToDeskTop(const QString& filename,const QString& name)
{
QFile::link(filename, QStandardPaths::writableLocation(QStandardPaths::DesktopLocation).append("/").append(name+".lnk"));
}
static bool delDeskTopLink(const QString& name)
{
QString fileName = QStandardPaths::writableLocation(QStandardPaths::DesktopLocation).append("/").append(name+".lnk");
if(QFile::exists(fileName))
return QFile::remove(fileName);
return false;
}
其中fileName 为应用程序的程序名 如:C:\test\test.exe