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

@@ -51,7 +51,6 @@
#include <QMessageBox>
#include <QDir>
#include <QOpenGLContext>
#include <QQmlPropertyMap>
#ifdef USE_QUICK_WIDGET
@@ -289,10 +288,8 @@ WelcomePlugin::WelcomePlugin()
bool WelcomePlugin::initialize(const QStringList & /* arguments */, QString *errorMessage)
{
if (!QOpenGLContext().create()) {
*errorMessage = tr("Cannot create OpenGL context.");
if (!Utils::HostOsInfo::canCreateOpenGLContext(errorMessage))
return false;
}
m_welcomeMode = new WelcomeMode;
addAutoReleasedObject(m_welcomeMode);