I have the following code, which should remove all items from QListWidget,
but it removes only one item on one click (not all). Why? How is it right?
I don't want to use clear() method. I want to remove them gradually.
def onRemoveItems(self): # button click event
for i in range(self.myListWidget2.count()):
itemI = self.myListWidget2.item(i)
self.myListWidget2.takeItem(self.myListWidget2.row(itemI))