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. Mitigate "Variable Delegate Size" issue in ListView

Mitigate "Variable Delegate Size" issue in ListView

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
3 Posts 3 Posters 579 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.
  • T Offline
    T Offline
    TheEnigmist
    wrote on last edited by
    #1

    I'm using a ListView to display a variable number of elements. I attached a custom ScrollBar to the list view. Since my elements have different heights, I'm facing Variable Delegate Size and Section Labels issue.
    The documentation suggests increasing the cacheBuffer, but I don't really like this fix. Is there a way to let the scroll bar know the full size of my list view? I know how to calculate the height of each delegate. I could use a Repeater and simply show them all in a ScrollView, but that only works when the number of elements is small.
    For now, I'm simply hiding the scroll bar while I wait to find a way to fix this.

    1 Reply Last reply
    0
    • J Offline
      J Offline
      Junbaibai
      wrote last edited by
      #2

      I'm facing this issus too. I try to use repeater and scrollview, then manually control data load while scroll to bottom and top.

      1 Reply Last reply
      0
      • GrecKoG Offline
        GrecKoG Offline
        GrecKo
        Qt Champions 2018
        wrote last edited by
        #3

        If you know how to calculate the total of your delegates' height, you might want to handle the ScrollBar yourself and set its size and position manually. The position might be trickier to compute.

        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