Mac Qt设置应用图标在Qt帮助文档中搜索 Setting the Application Icon。
见官方网站:https://doc.qt.io/archives/qt-5.6/appicon.html
1、得到设计尺寸为1024*1024的logo图,通过工具生成对应图标
2、生成app.icns文件
将文件夹改成app.iconset,进入app.iconset同级目录,输入如下命令。生成app.icns文件
iconutil -c icns ./app.iconset/
3、设置pro文件
macx {
ICON = app.icns
}
4、确保qmake将icons设置到正确位置,需在info.plist配置
5、清理并重新编译。