Allow including cpp sources in the overlay

This commit is contained in:
Michael Zanetti 2021-06-29 13:50:02 +02:00
parent 69829c4edd
commit 77a66123f2
2 changed files with 14 additions and 0 deletions

View File

@ -53,6 +53,10 @@
#include "logging.h"
#ifdef OVERLAY_QMLTYPES
#include OVERLAY_QMLTYPES
#endif
NYMEA_LOGGING_CATEGORY(dcApplication, "Application")
NYMEA_LOGGING_CATEGORY(qml, "qml")
@ -164,6 +168,10 @@ int main(int argc, char *argv[])
qmlRegisterType<MouseObserver>("Nymea", 1, 0, "MouseObserver");
#ifdef OVERLAY_QMLTYPES
registerOverlayTypes("Nymea", 1, 0);
#endif
engine->rootContext()->setContextProperty("appVersion", APP_VERSION);
engine->rootContext()->setContextProperty("qtBuildVersion", QT_VERSION_STR);
engine->rootContext()->setContextProperty("qtVersion", qVersion());

View File

@ -55,6 +55,12 @@ RESOURCES += resources.qrc \
!equals(OVERLAY_PATH, "") {
message("Resource overlay enabled. Will be using overlay from $${OVERLAY_PATH}")
RESOURCES += $${OVERLAY_PATH}/overlay.qrc
exists($${OVERLAY_PATH}/src/src.pri) {
message("Including sources from overlay")
include($${OVERLAY_PATH}/src/src.pri)
DEFINES += OVERLAY_QMLTYPES=\\\"$${OVERLAY_PATH}/src/qmltypes.h\\\"
}
} else {
RESOURCES += styles.qrc
}