[PyQt] qTreeWidgetItemIterator : how it works

Baz Walter bazwal at ftml.net
Sun Jun 1 16:07:37 BST 2014


On 01/06/14 13:15, singhai.nish wrote:
> Thank you Baz. Just to wrap this discussion, how may I distinguish the
> current item as root item. IOW. How would I know
> that the item in consideration is a root item.

Root items don't have a parent. So:

     if item.parent() is None:
         print 'root item'
     else:
	print 'child item'

-- 
Regards
Baz Walter


More information about the PyQt mailing list