diff options
author | Gunnar Sletta <gunnar.sletta@nokia.com> | 2011-12-20 00:50:15 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-01-03 17:58:59 +0100 |
commit | 42d6acd0a3ea5fa5cf7ab69f1f8f2206559107ea (patch) | |
tree | 84377465ecf6dbc45634656631c72f24e0e77f51 /src/quick/items/qquickitem.h | |
parent | a9b103d02831a03e8f3815af2b7d043c5cf4eae6 (diff) |
Introduce layerering support (ShaderEffectSource) directly in Item
This is enabled by doing "Item.layer.enabled: true". The implementation
is solely based on the existing shader effect (source) and simply
swaps in a sibling next to the item when enabled.
This change also adds the QSGTextureProvider to the public API,
as it is now a natural part of the QQuickItem API since all items
can be textures.
Change-Id: I26705c11e92d5623a5121300acc123782b784077
Reviewed-by: Kim M. Kalland <kim.kalland@nokia.com>
Diffstat (limited to 'src/quick/items/qquickitem.h')
-rw-r--r-- | src/quick/items/qquickitem.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/quick/items/qquickitem.h b/src/quick/items/qquickitem.h index 763fc59ac4..9810e0cf22 100644 --- a/src/quick/items/qquickitem.h +++ b/src/quick/items/qquickitem.h @@ -81,6 +81,7 @@ private: Q_DECLARE_PRIVATE(QQuickTransform) }; +class QQuickItemLayer; class QDeclarativeV8Function; class QDeclarativeState; class QQuickAnchorLine; @@ -145,6 +146,8 @@ class Q_QUICK_EXPORT QQuickItem : public QObject, public QDeclarativeParserStatu Q_PROPERTY(qreal implicitWidth READ implicitWidth WRITE setImplicitWidth NOTIFY implicitWidthChanged) Q_PROPERTY(qreal implicitHeight READ implicitHeight WRITE setImplicitHeight NOTIFY implicitHeightChanged) + Q_PRIVATE_PROPERTY(QQuickItem::d_func(), QQuickItemLayer *layer READ layer DESIGNABLE false CONSTANT FINAL) + Q_ENUMS(TransformOrigin) Q_CLASSINFO("DefaultProperty", "data") Q_CLASSINFO("qt_HasQmlAccessors", "true") @@ -316,8 +319,8 @@ public: UpdatePaintNodeData(); }; - virtual bool isTextureProvider() const { return false; } - virtual QSGTextureProvider *textureProvider() const { return 0; } + virtual bool isTextureProvider() const; + virtual QSGTextureProvider *textureProvider() const; public Q_SLOTS: void update(); |