def _get_pyqt_objects(lines, obj, depth=0):
 for kid in obj.findChildren(QObject, '', Qt.FindDirectChildrenOnly):
  lines.append((('    ' * depth) + repr(kid)))
  _get_pyqt_objects(lines, kid, (depth + 1))

def _get_pyqt_objects ( lines , obj , depth = 0 ) : for kid in obj . findChildren ( QObject , '' , Qt . FindDirectChildrenOnly ) : lines . append ( ( ( '    ' * depth ) + repr ( kid ) ) ) _get_pyqt_objects ( lines , kid , ( depth + 1 ) )
recursive method for get_all_objects to get qt objects .