not able to get a border to display using REctangle obj or frame in tableView
Rectangle {
id: tableViewRect
width: 880
height: 490
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
anchors.leftMargin: 10
border.width: 10
border.color: "lightsteelblue"
color: "transparent"
TableView {
id: tableView
anchors.fill: parent
sortIndicatorVisible: true
sortIndicatorOrder: 1
sortIndicatorColumn: 1
frameVisible: true
model: UserEventLog
style: TableViewStyle {
// frame: Rectangle {
// border.color: "lightsteelblue"
// border.width: 50
// }
headerDelegate: Rectangle {
height: textItem.implicitHeight * 1.2
width: textItem.implicitWidth
color: "lightsteelblue"
Text {
id: textItem
anchors.centerIn: parent
text: styleData.value
}
Rectangle {
anchors.right: parent.right
anchors.top: parent.top
anchors.bottom: parent.bottom
width: 3
color: "yellow"
}
}
}
TableViewColumn {
role: "id"
title: "id"
width: 100
}
TableViewColumn {
role: "userName"
title: "User Name"
width: 200
}
TableViewColumn {
role: "eventMessage"
title: "Event Message"
width: 372
}
TableViewColumn {
role: "dateTime"
title: "Date Time"
width: 201
}
}
}
Rectangle {
id: tableViewRect
width: 880
height: 490
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
anchors.leftMargin: 10
border.width: 10
border.color: "lightsteelblue"
color: "transparent"
TableView {
id: tableView
anchors.fill: parent
sortIndicatorVisible: true
sortIndicatorOrder: 1
sortIndicatorColumn: 1
frameVisible: true
model: UserEventLog
style: TableViewStyle {
// frame: Rectangle {
// border.color: "lightsteelblue"
// border.width: 50
// }
headerDelegate: Rectangle {
height: textItem.implicitHeight * 1.2
width: textItem.implicitWidth
color: "lightsteelblue"
Text {
id: textItem
anchors.centerIn: parent
text: styleData.value
}
Rectangle {
anchors.right: parent.right
anchors.top: parent.top
anchors.bottom: parent.bottom
width: 3
color: "yellow"
}
}
}
TableViewColumn {
role: "id"
title: "id"
width: 100
}
TableViewColumn {
role: "userName"
title: "User Name"
width: 200
}
TableViewColumn {
role: "eventMessage"
title: "Event Message"
width: 372
}
TableViewColumn {
role: "dateTime"
title: "Date Time"
width: 201
}
}
}
To copy to clipboard, switch view to plain text mode
update: I get the border to kinda show up but cant adjust width an it does not wrap around the hole table...
style: TableViewStyle {
frame: Rectangle {
border{
color: "red"
width: 10
}
}
style: TableViewStyle {
frame: Rectangle {
border{
color: "red"
width: 10
}
}
To copy to clipboard, switch view to plain text mode
Added after 44 minutes:
found a solution: just messed around with my outer object rectangle and anchoring got a border around my tableView now! I made the rectangle little larger than tableView then enter tableView in the Rect.
Rectangle {
width: 880
height: 490
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
anchors.leftMargin: 10
color: "transparent"
radius: 7
border.color: "lightsteelblue"
border.width: 5
visible: true
TableView {
id: tableView
width: 870
height: 480
anchors.centerIn: parent
sortIndicatorVisible: true
sortIndicatorOrder: 1
sortIndicatorColumn: 1
//frameVisible: true
model: UserEventLog
style: TableViewStyle {
headerDelegate: Rectangle {
height: textItem.implicitHeight * 1.2
width: textItem.implicitWidth
color: "lightsteelblue"
Text {
id: textItem
anchors.centerIn: parent
text: styleData.value
}
Rectangle {
anchors.right: parent.right
anchors.top: parent.top
anchors.bottom: parent.bottom
width: 3
color: "yellow"
}
}
}
TableViewColumn {
role: "id"
title: "id"
width: 100
}
TableViewColumn {
role: "userName"
title: "User Name"
width: 200
}
TableViewColumn {
role: "eventMessage"
title: "Event Message"
width: 372
}
TableViewColumn {
role: "dateTime"
title: "Date Time"
width: 201
}
}
}
Rectangle {
width: 880
height: 490
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
anchors.leftMargin: 10
color: "transparent"
radius: 7
border.color: "lightsteelblue"
border.width: 5
visible: true
TableView {
id: tableView
width: 870
height: 480
anchors.centerIn: parent
sortIndicatorVisible: true
sortIndicatorOrder: 1
sortIndicatorColumn: 1
//frameVisible: true
model: UserEventLog
style: TableViewStyle {
headerDelegate: Rectangle {
height: textItem.implicitHeight * 1.2
width: textItem.implicitWidth
color: "lightsteelblue"
Text {
id: textItem
anchors.centerIn: parent
text: styleData.value
}
Rectangle {
anchors.right: parent.right
anchors.top: parent.top
anchors.bottom: parent.bottom
width: 3
color: "yellow"
}
}
}
TableViewColumn {
role: "id"
title: "id"
width: 100
}
TableViewColumn {
role: "userName"
title: "User Name"
width: 200
}
TableViewColumn {
role: "eventMessage"
title: "Event Message"
width: 372
}
TableViewColumn {
role: "dateTime"
title: "Date Time"
width: 201
}
}
}
To copy to clipboard, switch view to plain text mode
Bookmarks