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 int direction: Qt.NoArrow
    property bool active: false
    property bool flashing: false

    property url iconOn: "image://etc/Icon_TurnLeft_ON.png"
    property url iconOff: "image://etc/Icon_TurnLeft_OFF.png"

    Timer {
        interval: 500
        running: (direction !== Qt.NoArrow)
        repeat: true
        onTriggered: flashing = !flashing
    }

    Image {
        source: (active && flashing) ? iconOn : iconOff
        mirror: direction === Qt.RightArrow
        anchors.centerIn: parent
    }
}