Only create OpenGL context on Linux

.. MacOS Qt crashes when destroying it, OpenGL is *that*
   broken by Apple.

.. applied to Windows too, despite it not being an issue
   reported there is no value in doing it so removed.

[publish binaries]
This commit is contained in:
Mark Liversedge
2020-09-15 10:58:23 +01:00
parent 0d4c289b9e
commit 8e84ed280d
2 changed files with 9 additions and 2 deletions

View File

@@ -257,7 +257,9 @@ QString GcCrashDialog::versionHTML()
"<br>DB Schema: %5"
"<br>Metrics: %7"
"<br>OS: %6"
#ifdef Q_OS_LINUX
"<br>OpenGL: %8"
#endif
"<br>")
.arg(__DATE__)
.arg(__TIME__)
@@ -270,7 +272,10 @@ QString GcCrashDialog::versionHTML()
.arg(schemaVersion)
.arg(os)
.arg(factory.metricCount())
.arg(gl_version);
#ifdef Q_OS_LINUX
.arg(gl_version)
#endif
;
QString lib_version = tr(
"<table>"

View File

@@ -372,8 +372,9 @@ MainWindow::MainWindow(const QDir &home)
spacer->setFixedWidth(5 *dpiYFactor);
head->addWidget(spacer);
#ifdef Q_OS_LINUX
// check opengl is available with version 2 or higher
// only do this on Linux since Windows and MacOS have opengl "issues"
QOffscreenSurface surf;
surf.create();
@@ -384,6 +385,7 @@ MainWindow::MainWindow(const QDir &home)
// OpenGL version number
gl_version = QString::fromUtf8((char *)(ctx.functions()->glGetString(GL_VERSION)));
gl_major = Utils::number(gl_version);
#endif
/*----------------------------------------------------------------------
* Central Widget