QSClass *QSCheckData::typeInfo( const QString &name ) const { QSMember member; QSScopeResolutionList::const_iterator it = scopeStack.begin(); QSObject tmp; tmp.setVal( (int) 0 ); int offset; while( it!=scopeStack.end() ) { offset = 0; tmp.setType( (*it).cl ); const QSClass *cl; if( (*it).cl->name() == QString::fromLatin1("QObject") ) { cl = env()->thisValue().resolveMember( name, &member, tmp.objectType(), &offset ); } else { cl = tmp.resolveMember( name, &member, tmp.objectType(), &offset ); tmp.invalidate(); } if( cl ) { /* Avoid calls to deref for QSWrapperClass, when tmp is destroyed */ tmp.invalidate(); QSObject o( cl->fetchValue( 0, member ) ); if ( o.objectType() == env()->typeClass() ) return QSTypeClass::classValue(&o); else return 0; } it++; } return 0; }
void invalidate() { base.invalidate(); ScopeChain::Iterator it = context.begin(); while (it != context.end()) { (*it).invalidate(); it++; } }