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. Issue with nested ListViews and scroll bar
Forum Updated to NodeBB v4.3 + New Features

Issue with nested ListViews and scroll bar

Scheduled Pinned Locked Moved QML and Qt Quick
2 Posts 1 Posters 967 Views 1 Watching
  • 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.
  • V Offline
    V Offline
    vivekmalik2466
    wrote on last edited by
    #1

    Hello,

    I am facing a problem with nested ListViews and scroll bar. I want to apply a scroll bar to the outer ListView which may contain multiple children ListViews and these can be of different heights so now the scroll bar is giving me the problem because of the variable heights of the inner ListViews.

    @
    ListView {
    id: list
    anchors.fill: parent
    clip: true
    model: items
    delegate: trackDelegate
    }
    ScrollBar {
    id: verticalScrollBar
    target: list
    clip: true
    }@

    This gives me the scroll bar problem. The contentHeight of "list" becomes dynamic when scrolling down.
    I tried the following:

    @ Flickable{
    id: mainList
    anchors.fill: parent
    contentHeight: list.contentHeight
    clip: true

        ListView {
            id: list
            anchors.fill: parent
            clip: true
            model: items
            delegate: trackDelegate
            interactive: false
        }
    }
    ScrollBar {
        id: verticalScrollBar
        target: mainList
        clip: true
    }@
    

    This fixed the problem but new problem is occurred. If I false the visible property of the item that contains the above component and then set true it hangs the screen and results into Not Responding state.

    please help me to come out of this problem.

    1 Reply Last reply
    0
    • V Offline
      V Offline
      vivekmalik2466
      wrote on last edited by
      #2

      p

      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