Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QTreeView CustomDelegate set by setItemDelegateForRow stays with row index

QTreeView CustomDelegate set by setItemDelegateForRow stays with row index

Scheduled Pinned Locked Moved Unsolved General and Desktop
qtreeviewcustomdelegate
3 Posts 3 Posters 149 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.
  • G Offline
    G Offline
    gary-1959
    wrote on 18 Jan 2025, 16:00 last edited by
    #1
    This post is deleted!
    P 1 Reply Last reply 18 Jan 2025, 18:50
    0
    • G gary-1959
      18 Jan 2025, 16:00

      This post is deleted!

      P Online
      P Online
      Pl45m4
      wrote on 18 Jan 2025, 18:50 last edited by
      #2

      @gary-1959 said in QTreeView CustomDelegate set by setItemDelegateForRow stays with row index:

      setItemDelegateForRow
      

      Is there a way to set a CustomDelegate which will stay connected to the row item

      So you enable your custom delegate for, say, row 3, then remove rows 1-2. After that your delegate for row 3 should be in row 1?!
      I don't think that this is standard behavior, therefore you have to keep track on insertations and deletion yourself and handle them as desired.


      If debugging is the process of removing software bugs, then programming must be the process of putting them in.

      ~E. W. Dijkstra

      1 Reply Last reply
      1
      • C Offline
        C Offline
        Christian Ehrlicher
        Lifetime Qt Champion
        wrote on 18 Jan 2025, 18:54 last edited by
        #3

        ... or check inside the delegate functions if the row is still the one e.g. by checking the data to display.

        Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
        Visit the Qt Academy at https://academy.qt.io/catalog

        1 Reply Last reply
        1

        1/3

        18 Jan 2025, 16:00

        • Login

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