From 8bf52f35d116f4170b76d04c7e2b86c4bbc78a8d Mon Sep 17 00:00:00 2001 From: Paul Lemire Date: Mon, 14 Oct 2019 11:20:00 +0200 Subject: QTextureLoader: reset target and format on source change Could otherwise prevent reloading the content of the texture when the generator/source changes Change-Id: I5cf3389792032ba7a85a111f04dd4670a3091683 Reviewed-by: Mike Krus --- src/render/texture/qtexture.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/render/texture/qtexture.cpp b/src/render/texture/qtexture.cpp index 734942847..b28004aa0 100644 --- a/src/render/texture/qtexture.cpp +++ b/src/render/texture/qtexture.cpp @@ -1483,6 +1483,11 @@ void QTextureLoader::setSource(const QUrl& source) Q_D(QTextureLoader); if (source != d->m_source) { d->m_source = source; + + // Reset target and format + d->m_target = TargetAutomatic; + setFormat(NoFormat); + d->updateGenerator(); const bool blocked = blockNotifications(true); emit sourceChanged(source); -- cgit v1.2.3