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
Forum Updated to NodeBB v4.3 + New Features

Displaying QML components in GridView

Scheduled Pinned Locked Moved QML and Qt Quick
2 Posts 2 Posters 511 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 24 Nov 2016, 10:42 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 24 Nov 2016, 14:03
    0
    • M MartinD
      24 Nov 2016, 10:42

      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 24 Nov 2016, 14:03 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

      1/2

      24 Nov 2016, 10:42

      • Login

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