Skip to content
Permalink
Browse files

Merge PR #2857: OverlayConfig: handle removal of qWinAppInst() in Qt …

…5.8.
  • Loading branch information...
davidebeatrici committed Feb 20, 2017
2 parents 17bae48 + 1a4ecd1 commit a9785932c15b317a194554e716acfca1c81a1e5c
Showing with 13 additions and 1 deletion.
  1. +13 −1 src/mumble/OverlayConfig.cpp
@@ -229,7 +229,19 @@ OverlayAppInfo OverlayConfig::applicationInfoForId(const QString &identifier) {
CFRelease(bundle);

#elif defined(Q_OS_WIN)
HICON icon = ExtractIcon(qWinAppInst(), identifier.toStdWString().c_str(), 0);
// qWinAppInst(), whose return value we used to pass
// to ExtractIcon below, was removed in Qt 5.8.
//
// It was removed via
// https://github.com/qt/qtbase/commit/64507c7165e42c2a5029353d8f97a0d841fa6b01
//
// In both Qt 4 and Qt 5, the qWinAppInst() implementation
// simply calls GetModuleHandle(0).
//
// To sidestep the removal of the function, we simply
// call through to GetModuleHandle() directly.
HINSTANCE qWinAppInstValue = GetModuleHandle(NULL);
HICON icon = ExtractIcon(qWinAppInstValue, identifier.toStdWString().c_str(), 0);
if (icon) {
#if QT_VERSION >= 0x050000
extern QPixmap qt_pixmapFromWinHICON(HICON icon);

0 comments on commit a978593

Please sign in to comment.
You can’t perform that action at this time.