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}:

        QList<QWidget *> widgets = parentWidget.findChildren<QWidget *>("widgetname");

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

        QList<QPushButton *> allPButtons = parentWidget.findChildren<QPushButton *>();

Warning:
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 149 of file qobject.h.

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


Generated by  Doxygen 1.6.0   Back to index