summaryrefslogtreecommitdiffstats
path: root/tradeshow
diff options
context:
space:
mode:
Diffstat (limited to 'tradeshow')
-rw-r--r--tradeshow/iot-sensortag/main.cpp9
-rw-r--r--tradeshow/iot-sensortag/resources/base/TopToolbar.qml7
-rw-r--r--tradeshow/iot-sensortag/resources/base/main.qml1
3 files changed, 16 insertions, 1 deletions
diff --git a/tradeshow/iot-sensortag/main.cpp b/tradeshow/iot-sensortag/main.cpp
index 0925a5a..5164919 100644
--- a/tradeshow/iot-sensortag/main.cpp
+++ b/tradeshow/iot-sensortag/main.cpp
@@ -161,6 +161,14 @@ int main(int argc, char *argv[])
qCDebug(boot2QtDemos) << "screen dimensions" << scr->geometry().size();
qCDebug(boot2QtDemos) << "Scale factor:" << sf.data();
+ QString addressString;
+ for (auto address : QNetworkInterface::allAddresses()) {
+ if (address.protocol() == QAbstractSocket::IPv4Protocol && address != QHostAddress(QHostAddress::LocalHost)
+ && !address.toString().startsWith(QLatin1String("169"))) {
+ addressString.append(address.toString());
+ addressString.append(QLatin1Char('/'));
+ }
+ }
#if defined(UI_SMALL)
mainFile = namingScheme + QStringLiteral("/resources/small/MainSmall.qml");
styleFile = namingScheme + QStringLiteral("/resources/small/StyleSmall.qml");
@@ -216,6 +224,7 @@ int main(int argc, char *argv[])
item->setProperty("dataProviderPool", QVariant::fromValue(dataProviderPool));
item->setProperty("contentFile", mainFile);
item->setProperty("seriesStorage", QVariant::fromValue(&seriesStorage));
+ item->setProperty("addresses", addressString);
}
int returnValue = app.exec();
dataProviderPool->stopScanning();
diff --git a/tradeshow/iot-sensortag/resources/base/TopToolbar.qml b/tradeshow/iot-sensortag/resources/base/TopToolbar.qml
index eb94cb2..fd5054d 100644
--- a/tradeshow/iot-sensortag/resources/base/TopToolbar.qml
+++ b/tradeshow/iot-sensortag/resources/base/TopToolbar.qml
@@ -151,7 +151,8 @@ Item {
}
Text {
- text: Qt.formatDateTime(new Date, "dddd, MMMM d, yyyy")
+ property bool showAddress : false
+ text: showAddress ? mainWindow.addresses : Qt.formatDateTime(new Date, "dddd, MMMM d, yyyy")
color: "white"
anchors.bottom: parent.bottom
anchors.bottomMargin: 16
@@ -160,6 +161,10 @@ Item {
horizontalAlignment: Text.AlignRight
font.pixelSize: Style.topToolbarSmallFontSize
font.capitalization: Font.AllUppercase
+ MouseArea {
+ anchors.fill: parent
+ onClicked: parent.showAddress = !parent.showAddress
+ }
}
Text {
diff --git a/tradeshow/iot-sensortag/resources/base/main.qml b/tradeshow/iot-sensortag/resources/base/main.qml
index 2840433..6d492d5 100644
--- a/tradeshow/iot-sensortag/resources/base/main.qml
+++ b/tradeshow/iot-sensortag/resources/base/main.qml
@@ -59,6 +59,7 @@ Window {
property DataProviderPool dataProviderPool
property SeriesStorage seriesStorage
property real globalBlinkOpacity: 1.0
+ property string addresses : ""
// Size defaults to the small display
width: 1920