From 73adac2501eb2279523531da9d04f514ab614853 Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Thu, 10 Aug 2023 20:25:01 +0200 Subject: [PATCH] fix: use QColorConstants in Qt 5.14+ Signed-off-by: Sefa Eyeoglu --- launcher/SkinUtils.cpp | 4 ++++ launcher/minecraft/auth/MinecraftAccount.cpp | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/launcher/SkinUtils.cpp b/launcher/SkinUtils.cpp index 15be1cec6..989114ad5 100644 --- a/launcher/SkinUtils.cpp +++ b/launcher/SkinUtils.cpp @@ -35,7 +35,11 @@ QPixmap getFaceFromCache(QString username, int height, int width) QPixmap skinTexture(fskin.fileName()); if (!skinTexture.isNull()) { QPixmap skin = QPixmap(8, 8); +#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) skin.fill(QColorConstants::Transparent); +#else + skin.fill(QColor(0, 0, 0, 0)); +#endif QPainter painter(&skin); painter.drawPixmap(0, 0, skinTexture.copy(8, 8, 8, 8)); painter.drawPixmap(0, 0, skinTexture.copy(40, 8, 8, 8)); diff --git a/launcher/minecraft/auth/MinecraftAccount.cpp b/launcher/minecraft/auth/MinecraftAccount.cpp index 79213fe91..6c2f0805f 100644 --- a/launcher/minecraft/auth/MinecraftAccount.cpp +++ b/launcher/minecraft/auth/MinecraftAccount.cpp @@ -37,6 +37,7 @@ #include "MinecraftAccount.h" +#include #include #include #include @@ -126,7 +127,11 @@ QPixmap MinecraftAccount::getFace() const return QPixmap(); } QPixmap skin = QPixmap(8, 8); +#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) skin.fill(QColorConstants::Transparent); +#else + skin.fill(QColor(0, 0, 0, 0)); +#endif QPainter painter(&skin); painter.drawPixmap(0, 0, skinTexture.copy(8, 8, 8, 8)); painter.drawPixmap(0, 0, skinTexture.copy(40, 8, 8, 8));