Trying to get the indexes from multi-selection of items in a treeView. But each item is returned multiple times.
Looking at the raw returned items, each one has a different memory address, so it’s not simply calling the same object multiple times, but creating multiple instances and returning each one.
I’ve tried to use a for loop to try and eliminate all but one of the responses, but it doesn’t work.
def get_items(self): indexes = self.treeView.selectedIndexes() seen =  for item in indexes: if item not in seen: self.console.on_update_text(str(item)) self.console.on_update_text("\n") seen.append(item)
(Sorry. I can’t seem to get the code tags to actually present the code correctly.)