hahn-kev / QmlGrid

This is a QML Data grid using Qt Quick Controls 2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

QmlGrid

DataTable.qml has the main control, it depends on a couple other files.

Some examples are shown in ExampleGrid1.qml and AdvancedExample.qml

Simple grid

image

DataTable {
    id: tableId
    columns: [
        {name:"name", label: "First Name", type:"string"},
        {name:"lastName", label: "Last Name", type:"string"},
        {name:"age", type:"number"},
    ]
    rows: [
        {lastName: "Bobberson", name:"bob", age: 4}, 
        {lastName: "be", name: "jo", age: 6},
        {lastName: "ington", name: "Alex", age: 50},
        {lastName: "Butterfly", name: "Rebekah", age: 22},
    ]
    onColumnHeaderClicked: {
        print("sorting column: " + column.name);
    }
    onCellClicked: print("clicked cell:" + column.name + "|" + row.name)
}

Advanced grid

image

About

This is a QML Data grid using Qt Quick Controls 2

License:MIT License


Languages

Language:QML 89.9%Language:QMake 7.8%Language:C++ 2.3%