aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2014-08-08 16:33:14 +0200
committerSimon Hausmann <simon.hausmann@digia.com>2014-08-08 20:07:28 +0200
commit126c06586849ca41c7d13b833cb8af98d3873b4b (patch)
tree3b2ada357f5768833ce0e0ecee6c28c681c15312 /src/quick
parent024c0b35d9dcc72d11bfcb8faadac921be92e706 (diff)
Added interface for the QStyle rendering in QtQuick Controls
This allows a scene graph backend to customize the style rendering Change-Id: I6048df47ed3705d81140d63a21257f704a0e0a82 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/quick')
-rw-r--r--src/quick/scenegraph/qsgadaptationlayer_p.h15
-rw-r--r--src/quick/scenegraph/qsgcontext.cpp9
-rw-r--r--src/quick/scenegraph/qsgcontext_p.h2
3 files changed, 26 insertions, 0 deletions
diff --git a/src/quick/scenegraph/qsgadaptationlayer_p.h b/src/quick/scenegraph/qsgadaptationlayer_p.h
index 46531f79fb..cc998a9cef 100644
--- a/src/quick/scenegraph/qsgadaptationlayer_p.h
+++ b/src/quick/scenegraph/qsgadaptationlayer_p.h
@@ -70,6 +70,7 @@ class QOpenGLContext;
class QSGImageNode;
class QSGRectangleNode;
class QSGGlyphNode;
+class QSGNinePatchNode;
class Q_QUICK_PRIVATE_EXPORT QSGNodeVisitorEx
{
@@ -88,6 +89,8 @@ public:
virtual void endVisit(QSGRectangleNode *) = 0;
virtual void visit(QSGGlyphNode *) = 0;
virtual void endVisit(QSGGlyphNode *) = 0;
+ virtual void visit(QSGNinePatchNode *) = 0;
+ virtual void endVisit(QSGNinePatchNode *) = 0;
void visitChildren(QSGNode *node);
};
@@ -142,6 +145,18 @@ public:
virtual void accept(QSGNodeVisitorEx *visitor) { visitor->visit(this); visitor->visitChildren(this); visitor->endVisit(this); }
};
+class Q_QUICK_PRIVATE_EXPORT QSGNinePatchNode : public QSGVisitableNode
+{
+public:
+ virtual void setTexture(QSGTexture *texture) = 0;
+ virtual void setBounds(const QRectF &bounds) = 0;
+ virtual void setDevicePixelRatio(qreal ratio) = 0;
+ virtual void setPadding(qreal left, qreal top, qreal right, qreal bottom) = 0;
+
+ virtual void update() = 0;
+
+ virtual void accept(QSGNodeVisitorEx *visitor) { visitor->visit(this); visitor->visitChildren(this); visitor->endVisit(this); }
+};
class Q_QUICK_PRIVATE_EXPORT QSGGlyphNode : public QSGVisitableNode
{
diff --git a/src/quick/scenegraph/qsgcontext.cpp b/src/quick/scenegraph/qsgcontext.cpp
index 267c729504..cf980dfbd4 100644
--- a/src/quick/scenegraph/qsgcontext.cpp
+++ b/src/quick/scenegraph/qsgcontext.cpp
@@ -299,6 +299,15 @@ QSGGlyphNode *QSGContext::createGlyphNode(QSGRenderContext *rc, bool preferNativ
}
}
+/*!
+ * Factory function for scene graph backends of the QStyle stylable elements. Returns a
+ * null pointer if the backend doesn't provide its own node type.
+ */
+QSGNinePatchNode *QSGContext::createQStyleNode()
+{
+ return 0;
+}
+
QSurfaceFormat QSGContext::defaultSurfaceFormat() const
{
QSurfaceFormat format;
diff --git a/src/quick/scenegraph/qsgcontext_p.h b/src/quick/scenegraph/qsgcontext_p.h
index 7113ef8530..97b2c2b358 100644
--- a/src/quick/scenegraph/qsgcontext_p.h
+++ b/src/quick/scenegraph/qsgcontext_p.h
@@ -64,6 +64,7 @@ class QSGContextPrivate;
class QSGRectangleNode;
class QSGImageNode;
class QSGGlyphNode;
+class QSGNinePatchNode;
class QSGRenderer;
class QSGDistanceFieldGlyphCache;
class QQuickWindow;
@@ -174,6 +175,7 @@ public:
virtual QSGRectangleNode *createRectangleNode();
virtual QSGImageNode *createImageNode();
virtual QSGGlyphNode *createGlyphNode(QSGRenderContext *rc, bool preferNativeGlyphNode);
+ virtual QSGNinePatchNode *createQStyleNode();
virtual QAnimationDriver *createAnimationDriver(QObject *parent);
virtual QSize minimumFBOSize() const;