In quick 2.0 how do we add an item (e.g. a QVariantMap) to a ListModel from C++ ?



  • Hi folks.

    Q: in quick 2.0 how do we add an item (e.g. a QVariantMap) to a ListModel from C++ ?
    I used to do that with ok_invoke_append = QMetaObject::invokeMethod(in_list_model,"append", Qt::DirectConnection,Q_ARG(QScriptValue,myObject1));

    So the declaration in the modellist reads:
    in qtquick 1.0 : Q_INVOKABLE void append(const QScriptValue&),
    In qtquick 2.0 : Q_INVOKABLE void append(QDeclarativeV8Function *args);

    but QDeclarativeV8Function seems to be private.

    So how do i add an item to a modellist ?


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.