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

int QMetaObject::indexOfProperty ( const char *  name  )  const

Finds property name and returns its index; otherwise returns -1.

See also:
property(), propertyCount(), propertyOffset()

Definition at line 535 of file qmetaobject.cpp.

References d, data, propertyOffset(), stringdata, and superdata.

Referenced by QAbstractFormBuilder::computeProperties(), QObject::property(), and QObject::setProperty().

{
    int i = -1;
    const QMetaObject *m = this;
    while (m && i < 0) {
        for (i = priv(m->d.data)->propertyCount-1; i >= 0; --i)
            if (strcmp(name, m->d.stringdata
                       + m->d.data[priv(m->d.data)->propertyData + 3*i]) == 0) {
                i += m->propertyOffset();
                break;
            }
        m = m->d.superdata;
    }
    return i;
}


Generated by  Doxygen 1.6.0   Back to index