PDA

View Full Version : TableViewColumn



codeman
9th April 2014, 16:24
Hello friends,

is it possible to add/change dynamically TableViewColumns to/from the tableview.
The problem is when I change the datasource of my model the columns is also changing.

In the examples I see only static defined columns



TableView {
id: myTableView
anchors.fill: parent
sortIndicatorVisible: true
frameVisible: true
headerVisible: true
alternatingRowColors: true

TableViewColumn { role: "a"; title: "A"; }
TableViewColumn { role: "b"; title: "B"; }
TableViewColumn { role: "c"; title: "C"; }
model: myModel
...
...
}

usva.techdev
14th April 2014, 23:08
check out this link i tmight be of help as it was for me.

http://qt-project.org/wiki/QML-Dynamic-Objects

and this other.

http://qt-project.org/doc/qt-5/qml-qtquick-controls-tableview.html

good look!!!