On 21 November 2014 06:40, Nuno Santos <[email protected]> wrote:
> I have subclassed QAbstractListModel and i’m already able to have the > model listed in a list view. > > What I can’t find is how I programmatically add items to the model from > the QML side and which methods I need to reimplement in my model class. > > The qml-object-model you have sent me is probably old because there aren’t > the same methods on the documentation for Qt 5.3 > > Suggestions? > > > ah , I have forgotten that I have modified the code to get it work on Qt 5. However, you may still refer to the append() / insert() / move() functions . Those beginXXX and endXXX should be valid for Qt 5. The help to setup the signal and make it behave like a ListModel. Therefore , you may add data to the model via append() / insert() calls by QML just like a ListModel.
_______________________________________________ Interest mailing list [email protected] http://lists.qt-project.org/mailman/listinfo/interest
