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. How to detect when a delegate is destroyed?
Forum Updated to NodeBB v4.3 + New Features

How to detect when a delegate is destroyed?

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

    Is there a way to detect when a delegate is being (or has been) destroyed?
    I need to do some cleaning up on my own (deleting the pixmap used by the delegate, which comes from C++) when a delegate is no longer shown, but I'm not sure how to do it. The best way would be to somehow detect the destruction of the delegate, but how can I do that?

    1 Reply Last reply
    0
    • D Offline
      D Offline
      dmcr
      wrote on last edited by
      #2

      Hello,

      You can use Component.onDestruction.

      dmcr

      dmcr

      1 Reply Last reply
      0
      • L Offline
        L Offline
        ludde
        wrote on last edited by
        #3

        Thanks! For some reason I got the impression that this would not work for individual delegates, but it does. I'm not sure how I was thinking really... so thanks for pointing me in the right direction.

        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