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 Sections

ListView with Sections

Scheduled Pinned Locked Moved Solved QML and Qt Quick
2 Posts 1 Posters 691 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.
  • B Offline
    B Offline
    BTSTOnline
    wrote on last edited by
    #1

    I am having an issue understanding how to get the selected child of a ListView delegate, when using sections.

    If I grab the currentIndex of the selected delegate, then try to grab that delegate... I get the delegate that is several indexes above the one I selected( 'several indexes above' depends on how many sections are above the selected item.

    So.. the 'currentIndex' is correct as it seems to exclude the section items. However, using this:

    listview.contentItem.children[idx]
    

    returns the wrong item.

    How do I get the right item? I need the item, due to the delegate includes a checkbox that I need to know if the user checked it or not....

    B 1 Reply Last reply
    0
    • B BTSTOnline

      I am having an issue understanding how to get the selected child of a ListView delegate, when using sections.

      If I grab the currentIndex of the selected delegate, then try to grab that delegate... I get the delegate that is several indexes above the one I selected( 'several indexes above' depends on how many sections are above the selected item.

      So.. the 'currentIndex' is correct as it seems to exclude the section items. However, using this:

      listview.contentItem.children[idx]
      

      returns the wrong item.

      How do I get the right item? I need the item, due to the delegate includes a checkbox that I need to know if the user checked it or not....

      B Offline
      B Offline
      BTSTOnline
      wrote on last edited by
      #2

      @BTSTOnline Solved....

      Using listView.itemAtIndex works...

      1 Reply Last reply
      0
      • B BTSTOnline has marked this topic as solved on

      • Login

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