summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMikko Gronoff <mikko.gronoff@qt.io>2018-09-21 13:09:53 +0300
committerMikko Gronoff <mikko.gronoff@qt.io>2018-09-21 13:10:21 +0300
commitecc5c864e3a18560f5d8d7120e8c2dc54477d563 (patch)
tree407c9dffea7094f5246badc48419ca667db6edc3
parent97863a4992276a3d1aeb3c1bb9ef5a280a5e8b12 (diff)
parent7e1d96ef9ca1ff2449d1d3c4b1eefb42234da7dd (diff)
Merge remote-tracking branch 'origin/5.11' into 5.12
* origin/5.11: 7e1d96e Use Material style only on devices with gpu Change-Id: Ia0a48b7d6d3fde45cb4c68344a663ed15bf0d3c9
-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;