Logo Search packages:      
Sourcecode: qt4-x11 version File versions

template<typename T>
QList< T > QObject::findChildren ( const QString name = QString()  )  const [inline, inherited]

Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects. Omitting the name argument causes all object names to be matched. The search is performed recursively.

The following example shows how to find a list of child {QWidget}s of the specified {parentWidget} named {widgetname}:

doc/src/snippets/code/src_corelib_kernel_qobject.cpp 12

This example returns all {QPushButton}s that are children of {parentWidget}:

doc/src/snippets/code/src_corelib_kernel_qobject.cpp 13

This function is not available with MSVC 6. Use qFindChildren() instead if you need to support that version of the compiler.
See also:
findChild(), qFindChildren()

Definition at line 166 of file qobject.h.

    { return qFindChildren<T>(this, aName); }

Generated by  Doxygen 1.6.0   Back to index