ListModel default property problem
-
If I define a ListModel in a separate qml file, then try in to use it in another qml file and add items, I get an error saying: Cannot assign to non-existent default property. Is this a bug, or is this how ListModel is designed to work? I looked over the source for ListModel, but couldn't find anywhere a default property is defined.
ListModelTest.qml
@
import QtQuick 2.1ListModel
{
}
@Main.qml
@
import QtQuick 2.1Rectangle
{
...ListModelTest { ListElement { text: "test" } }
}
@ -
@BlueMagma Use
append
instead:ListModelTest { Component.onCompleted: { append( { text : "test" } ) } }