From a96cf650b967d88757bc4e550dbdbbd24dfe55cc Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Wed, 29 Oct 2014 12:22:26 +0200 Subject: Fix crash when initializing QCustom3DLabel out of context. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-number: QTRD-3391 Change-Id: I5c2f2b674e50e7d39bc9355ebc9bcf05f22d5a39 Reviewed-by: Tomi Korpipää --- tests/barstest/main.cpp | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) (limited to 'tests') 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 #include #include - -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 +#include +#include 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(); -- cgit v1.2.3