Issue when loading an ico from a Qt resource file

后端 未结 5 2288
星月不相逢
星月不相逢 2020-12-21 05:31

I am using Qt Designer 4.8.4 and I include two files in the QMainWindow resource file: a .ico file and a .gif file. When loading from code using:

QPixmap p;
         


        
5条回答
  •  温柔的废话
    2020-12-21 05:41

    Guessing from your followup on the already chosen answer, you may want to have that ICO as the appwindow icon. That is possible, and also is perhaps why Qt Designer is capable of displaying it (trying to guess your intent). However, having it so doesn't involve any QPixmap coding, it's purely configuration affair. Described here (and yes, #worksforme) :

    http://doc.qt.digia.com/qt/appicon.html

提交回复
热议问题