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
Qt创建桌面快捷方式和删除桌面快捷方式
最新推荐文章于 2024-02-22 21:06:01 发布