From 4247a4ec798be2d085746f61157921ede8a02eda Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sun, 10 Apr 2022 13:47:38 -1000 Subject: [PATCH] macOS: use software backend by default with Qt6 Signed-off-by: Dirk Hohndel --- subsurface-desktop-main.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/subsurface-desktop-main.cpp b/subsurface-desktop-main.cpp index 1bf044552..1b3483b20 100644 --- a/subsurface-desktop-main.cpp +++ b/subsurface-desktop-main.cpp @@ -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