summaryrefslogtreecommitdiffstats
path: root/src/render/frontend/qmesh.cpp
diff options
context:
space:
mode:
authorPaul Lemire <paul.lemire.ecortex@kdab.com>2014-12-29 16:10:48 +0100
committerSean Harmer <sean.harmer@kdab.com>2014-12-31 11:23:49 +0100
commitbee25daf9efaa688a6954a5b31a07c51db49b8ba (patch)
tree5bc3f2982689c8908c9fbe440eff36cd1d15f6a1 /src/render/frontend/qmesh.cpp
parent2be97a74b23c66d385b1dd89df106c9be7be7696 (diff)
Default cpp materials + material-cpp example
QDiffuseMapMaterial QDiffuseSpecularMapMaterial QNormalDiffuseMapMaterial QNormalDiffuseAlphaMapMaterial QNormalDiffuseSpecularMapMaterial material-cpp is mostly inspired from materials (QML) but nicer :). Note: there seems to be an issue with qrc and QUrl. The behavior is different between QML and C++. -In C++ we need to prefix with have qrc:/ and convert that to :/ (passing :/ directly returns "" when QUrl toString is called) -From QML no prefix is needed. -For QImage path, :/ should be used. Change-Id: Ib56fb9546c95c2872686a46ed048a290ab4a5b6f Task-number: QTBUG-41548 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/render/frontend/qmesh.cpp')
-rw-r--r--src/render/frontend/qmesh.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/render/frontend/qmesh.cpp b/src/render/frontend/qmesh.cpp
index 48103eb7e..a69458091 100644
--- a/src/render/frontend/qmesh.cpp
+++ b/src/render/frontend/qmesh.cpp
@@ -128,8 +128,10 @@ QMeshDataPtr MeshFunctor::operator()()
loader.setTangentGenerationEnabled(true);
qCDebug(Render::Jobs) << Q_FUNC_INFO << "Loading mesh from" << m_sourcePath;
+
// TO DO: Handle file download if remote url
- QString filePath = m_sourcePath.toString().replace(QStringLiteral("qrc:/"), QStringLiteral(""));
+ // If the file contained :/ directly, is it mapped to "" when toString is called
+ QString filePath = m_sourcePath.toString().replace(QStringLiteral("qrc:/"), QStringLiteral(":/"));
if (loader.load(filePath))
return QMeshDataPtr(loader.mesh());