diff options
author | Gunnar Sletta <gunnar@sletta.org> | 2015-09-09 11:16:31 +0200 |
---|---|---|
committer | Gunnar Sletta <gunnar@sletta.org> | 2015-09-11 07:10:25 +0000 |
commit | af0a53d89835baa86698b40ac845024ee49e71b1 (patch) | |
tree | 489788f325e84c0d094a03228e7dd5caa8f3eb0e /src/quick | |
parent | 1aa18624f92f1ec7f2f5715653732515fddcbb9e (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/quick')
-rw-r--r-- | src/quick/items/qquickimage.cpp | 7 |
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; |