GUI ausbau

This commit is contained in:
2024-11-11 08:33:50 +01:00
parent ca4d8f6b9c
commit 18c600c7c7
5 changed files with 161 additions and 3 deletions

View File

@@ -72,11 +72,23 @@ Item {
columnSpacing: 1
rowSpacing: 2
model: dbm
selectionBehavior: TableView.SelectRows
selectionModel: ItemSelectionModel
delegate:Item
{
id: selModel
model: testTable.model
}
delegate:Rectangle
{
required property bool selected
required property bool current
implicitWidth: 200
implicitHeight: 25
color: selected? "lightblue": palette.base
Text
{
@@ -87,8 +99,21 @@ Item {
MouseArea
{
id: mouseArea
property bool hovered:false
anchors.fill: parent
onClicked: dbm.onRowClicked(row)
hoverEnabled: true
onClicked:
{
dbm.onRowClicked(row)
testTable.selectionModel.select(testTable.model.index(row, 0), ItemSelectionModel.SelectCurrent | ItemSelectionModel.Rows)
}
}
}
}