Add support for Qt5

This commit is contained in:
Duncan Ogilvie
2026-02-10 01:37:26 +01:00
parent 6bd61a6b78
commit 7194322831
16 changed files with 363 additions and 82 deletions

View File

@@ -10,6 +10,9 @@
#include <QImage>
#include <QDir>
#include <QFileInfo>
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) && defined(_WIN32)
#include <QtWin>
#endif
#ifdef _WIN32
#include <windows.h>
@@ -469,7 +472,11 @@ QVector<PluginProcessInfo> ProcessMemoryPlugin::enumerateProcesses()
SHFILEINFOW sfi = {};
if (SHGetFileInfoW(path, 0, &sfi, sizeof(sfi), SHGFI_ICON | SHGFI_SMALLICON)) {
if (sfi.hIcon) {
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
QPixmap pixmap = QPixmap::fromImage(QImage::fromHICON(sfi.hIcon));
#else
QPixmap pixmap = QtWin::fromHICON(sfi.hIcon);
#endif
info.icon = QIcon(pixmap);
DestroyIcon(sfi.hIcon);
}