summaryrefslogtreecommitdiffstats
path: root/tools/qmlviewer/qmlviewer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/qmlviewer/qmlviewer.cpp')
-rw-r--r--tools/qmlviewer/qmlviewer.cpp18
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"