summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@theqtcompany.com>2014-10-29 12:22:26 +0200
committerTomi Korpipää <tomi.korpipaa@digia.com>2014-10-29 13:08:40 +0200
commita96cf650b967d88757bc4e550dbdbbd24dfe55cc (patch)
treecc86ec0760c6f588db12d9682bd35d64f90eaa0b /tests
parent1797a7697d975545dd5b5b0d280c3a054dab39c5 (diff)
Fix crash when initializing QCustom3DLabel out of context.
Task-number: QTRD-3391 Change-Id: I5c2f2b674e50e7d39bc9355ebc9bcf05f22d5a39 Reviewed-by: Tomi Korpipää <tomi.korpipaa@digia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/barstest/main.cpp22
1 files changed, 9 insertions, 13 deletions
diff --git a/tests/barstest/main.cpp b/tests/barstest/main.cpp
index af033990..1305fff9 100644
--- a/tests/barstest/main.cpp
+++ b/tests/barstest/main.cpp
@@ -35,22 +35,19 @@
#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
-}
+#include <QtDataVisualization/QCustom3DItem>
+#include <QtDataVisualization/QCustom3DLabel>
+#include <QtDataVisualization/QCustom3DVolume>
int main(int argc, char **argv)
{
QApplication app(argc, argv);
+ // Test creating custom items before graph is created
+ QCustom3DItem customItem;
+ QCustom3DLabel customLabel;
+ QCustom3DVolume customVolume;
+
QWidget *widget = new QWidget;
QHBoxLayout *hLayout = new QHBoxLayout(widget);
QVBoxLayout *vLayout = new QVBoxLayout();
@@ -60,8 +57,7 @@ int main(int argc, char **argv)
// For testing custom surface format
QSurfaceFormat surfaceFormat;
surfaceFormat.setDepthBufferSize(24);
- if (!isOpenGLES())
- surfaceFormat.setSamples(8);
+ surfaceFormat.setSamples(8);
Q3DBars *widgetchart = new Q3DBars(&surfaceFormat);
QSize screenSize = widgetchart->screen()->size();