Long story short, here’s a workaround to a common gripe, missing QPixmap::toWinHICON() in Qt5.
#if QT_VERSION >= 0x050000
extern HICON qt_pixmapToWinHICON(const QPixmap &p);
#else
#define qt_pixmapToWinHICON(p) p.toWinHICON()
#endif
HICON hIcon = qt_pixmapToWinHICON(QPixmap("test.png"));
References: