diff options
Diffstat (limited to 'src/plugins/qmldesigner/components/materialbrowser/materialbrowsertexturesmodel.cpp')
-rw-r--r-- | src/plugins/qmldesigner/components/materialbrowser/materialbrowsertexturesmodel.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/plugins/qmldesigner/components/materialbrowser/materialbrowsertexturesmodel.cpp b/src/plugins/qmldesigner/components/materialbrowser/materialbrowsertexturesmodel.cpp index 3f5fde5a7c..0184b1cae1 100644 --- a/src/plugins/qmldesigner/components/materialbrowser/materialbrowsertexturesmodel.cpp +++ b/src/plugins/qmldesigner/components/materialbrowser/materialbrowsertexturesmodel.cpp @@ -34,7 +34,12 @@ 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 QVariant(DocumentManager::currentResourcePath().path() + '/' + source); + if (source.isEmpty()) + return {}; + if (Utils::FilePath::fromString(source).isAbsolutePath()) + return QVariant(source); + return QVariant(QmlDesignerPlugin::instance()->documentManager().currentDesignDocument() + ->fileName().absolutePath().pathAppended(source).cleanPath().toString()); } if (roleName == "textureVisible") |