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. Displaying QML components in GridView

Displaying QML components in GridView

Scheduled Pinned Locked Moved QML and Qt Quick
2 Posts 2 Posters 503 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.
  • M Offline
    M Offline
    MartinD
    wrote on last edited by
    #1

    Hi,
    In C++ I have several MyComponent.qml instantiated (they are of custom C++ type which inherits from QQuickItem), and they are stored in QList. How to display this QList of QML components in a GridView (the GridView is defined in another QML component)?

    R 1 Reply Last reply
    0
    • M MartinD

      Hi,
      In C++ I have several MyComponent.qml instantiated (they are of custom C++ type which inherits from QQuickItem), and they are stored in QList. How to display this QList of QML components in a GridView (the GridView is defined in another QML component)?

      R Offline
      R Offline
      Roumed
      wrote on last edited by
      #2

      @MartinD , Hi

      First of all, I hope this article will be useful for you:
      http://doc.qt.io/qt-5/qtquick-modelviewsdata-cppmodels.html#qobjectlist-based-model

      Secondly, I think your case can be solved with ObjectModel and Repeater.

      But, let me be honest, it will look like a workaround.

      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