diff options
author | Mike Krus <mike.krus@kdab.com> | 2018-03-10 17:42:47 +0000 |
---|---|---|
committer | Mike Krus <mike.krus@kdab.com> | 2018-03-16 08:18:35 +0000 |
commit | 42788e0c54e994609bcab1cf757b38a86b815f5a (patch) | |
tree | 3cee86ed5c260a1f35b03826852cd2f45bed6c79 | |
parent | d6f62cc4ca72ee97711b47425fbcda988a8de83e (diff) |
Notify texture status changed
Change-Id: Id8ef731d5f80648c19221c1d1b334bd8367188c3
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
-rw-r--r-- | src/render/texture/qabstracttexture.cpp | 4 | ||||
-rw-r--r-- | tests/manual/downloading/main.qml | 7 |
2 files changed, 9 insertions, 2 deletions
diff --git a/src/render/texture/qabstracttexture.cpp b/src/render/texture/qabstracttexture.cpp index 76886f438..c4c693852 100644 --- a/src/render/texture/qabstracttexture.cpp +++ b/src/render/texture/qabstracttexture.cpp @@ -939,6 +939,10 @@ void QAbstractTexture::sceneChangeEvent(const Qt3DCore::QSceneChangePtr &change) bool blocked = blockNotifications(true); setFormat(static_cast<QAbstractTexture::TextureFormat>(propertyChange->value().toInt())); blockNotifications(blocked); + } else if (propertyChange->propertyName() == QByteArrayLiteral("status")) { + bool blocked = blockNotifications(true); + setStatus(static_cast<QAbstractTexture::Status>(propertyChange->value().toInt())); + blockNotifications(blocked); } // TODO handle target changes, it's a CONSTANT property but can be affected by loader break; diff --git a/tests/manual/downloading/main.qml b/tests/manual/downloading/main.qml index 1dbbc3e5c..a78cf605e 100644 --- a/tests/manual/downloading/main.qml +++ b/tests/manual/downloading/main.qml @@ -82,7 +82,7 @@ Entity { Mesh { id: mesh source: "https://codereview.qt-project.org/gitweb?p=qt/qt3d.git;a=blob_plain;hb=refs/heads/dev;f=examples/qt3d/exampleresources/assets/chest/Chest.obj" - onStatusChanged: console.log("Status " + status) + onStatusChanged: console.log("Mesh status " + status) } Transform { @@ -93,7 +93,10 @@ Entity { DiffuseMapMaterial { id: material - diffuse: TextureLoader { source: "https://codereview.qt-project.org/gitweb?p=qt/qt3d.git;a=blob_plain;hb=refs/heads/dev;f=examples/qt3d/planets-qml/images/solarsystemscope/earthmap2k.jpg" } + diffuse: TextureLoader { + source: "https://codereview.qt-project.org/gitweb?p=qt/qt3d.git;a=blob_plain;hb=refs/heads/dev;f=examples/qt3d/planets-qml/images/solarsystemscope/earthmap2k.jpg" + onStatusChanged: console.log("TextureLoader status " + status) + } specular: Qt.rgba( 0.2, 0.2, 0.2, 1.0 ) shininess: 2.0 } |