aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar@sletta.org>2015-09-09 11:16:31 +0200
committerGunnar Sletta <gunnar@sletta.org>2015-09-11 07:10:25 +0000
commitaf0a53d89835baa86698b40ac845024ee49e71b1 (patch)
tree489788f325e84c0d094a03228e7dd5caa8f3eb0e /src
parent1aa18624f92f1ec7f2f5715653732515fddcbb9e (diff)
Make Image::layer::enabled work as expected.
Change-Id: I0021ab5d3f51e47725cc0462ff74b6562d39c95b Task-number: QTBUG-48113 Reviewed-by: Michael Brasser <michael.brasser@live.com>
Diffstat (limited to 'src')
-rw-r--r--src/quick/items/qquickimage.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/quick/items/qquickimage.cpp b/src/quick/items/qquickimage.cpp
index 3ba09f9cea..483d86c97d 100644
--- a/src/quick/items/qquickimage.cpp
+++ b/src/quick/items/qquickimage.cpp
@@ -551,6 +551,13 @@ QSGTextureProvider *QQuickImage::textureProvider() const
{
Q_D(const QQuickImage);
+ // When Item::layer::enabled == true, QQuickItem will be a texture
+ // provider. In this case we should prefer to return the layer rather
+ // than the image itself. The layer will include any children and any
+ // the image's wrap and fill mode.
+ if (QQuickItem::isTextureProvider())
+ return QQuickItem::textureProvider();
+
if (!d->window || !d->sceneGraphRenderContext() || QThread::currentThread() != d->sceneGraphRenderContext()->thread()) {
qWarning("QQuickImage::textureProvider: can only be queried on the rendering thread of an exposed window");
return 0;