how can I clear a pyqt QTableWidget?
问题 I want to clear my QTableWidget. First of all I select a user in a qcombobox after that I click a qpushbutton and I populate it from database records; when I select other user and I click the qpushbutton to add data I try to clear with: self.tableFriends.clear() The data disappears but the rows remain. The code I populate with is: def getFriends(self): id_us = self.cbUser.itemData(self.cbUser.currentIndex()).toPyObject() rowIndex = 0 self.tableFriends.clear() for row in self.SELECT_FRIENDS(id