aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/quick/items/qquickwindow.cpp49
-rw-r--r--src/quick/items/qquickwindow.h3
2 files changed, 52 insertions, 0 deletions
diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp
index ed02c4f4c8..6a032878a0 100644
--- a/src/quick/items/qquickwindow.cpp
+++ b/src/quick/items/qquickwindow.cpp
@@ -4251,6 +4251,20 @@ void QQuickWindow::setRenderTarget(const QQuickRenderTarget &target)
}
/*!
+ \return the QQuickRenderTarget passed to setRenderTarget(), or a default
+ constructed one otherwise
+
+ \since 6.0
+
+ \sa setRenderTarget()
+ */
+QQuickRenderTarget QQuickWindow::renderTarget() const
+{
+ Q_D(const QQuickWindow);
+ return d->customRenderTarget;
+}
+
+/*!
Grabs the contents of the window and returns it as an image.
It is possible to call the grabWindow() function when the window is not
@@ -5669,6 +5683,10 @@ QString QQuickWindow::sceneGraphBackend()
renderer. This requires using the same graphics device (or with OpenGL,
OpenGL context).
+ QQuickGraphicsDevice instances are implicitly shared, copyable, and
+ can be passed by value. They do not own the associated native objects (such
+ as, the ID3D11Device in the example).
+
\note Using QQuickRenderControl does not always imply having to call this
function. When adopting an existing device or context is not needed, this
function should not be called, and the scene graph will then initialize its
@@ -5686,6 +5704,20 @@ void QQuickWindow::setGraphicsDevice(const QQuickGraphicsDevice &device)
}
/*!
+ \return the QQuickGraphicsDevice passed to setGraphicsDevice(), or a
+ default constructed one otherwise
+
+ \since 6.0
+
+ \sa setGraphicsDevice()
+ */
+QQuickGraphicsDevice QQuickWindow::graphicsDevice() const
+{
+ Q_D(const QQuickWindow);
+ return d->customDeviceObjects;
+}
+
+/*!
Sets the graphics configuration for this window. \a config contains various
settings that may be taken into account by the scene graph when
initializing the underlying graphics devices and contexts.
@@ -5700,6 +5732,9 @@ void QQuickWindow::setGraphicsDevice(const QQuickGraphicsDevice &device)
via setGraphicsDevice() since the scene graph is then not in control of the
actual construction of those objects.
+ QQuickGraphicsConfiguration instances are implicitly shared, copyable, and
+ can be passed by value.
+
\warning Setting a QQuickGraphicsConfiguration on a QQuickWindow must
happen early enough, before the scene graph is initialized for the first
time for that window. With on-screen windows this means the call must be
@@ -5716,6 +5751,20 @@ void QQuickWindow::setGraphicsConfiguration(const QQuickGraphicsConfiguration &c
}
/*!
+ \return the QQuickGraphicsDevice passed to setGraphicsDevice(), or a
+ default constructed one otherwise
+
+ \since 6.0
+
+ \sa setGraphicsConfiguration()
+ */
+QQuickGraphicsConfiguration QQuickWindow::graphicsConfiguration() const
+{
+ Q_D(const QQuickWindow);
+ return d->graphicsConfig;
+}
+
+/*!
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 88b3772048..fd4fb28cbe 100644
--- a/src/quick/items/qquickwindow.h
+++ b/src/quick/items/qquickwindow.h
@@ -137,6 +137,7 @@ public:
QImage grabWindow();
void setRenderTarget(const QQuickRenderTarget &target);
+ QQuickRenderTarget renderTarget() const;
struct GraphicsStateInfo {
int currentFrameSlot;
@@ -186,8 +187,10 @@ public:
static QString sceneGraphBackend();
void setGraphicsDevice(const QQuickGraphicsDevice &device);
+ QQuickGraphicsDevice graphicsDevice() const;
void setGraphicsConfiguration(const QQuickGraphicsConfiguration &config);
+ QQuickGraphicsConfiguration graphicsConfiguration() const;
QSGRectangleNode *createRectangleNode() const;
QSGImageNode *createImageNode() const;