Some tweaks for Raspi

This commit is contained in:
Dorian Zedler 2021-04-08 19:05:37 +02:00
parent 5b2ac995fe
commit 48f4e6972d
Signed by: dorian
GPG Key ID: 989DE36109AFA354
3 changed files with 17 additions and 5 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/bin/ScStwMonitor else: unix:!android: target.path = /usr/bin
!isEmpty(target.path): INSTALLS += target !isEmpty(target.path): INSTALLS += target
HEADERS += \ HEADERS += \

View File

@ -535,7 +535,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();