diff options
author | Andy Shaw <andy.shaw@theqtcompany.com> | 2016-01-25 21:57:29 +0100 |
---|---|---|
committer | Andy Shaw <andy.shaw@theqtcompany.com> | 2016-04-07 08:39:31 +0000 |
commit | bf6bda9487ce63275264eff66e609a89bacb6416 (patch) | |
tree | 4db9e93896968507731407b44b936ec8b2d1493e /src/quick | |
parent | a676e4e2dae945c02521691c7018f5a5534feff9 (diff) |
Update the item when the DevicePixelRatio changes
Since the rendering of the item depends on the device pixel ratio then it
needs to be updated whenever this changes.
[ChangeLog][QQuickPaintedItem] When the device pixel ratio
is changed for the screen the item is rendered on then the item will be
updated.
Change-Id: Idf3c73faf0c13573c570fe22b5fb9e97fe1e66e2
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
Diffstat (limited to 'src/quick')
-rw-r--r-- | src/quick/items/qquickpainteditem.cpp | 7 | ||||
-rw-r--r-- | src/quick/items/qquickpainteditem.h | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/quick/items/qquickpainteditem.cpp b/src/quick/items/qquickpainteditem.cpp index ad8d94d240..63e90a5cce 100644 --- a/src/quick/items/qquickpainteditem.cpp +++ b/src/quick/items/qquickpainteditem.cpp @@ -657,4 +657,11 @@ QSGTextureProvider *QQuickPaintedItem::textureProvider() const return d->textureProvider; } +void QQuickPaintedItem::itemChange(ItemChange change, const ItemChangeData &value) +{ + if (change == ItemDevicePixelRatioHasChanged) + update(); + QQuickItem::itemChange(change, value); +} + QT_END_NAMESPACE diff --git a/src/quick/items/qquickpainteditem.h b/src/quick/items/qquickpainteditem.h index bb4e7f1f85..ff559cd10e 100644 --- a/src/quick/items/qquickpainteditem.h +++ b/src/quick/items/qquickpainteditem.h @@ -115,6 +115,7 @@ protected: QQuickPaintedItem(QQuickPaintedItemPrivate &dd, QQuickItem *parent = Q_NULLPTR); QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *) Q_DECL_OVERRIDE; void releaseResources() Q_DECL_OVERRIDE; + void itemChange(ItemChange, const ItemChangeData &) Q_DECL_OVERRIDE; private Q_SLOTS: void invalidateSceneGraph(); |