How can I access to items in a list/vector from JavaScript through QWebChannel



  • Hi,
    I have an List of QObjects. And I want to access to these objects from javascript.
    I can register the list object (QVector), but I cannot access to the Items in the client side.
    C++:

    class MyParentObject = QObject
    Q_OBJECT
    Q_PROPERTY(QVector<MyQObject> prop1 READ prop1 ...)
    Q_PROPERTY( prop2 READ prop2 ...)
    ...
    

    On the javascript side I want to do like this:

    alert(objects.parentObj.prop1.count);
    alert(objects.parentObj.prop1[0]);
    ...
    

    Can anybody help me please?


Log in to reply
 

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