Merge branch 'master' into milestone/1.1

This commit is contained in:
Dorian Zedler 2021-05-02 20:18:53 +02:00
commit 45bb39efa7
Signed by: dorian
GPG key ID: 989DE36109AFA354
3 changed files with 19 additions and 6 deletions

View file

@ -17,6 +17,12 @@ DEFINES += QT_DEPRECATED_WARNINGS
# You can also select to disable deprecated APIs only up to a certain version of Qt. # You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
# for raspi
contains(QMAKE_CXX, .*aarch.*):{
message("this is raspi")
DEFINES += RASPI
}
SOURCES += \ SOURCES += \
sources/main.cpp sources/main.cpp
@ -38,7 +44,7 @@ QML_DESIGNER_IMPORT_PATH =
# Default rules for deployment. # Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin qnx: target.path = /tmp/$${TARGET}/bin
# target path for raspi # target path for raspi
else: unix:!android: target.path = /usr/share/ScStwMonitor else: unix:!android: target.path = /usr/bin
!isEmpty(target.path): INSTALLS += target !isEmpty(target.path): INSTALLS += target
HEADERS += \ HEADERS += \

View file

@ -19,7 +19,6 @@
import QtQuick 2.9 import QtQuick 2.9
import QtQuick.Window 2.2 import QtQuick.Window 2.2
import QtQuick.Controls 2.2 import QtQuick.Controls 2.2
import QtGraphicalEffects 1.0
import Qt.labs.settings 1.0 import Qt.labs.settings 1.0
import QtQuick.Layouts 1.0 import QtQuick.Layouts 1.0
@ -515,6 +514,8 @@ Window {
id: loadingInd id: loadingInd
anchors.centerIn: parent anchors.centerIn: parent
visible: !raspi
width: app.landscape() ? parent.height * 0.2 : parent.width *0.2 width: app.landscape() ? parent.height * 0.2 : parent.width *0.2
height: width height: width
@ -536,7 +537,7 @@ Window {
horizontalCenter: parent.horizontalCenter horizontalCenter: parent.horizontalCenter
} }
visible: !textFieldEnableMa.containsMouse visible: !textFieldEnableMa.containsMouse && !raspi
opacity: scStwClient.state === ScStwClient.CONNECTED ? 0:1 opacity: scStwClient.state === ScStwClient.CONNECTED ? 0:1

View file

@ -35,7 +35,7 @@ int main(int argc, char *argv[])
QGuiApplication app(argc, argv); QGuiApplication app(argc, argv);
app.setOrganizationName("itsblue"); app.setOrganizationName("ScStwMonitor");
app.setOrganizationDomain("itsblue.de"); app.setOrganizationDomain("itsblue.de");
QQmlApplicationEngine engine; QQmlApplicationEngine engine;
@ -68,14 +68,20 @@ int main(int argc, char *argv[])
else else
engine.rootContext()->setContextProperty("darkMode", false); engine.rootContext()->setContextProperty("darkMode", false);
#ifdef RASPI
engine.rootContext()->setContextProperty("raspi", true);
#else
engine.rootContext()->setContextProperty("raspi", false);
#endif
engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
if (engine.rootObjects().isEmpty()) if (engine.rootObjects().isEmpty())
return -1; return -1;
#if defined(Q_OS_IOS) #if defined(Q_OS_IOS)
SleepPrevent sp; SleepPrevent sp;
sp.setTimerDisabled(); sp.setTimerDisabled();
#endif #endif
// move the cursor into an invisible position // move the cursor into an invisible position
QScreen *screen = QGuiApplication::primaryScreen(); QScreen *screen = QGuiApplication::primaryScreen();