diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2009-09-02 23:32:38 (GMT) |
---|---|---|
committer | Michael Brasser <michael.brasser@nokia.com> | 2009-09-02 23:32:38 (GMT) |
commit | 48b47f9d242f76e944986df08a16c083bce47bef (patch) | |
tree | 3cf9a57b2570f157f70a6b9ca2aa80450af61dc9 /tools/qmlviewer/qmlviewer.cpp | |
parent | ed417f18023f1bbd0636c9724b8f79e08c77d51a (diff) | |
download | Qt-48b47f9d242f76e944986df08a16c083bce47bef.zip Qt-48b47f9d242f76e944986df08a16c083bce47bef.tar.gz Qt-48b47f9d242f76e944986df08a16c083bce47bef.tar.bz2 |
Make it easier to test examples with EGL.
Currently -graphicssystem opengl is not very reliable with EGL, so
we've added a -opengl option to qmlviewer which sets the viewport of
the view to a QGLWidget and allows for GL testing.
Diffstat (limited to 'tools/qmlviewer/qmlviewer.cpp')
-rw-r--r-- | tools/qmlviewer/qmlviewer.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tools/qmlviewer/qmlviewer.cpp b/tools/qmlviewer/qmlviewer.cpp index 272ebcb..3ae9a97 100644 --- a/tools/qmlviewer/qmlviewer.cpp +++ b/tools/qmlviewer/qmlviewer.cpp @@ -45,6 +45,10 @@ #include <QKeyEvent> #include "proxysettings.h" +#ifdef GL_SUPPORTED +#include <QGLWidget> +#endif + QT_BEGIN_NAMESPACE class PreviewDeviceSkin : public DeviceSkin @@ -1003,6 +1007,20 @@ void QmlViewer::setNetworkCacheSize(int size) } } +void QmlViewer::setUseGL(bool useGL) +{ +#ifdef GL_SUPPORTED + if (useGL) { + QGLFormat format = QGLFormat::defaultFormat(); + format.setSampleBuffers(false); + + QGLWidget *glWidget = new QGLWidget(format); + glWidget->setAutoFillBackground(false); + canvas->setViewport(glWidget); + } +#endif +} + QT_END_NAMESPACE #include "qmlviewer.moc" |