Qt5.1 beta provide us tableView
import QtQuick 2.0
import QtQuick.Controls 1.0
Rectangle {
width: 640
height: 480
ListModel {
id: libraryModel
ListElement{ title: "A Masterpiece" ; author: "Gabriel" }
ListElement{ title: "Brilliance" ; author: "Jens" }
ListElement{ title: "Outstanding" ; author: "Frederik" }
}
TableView {
anchors.fill: parent
TableViewColumn{ role: "title" ; title: "Title" ; width: 100 }
TableViewColumn{ role: "author" ; title: "Author" ; width: 200 }
model: libraryModel
}
}
import QtQuick 2.0
import QtQuick.Controls 1.0
Rectangle {
width: 640
height: 480
ListModel {
id: libraryModel
ListElement{ title: "A Masterpiece" ; author: "Gabriel" }
ListElement{ title: "Brilliance" ; author: "Jens" }
ListElement{ title: "Outstanding" ; author: "Frederik" }
}
TableView {
anchors.fill: parent
TableViewColumn{ role: "title" ; title: "Title" ; width: 100 }
TableViewColumn{ role: "author" ; title: "Author" ; width: 200 }
model: libraryModel
}
}
To copy to clipboard, switch view to plain text mode
This is the example from the QtDocument
Bookmarks