path: root/src/plugins
diff options
authorLaszlo Agocs <>2011-10-15 00:17:30 +0300
committerQt by Nokia <>2011-10-17 10:29:57 +0200
commit5d8d7b1dbc703c381033681c2cd4f7a912f60850 (patch)
tree6b5016d4b218570306a547a4d97dc520a9cf82ed /src/plugins
parent86ea95259d3fe827e340b4691710d7d971efc35a (diff)
Add a warning and a return value to xcb's createGLPlatformContext
There was no value returned previously when none of GLX, EGL, DRI was enabled. Now we show a warning message and return null (resulting in a crash). Previously not returning a value resulted in obscure crashes with strange-looking call stacks, now it will be clear what the problem is. This is particularly important because not having libx11-xcb-dev installed results in silently disabled xlib support which in turn disallows the usage of glx too. The result is an obscure crash in any GL (e.g. QML2) app. Now there will be a proper warning message at least. Change-Id: I15cf3a6c16ca373d4ada7abb6d3c8f7e30c1e03d Reviewed-by: Samuel Rødal <>
Diffstat (limited to 'src/plugins')
1 files changed, 2 insertions, 0 deletions
diff --git a/src/plugins/platforms/xcb/qxcbintegration.cpp b/src/plugins/platforms/xcb/qxcbintegration.cpp
index 91d7e287f3..aa5c7e444b 100644
--- a/src/plugins/platforms/xcb/qxcbintegration.cpp
+++ b/src/plugins/platforms/xcb/qxcbintegration.cpp
@@ -175,6 +175,8 @@ QPlatformOpenGLContext *QXcbIntegration::createPlatformOpenGLContext(QOpenGLCont
#elif defined(XCB_USE_DRI2)
return new QDri2Context(context->format(), context->shareHandle());
+ qWarning("Cannot create platform GL context, none of GLX, EGL, DRI2 is enabled");
+ return 0;
QPlatformBackingStore *QXcbIntegration::createPlatformBackingStore(QWindow *window) const