diff options
author | Kai Köhne <kai.koehne@qt.io> | 2022-01-12 09:16:38 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-02-19 08:19:58 +0000 |
commit | 408cd8694bfeff27069a2bc42da5e02cbde58380 (patch) | |
tree | b4c27eb5a1c323f0461f042b5a653a4eb59167f5 | |
parent | 17c8cf1f1b43ace40ddd485d8ee97504937a2725 (diff) |
Doc: Turn notes into section in QQuickWidget overview
The extensive use of notes in overview documentation should be avoided.
All the notes are concerned with performance considerations, so
let's group them together in one section.
Change-Id: I4854e078e35190726091b2ef6b7a674abda8b3b7
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
(cherry picked from commit 64f09b80146340d7eac87b51e1c292e69730b21f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | src/quick/doc/src/concepts/visualcanvas/scenegraph.qdoc | 1 | ||||
-rw-r--r-- | src/quickwidgets/qquickwidget.cpp | 19 |
2 files changed, 13 insertions, 7 deletions
diff --git a/src/quick/doc/src/concepts/visualcanvas/scenegraph.qdoc b/src/quick/doc/src/concepts/visualcanvas/scenegraph.qdoc index faec8df7e4..b0a66cfb5f 100644 --- a/src/quick/doc/src/concepts/visualcanvas/scenegraph.qdoc +++ b/src/quick/doc/src/concepts/visualcanvas/scenegraph.qdoc @@ -194,6 +194,7 @@ throttling, use the \c basic render loop instead by setting \c {QSG_RENDER_LOOP=basic} in the environment. \section2 Threaded Render Loop ('threaded') +\target threaded_render_loop On many configurations, the scene graph rendering will happen on a dedicated render thread. This is done to increase parallelism of diff --git a/src/quickwidgets/qquickwidget.cpp b/src/quickwidgets/qquickwidget.cpp index 37b3823bde..e3b7a8da28 100644 --- a/src/quickwidgets/qquickwidget.cpp +++ b/src/quickwidgets/qquickwidget.cpp @@ -558,19 +558,24 @@ QImage QQuickWidgetPrivate::grabFramebuffer() size of the view. Alternatively the resizeMode may be set to SizeRootObjectToView which will resize the view to the size of the root object. - \note QQuickWidget is an alternative to using QQuickView and QWidget::createWindowContainer(). + \section1 Performance Considerations + + QQuickWidget is an alternative to using QQuickView and QWidget::createWindowContainer(). The restrictions on stacking order do not apply, making QQuickWidget the more flexible alternative, behaving more like an ordinary widget. - \note However, the above mentioned advantages come at the expense of performance. - Unlike QQuickWindow and QQuickView, QQuickWidget requires rendering into OpenGL + However, the above mentioned advantages come at the expense of performance: + \list + + \li Unlike QQuickWindow and QQuickView, QQuickWidget requires rendering into OpenGL framebuffer objects, which needs to be enforced by calling - QQuickWindow::setGraphicsApi(QSGRendererInterface::OpenGLRhi) at startup. + QQuickWindow::setGraphicsApi(QSGRendererInterface::OpenGL) at startup. This will naturally carry a minor performance hit. - \note Using QQuickWidget disables the threaded render loop on all platforms. This means that - some of the benefits of threaded rendering, for example \l Animator classes and vsync driven - animations, will not be available. + \li Using QQuickWidget disables the \l{threaded_render_loop}{threaded render loop} on all + platforms. This means that some of the benefits of threaded rendering, for example + \l Animator classes and vsync driven animations, will not be available. + \endlist \note Avoid calling winId() on a QQuickWidget. This function triggers the creation of a native window, resulting in reduced performance and possibly rendering glitches. The |