fix: use QColorConstants in Qt 5.14+
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
This commit is contained in:
parent
97ef8e8d0e
commit
73adac2501
@ -35,7 +35,11 @@ QPixmap getFaceFromCache(QString username, int height, int width)
|
|||||||
QPixmap skinTexture(fskin.fileName());
|
QPixmap skinTexture(fskin.fileName());
|
||||||
if (!skinTexture.isNull()) {
|
if (!skinTexture.isNull()) {
|
||||||
QPixmap skin = QPixmap(8, 8);
|
QPixmap skin = QPixmap(8, 8);
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
|
||||||
skin.fill(QColorConstants::Transparent);
|
skin.fill(QColorConstants::Transparent);
|
||||||
|
#else
|
||||||
|
skin.fill(QColor(0, 0, 0, 0));
|
||||||
|
#endif
|
||||||
QPainter painter(&skin);
|
QPainter painter(&skin);
|
||||||
painter.drawPixmap(0, 0, skinTexture.copy(8, 8, 8, 8));
|
painter.drawPixmap(0, 0, skinTexture.copy(8, 8, 8, 8));
|
||||||
painter.drawPixmap(0, 0, skinTexture.copy(40, 8, 8, 8));
|
painter.drawPixmap(0, 0, skinTexture.copy(40, 8, 8, 8));
|
||||||
|
@ -37,6 +37,7 @@
|
|||||||
|
|
||||||
#include "MinecraftAccount.h"
|
#include "MinecraftAccount.h"
|
||||||
|
|
||||||
|
#include <QColor>
|
||||||
#include <QCryptographicHash>
|
#include <QCryptographicHash>
|
||||||
#include <QJsonArray>
|
#include <QJsonArray>
|
||||||
#include <QJsonDocument>
|
#include <QJsonDocument>
|
||||||
@ -126,7 +127,11 @@ QPixmap MinecraftAccount::getFace() const
|
|||||||
return QPixmap();
|
return QPixmap();
|
||||||
}
|
}
|
||||||
QPixmap skin = QPixmap(8, 8);
|
QPixmap skin = QPixmap(8, 8);
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
|
||||||
skin.fill(QColorConstants::Transparent);
|
skin.fill(QColorConstants::Transparent);
|
||||||
|
#else
|
||||||
|
skin.fill(QColor(0, 0, 0, 0));
|
||||||
|
#endif
|
||||||
QPainter painter(&skin);
|
QPainter painter(&skin);
|
||||||
painter.drawPixmap(0, 0, skinTexture.copy(8, 8, 8, 8));
|
painter.drawPixmap(0, 0, skinTexture.copy(8, 8, 8, 8));
|
||||||
painter.drawPixmap(0, 0, skinTexture.copy(40, 8, 8, 8));
|
painter.drawPixmap(0, 0, skinTexture.copy(40, 8, 8, 8));
|
||||||
|
Loading…
Reference in New Issue
Block a user