aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickpainteditem.cpp
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@theqtcompany.com>2016-01-25 21:57:29 +0100
committerAndy Shaw <andy.shaw@theqtcompany.com>2016-04-07 08:39:31 +0000
commitbf6bda9487ce63275264eff66e609a89bacb6416 (patch)
tree4db9e93896968507731407b44b936ec8b2d1493e /src/quick/items/qquickpainteditem.cpp
parenta676e4e2dae945c02521691c7018f5a5534feff9 (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/items/qquickpainteditem.cpp')
-rw-r--r--src/quick/items/qquickpainteditem.cpp7
1 files changed, 7 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