if (scopeObject) {
if (QV4::QObjectWrapper *o = qobjectWrapper->newQObject(scopeObject)->v4Value().as<QV4::QObjectWrapper>()) {
bool hasProp = false;
- QV4::Value result = o->getProperty(o->engine()->current, propertystring.string().asString(), QV4::QObjectWrapper::CheckRevision, &hasProp);
+ QV4::Value result = o->getQmlProperty(o->engine()->current, propertystring.string().asString(), QV4::QObjectWrapper::CheckRevision, &hasProp);
if (hasProp) {
if (hasProperty)
*hasProperty = true;
}
}
-Value QObjectWrapper::getProperty(ExecutionContext *ctx, String *name, QObjectWrapper::RevisionMode revisionMode, bool *hasProperty)
+Value QObjectWrapper::getQmlProperty(ExecutionContext *ctx, String *name, QObjectWrapper::RevisionMode revisionMode, bool *hasProperty, bool includeImports)
{
if (QQmlData::wasDeleted(m_object)) {
if (hasProperty)
return result->v4Value();
}
- if (name->startsWithUpper()) {
+ if (includeImports && name->startsWithUpper()) {
// Check for attached properties
if (context && context->imports) {
QQmlTypeNameCache::Result r = context->imports->query(propertystring);
QV4::Value QObjectWrapper::get(Managed *m, ExecutionContext *ctx, String *name, bool *hasProperty)
{
QObjectWrapper *that = static_cast<QObjectWrapper*>(m);
- return that->getProperty(ctx, name, IgnoreRevision, hasProperty);
+ return that->getQmlProperty(ctx, name, IgnoreRevision, hasProperty, /*includeImports*/ true);
}
void QObjectWrapper::put(Managed *m, ExecutionContext *ctx, String *name, const Value &value)
void deleteQObject(bool deleteInstantly = false);
- Value getProperty(ExecutionContext *ctx, String *name, RevisionMode revisionMode, bool *hasProperty = 0);
+ Value getQmlProperty(ExecutionContext *ctx, String *name, RevisionMode revisionMode, bool *hasProperty = 0, bool includeImports = false);
private:
QQmlGuard<QObject> m_object;