summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--basicsuite/shared/main.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/basicsuite/shared/main.cpp b/basicsuite/shared/main.cpp
index e682c67..c6aefc3 100644
--- a/basicsuite/shared/main.cpp
+++ b/basicsuite/shared/main.cpp
@@ -66,6 +66,7 @@
#include <QSettings>
#include <QQuickStyle>
#include <QIcon>
+#include <QQuickWindow>
#if defined(USE_QTWEBENGINE)
#include <qtwebengineglobal.h>
@@ -73,6 +74,13 @@
#include "engine.h"
+static bool checkGlAvailability()
+{
+ QQuickWindow window;
+ return ((window.sceneGraphBackend() != "software") &&
+ (window.sceneGraphBackend() != "softwarecontext"));
+}
+
int main(int argc, char **argv)
{
//qputenv("QT_IM_MODULE", QByteArray("qtvkb"));
@@ -140,10 +148,15 @@ int main(int argc, char **argv)
QGuiApplication::setFont(font);
}
+ // Material style can be set only for devices supporting GL
QSettings styleSettings;
QString style = styleSettings.value("style").toString();
- if (style.isEmpty() || style == "Default")
- styleSettings.setValue("style", "Material");
+ if (checkGlAvailability()) {
+ if (style.isEmpty() || style == "Default")
+ styleSettings.setValue("style", "Material");
+ } else {
+ qDebug()<<"No GL available, skipping Material style";
+ }
QQuickStyle::setStyle(styleSettings.value("style").toString());
DummyEngine engine;