SF.net SVN: fclient:[894] trunk/fclient/fclient/impl/lib/qt4ex/ treewidgetwrap.py
Status: Pre-Alpha
Brought to you by:
jurner
|
From: <jU...@us...> - 2008-08-11 10:41:14
|
Revision: 894
http://fclient.svn.sourceforge.net/fclient/?rev=894&view=rev
Author: jUrner
Date: 2008-08-11 10:41:15 +0000 (Mon, 11 Aug 2008)
Log Message:
-----------
impl bottom up item walks
Modified Paths:
--------------
trunk/fclient/fclient/impl/lib/qt4ex/treewidgetwrap.py
Modified: trunk/fclient/fclient/impl/lib/qt4ex/treewidgetwrap.py
===================================================================
--- trunk/fclient/fclient/impl/lib/qt4ex/treewidgetwrap.py 2008-08-11 10:40:25 UTC (rev 893)
+++ trunk/fclient/fclient/impl/lib/qt4ex/treewidgetwrap.py 2008-08-11 10:41:15 UTC (rev 894)
@@ -40,10 +40,20 @@
#
#thow in a walker to fix this..
#**************************************************************************************
-def walkItem(item):
- yield item
- for i in xrange(item.childCount()):
- child = item.child(i)
+def walkItem(item, topdown=True):
+ """walks over a treeWidgetItem
+ @param item: item to walk
+ @topdown: if True, walks the item top down, else bottom up
+ """
+ if topdown:
+ yield item
+
+ children = [item.child(i) for i in xrange(item.childCount())]
+ for child in children:
for x in walkItem(child):
yield x
-
\ No newline at end of file
+
+ if not topdown:
+ yield item
+
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|