Hi,
I just noticed something unusual with assigning delegates to data models in
QML. I have following item to use as a delegate:
Item {
id: delegateItem
Text { text: modelData }
}
And following data model:
Row {
Repeater {
model: ["hello", "world"]
delegate: delegateItem
}
}
Such a usage throws the error: Unable to assign QObject* to
QDeclarativeComponent*
If I change the delegateItem from Item{} to Component{}, it says: QML
Component: Delegate component must be Item type.
However, if I use it as follows, it works:
Row {
Repeater {
model: ["hello", "world"]
delegate: Item {
id: delegateItem
Text { text: modelData }
}
}
But this makes the code look really messed up. Any alternatives?
Viranch
_______________________________________________
Plasma-devel mailing list
[email protected]
https://mail.kde.org/mailman/listinfo/plasma-devel