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

void * qt_find_obj_child ( QObject parent,
const char *  type,
const QString name 
) [related, inherited]

Returns a pointer to the object named name that inherits type and with a given parent.

Returns 0 if there is no such child.

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

Definition at line 618 of file qobject.cpp.

References QList< T >::at(), QObject::children(), QObject::inherits(), QObject::objectName, and QList< T >::size().

{
    QObjectList list = parent->children();
    if (list.size() == 0) return 0;
    for (int i = 0; i < list.size(); ++i) {
        QObject *obj = list.at(i);
        if (name == obj->objectName() && obj->inherits(type))
            return obj;
    }
    return 0;
}


Generated by  Doxygen 1.6.0   Back to index