[SailfishDevel] Build a Model with "fixed" items + "dynamic" ones

Michael Fuchs michfu at gmx.at
Mon Apr 20 10:33:08 UTC 2015



Am 20.04.2015 um 10:49 schrieb François K.:
> 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) ?
>

You are creating your custom Model in C++ holding your data, which you 
present in a View in QML, right?
Maybe you can derive another Model from your custom C++-Model which 
appends or inserts the fixed items.

FixedItemsModel.qml:

import com.daitheflu.custommodel 1.0

CustomModel {

   Component.onComplete {
    //this could be a place for doing some autostart stuff
   }
}


FirstPage.qml:
....
FixedItemsModel {
  id: projects
}
...

greets, Michael.


More information about the Devel mailing list