[PyKDE] Null pointer test
Ingo Krabbe
i.krabbe at dokom.net
Thu Oct 17 20:13:00 BST 2002
Hi,
I've the following problem, while trying to build a tree in a QListView:
Each Item of the QListView is a QListViewItem. I insert into the tree
in sorted manner by storing the last parent and starting with the
QListView as the initial parent:
item = QListViewItem( parent, X_i )
parent.insertItem( item )
parent = item
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 ?
TIA INGO
More information about the PyQt
mailing list