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;
The accepted answer here is incorrect, or as mentioned in the comments, at least misleading. Qt has come with a plugin for handling ICO format since sometime in version 4.4. Here's a similar question from the same era.
For deployment, one needs to copy the plugins/imageformats/[lib]qico.[dll|so] file from the Qt installation used for building with to within their executable's directory. Put it in a subfolder, like so: . If testing a debug build, the d suffix version of the lib is needed instead (qicod.dll).
(This newer question has been marked as a duplicate of this, so now 2 questions point to the wrong answer. Which is why I'm essentially repeating my post here.)