Results 1 to 3 of 3

Thread: QTreeWidgetItemIterator with python

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QTreeWidgetItemIterator with python

    QTreeWidgetItemIterator is not a widget, it's an iterator. You can use it to iterate over a collection of QTreeWidgetItems.

    Unfortunately there isn't much information about it in PyQt docs. You can use it += 1 to move to another element and it.value() to access the QTreeWidgetItem. The question is how do you know if you reached the last item?

    I don't have PyQt installed, but judging from the original Qt docs, probably you can do it like this:
    Python Code:
    1. while it.value():
    2. doSomethingWithItem( it.value() )
    3. it += 1
    To copy to clipboard, switch view to plain text mode 
    Last edited by jacek; 6th September 2006 at 17:54.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.