diff options
author | Gunnar Sletta <gunnar@sletta.org> | 2015-09-09 10:20:23 +0200 |
---|---|---|
committer | Gunnar Sletta <gunnar@sletta.org> | 2015-09-15 07:45:51 +0000 |
commit | 0c7349fa9621f6460b754c2b3595d1c0f1d02ec4 (patch) | |
tree | 1f94b5dc0cdc1ae551bc784416f6d3473f1738f4 /src/quick/items/qquickpainteditem.h | |
parent | f3efdebc34d37137f256995984d2050375be25de (diff) |
Introduce QQuickPaintedItem::textureSize and support HighDpi.
contentsSize/Scale/BoundingRect are confusing and will in
most cases not produce what the user wants, but since
they might be in use, we keep their behavior and simply
obsolete them. New code should use textureSize, though most
code can simply rely on implicit HighDpi support.
[ChangeLog][QtQuick][QQuickPaintedItem] Implement high-dpi
support and add function textureSize. This obsoletes the
existing contentsSize, contentsScale and contentsBoundingRect
functions.
Task-number: QTBUG-32510
Task-number: QTBUG-40489
Change-Id: I660bbf394594b6ea588d4de9cc83c8c5eb28cb28
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
Diffstat (limited to 'src/quick/items/qquickpainteditem.h')
-rw-r--r-- | src/quick/items/qquickpainteditem.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/quick/items/qquickpainteditem.h b/src/quick/items/qquickpainteditem.h index 28eb3398a0..8c9ae2eebb 100644 --- a/src/quick/items/qquickpainteditem.h +++ b/src/quick/items/qquickpainteditem.h @@ -48,6 +48,8 @@ class Q_QUICK_EXPORT QQuickPaintedItem : public QQuickItem Q_PROPERTY(QColor fillColor READ fillColor WRITE setFillColor NOTIFY fillColorChanged) Q_PROPERTY(qreal contentsScale READ contentsScale WRITE setContentsScale NOTIFY contentsScaleChanged) Q_PROPERTY(RenderTarget renderTarget READ renderTarget WRITE setRenderTarget NOTIFY renderTargetChanged) + Q_PROPERTY(QSize textureSize READ textureSize WRITE setTextureSize NOTIFY textureSizeChanged) + public: QQuickPaintedItem(QQuickItem *parent = 0); virtual ~QQuickPaintedItem(); @@ -88,6 +90,9 @@ public: qreal contentsScale() const; void setContentsScale(qreal); + QSize textureSize() const; + void setTextureSize(const QSize &size); + QColor fillColor() const; void setFillColor(const QColor&); @@ -104,6 +109,7 @@ Q_SIGNALS: void contentsSizeChanged(); void contentsScaleChanged(); void renderTargetChanged(); + void textureSizeChanged(); protected: QQuickPaintedItem(QQuickPaintedItemPrivate &dd, QQuickItem *parent = 0); |