code: def get_visible_items(self):
          
          items = []
          iterator = QTreeWidgetItemIterator(self)
          while iterator.value():
              item = iterator.value()
              if not item.isHidden():
                  if item.parent():
                      if item.parent().isExpanded():
                          items.append(item)
                  else:
                      items.append(item)
              iterator += 1
          return items
docs: Return a list of all visible items in the treewidget.