QmlDesigner: Generate material browser texture icons using provider

Provider allows using special generation methods for hdr images, which
QImage doesn't support.

Task-number: QDS-8296
Change-Id: I829199264ff4a5eb677d65c908eacd1e20ad94e5
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
Miikka Heikkinen
2022-11-14 16:26:42 +02:00
parent 96b0cda1c9
commit 69461e4c68
13 changed files with 43 additions and 6 deletions

View File

@@ -35,7 +35,7 @@ QVariant MaterialBrowserTexturesModel::data(const QModelIndex &index, int role)
QByteArray roleName = roleNames().value(role);
if (roleName == "textureSource") {
QString source = m_textureList.at(index.row()).variantProperty("source").value().toString();
return QUrl::fromLocalFile(DocumentManager::currentResourcePath().path() + '/' + source);
return QVariant(DocumentManager::currentResourcePath().path() + '/' + source);
}
if (roleName == "textureVisible")