I suppose you are asking how to traverse a Qt object tree. See http://qt-project.org/doc/qt-4.8/qobject.html#details
QObjects organize themselves in object trees. When you create a
QObject with another object as parent, the object will automatically
add itself to the parent's children() list. The parent takes ownership
of the object; i.e., it will automatically delete its children in its
destructor. You can look for an object by name and optionally type
using findChild() or findChildren().
EDIT:
QGraphicsItem
, however, is not a subclass of QObject
and does not have an objectName
property. If you need to access such objects by name, you must do it by yourself, for example using a Python dict
with names as keys and objects as values.