05-08-2013 03:26 PM
QDeclarativeListProperty * list = new QDeclarativeListProperty<bb::cascades::Option *>() QList<bb::cascades::Option *> option = new QList<bb::cascades::Option *>(); Option* selection = new Option(); selection->create().text("sample1"); option->append(option); //I have set upt the Q_PROPERTY TO BE: Q_PROPERTY(QDeclarativeListProperty<bb::cascades::
Option *> *option READ option CONSTANT);
My question is how to insert the Qlist<option> into the QDeclarativeListProperty<option>????
05-08-2013 06:09 PM
This page has sample code for QDeclarativeListProperty, maybe it will help:
It might be easier to directly export QList as a property. I'm not sure about this, but I think QDeclarativeListProperty is only needed when manipulating lists from QML side.
Even simpler approach is exporting a few functions to QML such as count() getItemAt(int index) etc to work with the list.