[SailfishDevel] Build a Model with "fixed" items + "dynamic" ones
Richard Grooff
rgrnetalk at yahoo.com
Mon Apr 20 10:02:14 UTC 2015
Hi,
In qml it would be something like this:
> state = "Loaded"
> for (var i = 0; i < xmlOverstapgegevens.count+6; i++) {
> if (i<6)
> {// first we load the FixedValues
> // (use select case? )
> if (i=0){
> list_model2.append({"StationVan" : "FixedValue1"
> }
> if (i=1){
> list_model2.append({"StationVan" : "FixedValue2"
> }
> .
> .
> .
> .
> if (i=5){
> list_model2.append({"StationVan" : "FixedValue6"
> }
> }
> else {// Then we load the dynamic values
> // don't forget to correct the counter for the FixedValues
> var item = get(i-6)
> list_model2.append({"StationVan" : item.StationVan
> }
Don't use two step creation, it caused terrible timing issues for me.
On Mon Apr 20 10:49:56 2015 GMT+0200, François K. wrote:
> Hi Michael, hi Lucien, hi devs,
>
>
> > I support this idea:
> > Why don't you build a model that is built in two step during
> > creation, first, build the 6 entries, then build the rest ?
>
> Do you suggest to do this in C++ (which is my idea n°1) or mix C++ and QML (see below) ?
>
>
> > > Is'nt it possible to add the items in the QML-part?
>
> I don't know... I just don't know how to do this with QML :/
> With a SilicaListView, I guess Qt would overwrite the fixed items as soon as I set the model property on the SilicaListView, wouldn't it ?
>
> Cheers,
>
> --
> François
> _______________________________________________
> SailfishOS.org Devel mailing list
> To unsubscribe, please send a mail to devel-unsubscribe at lists.sailfishos.or
--
Sent from my Jolla
More information about the Devel
mailing list