[Qt-interest] QTreeWidgetItemIterator weird behaviour

NARCISO, Rui RUI.NARCISO at airbus.com
Mon Oct 19 11:51:23 CEST 2009


Hi all

Is a QTreeWidgetItemIterator supposed to go trhough the items on a QTreeWidget by any specific order or is it completely random?

I ask this because the first value given by my iterator is not the first one on the list and after going through all the items it fails to give me the very first one !!!!

My code (sorry, it's PyQt but you should be able to read it)

	  iterator = QTreeWidgetItemIterator(self.tree)
        while iterator.value():
            print str(iterator.value().text(self.columns["name"]))
            if len(str(iterator.value().text(self.columns["path"]))) > 0 and len(str(iterator.value().text(self.columns['owner']))) >0:
                print str(iterator.value().text(self.columns["name"]))
                user = str(iterator.value().text(self.columns['owner']))
		self.refreshInfo(iterator.value())

and

def refreshInfo(self, calculation):
            iterator = QTreeWidgetItemIterator(self.tree)
            while iterator.value():
                if calculation == iterator.value():
                    iterator.value().setText(self.columns["status"], "...")

from my architecture I need to do these steps as they are in these different functions.

Any advice?

Rui

The information in this e-mail is confidential. The contents may not be disclosed or used by anyone other than the addressee. Access to this e-mail by anyone else is unauthorised.
If you are not the intended recipient, please notify Airbus immediately and delete this e-mail.
Airbus cannot accept any responsibility for the accuracy or completeness of this e-mail as it has been sent over public networks. If you have any concerns over the content of this message or its Accuracy or Integrity, please contact Airbus immediately.
All outgoing e-mails from Airbus are checked using regularly updated virus scanning software but you should take whatever measures you deem to be appropriate to ensure that this message and any attachments are virus free.





More information about the Qt-interest-old mailing list