janosimas
13th December 2011, 11:17
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).
def updateCardList(self):
for card_ in self.cards:
self.cardList.addItem(card_[0])
It works fine for this function:
def selectEditionsF(self):
self.cards=[]
for sEdition in self.selectedEditions:
for edition in self.listEditions:
if sEdition == edition[0]:
for card in edition[1].iter('card'):
self.cards.append([QListWidgetItem(card.get('name')), card.get('graphics'), sEdition])
self.updateCardList()
self.selectEditionsWindow.close()
but in this case:
def refine(self, bool):
tempcards = self.cards
self.cards = []
for card in tempcards:
if self.refineColor.isChecked():
if self.colorBlue.isChecked():
if self.getCardColor(card[0]) == "Blue":
self.cards.append(card)
self.updateCardList()
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?
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).
def updateCardList(self):
for card_ in self.cards:
self.cardList.addItem(card_[0])
It works fine for this function:
def selectEditionsF(self):
self.cards=[]
for sEdition in self.selectedEditions:
for edition in self.listEditions:
if sEdition == edition[0]:
for card in edition[1].iter('card'):
self.cards.append([QListWidgetItem(card.get('name')), card.get('graphics'), sEdition])
self.updateCardList()
self.selectEditionsWindow.close()
but in this case:
def refine(self, bool):
tempcards = self.cards
self.cards = []
for card in tempcards:
if self.refineColor.isChecked():
if self.colorBlue.isChecked():
if self.getCardColor(card[0]) == "Blue":
self.cards.append(card)
self.updateCardList()
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?