Ingo Krabbe wrote:
When I want to go a level up I do:

	parent = parent.parent()

But this only works if we aren't at the root node since a QListViewItem
isn't a QObject but opens an own base class.  So

	parent.parent() would give NULL in C++.

What's returned in pyqt here ?
The Python equivalent of C/C++'s NULL is None. So you would do something like this:

parent = parent.parent()
if not parent is None:
# do stuff with parent

None evaluates to false in an if expression so you could shorten it to:

if parent:
# do stuff with parent

Ciao,
Gordon



_______________________________________________
PyKDE mailing list [EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde

Reply via email to