forked from qt-creator/qt-creator
HostOsInfo/FileUtils/PersistentSettings: Fix build without QtGui
Interesting for command line tools that want to pull this in but not QtGui (e.g. sdktool) Change-Id: Ic2f5c1f3126869cc38bf672345750d7d966560fd Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
This commit is contained in:
@@ -25,8 +25,11 @@
|
||||
|
||||
#include "hostosinfo.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QCoreApplication>
|
||||
|
||||
#if !defined(QT_NO_OPENGL) && defined(QT_GUI_LIB)
|
||||
#include <QOpenGLContext>
|
||||
#endif
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
#undef _WIN32_WINNT
|
||||
@@ -82,14 +85,14 @@ void HostOsInfo::unsetOverrideFileNameCaseSensitivity()
|
||||
|
||||
bool HostOsInfo::canCreateOpenGLContext(QString *errorMessage)
|
||||
{
|
||||
#ifdef QT_NO_OPENGL
|
||||
#if defined(QT_NO_OPENGL) || !defined(QT_GUI_LIB)
|
||||
Q_UNUSED(errorMessage)
|
||||
return false;
|
||||
#else
|
||||
static const bool canCreate = QOpenGLContext().create();
|
||||
if (!canCreate)
|
||||
*errorMessage = QApplication::translate("Utils::HostOsInfo",
|
||||
"Cannot create OpenGL context.");
|
||||
*errorMessage = QCoreApplication::translate("Utils::HostOsInfo",
|
||||
"Cannot create OpenGL context.");
|
||||
return canCreate;
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user