Files
volvodisplay/main.qml
Daniel Dybing 5a4ae98f94
All checks were successful
Build Raspberry Pi Binary / build-arm64 (push) Successful in 12m6s
Support for 480x480 HDMI display, optimized sensor polling, and touch tools
2026-01-14 16:39:05 +01:00

63 lines
1.7 KiB
QML

import QtQuick
import QtQuick.Controls
Window {
width: 480
height: 480
visible: true
title: "Volvo Display"
// For a circular display, hide the window frame and go full screen
flags: Qt.FramelessWindowHint | Qt.WindowStaysOnTopHint
visibility: Window.FullScreen
Loader {
id: mainLoader
anchors.fill: parent
sourceComponent: introComponent
onStatusChanged: {
if (status === Loader.Ready) console.log("Loader: Loaded " + source)
if (status === Loader.Error) console.log("Loader: Error loading " + source)
}
Binding {
target: mainLoader.item
property: "currentTemp"
value: backend.leftTemp
when: mainLoader.status === Loader.Ready && mainLoader.source.toString().includes("TemperatureGauge.qml")
}
Binding {
target: mainLoader.item
property: "currentRightTemp"
value: backend.rightTemp
when: mainLoader.status === Loader.Ready && mainLoader.source.toString().includes("TemperatureGauge.qml")
}
}
Component {
id: introComponent
Rectangle {
id: bg
anchors.fill: parent
color: "white"
Text {
anchors.centerIn: parent
text: "Hello Pi"
color: "black"
}
}
}
Timer {
interval: 5000
running: true
repeat: false
onTriggered: {
console.log("Timer triggered. Switching to TemperatureGauge.qml")
mainLoader.source = "TemperatureGauge.qml"
}
}
}