Commit b92c00ba authored by Robert Loehning's avatar Robert Loehning

Check in initialize if OpenGl context can be created

Change-Id: I224c2559c1e65cfc3b699e7ec7b56dee8308bd83
Task-number: QTCREATORBUG-15101
Reviewed-by: default avatarThomas Hartmann <Thomas.Hartmann@digia.com>
Reviewed-by: default avatarEike Ziller <eike.ziller@theqtcompany.com>
parent 734725ff
......@@ -60,6 +60,7 @@
#include <qplugin.h>
#include <QDebug>
#include <QProcessEnvironment>
#include <QOpenGLContext>
namespace QmlDesigner {
......@@ -125,8 +126,10 @@ QmlDesignerPlugin::~QmlDesignerPlugin()
////////////////////////////////////////////////////
bool QmlDesignerPlugin::initialize(const QStringList & /*arguments*/, QString *errorMessage/* = 0*/) // =0;
{
if (errorMessage)
errorMessage->clear();
if (!QOpenGLContext().create()) {
*errorMessage = tr("Cannot create OpenGL context.");
return false;
}
data = new QmlDesignerPluginData;
......
......@@ -37,6 +37,7 @@
#include <analyzerbase/analyzermanager.h>
#include <extensionsystem/pluginmanager.h>
#include <QOpenGLContext>
#include <QtPlugin>
using namespace Analyzer;
......@@ -50,7 +51,11 @@ QmlProfilerPlugin *QmlProfilerPlugin::instance = 0;
bool QmlProfilerPlugin::initialize(const QStringList &arguments, QString *errorString)
{
Q_UNUSED(arguments)
Q_UNUSED(errorString)
if (!QOpenGLContext().create()) {
*errorString = tr("Cannot create OpenGL context.");
return false;
}
auto tool = new QmlProfilerTool(this);
auto widgetCreator = [tool] { return tool->createWidgets(); };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment