diff options
author | Robert Loehning <robert.loehning@theqtcompany.com> | 2015-09-25 13:15:28 +0200 |
---|---|---|
committer | Robert Loehning <robert.loehning@theqtcompany.com> | 2015-09-25 12:23:02 +0000 |
commit | 734725ffc88e5b04f1ed7d7f801e0b39e7580756 (patch) | |
tree | 3ca78dc0a14d3f0afb120eee85bb6593b3594e67 | |
parent | f229f0dbe51be6a8b0c4fb0a1948bde935f7b423 (diff) | |
download | qt-creator-734725ffc88e5b04f1ed7d7f801e0b39e7580756.tar.gz |
Welcome: Check in initialize if OpenGl context can be created
Task-number: QTCREATORBUG-15040
Change-Id: I8c78ac0a3b979c4ec8e088cd1be3c6aeb04ff339
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
-rw-r--r-- | src/plugins/welcome/welcomeplugin.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/plugins/welcome/welcomeplugin.cpp b/src/plugins/welcome/welcomeplugin.cpp index 4ae5c96c4a..0b7ac6e0e4 100644 --- a/src/plugins/welcome/welcomeplugin.cpp +++ b/src/plugins/welcome/welcomeplugin.cpp @@ -51,6 +51,7 @@ #include <QMessageBox> #include <QDir> +#include <QOpenGLContext> #include <QQmlPropertyMap> #ifdef USE_QUICK_WIDGET @@ -286,8 +287,13 @@ WelcomePlugin::WelcomePlugin() { } -bool WelcomePlugin::initialize(const QStringList & /* arguments */, QString * /* errorMessage */) +bool WelcomePlugin::initialize(const QStringList & /* arguments */, QString *errorMessage) { + if (!QOpenGLContext().create()) { + *errorMessage = tr("Cannot create OpenGL context."); + return false; + } + m_welcomeMode = new WelcomeMode; addAutoReleasedObject(m_welcomeMode); |