我已经开始使用 Qt Installer Framework 并发现它很有用,除了许多未记录的功能(例如,设置向导 subTitle 或 DesktopDir 变量的存在),但有一件事我无法通过代码检查弄清楚就是在创建桌面快捷方式的时候如何指定快捷方式图标?
我可以创建桌面快捷方式就好了
component.addOperation("CreateShortcut",td,dd);
其中 td 和 dd 分别是可执行文件和链接文件的路径(但我无法进行安装程序操作
boolean performOperation(string name, stringlist arguments)
工作)
但是我无法弄清楚如何设置桌面快捷方式图标。
必须有一种方法,因为在下载的 Qt Installer Framework 安装中,桌面快捷方式图标不是通用的,而是指定的。我试过查看代码,在 createshortcutoperation.cpp 中是代码
const QString iconId = takeArgument(QString::fromLatin1("iconId="), &args);
const QString iconPath = takeArgument(QString::fromLatin1("iconPath="), &args);
const QString workingDir = takeArgument(QString::fromLatin1("workingDirectory="), &args);
所以我没有成功尝试
component.addOperation("CreateShortcut",td,dd,"iconPath="+iconPath);
其中 iconPath 是图标的路径。
有谁知道 Qt 如何指定他们的桌面快捷方式图标?