PDA

View Full Version : ListElement cannot use script for property value in ListElement (QML)



magpielover
22nd April 2011, 11:20
Hello,
I am trying to update the values of roles in ListElement.
Here is my Example.qml file



Item{

property string title :""
property string tags: ""
property string name: ""

}


Here is myModel.qml



ListModel{

ListElement{source: myExample.tags }

}






and here is the main.qml


Rectangle {
width: 600
height: 600
Text {
x: 66
y: 93
text: "Hello World"
}


Example{id:myExample}

}



What I am not allowed to do above is to use "myExample.tags" as the value of role of a ListElement. The error is the following:


ListElement: cannot use script for property value
ListElement{source: myExample.tags }

Is there any other way to update the roles inside the ListModel?
Is it possible to create a ListModel in C++ and use it in QML as plugin?