import QtQuick 2.11 import QtQuick.Controls 1.4 Item { Rectangle{ anchors.fill: parent anchors.margins: 10 color: "gray" ListModel { id: libraryModel ListElement { title: "A Masterpiece" author: "Gabriel" } ListElement { title: "Brilliance" author: "Jens" } ListElement { title: "Outstanding" author: "Frederik" } } TableView { TableViewColumn { role: "title" title: "Title" width: 100 } TableViewColumn { role: "author" title: "Author" width: 200 } model: libraryModel } // ListModel { // id: libraryModel // } // TableView { // anchors.centerIn: parent // TableViewColumn { // role: "T0" // title: "T0" // width: 40 // } // TableViewColumn { // role: "T1" // title: "T1" // width: 40 // } // TableViewColumn { // role: "T2" // title: "T2" // width: 40 // } // model: libraryModel // } // Component.onCompleted: { // var obj={} // obj.T0= "100" // obj.T1= "200" // obj.T2= "300" // libraryModel.append(obj) // } } }