Pass list of lists from qt to qml
-
wrote on 3 Dec 2012, 11:56 last edited by
I need to pass two-dimensional list of data to qml and display it in Table in qml.
I tried to use this:
@
Q_PROPERTY(QList<QVariant> valuesList READ valuesList NOTIFY valuesListChanged)@and in the qml file:
@...
ListView
{
id: dataList
anchors.fill: parent
model: numOfRows //I know this parameter
clip: true
boundsBehavior: Flickable.StopAtBounds
delegate: RowDelegate
{
}}
...
RowDelegate.qmlRectangle
{
height: __itemHeight
width: ListView.view.width
border.color: "black"property variant rowValuesList: backendList.valuesList[index] // from qt object Column { anchors.fill: parent Repeater { model: numOfColumns //I know this parameter Text { width: __itemWidth height: parent.height text: rowValuesList[index] } }
}
@but it does not work ....
how can I use this correctly?
1/1