/* The QDeclarativeObjectScriptClass handles property access for QObjects via QtScript. It is also used to provide a more useful API in QtScript for QML. */ QDeclarativeObjectScriptClass::QDeclarativeObjectScriptClass(QDeclarativeEngine *bindEngine) : QScriptDeclarativeClass(QDeclarativeEnginePrivate::getScriptEngine(bindEngine)), methods(bindEngine), lastData(0), engine(bindEngine) { QScriptEngine *scriptEngine = QDeclarativeEnginePrivate::getScriptEngine(engine); m_destroy = scriptEngine->newFunction(destroy); m_destroyId = createPersistentIdentifier(QLatin1String("destroy")); m_toString = scriptEngine->newFunction(tostring); m_toStringId = createPersistentIdentifier(QLatin1String("toString")); }
QDeclarativeObjectMethodScriptClass::QDeclarativeObjectMethodScriptClass(QDeclarativeEngine *bindEngine) : QScriptDeclarativeClass(QDeclarativeEnginePrivate::getScriptEngine(bindEngine)), engine(bindEngine) { qRegisterMetaType<QList<QObject *> >("QList<QObject *>"); setSupportsCall(true); QScriptEngine *scriptEngine = QDeclarativeEnginePrivate::getScriptEngine(engine); m_connect = scriptEngine->newFunction(connect); m_connectId = createPersistentIdentifier(QLatin1String("connect")); m_disconnect = scriptEngine->newFunction(disconnect); m_disconnectId = createPersistentIdentifier(QLatin1String("disconnect")); }
QDeclarativeListScriptClass::QDeclarativeListScriptClass(QDeclarativeEngine *e) : QDeclarativeScriptClass(QDeclarativeEnginePrivate::getScriptEngine(e)), engine(e) { QScriptEngine *scriptEngine = QDeclarativeEnginePrivate::getScriptEngine(engine); Q_UNUSED(scriptEngine); m_lengthId = createPersistentIdentifier(QLatin1String("length")); }