42 #include "private/qdeclarativecontextscriptclass_p.h" 44 #include "private/qdeclarativeengine_p.h" 45 #include "private/qdeclarativecontext_p.h" 46 #include "private/qdeclarativetypenamescriptclass_p.h" 47 #include "private/qdeclarativelistscriptclass_p.h" 48 #include "private/qdeclarativeguard_p.h" 74 return scopeObject.
data();
97 lastScopeObject(0), lastContext(0), lastData(0), lastPropertyIndex(-1)
150 return QUrl(static_cast<UrlContextData *>(data)->url);
167 QScriptClass::QueryFlags
169 QScriptClass::QueryFlags flags)
184 if (overrideObject) {
186 QScriptClass::QueryFlags rv =
197 bool includeTypes =
true;
198 while (bindContext) {
199 QScriptClass::QueryFlags rv =
200 queryProperty(bindContext, scopeObject, name, flags, includeTypes);
202 includeTypes =
false;
204 bindContext = bindContext->
parent;
210 QScriptClass::QueryFlags
213 QScriptClass::QueryFlags flags,
224 if (includeTypes && bindContext->
imports) {
236 QScriptClass::QueryFlags rv =
247 QScriptClass::QueryFlags rv =
280 if (index < bindContext->importedScripts.count()) {
294 if (lastPropertyIndex < bindContext->idValueCount) {
302 if (value.
userType() == qMetaTypeId<QList<QObject*> >()) {
312 return Value(scriptEngine, rv);
~QDeclarativeContextScriptClass()
The QVariant class acts like a union for the most common Qt data types.
UrlContextData(const QString &u)
static QScriptEngine * getScriptEngine(QDeclarativeEngine *e)
QScriptValue newUrlContext(QDeclarativeContextData *, QObject *, const QString &)
QDeclarativeTypeNameScriptClass * typeNameClass
UrlContextData(QDeclarativeContextData *c, QObject *o, const QString &u)
QDeclarativeContextData * getContext(QDeclarativeEngine *engine)
#define QT_END_NAMESPACE
This macro expands to.
virtual void setProperty(Object *, const Identifier &name, const QScriptValue &)
QObject * setOverrideObject(QScriptValue &, QObject *)
static QScriptValue newObject(QScriptEngine *, QScriptDeclarativeClass *, Object *)
QScriptClass::QueryFlags queryProperty(QObject *, const Identifier &, QScriptClass::QueryFlags flags, QDeclarativeContextData *evalContext, QueryHints hints=0)
QList< QVariant > propertyValues
QScriptValue lastFunction
virtual Value property(Object *, const Identifier &)
static int context_count(QDeclarativeListProperty< QObject > *)
QDeclarativeContextData * contextFromValue(const QScriptValue &)
The QUrl class provides a convenient interface for working with URLs.
QDeclarativeContextScriptClass(QDeclarativeEngine *)
The QString class provides a Unicode character string.
QDeclarativeContextData * parent
The QObject class is the base class of all Qt objects.
static QDeclarativeEnginePrivate * get(QDeclarativeEngine *e)
QObject * lastScopeObject
The QScriptDeclarativeClass::Value class acts as a container for JavaScript data types.
QDeclarativeTypeNameCache * imports
QScriptValue newQObject(QObject *, int type=QMetaType::QObjectStar)
The QScriptEngine class provides an environment for evaluating Qt Script code.
QDeclarativeContextPrivate * asQDeclarativeContextPrivate()
#define QT_BEGIN_NAMESPACE
This macro expands to.
QScriptValue newSharedContext()
QScriptValue newObject(QObject *, QDeclarativeType *, TypeNameMode=IncludeEnums)
QDeclarativeTypeNameCache::Data * lastData
QScriptEngine * engine() const
const T & at(int i) const
Returns the item at index position i in the list.
virtual QScriptClass::QueryFlags queryProperty(Object *, const Identifier &, QScriptClass::QueryFlags flags)
QScriptValue scriptValueFromVariant(const QVariant &)
static const char * data(const QByteArray &arr)
QObject * getScope(QDeclarativeEngine *engine)
QScriptValue newContext(QDeclarativeContextData *, QObject *=0)
QDeclarativeContextData * sharedContext
QDeclarativeIntegerCache * propertyNames
QDeclarativeObjectScriptClass * objectClass
QDeclarativeNotifier bindings
int userType() const
Returns the storage type of the value stored in the variant.
The QDeclarativeEngine class provides an environment for instantiating QML components.
QDeclarativeListScriptClass * listClass
QDeclarativeContext * asQDeclarativeContext()
QUrl urlFromValue(const QScriptValue &)
QDeclarativeContextData * lastContext
QDeclarativeTypeNameCache * typeNamespace
static QObject * context_at(QDeclarativeListProperty< QObject > *, int)
static QScriptDeclarativeClass * scriptClass(const QScriptValue &)
int value(const QString &)
QDeclarativeContextData * contextData()
QDeclarativeGuardedContextData context
void setProperty(QObject *, const Identifier &name, const QScriptValue &, QScriptContext *context, QDeclarativeContextData *evalContext=0)
Data * data(const QString &) const
QScriptValue newList(QObject *, int, int)
QDeclarativeGuard< QObject > scopeObject
QScriptContext * context() const
QList< QScriptValue > importedScripts
The QScriptValue class acts as a container for the Qt Script data types.
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Value property(QObject *, const Identifier &)
QPODVector< CapturedProperty, 16 > capturedProperties
ContextData(QDeclarativeContextData *c, QObject *o)