C

Event Sender: Sending Messages to Applications

// Copyright (C) 2025 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial

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

Item {
    id: carFrame

    width: electricCar ? carShapeElectric.width : carShape.width
    height: electricCar ? carShapeElectric.height : carShape.height

    property bool electricCar: false

    property bool headLight: false
    property bool leftBlink: false
    property bool rightBlink: false
    property bool breakLight: false

    property bool leftFrontDoorOpen: false
    property bool leftBackDoorOpen: false
    property bool rightFrontDoorOpen: false
    property bool rightBackDoorOpen: false
    property bool bootDoorOpen: false
    property bool hoodDoorOpen: false

    property real scaleFactor: 0.9

    // Sports Car
    Image {
        id: carShape
        width: 150 * scaleFactor
        height: 280 * scaleFactor
        visible: !electricCar
        source: "qrc:/S-Car_Shape.png"
    }

    Image {
        width: carShape.width
        height: carShape.height
        visible: !electricCar
        source: breakLight ? "qrc:/S-Car_BrakesON.png" : "qrc:/S-Car_BrakesOFF.png"
    }

    Image {
        width: carShape.width
        height: carShape.height
        visible: !electricCar
        source: headLight ? "qrc:/S-Car_LowBeamsON.png" : "qrc:/S-Car_LowBeamsOFF.png"
    }

    Image {
        width: carShape.width
        height: carShape.height
        visible: !electricCar
        source: leftBlink ? "qrc:/S-Car_TurnLeftON.png" : "qrc:/S-Car_TurnLeftOFF.png"
    }

    Image {
        width: carShape.width
        height: carShape.height
        visible: !electricCar
        source: rightBlink ? "qrc:/S-Car_TurnRightON.png" : "qrc:/S-Car_TurnRightOFF.png"
    }
}