Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. How to invoke operator [] to QML?
Forum Updated to NodeBB v4.3 + New Features

How to invoke operator [] to QML?

Scheduled Pinned Locked Moved QML and Qt Quick
1 Posts 1 Posters 914 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Roumed
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved