I've already asked this question in 'newbie' but with no answer, I'm trying here then.

I have list, self.cards, that is [QListWidgetItem, string, QString]
in this function I just iter the elements of this list and populate my QListView (self.cardList).

Qt Code:
  1. def updateCardList(self):
  2. for card_ in self.cards:
  3. self.cardList.addItem(card_[0])
To copy to clipboard, switch view to plain text mode 

It works fine for this function:
Qt Code:
  1. def selectEditionsF(self):
  2. self.cards=[]
  3. for sEdition in self.selectedEditions:
  4. for edition in self.listEditions:
  5. if sEdition == edition[0]:
  6. for card in edition[1].iter('card'):
  7. self.cards.append([QListWidgetItem(card.get('name')), card.get('graphics'), sEdition])
  8. self.updateCardList()
  9. self.selectEditionsWindow.close()
To copy to clipboard, switch view to plain text mode 

but in this case:
Qt Code:
  1. def refine(self, bool):
  2. tempcards = self.cards
  3. self.cards = []
  4. for card in tempcards:
  5. if self.refineColor.isChecked():
  6. if self.colorBlue.isChecked():
  7. if self.getCardColor(card[0]) == "Blue":
  8. self.cards.append(card)
  9. self.updateCardList()
To copy to clipboard, switch view to plain text mode 

When it enters the loop in updateCardList I receive this message: "underlying C/C++ object has been deleted"
Debug I found that inside the function everything is Ok, the error appears just inside the loop.

Any Ideas?