summaryrefslogtreecommitdiffstats
path: root/basicsuite/shared/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'basicsuite/shared/main.cpp')
-rw-r--r--basicsuite/shared/main.cpp49
1 files changed, 25 insertions, 24 deletions
diff --git a/basicsuite/shared/main.cpp b/basicsuite/shared/main.cpp
index 4afbbe4..e682c67 100644
--- a/basicsuite/shared/main.cpp
+++ b/basicsuite/shared/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2018 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the examples of Qt for Device Creation.
@@ -79,7 +79,12 @@ int main(int argc, char **argv)
qputenv("QT_QUICK_CONTROLS_CONF", "/data/user/qt/qtquickcontrols2/qtquickcontrols2.conf");
QIcon::setThemeName("gallery");
QIcon::setThemeSearchPaths(QStringList() << "/data/user/qt/qtquickcontrols2/icons");
- QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
+
+ // Do not set HighDpiScaling for emulator, see QTBUG-64815
+ if (qEnvironmentVariableIsEmpty("QTGLESSTREAM_DISPLAY")) {
+ QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
+ }
+
QApplication app(argc, argv);
#if defined(USE_QTWEBENGINE)
@@ -95,15 +100,15 @@ int main(int argc, char **argv)
QFontDatabase::addApplicationFont(":/fonts/TitilliumWeb-Black.ttf");
//For eBike demo
- QFontDatabase::addApplicationFont(":/fonts/Montserrat-Bold.ttf");
- QFontDatabase::addApplicationFont(":/fonts/Montserrat-Light.ttf");
- QFontDatabase::addApplicationFont(":/fonts/Montserrat-Medium.ttf");
- QFontDatabase::addApplicationFont(":/fonts/Montserrat-Regular.ttf");
- QFontDatabase::addApplicationFont(":/fonts/Teko-Bold.ttf");
- QFontDatabase::addApplicationFont(":/fonts/Teko-Light.ttf");
- QFontDatabase::addApplicationFont(":/fonts/Teko-Medium.ttf");
- QFontDatabase::addApplicationFont(":/fonts/Teko-Regular.ttf");
- QFontDatabase::addApplicationFont(":/fonts/fontawesome-webfont.ttf");
+ QFontDatabase::addApplicationFont(":/fonts/ebike-fonts/Montserrat-Bold.ttf");
+ QFontDatabase::addApplicationFont(":/fonts/ebike-fonts/Montserrat-Light.ttf");
+ QFontDatabase::addApplicationFont(":/fonts/ebike-fonts/Montserrat-Medium.ttf");
+ QFontDatabase::addApplicationFont(":/fonts/ebike-fonts/Montserrat-Regular.ttf");
+ QFontDatabase::addApplicationFont(":/fonts/ebike-fonts/Teko-Bold.ttf");
+ QFontDatabase::addApplicationFont(":/fonts/ebike-fonts/Teko-Light.ttf");
+ QFontDatabase::addApplicationFont(":/fonts/ebike-fonts/Teko-Medium.ttf");
+ QFontDatabase::addApplicationFont(":/fonts/ebike-fonts/Teko-Regular.ttf");
+ QFontDatabase::addApplicationFont(":/fonts/ebike-fonts/fontawesome-webfont.ttf");
QString path = app.applicationDirPath();
@@ -135,10 +140,6 @@ int main(int argc, char **argv)
QGuiApplication::setFont(font);
}
- QString videosPath = QStringLiteral("file://");
- QString defaultVideoUrl = QStringLiteral("file:///data/videos/Qt_video_720p.webm");
- videosPath.append("/data/videos");
-
QSettings styleSettings;
QString style = styleSettings.value("style").toString();
if (style.isEmpty() || style == "Default")
@@ -153,17 +154,17 @@ int main(int argc, char **argv)
applicationengine.rootContext()->setContextProperty("appFont", appFont);
applicationengine.rootContext()->setContextProperty("availableStyles", QQuickStyle::availableStyles());
- applicationengine.rootContext()->setContextProperty("VideosLocation", videosPath);
- applicationengine.rootContext()->setContextProperty("DefaultVideoUrl", defaultVideoUrl);
+ QSettings demoSettings("Boot2Qt-demos", "demoSettings");
- QSettings themeColorSettings("QtLauncher", "colorSettings");
+ applicationengine.rootContext()->setContextProperty("_backgroundColor", demoSettings.value("backgroundColor", "#09102b"));
+ applicationengine.rootContext()->setContextProperty("_primaryGreen", demoSettings.value("primaryGreen", "#41cd52"));
+ applicationengine.rootContext()->setContextProperty("_mediumGreen", demoSettings.value("mediumGreen", "#21be2b"));
+ applicationengine.rootContext()->setContextProperty("_darkGreen", demoSettings.value("darkGreen", "#17a81a"));
+ applicationengine.rootContext()->setContextProperty("_primaryGrey", demoSettings.value("primaryGrey", "#9d9faa"));
+ applicationengine.rootContext()->setContextProperty("_secondaryGrey", demoSettings.value("secondaryGrey", "#3a4055"));
- applicationengine.rootContext()->setContextProperty("_backgroundColor", themeColorSettings.value("backgroundColor", "#09102b"));
- applicationengine.rootContext()->setContextProperty("_primaryGreen", themeColorSettings.value("primaryGreen", "#41cd52"));
- applicationengine.rootContext()->setContextProperty("_mediumGreen", themeColorSettings.value("mediumGreen", "#21be2b"));
- applicationengine.rootContext()->setContextProperty("_darkGreen", themeColorSettings.value("darkGreen", "#17a81a"));
- applicationengine.rootContext()->setContextProperty("_primaryGrey", themeColorSettings.value("primaryGrey", "#9d9faa"));
- applicationengine.rootContext()->setContextProperty("_secondaryGrey", themeColorSettings.value("secondaryGrey", "#3a4055"));
+ applicationengine.rootContext()->setContextProperty("VideosLocation", demoSettings.value("videosLocation", "file:///data/videos"));
+ applicationengine.rootContext()->setContextProperty("DefaultVideoUrl", demoSettings.value("defaultVideoUrl", "file:///data/videos/Qt+for+Designers+and+Developers.mp4"));
applicationengine.load(QUrl::fromLocalFile(path + "/SharedMain.qml"));