Centralize checking for OpenGL

Change-Id: Ic2212c8519f4c771ba3e3c61dd32073b93db7ed9
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
This commit is contained in:
Robert Loehning
2015-09-29 16:43:42 +02:00
parent 0e8a0cac47
commit a835b51407
5 changed files with 18 additions and 12 deletions

View File

@@ -36,8 +36,8 @@
#include <analyzerbase/analyzermanager.h>
#include <extensionsystem/pluginmanager.h>
#include <utils/hostosinfo.h>
#include <QOpenGLContext>
#include <QtPlugin>
using namespace Analyzer;
@@ -54,10 +54,8 @@ bool QmlProfilerPlugin::initialize(const QStringList &arguments, QString *errorS
{
Q_UNUSED(arguments)
if (!QOpenGLContext().create()) {
*errorString = tr("Cannot create OpenGL context.");
if (!Utils::HostOsInfo::canCreateOpenGLContext(errorString))
return false;
}
auto tool = new QmlProfilerTool(this);
auto widgetCreator = [tool] { return tool->createWidgets(); };