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. Signal or event when QTreeWidgetItem is deleted?
Forum Updated to NodeBB v4.3 + New Features

Signal or event when QTreeWidgetItem is deleted?

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 1.3k 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.
  • B Offline
    B Offline
    bobEdwards
    wrote on 19 Nov 2013, 01:50 last edited by
    #1

    Hello,

    I'm looking for a way to get a signal or event triggered whenever a QTreeWidgetItem is deleted, and then perform an action based on the QVariant data held within that item. Is there a way to do this? Looking through the manual it does not look like it emits any signals except for dataChanged.

    For example, I am hoping to simply call delete on a QTreeWidgetItem* that has many, many nested child objects. Qt will automatically delete all of the QTreeWidgetItem children, but I'd like to perform an action on each based on the QVariant data it holds. As it stands now I have to recursively loop over all items and all children and when call delete when there is no more children.

    Does anyone have any suggestions?

    Cheers,

    Bob

    1 Reply Last reply
    0
    • J Offline
      J Offline
      JKSH
      Moderators
      wrote on 19 Nov 2013, 02:14 last edited by
      #2

      Hi,

      You can subclass QTreeWidgetItem and do your custom processing in its destructor.

      Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

      1 Reply Last reply
      0

      2/2

      19 Nov 2013, 02:14

      • Login

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