summaryrefslogtreecommitdiffstats
path: root/tradeshow
diff options
context:
space:
mode:
Diffstat (limited to 'tradeshow')
-rw-r--r--tradeshow/iot-sensortag/main.cpp17
-rw-r--r--tradeshow/iot-sensortag/resources/base/TopToolbar.qml24
-rw-r--r--tradeshow/iot-sensortag/resources/base/main.qml1
3 files changed, 42 insertions, 0 deletions
diff --git a/tradeshow/iot-sensortag/main.cpp b/tradeshow/iot-sensortag/main.cpp
index 5dd9a7e..ba5324b 100644
--- a/tradeshow/iot-sensortag/main.cpp
+++ b/tradeshow/iot-sensortag/main.cpp
@@ -78,8 +78,22 @@
Q_DECLARE_LOGGING_CATEGORY(boot2QtDemos)
Q_LOGGING_CATEGORY(boot2QtDemos, "boot2qt.demos.iot")
+QString loggingOutput;
+QQuickWindow *loggingItem{nullptr};
+void handleMessageOutput(QtMsgType, const QMessageLogContext &, const QString &text)
+{
+ loggingOutput.prepend("\n");
+ loggingOutput.prepend(text);
+
+ loggingOutput.chop(loggingOutput.size() - 1024);
+ if (loggingItem)
+ loggingItem->setProperty("loggingOutput", loggingOutput);
+}
+
int main(int argc, char *argv[])
{
+ auto oldHandler = qInstallMessageHandler(handleMessageOutput);
+
// QtChars mandate using QApplication as it uses the graphics view fw
QApplication app(argc, argv);
@@ -184,9 +198,12 @@ int main(int argc, char *argv[])
item->setProperty("contentFile", mainFile);
item->setProperty("seriesStorage", QVariant::fromValue(&seriesStorage));
item->setProperty("addresses", addressString);
+ loggingItem = item;
}
int returnValue = app.exec();
remoteProviderPool->stopScanning();
+ qInstallMessageHandler(oldHandler);
+
return returnValue;
}
diff --git a/tradeshow/iot-sensortag/resources/base/TopToolbar.qml b/tradeshow/iot-sensortag/resources/base/TopToolbar.qml
index 6e5d9d2..69722b7 100644
--- a/tradeshow/iot-sensortag/resources/base/TopToolbar.qml
+++ b/tradeshow/iot-sensortag/resources/base/TopToolbar.qml
@@ -67,6 +67,26 @@ Item {
visible: true
}
+ Image {
+ id: logWindow
+ source: "images/bg_blue.jpg"
+ x: sensorItem.x
+ y: topToolbar.height
+ width: Math.min(mainWindow.width, 600)
+ height: Math.min(mainWindow.height - topToolbar.height, 400)
+ anchors.horizontalCenter: parent.horizontalCenter
+ visible: false
+ Text {
+ clip: true
+ color: "white"
+ font.pixelSize: 26
+ text: mainWindow.loggingOutput ? mainWindow.loggingOutput : "...debug..."
+ anchors.fill: parent
+ anchors.margins: 15
+ }
+ }
+
+
Item {
id: sensorItem
height: topToolbar.height
@@ -134,6 +154,10 @@ Item {
font.pixelSize: Style.topToolbarLargeFontSize
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: parent.bottom
+ MouseArea {
+ anchors.fill: parent
+ onClicked: clickBait.activate(logWindow)
+ }
}
Timer {
diff --git a/tradeshow/iot-sensortag/resources/base/main.qml b/tradeshow/iot-sensortag/resources/base/main.qml
index caa8617..c756c6d 100644
--- a/tradeshow/iot-sensortag/resources/base/main.qml
+++ b/tradeshow/iot-sensortag/resources/base/main.qml
@@ -63,6 +63,7 @@ Window {
property real globalBlinkOpacity: 1.0
property string addresses : ""
property bool localSelected : true
+ property var loggingOutput : null
function getCurrentPool() {
if (localSelected)