   Highlighting items in a tree
  I have been working on this and thinking of a few different ideas, but i cannot think of a way that will work.Basically, i have a tree view (Qt's QTreeWidget) which has tree items (QTreeWidgetItem). These items need to be highlighted for a short period of time, like Process Explorer highlights new processes.The problem is not how to actually highlight the items but rather to manage when they are highlighted and unhighlighted.First, i tried to do it all in a subclassed tree item class. But then i tried to go more OO so i had a TreeHighlight class which would handle applying and removing the highlight. It would take an item object in it's constructor and highlight it, then set a timer which would delete it on timeout (using Qt's deleteLater() method). Then it would remove the highlighting in the destructor.When an item wanted to be highlighted, it would simply create a new object.But this had a flaw, what happens when the item is deleted before the highlight object?So then i thought it would be better to decouple the highlight object from the item. So i instead made a TreeHighlighter class (subtle difference) which was used by the tree, not each individual item. It would work in pretty much the same way, except that the object would keep an array of which items were highlighted and it would do the work of unhighlighting them instead of a bunch of separate objects.But now i still have to check if the item still exists when i unhighlight it. And i also have another problem that when the timer fires, i will not know which item is to be unhighlighted.So there are a few things i am asking here (as well as just general advice on how to do it). Firstly, if an item gets deleted, can i still search the tree looking for the item pointer to check if it exists? I assume so, since the pointer that i store will point to the same place that the tree does, right?Secondly, I can assume that the array in TreeHighlight will be FIFO, so i can just unhighlight the first on timeout, but can i be sure?   
  Any response for this? I'm kinda stuck [sad]I am now having problems where the highlighting will not unhighlight. I haven't looked into it yet but it could be because the TreeHighlighter is failing to find the tree item in the tree. I am thinking maybe i should go back to using my first method (using TreeHighlight objects).   