diff options
author | Liang Qi <liang.qi@theqtcompany.com> | 2016-02-10 10:19:28 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@theqtcompany.com> | 2016-02-10 10:19:28 +0100 |
commit | d1f4409a2b1e0143be0d4fd734f3dd83255ea35c (patch) | |
tree | 52daa990c1da2c2ce9656fe4065b73a848a57a5a /src/webengine/render_widget_host_view_qt_delegate_quick.cpp | |
parent | 8e5ac243ac774209b77bec42eda2ec43f9c9b04a (diff) | |
parent | 776442f2117c4b2d6dac75ab56b42bd82e2ce6d0 (diff) |
Merge remote-tracking branch 'origin/5.6' into dev
Conflicts:
tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp
tests/auto/widgets/widgets.pro
Change-Id: Id9444359ed2e35d469331db96a355c9ea2d095d5
Diffstat (limited to 'src/webengine/render_widget_host_view_qt_delegate_quick.cpp')
-rw-r--r-- | src/webengine/render_widget_host_view_qt_delegate_quick.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/webengine/render_widget_host_view_qt_delegate_quick.cpp b/src/webengine/render_widget_host_view_qt_delegate_quick.cpp index eebf0ceb6..1101bd483 100644 --- a/src/webengine/render_widget_host_view_qt_delegate_quick.cpp +++ b/src/webengine/render_widget_host_view_qt_delegate_quick.cpp @@ -44,6 +44,7 @@ #include <QGuiApplication> #include <QQuickPaintedItem> #include <QQuickWindow> +#include <QSurfaceFormat> #include <QVariant> #include <QWindow> #include <private/qquickwindow_p.h> @@ -63,6 +64,20 @@ RenderWidgetHostViewQtDelegateQuick::RenderWidgetHostViewQtDelegateQuick(RenderW return; setFocus(true); setActiveFocusOnTab(true); + +#ifdef Q_OS_OSX + // Check that the default QSurfaceFormat OpenGL profile matches the global OpenGL shared + // context profile, otherwise this could lead to a nasty crash. + QOpenGLContext *globalSharedContext = QOpenGLContext::globalShareContext(); + if (globalSharedContext) { + QSurfaceFormat sharedFormat = globalSharedContext->format(); + QSurfaceFormat defaultFormat = QSurfaceFormat::defaultFormat(); + if (defaultFormat.profile() != sharedFormat.profile()) { + qFatal("QWebEngine: Default QSurfaceFormat OpenGL profile does not match global shared context OpenGL profile. Please make sure you set a new QSurfaceFormat before the QtGui application instance is created."); + } + } +#endif + } void RenderWidgetHostViewQtDelegateQuick::initAsChild(WebContentsAdapterClient* container) |