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. Instantiation of another QAbstractListModel derived class
Forum Updated to NodeBB v4.3 + New Features

Instantiation of another QAbstractListModel derived class

Scheduled Pinned Locked Moved Solved QML and Qt Quick
qmlqabstractlistmo
3 Posts 2 Posters 601 Views 2 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.
  • K Offline
    K Offline
    koahnig
    wrote on last edited by
    #1

    I have created C++ class which is holding information for a QML interface. The QML interface has basically a couple of panes for interaction. Now I like to add on one of the panes a variable table fed by a class derived from QAbstractListModel.

    I have mastered the fixed information display through model and repeater. The derived class has been registered by qmlRegisterType. However, the instance of that class needs to be updated through C++, but I have no real understanding where the instance is located.

    How can I instanciate the new C++ class within my main class and make it accessible in the qml file?

    Vote the answer(s) that helped you to solve your issue(s)

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      One way to achieve that is through context properties.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      K 1 Reply Last reply
      3
      • SGaistS SGaist

        Hi,

        One way to achieve that is through context properties.

        K Offline
        K Offline
        koahnig
        wrote on last edited by
        #3

        @SGaist

        Thanks for pointing into that direction. It does work.

        Vote the answer(s) that helped you to solve your issue(s)

        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