diff options
Diffstat (limited to 'src/quick')
-rw-r--r-- | src/quick/items/qquickwindow.cpp | 14 | ||||
-rw-r--r-- | src/quick/items/qquickwindow.h | 1 | ||||
-rw-r--r-- | src/quick/scenegraph/qsgcontext_p.h | 1 | ||||
-rw-r--r-- | src/quick/scenegraph/qsgcontextplugin.cpp | 9 |
4 files changed, 25 insertions, 0 deletions
diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp index a8606ff1b6..8e78586697 100644 --- a/src/quick/items/qquickwindow.cpp +++ b/src/quick/items/qquickwindow.cpp @@ -4564,6 +4564,20 @@ void QQuickWindow::setSceneGraphBackend(const QString &backend) } /*! + Returns the requested Qt Quick scenegraph \a backend. + + \note The return value of this function may still be outdated by + subsequent calls to setSceneGraphBackend() until the first QQuickWindow in the + application has been constructed. + + \since 5.9 + */ +QString QQuickWindow::sceneGraphBackend() +{ + return QSGContext::backend(); +} + +/*! 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. diff --git a/src/quick/items/qquickwindow.h b/src/quick/items/qquickwindow.h index 27a73988ae..9c3e7277bc 100644 --- a/src/quick/items/qquickwindow.h +++ b/src/quick/items/qquickwindow.h @@ -162,6 +162,7 @@ public: static void setSceneGraphBackend(QSGRendererInterface::GraphicsApi api); static void setSceneGraphBackend(const QString &backend); + static QString sceneGraphBackend(); QSGRectangleNode *createRectangleNode() const; QSGImageNode *createImageNode() const; diff --git a/src/quick/scenegraph/qsgcontext_p.h b/src/quick/scenegraph/qsgcontext_p.h index 2f5d5790ee..1c4cd0ce90 100644 --- a/src/quick/scenegraph/qsgcontext_p.h +++ b/src/quick/scenegraph/qsgcontext_p.h @@ -145,6 +145,7 @@ public: static QSGRenderLoop *createWindowManager(); static void setBackend(const QString &backend); + static QString backend(); }; class Q_QUICK_PRIVATE_EXPORT QSGRenderContext : public QObject diff --git a/src/quick/scenegraph/qsgcontextplugin.cpp b/src/quick/scenegraph/qsgcontextplugin.cpp index 46c2a1dbd9..b8b5141957 100644 --- a/src/quick/scenegraph/qsgcontextplugin.cpp +++ b/src/quick/scenegraph/qsgcontextplugin.cpp @@ -232,6 +232,15 @@ void QSGContext::setBackend(const QString &backend) backendData->quickWindowBackendRequest = backend; } +QString QSGContext::backend() +{ + QSGAdaptationBackendData *backendData = qsg_adaptation_data(); + if (backendData->tried) + return backendData->name; + + return backendData->quickWindowBackendRequest; +} + QT_END_NAMESPACE #include "moc_qsgcontextplugin_p.cpp" |