summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/barstest/main.cpp17
-rw-r--r--tests/scattertest/main.cpp3
2 files changed, 16 insertions, 4 deletions
diff --git a/tests/barstest/main.cpp b/tests/barstest/main.cpp
index 9a791c5b..af033990 100644
--- a/tests/barstest/main.cpp
+++ b/tests/barstest/main.cpp
@@ -34,6 +34,18 @@
#include <QColorDialog>
#include <QLineEdit>
#include <QSpinBox>
+#include <QtGui/QOpenGLContext>
+
+static bool isOpenGLES()
+{
+#if defined(QT_OPENGL_ES_2)
+ return true;
+#elif (QT_VERSION < QT_VERSION_CHECK(5, 3, 0))
+ return false;
+#else
+ return QOpenGLContext::currentContext()->isOpenGLES();
+#endif
+}
int main(int argc, char **argv)
{
@@ -48,9 +60,8 @@ int main(int argc, char **argv)
// For testing custom surface format
QSurfaceFormat surfaceFormat;
surfaceFormat.setDepthBufferSize(24);
-#if !defined(QT_OPENGL_ES_2)
- surfaceFormat.setSamples(8);
-#endif
+ if (!isOpenGLES())
+ surfaceFormat.setSamples(8);
Q3DBars *widgetchart = new Q3DBars(&surfaceFormat);
QSize screenSize = widgetchart->screen()->size();
diff --git a/tests/scattertest/main.cpp b/tests/scattertest/main.cpp
index 811c7f3b..9b6f51ac 100644
--- a/tests/scattertest/main.cpp
+++ b/tests/scattertest/main.cpp
@@ -36,6 +36,7 @@
int main(int argc, char **argv)
{
QApplication app(argc, argv);
+ //QCoreApplication::setAttribute(Qt::AA_UseOpenGLES);
QWidget *widget = new QWidget;
QHBoxLayout *hLayout = new QHBoxLayout(widget);
@@ -484,7 +485,7 @@ int main(int argc, char **argv)
chart->setGeometry(QRect(0, 0, 800, 800));
modifier->start();
- modifier->renderToImage(); // Initial hidden render
+ //modifier->renderToImage(); // Initial hidden render
widget->show();