[Interest] create delegate modelData
Alan Ezust
alan.ezust at gmail.com
Tue Jul 19 00:42:53 CEST 2016
modelData is indeed a special reserved data role for use inside delegates
with certain kinds of models, including C++ objectlists and also
stringlistmodel.
I can't find any documentation that explains exactly what 'modelData' is or
where it is "reserved".
However, modelData mentioned here:
http://doc.qt.io/qt-5/qtquick-modelviewsdata-cppmodels.html
And mentioned again here:
http://doc.qt.io/qt-5/qml-qtquick-repeater.html
Cheers --Alan
On Thu, Jul 14, 2016 at 10:07 PM, Kevin Mcintyre <kebin70 at gmail.com> wrote:
> Below is psuedo code...am I doing something wrong - or is modelData
> reserved?
>
> //This works.
> -- ~repeater.qml
> Item {
> Repeater {
> model: [
> ["example"],
> ]
> delegate: Qt.createComponent("maybe_delegate.qml")
> }
> }
>
> -- maybe_delegate.qml
> Item {
> objectName: modelData[0]
> }
>
> //This does not?
> -- nondelegate.qml
> Item {
> id: nondelegate
> Component.onCompleted: {
>
> Qt.createComponent("maybe_delegate.qml").createObject(nondelegate,{
> modelData: ["example1"]});
> }
> }
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20160718/c94a4e26/attachment.html>
More information about the Interest
mailing list