jfinn88
23rd September 2016, 17:44
I'm trying to implement a flickable area on my table view for touch screen scrolling... but it doesn't seem to work
Rectangle {
width: 990
height: 490
anchors.centerIn: parent
color: "transparent"
radius: 4
border.color: "lightsteelblue"
border.width: 5
visible: true
//---Create a flickable area---//
Flickable {
id: tableViewFlickable
height: tableView.height
width: tableView.width
contentHeight: tableView.height
contentWidth: tableView.width
anchors.centerIn: parent
interactive: true
boundsBehavior: Flickable.StopAtBounds
TableView {
id: tableView
width: 980
height: 480
anchors.centerIn: parent
sortIndicatorVisible: true
sortIndicatorOrder: 1
sortIndicatorColumn: 1
model: UserEventLog
style: TableViewStyle {
headerDelegate: Rectangle {
height: textItem.implicitHeight * 1.2
width: textItem.implicitWidth
color: "lightsteelblue"
border.color: "black"
border.width: .5
Text {
id: textItem
anchors.centerIn: parent
text: styleData.value
color: "black"
font.bold: true
}
}
}
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: 990
height: 490
anchors.centerIn: parent
color: "transparent"
radius: 4
border.color: "lightsteelblue"
border.width: 5
visible: true
//---Create a flickable area---//
Flickable {
id: tableViewFlickable
height: tableView.height
width: tableView.width
contentHeight: tableView.height
contentWidth: tableView.width
anchors.centerIn: parent
interactive: true
boundsBehavior: Flickable.StopAtBounds
TableView {
id: tableView
width: 980
height: 480
anchors.centerIn: parent
sortIndicatorVisible: true
sortIndicatorOrder: 1
sortIndicatorColumn: 1
model: UserEventLog
style: TableViewStyle {
headerDelegate: Rectangle {
height: textItem.implicitHeight * 1.2
width: textItem.implicitWidth
color: "lightsteelblue"
border.color: "black"
border.width: .5
Text {
id: textItem
anchors.centerIn: parent
text: styleData.value
color: "black"
font.bold: true
}
}
}
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
}
}
}
}