Qt-为应用程序添加logo

在Qt Creator中新建Qt Resource File,名字为logo.qrc

1.选择Add Prefix得到/new/prefix1

2.然后Add Files,将文件添加进去,如CA-DCP.png

3.在*.pro中添加:  RESOURCES +=logo.qrc  

4.在构造函数中添加:

 setWindowIcon(QIcon(":/new/prefix1/CA-DCP.png"));
posted @ 2016-12-28 16:25  暗夜影  阅读(2804)  评论(0编辑  收藏  举报