Skip to content

Commit

Permalink
macOS: use software backend by default with Qt6
Browse files Browse the repository at this point in the history
Signed-off-by: Dirk Hohndel <[email protected]>
  • Loading branch information
dirkhh committed Apr 18, 2022
1 parent 7bd17a1 commit baf23fd
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions subsurface-desktop-main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,13 @@ int main(int argc, char **argv)
void validateGL()
{
QString quickBackend = qgetenv("QT_QUICK_BACKEND");
/* on macOS with Qt6 (maybe others), things only work with the software backend */
#if defined(Q_OS_MACOS) && QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
if (quickBackend.isEmpty()) {
quickBackend = QStringLiteral("software");
qputenv("QT_QUICK_BACKEND", "software");
}
#endif
/* an empty QT_QUICK_BACKEND env. variable means OpenGL (default).
* only validate OpenGL; for everything else print out and return.
* https://doc.qt.io/qt-5/qtquick-visualcanvas-adaptations.html
Expand Down

0 comments on commit baf23fd

Please sign in to comment.