diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2023-08-24 09:57:39 +0200 |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2023-09-01 11:20:33 +0200 |
commit | 8e7572ac63b4eb7ced5148fdca11702108fa511d (patch) | |
tree | 748bdad14566f96cfe5b8a4a8178d7ba7ac3a332 /src/quick/scenegraph/qsgcontext.cpp | |
parent | ac5c7d52737489b2b63071e1003ef2d72e8eb8ae (diff) |
Make text node scenegraph API public
A lot of functionality is hidden underneath this, so exposing
this API will make it possible to build custom text-based
components for Qt Quick.
[ChangeLog][Text] Added QSGTextNode and QQuickWindow::createTextNode()
for creating scene graph nodes containing text. This can be useful when
building custom Qt Quick items with text.
Fixes: QTBUG-72773
Change-Id: I4810589cc28eb1cdfe91c9d8b66f4c6fe52a0c6a
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'src/quick/scenegraph/qsgcontext.cpp')
-rw-r--r-- | src/quick/scenegraph/qsgcontext.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/quick/scenegraph/qsgcontext.cpp b/src/quick/scenegraph/qsgcontext.cpp index 0b90ff07ed..17a685aee1 100644 --- a/src/quick/scenegraph/qsgcontext.cpp +++ b/src/quick/scenegraph/qsgcontext.cpp @@ -6,6 +6,7 @@ #include <QtQuick/private/qsgrenderer_p.h> #include <QtQuick/private/qquickpixmapcache_p.h> #include <QtQuick/private/qsgadaptationlayer_p.h> +#include <QtQuick/private/qsginternaltextnode_p.h> #include <QGuiApplication> #include <QScreen> @@ -332,6 +333,16 @@ QSGInternalRectangleNode *QSGContext::createInternalRectangleNode(const QRectF & return node; } +QSGInternalTextNode *QSGContext::createInternalTextNode(QSGRenderContext *renderContext) +{ + return new QSGInternalTextNode(renderContext); +} + +QSGTextNode *QSGContext::createTextNode(QSGRenderContext *renderContext) +{ + return createInternalTextNode(renderContext); +} + /*! Creates a new shader effect helper instance. This function is called on the GUI thread, unlike the others. This is necessary in order to provide |