FactTextFieldGrid.qml 649 Bytes
Newer Older
1 2
import QtQuick          2.3
import QtQuick.Layouts  1.2
Don Gagne's avatar
Don Gagne committed
3 4 5 6 7

import QGroundControl.FactSystem    1.0
import QGroundControl.Controls      1.0

GridLayout {
8 9
    property var factList       ///< List of Facts to show
    property var factLabels     ///< Labels for facts, if not set, use Fact.name
Don Gagne's avatar
Don Gagne committed
10 11 12 13 14 15 16

    rows: factList.length
    flow: GridLayout.TopToBottom

    Repeater {
        model: parent.factList

17
        QGCLabel { text: factLabels ? factLabels[index] : modelData.name }
Don Gagne's avatar
Don Gagne committed
18 19 20 21 22 23 24 25 26 27 28
    }

    Repeater {
        model: parent.factList

        FactTextField {
            Layout.fillWidth:   true
            fact:               modelData
        }
    }
}