VehicleSetupSummary.qml 1.14 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
// Currently unused but leaving here for future conversion to QML

import QtQuick 2.0
import QtQuick.Controls 1.2

Item {
    width: parent.width
    height: parent.height

    ListModel {
        id: vehicleComponentModelTest
        ListElement {
            name: "Gyroscope"
            description: "Long description"
            setupComplete: false
        }
        ListElement {
            name: "Magnetometer"
            description: "Long description"
            setupComplete: false
        }
        ListElement {
            name: "Radio"
            description: "Long description"
            setupComplete: true
        }
    }

    ListView {
        id: componentList
        anchors.fill: parent
        model: vehicleComponentModel

        section.property: "setupComplete"
        section.criteria: ViewSection.FullString
        section.delegate: Text { text: section == "true" ? "Setup complete" : "Requires setup" }

        delegate: Item {
            width: 180; height: 40
            Column {
                Text { text: "Component:" + model.name }
                Text { text: model.description }
            }
        }
    }
}