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

Instantiation of another QAbstractListModel derived class

Scheduled Pinned Locked Moved Solved QML and Qt Quick
qmlqabstractlistmo
3 Posts 2 Posters 575 Views
  • 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 22 Mar 2019, 19:48 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
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 22 Mar 2019, 20:12 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 23 Mar 2019, 11:38
      3
      • S SGaist
        22 Mar 2019, 20:12

        Hi,

        One way to achieve that is through context properties.

        K Offline
        K Offline
        koahnig
        wrote on 23 Mar 2019, 11:38 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

        2/3

        22 Mar 2019, 20:12

        • Login

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