Where exactly do you call clear()?
Where exactly do you call clear()?
In a refresh() function in the QDialog that contains the Tree. It's called when the app loads to initially populate the tree, and is then connected to a button to refresh the list at any time.
Clearing the list and iterating through a plugin list seems the easiest way to refresh, rather than checking for additions or deletions.
When you clear the widget, all its items will become invalid, so if you store a pointer to one (or more) of them somewhere, you can't use it anymore - you have to ask the widget for the item again. Because you never know what caused a slot to trigger, you should always check for validity of pointers you get as slot parameters.
Bookmarks