generate skin preview

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
Trial97
2025-01-10 17:30:00 +02:00
parent 5ba4b3a32f
commit 1b98c69948
4 changed files with 116 additions and 3 deletions

View File

@ -239,8 +239,13 @@ QVariant SkinList::data(const QModelIndex& index, int role) const
return QVariant();
auto skin = m_skinList[row];
switch (role) {
case Qt::DecorationRole:
return skin.getTexture();
case Qt::DecorationRole: {
auto preview = skin.getPreview();
if (preview.isNull()) {
preview = skin.getTexture();
}
return preview;
}
case Qt::DisplayRole:
return skin.name();
case Qt::UserRole: