36 lines
668 B
QML
36 lines
668 B
QML
import QtQuick
|
||
import QtQuick.Controls
|
||
import QtQuick.Layouts
|
||
|
||
TableView
|
||
{
|
||
id: table
|
||
anchors.fill: parent
|
||
columnSpacing: 2
|
||
rowSpacing: 2
|
||
model: meinModel // z. B. QStandardItemModel mit 9 Spalten
|
||
|
||
delegate: Rectangle
|
||
{
|
||
|
||
required property string display
|
||
width: 100
|
||
height: 20
|
||
border.color: "#ccc"
|
||
|
||
Text
|
||
{
|
||
anchors.centerIn: parent
|
||
text: display
|
||
font.pixelSize: 10
|
||
}
|
||
}
|
||
|
||
// // Optional: Spaltenbreiten setzen
|
||
// onModelChanged: {
|
||
// for (let i = 0; i < model.columns; ++i)
|
||
// table.setColumnWidth(i, 100)
|
||
// }
|
||
}
|
||
|