diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2020-04-30 17:37:27 +0200 |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2020-05-27 10:45:45 +0200 |
commit | 0d80dbd8c2cfc2a7d2a4d970b7acfc7fb5fb97a0 (patch) | |
tree | a6f487a8604e6212d27184b69debac87e0f3aca8 /examples/quick/quickwidgets/quickwidget/main.cpp | |
parent | 6d3aae3cf47fbf21bd27eda7a249c2a23308156e (diff) |
Enable QQuickWidget with OpenGL over RHI
Also adapts to new NativeTexture format, where the actual
handle is passed around instead of a pointer to it.
[ChangeLog][QQuickWidget][Important Behavioral Changes] In
earlier versions, the returned value from QQuickWidget::quickWindow()
would persist for the life time of the widget. This is no
longer the case, so if you are connecting to its signals, make
sure you also connect to its destroyed() signal and update the
connections when it is destroyed.
Fixes: QTBUG-78638
Change-Id: I33cee8543ef1ff5d31555ed3ac18ba78c9c45102
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'examples/quick/quickwidgets/quickwidget/main.cpp')
-rw-r--r-- | examples/quick/quickwidgets/quickwidget/main.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/examples/quick/quickwidgets/quickwidget/main.cpp b/examples/quick/quickwidgets/quickwidget/main.cpp index f28b2f1443..3bff5901f9 100644 --- a/examples/quick/quickwidgets/quickwidget/main.cpp +++ b/examples/quick/quickwidgets/quickwidget/main.cpp @@ -197,6 +197,9 @@ int main(int argc, char **argv) { QApplication app(argc, argv); + // this example and QQuickWidget are only functional when rendering with OpenGL + QQuickWindow::setSceneGraphBackend(QSGRendererInterface::OpenGLRhi); + QCoreApplication::setApplicationName("Qt QQuickWidget Example"); QCoreApplication::setOrganizationName("QtProject"); QCoreApplication::setApplicationVersion(QT_VERSION_STR); |