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/items/qquickwindow.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/items/qquickwindow.cpp')
-rw-r--r-- | src/quick/items/qquickwindow.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp index 3c2e497018..324ddd0b56 100644 --- a/src/quick/items/qquickwindow.cpp +++ b/src/quick/items/qquickwindow.cpp @@ -4222,6 +4222,18 @@ QQuickGraphicsConfiguration QQuickWindow::graphicsConfiguration() const } /*! + Creates a text node. When the scenegraph is not initialized, the return value is null. + + \since 6.7 + \sa QSGTextNode + */ +QSGTextNode *QQuickWindow::createTextNode() const +{ + Q_D(const QQuickWindow); + return isSceneGraphInitialized() ? d->context->sceneGraphContext()->createTextNode(d->context) : nullptr; +} + +/*! Creates a simple rectangle node. When the scenegraph is not initialized, the return value is null. This is cross-backend alternative to constructing a QSGSimpleRectNode directly. |