C

Qt Cluster: Rendering and Recovery from Main UI Failure

// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause

// This file is part of the Qt Safe Renderer module

import QtQuick
import ClusterDemo

Item {
    property real batterymeterNeedleRotation: -batteryValue * batteryDegreesPerValue
    property real batteryValue: ValueSource.batteryLevel
    property real maxValueAngle: 317
    property real minValueAngle: 225
    property real maximumValue: 100
    property real batteryDegreesPerValue: Math.abs((maxValueAngle - minValueAngle) / maximumValue)

    anchors.right: parent.right
    anchors.top: parent.top
    anchors.rightMargin: 591
    anchors.topMargin: 83
    width: 107
    height: 7
    rotation: fpsmeterNeedleRotation - 45

    Image {
//        width: 37
//        height: 3
        anchors.left: parent.left
        anchors.verticalCenterOffset: 0
        anchors.leftMargin: -14
        anchors.verticalCenter: parent.verticalCenter
        source: "image://etc/gaugeNeedleSmall.png"
    }

    Behavior on batteryValue {
        enabled: !ValueSource.runningInDesigner && !ValueSource.automaticDemoMode && startupAnimationsFinished
        PropertyAnimation { duration: 250 }
    }
}