parent
766496575e
commit
e3e99c6a48
6
Makefile
6
Makefile
|
@ -147,6 +147,12 @@ else
|
||||||
DOTHERSIDE_BUILD_CMD := cmake --build . --config Release $(HANDLE_OUTPUT)
|
DOTHERSIDE_BUILD_CMD := cmake --build . --config Release $(HANDLE_OUTPUT)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
MONITORING ?= false
|
||||||
|
ifneq ($(MONITORING), false)
|
||||||
|
DOTHERSIDE_CMAKE_PARAMS := ${DOTHERSIDE_CMAKE_PARAMS} -DMONITORING:BOOL=ON -DMONITORING_QML_ENTRY_POINT:STRING="/../monitoring/Main.qml"
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
# Qt5 dirs (we can't indent with tabs here)
|
# Qt5 dirs (we can't indent with tabs here)
|
||||||
ifneq ($(detected_OS),Windows)
|
ifneq ($(detected_OS),Windows)
|
||||||
QT5_LIBDIR := $(shell qmake -query QT_INSTALL_LIBS 2>/dev/null)
|
QT5_LIBDIR := $(shell qmake -query QT_INSTALL_LIBS 2>/dev/null)
|
||||||
|
|
|
@ -0,0 +1,44 @@
|
||||||
|
import QtQuick 2.14
|
||||||
|
|
||||||
|
QtObject {
|
||||||
|
id: root
|
||||||
|
|
||||||
|
property string source
|
||||||
|
property bool rethrowErrors: true
|
||||||
|
readonly property alias component: d.component
|
||||||
|
readonly property alias errors: d.errors // QQmlError
|
||||||
|
|
||||||
|
onSourceChanged: d.createComponent()
|
||||||
|
|
||||||
|
readonly property QtObject _d: QtObject {
|
||||||
|
id: d
|
||||||
|
|
||||||
|
property Component component
|
||||||
|
property var errors: null
|
||||||
|
|
||||||
|
function createComponent() {
|
||||||
|
if (component) {
|
||||||
|
component.destroy()
|
||||||
|
component = null
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
component = Qt.createQmlObject(root.source,
|
||||||
|
this,
|
||||||
|
"HotComponentFromSource_dynamicSnippet"
|
||||||
|
)
|
||||||
|
d.errors = null
|
||||||
|
} catch (e) {
|
||||||
|
d.errors = e
|
||||||
|
|
||||||
|
if (root.rethrowErrors)
|
||||||
|
throw e
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
if (root.source)
|
||||||
|
d.createComponent()
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,13 @@
|
||||||
|
import QtQuick 2.14
|
||||||
|
|
||||||
|
Loader {
|
||||||
|
sourceComponent: hotComponent.component
|
||||||
|
|
||||||
|
property alias source: hotComponent.source
|
||||||
|
property alias rethrowErrors: hotComponent.rethrowErrors
|
||||||
|
readonly property alias errors: hotComponent.errors
|
||||||
|
|
||||||
|
HotComponentFromSource {
|
||||||
|
id: hotComponent
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,35 @@
|
||||||
|
import QtQuick 2.14
|
||||||
|
import QtQuick.Controls 2.14
|
||||||
|
|
||||||
|
ApplicationWindow {
|
||||||
|
id: monitorRoot
|
||||||
|
|
||||||
|
width: 800
|
||||||
|
height: 600
|
||||||
|
|
||||||
|
visible: true
|
||||||
|
title: "Status Monitor"
|
||||||
|
|
||||||
|
Timer {
|
||||||
|
interval: 1000
|
||||||
|
running: true
|
||||||
|
repeat: true
|
||||||
|
|
||||||
|
onTriggered: {
|
||||||
|
const xhr = new XMLHttpRequest()
|
||||||
|
xhr.open("GET", "MonitorEntryPoint.qml", false)
|
||||||
|
xhr.send()
|
||||||
|
|
||||||
|
const content = xhr.responseText
|
||||||
|
|
||||||
|
if (loader.source != content)
|
||||||
|
loader.source = content
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
HotLoader {
|
||||||
|
id: loader
|
||||||
|
|
||||||
|
anchors.fill: parent
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,40 @@
|
||||||
|
import QtQuick 2.14
|
||||||
|
import QtQuick.Controls 2.14
|
||||||
|
import QtQuick.Layouts 1.14
|
||||||
|
|
||||||
|
import Monitoring 1.0
|
||||||
|
|
||||||
|
|
||||||
|
Component {
|
||||||
|
ColumnLayout {
|
||||||
|
anchors.fill: parent
|
||||||
|
anchors.margins: 10
|
||||||
|
|
||||||
|
spacing: 15
|
||||||
|
|
||||||
|
Label {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
|
||||||
|
text: "Context properties:"
|
||||||
|
font.bold: true
|
||||||
|
}
|
||||||
|
|
||||||
|
ListView {
|
||||||
|
id: lv
|
||||||
|
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.fillHeight: true
|
||||||
|
|
||||||
|
clip: true
|
||||||
|
|
||||||
|
|
||||||
|
model: Monitor.contexPropertiesNames
|
||||||
|
|
||||||
|
spacing: 5
|
||||||
|
|
||||||
|
delegate: Text {
|
||||||
|
text: modelData
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -16,6 +16,7 @@ lupdate_only{
|
||||||
SOURCES += $$files("$$PWD/*qmldir", true)
|
SOURCES += $$files("$$PWD/*qmldir", true)
|
||||||
SOURCES += $$files("$$PWD/*.qml", true)
|
SOURCES += $$files("$$PWD/*.qml", true)
|
||||||
SOURCES += $$files("$$PWD/*.js", true)
|
SOURCES += $$files("$$PWD/*.js", true)
|
||||||
|
SOURCES += $$files("$$PWD/../monitoring/*.qml", true)
|
||||||
}
|
}
|
||||||
|
|
||||||
# Other *.ts files will be provided by Lokalise platform
|
# Other *.ts files will be provided by Lokalise platform
|
||||||
|
@ -28,6 +29,7 @@ OTHER_FILES += $$files("$$PWD/*qmldir", true)
|
||||||
OTHER_FILES += $$files("$$PWD/*.qml", true)
|
OTHER_FILES += $$files("$$PWD/*.qml", true)
|
||||||
OTHER_FILES += $$files("$$PWD/*.js", true)
|
OTHER_FILES += $$files("$$PWD/*.js", true)
|
||||||
OTHER_FILES += $$files("$$PWD/../src/*.nim", true)
|
OTHER_FILES += $$files("$$PWD/../src/*.nim", true)
|
||||||
|
OTHER_FILES += $$files("$$PWD/../monitoring/*.qml", true)
|
||||||
|
|
||||||
# Additional import path used to resolve QML modules in Qt Creator's code model
|
# Additional import path used to resolve QML modules in Qt Creator's code model
|
||||||
QML_IMPORT_PATH = $$PWD/imports \
|
QML_IMPORT_PATH = $$PWD/imports \
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 742a139b07338f23390b5d6ee84924424bbc8974
|
Subproject commit 7f2dd438325925ae3db073e19eec63a49253e735
|
Loading…
Reference in New Issue