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. ListView with flow layout
QtWS25 Last Chance

ListView with flow layout

Scheduled Pinned Locked Moved QML and Qt Quick
3 Posts 1 Posters 1.1k 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.
  • O Offline
    O Offline
    ondrejandrej
    wrote on last edited by
    #1

    What is currently the best way to make ListView with flow layout? (Qt 5.3.X)
    Is it possible to achieve it by some particular setting of orientation and layoutDirection?

    I know that I could achieve this without ListView with Repeater:
    @Flow {
    Repeater {
    model: myModel
    MyDelegate {
    }
    }
    }@

    But I will have potentially big amount of items, so ListView seems a better idea.
    BTW my model subclasses QAbstractListModel.

    1 Reply Last reply
    0
    • O Offline
      O Offline
      ondrejandrej
      wrote on last edited by
      #2

      It seems that I have to answer myself.

      What I want can be done with GridView with default property values. I'm just not yet sure if this is efficient.

      1 Reply Last reply
      0
      • O Offline
        O Offline
        ondrejandrej
        wrote on last edited by
        #3

        So I'm trying this in a GridView, where I show previews of photos (Image element in delegate). I'm testing on a set of 433 photos. My test application with GridView consumes 1.5 GB directly after start.

        Which is weird, because QAbstractItemModel::data() in my model is called only for a couple of first items after start (then again when GridView is scrolled).

        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