Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Displaying QML components in GridView

    QML and Qt Quick
    2
    2
    389
    Loading More Posts
    • 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
      MartinD last edited by

      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 Reply Quote 0
      • R
        Roumed @MartinD last edited by

        @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 Reply Quote 0
        • First post
          Last post