How to invoke operator [] to QML?



  • Hello everybody.
    That's my question.
    I've a QAbstractListModel-derived class. I need to define operator [] and use it at QtQuick side. I define this operator and use it at C++ side well, also I invoke it with Q_INVOKABLE like this:
    @Q_INVOKABLE QObjectDerived * operator [] (qint32 idx);@
    But @model[0] == undefined@

    Is there any way to invoke operator[] to QML?

    Qt 5.3.0
    QtQuick 2.0


Log in to reply
 

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