#include "private/qdeclarativecompiler_p.h"
-#include "private/qdeclarativeparser_p.h"
-#include "private/qdeclarativescriptparser_p.h"
#include "qdeclarativepropertyvaluesource.h"
#include "qdeclarativecomponent.h"
#include "private/qmetaobjectbuilder_p.h"
#include "private/qdeclarativerewrite_p.h"
#include "qdeclarativescriptstring.h"
#include "private/qdeclarativeglobal_p.h"
-#include "private/qdeclarativescriptparser_p.h"
#include "private/qdeclarativebinding_p.h"
#include "private/qdeclarativev4compiler_p.h"
#include "private/qdeclarativeutils_p.h"
DEFINE_BOOL_CONFIG_OPTION(compilerDump, QML_COMPILER_DUMP);
DEFINE_BOOL_CONFIG_OPTION(compilerStatDump, QML_COMPILER_STATS);
-using namespace QDeclarativeParser;
+using namespace QDeclarativeScript;
using namespace QDeclarativeCompilerTypes;
static QString id_string(QLatin1String("id"));
This test corresponds to action taken by genLiteralAssignment(). Any change
made here, must have a corresponding action in genLiteralAssigment().
*/
-bool QDeclarativeCompiler::testLiteralAssignment(QDeclarativeParser::Property *prop,
- QDeclarativeParser::Value *v)
+bool QDeclarativeCompiler::testLiteralAssignment(QDeclarativeScript::Property *prop,
+ QDeclarativeScript::Value *v)
{
- const QDeclarativeParser::Variant &value = v->value;
+ const QDeclarativeScript::Variant &value = v->value;
if (!prop->core.isWritable())
COMPILE_EXCEPTION(v, tr("Invalid property assignment: \"%1\" is a read-only property").arg(prop->name().toString()));
if (enumValue == -1)
COMPILE_EXCEPTION(v, tr("Invalid property assignment: unknown enumeration"));
- v->value = QDeclarativeParser::Variant((double)enumValue);
+ v->value = QDeclarativeScript::Variant((double)enumValue);
return true;
}
case QVariant::Vector4D:
{
bool ok;
- QDeclarativeStringConverters::vector4DFromString(string, &ok);
+ QDeclarativeStringConverters::vector4DFromString(value.asString(), &ok);
if (!ok) COMPILE_EXCEPTION(v, tr("Invalid property assignment: 4D vector expected"));
}
break;
Any literal assignment that is approved in testLiteralAssignment() must have
a corresponding action in this method.
*/
-void QDeclarativeCompiler::genLiteralAssignment(QDeclarativeParser::Property *prop,
- QDeclarativeParser::Value *v)
+void QDeclarativeCompiler::genLiteralAssignment(QDeclarativeScript::Property *prop,
+ QDeclarativeScript::Value *v)
{
QDeclarativeInstruction instr;
instr.setType(QDeclarativeInstruction::StoreTime);
instr.storeTime.propertyIndex = prop->index;
Q_ASSERT(sizeof(instr.storeTime.time) == sizeof(QTime));
- ::memcpy(&instr.storeTime.time, &time, sizeof(QTime)); }
+ ::memcpy(&instr.storeTime.time, &time, sizeof(QTime));
}
break;
case QVariant::DateTime:
case QVariant::Vector4D:
{
bool ok;
- QVector4D vector = QDeclarativeStringConverters::vector4DFromString(string, &ok);
+ QVector4D vector = QDeclarativeStringConverters::vector4DFromString(v->value.asString(), &ok);
instr.setType(QDeclarativeInstruction::StoreVector4D);
- instr.storeVector4D.propertyIndex = prop.propertyIndex();
+ instr.storeVector4D.propertyIndex = prop->index;
instr.storeVector4D.vector.xp = vector.x();
instr.storeVector4D.vector.yp = vector.y();
instr.storeVector4D.vector.zp = vector.z();
// Compile types
const QList<QDeclarativeTypeData::TypeReference> &resolvedTypes = unit->resolvedTypes();
- QList<QDeclarativeScriptParser::TypeReference *> referencedTypes = unit->parser().referencedTypes();
+ QList<QDeclarativeScript::TypeReference *> referencedTypes = unit->parser().referencedTypes();
for (int ii = 0; ii < resolvedTypes.count(); ++ii) {
QDeclarativeCompiledData::TypeReference ref;
const QDeclarativeTypeData::TypeReference &tref = resolvedTypes.at(ii);
- QDeclarativeScriptParser::TypeReference *parserRef = referencedTypes.at(ii);
+ QDeclarativeScript::TypeReference *parserRef = referencedTypes.at(ii);
if (tref.type) {
ref.type = tref.type;
out->types << ref;
}
- QDeclarativeParser::Object *root = unit->parser().tree();
+ QDeclarativeScript::Object *root = unit->parser().tree();
Q_ASSERT(root);
this->engine = engine;
return !isError();
}
-void QDeclarativeCompiler::compileTree(QDeclarativeParser::Object *tree)
+void QDeclarativeCompiler::compileTree(QDeclarativeScript::Object *tree)
{
compileState = pool->New<ComponentCompileState>();
return false;
}
-bool QDeclarativeCompiler::buildObject(QDeclarativeParser::Object *obj, const BindingContext &ctxt)
+bool QDeclarativeCompiler::buildObject(QDeclarativeScript::Object *obj, const BindingContext &ctxt)
{
if (componentStats)
componentStats->componentStat.objects++;
return true;
}
-void QDeclarativeCompiler::genObject(QDeclarativeParser::Object *obj)
+void QDeclarativeCompiler::genObject(QDeclarativeScript::Object *obj)
{
QDeclarativeCompiledData::TypeReference &tr = output->types[obj->type];
if (tr.type && obj->metatype == &QDeclarativeComponent::staticMetaObject) {
genObjectBody(obj);
}
-void QDeclarativeCompiler::genObjectBody(QDeclarativeParser::Object *obj)
+void QDeclarativeCompiler::genObjectBody(QDeclarativeScript::Object *obj)
{
for (Property *prop = obj->scriptStringProperties.first(); prop; prop = Object::PropertyList::next(prop)) {
Q_ASSERT(prop->scriptStringScope != -1);
for (Property *prop = obj->signalProperties.first(); prop; prop = Object::PropertyList::next(prop)) {
- QDeclarativeParser::Value *v = prop->values.first();
+ QDeclarativeScript::Value *v = prop->values.first();
if (v->type == Value::SignalObject) {
}
}
-void QDeclarativeCompiler::genValueTypeProperty(QDeclarativeParser::Object *obj,QDeclarativeParser::Property *prop)
+void QDeclarativeCompiler::genValueTypeProperty(QDeclarativeScript::Object *obj,QDeclarativeScript::Property *prop)
{
QDeclarativeInstruction fetch;
fetch.setType(QDeclarativeInstruction::FetchValueType);
output->addInstruction(pop);
}
-void QDeclarativeCompiler::genComponent(QDeclarativeParser::Object *obj)
+void QDeclarativeCompiler::genComponent(QDeclarativeScript::Object *obj)
{
- QDeclarativeParser::Object *root = obj->defaultProperty->values.first()->object;
+ QDeclarativeScript::Object *root = obj->defaultProperty->values.first()->object;
Q_ASSERT(root);
QDeclarativeInstruction create;
}
}
-bool QDeclarativeCompiler::buildComponent(QDeclarativeParser::Object *obj,
+bool QDeclarativeCompiler::buildComponent(QDeclarativeScript::Object *obj,
const BindingContext &ctxt)
{
// The special "Component" element can only have the id property and a
if (!obj->dynamicSlots.isEmpty())
COMPILE_EXCEPTION(obj, tr("Component objects cannot declare new functions."));
- QDeclarativeParser::Object *root = 0;
+ QDeclarativeScript::Object *root = 0;
if (obj->defaultProperty && !obj->defaultProperty->values.isEmpty())
root = obj->defaultProperty->values.first()->object;
return true;
}
-bool QDeclarativeCompiler::buildComponentFromRoot(QDeclarativeParser::Object *obj,
+bool QDeclarativeCompiler::buildComponentFromRoot(QDeclarativeScript::Object *obj,
const BindingContext &ctxt)
{
ComponentCompileState *oldComponentCompileState = compileState;
// Build a sub-object. A sub-object is one that was not created directly by
// QML - such as a grouped property object, or an attached object. Sub-object's
// can't have an id, involve a custom parser, have attached properties etc.
-bool QDeclarativeCompiler::buildSubObject(QDeclarativeParser::Object *obj, const BindingContext &ctxt)
+bool QDeclarativeCompiler::buildSubObject(QDeclarativeScript::Object *obj, const BindingContext &ctxt)
{
Q_ASSERT(obj->metatype);
Q_ASSERT(!obj->defaultProperty);
return output->types.count() - 1;
}
-bool QDeclarativeCompiler::buildSignal(QDeclarativeParser::Property *prop, QDeclarativeParser::Object *obj,
+bool QDeclarativeCompiler::buildSignal(QDeclarativeScript::Property *prop, QDeclarativeScript::Object *obj,
const BindingContext &ctxt)
{
Q_ASSERT(obj->metaObject());
/*!
Returns true if (value) property \a prop exists on obj, false otherwise.
*/
-bool QDeclarativeCompiler::doesPropertyExist(QDeclarativeParser::Property *prop,
- QDeclarativeParser::Object *obj)
+bool QDeclarativeCompiler::doesPropertyExist(QDeclarativeScript::Property *prop,
+ QDeclarativeScript::Object *obj)
{
if (prop->name().isEmpty())
return false;
return property(obj, prop->name()) != 0;
}
-bool QDeclarativeCompiler::buildProperty(QDeclarativeParser::Property *prop,
- QDeclarativeParser::Object *obj,
+bool QDeclarativeCompiler::buildProperty(QDeclarativeScript::Property *prop,
+ QDeclarativeScript::Object *obj,
const BindingContext &ctxt)
{
if (prop->isEmpty())
prop->value->metatype = type->attachedPropertiesType();
} else {
// Setup regular property data
- if (prop->isDefault) {
- QMetaProperty p = QDeclarativeMetaType::defaultProperty(metaObject);
-
- if (p.name())
- prop->setName(p.name());
- }
-
bool notInRevision = false;
QDeclarativePropertyCache::Data *d =
prop->name().isEmpty()?0:property(obj, prop->name(), ¬InRevision);
} else if (d) {
prop->index = d->coreIndex;
prop->core = *d;
+ } else if (prop->isDefault) {
+ QMetaProperty p = QDeclarativeMetaType::defaultProperty(metaObject);
+ QDeclarativePropertyCache::Data defaultPropertyData;
+ defaultPropertyData.load(p, engine);
+ if (p.name())
+ prop->setName(p.name());
+ prop->core = defaultPropertyData;
+ prop->index = prop->core.coreIndex;
}
// We can't error here as the "id" property does not require a
}
bool QDeclarativeCompiler::buildPropertyInNamespace(QDeclarativeImportedNamespace *ns,
- QDeclarativeParser::Property *nsProp,
- QDeclarativeParser::Object *obj,
+ QDeclarativeScript::Property *nsProp,
+ QDeclarativeScript::Object *obj,
const BindingContext &ctxt)
{
if (!nsProp->value)
return true;
}
-void QDeclarativeCompiler::genValueProperty(QDeclarativeParser::Property *prop,
- QDeclarativeParser::Object *obj)
+void QDeclarativeCompiler::genValueProperty(QDeclarativeScript::Property *prop,
+ QDeclarativeScript::Object *obj)
{
if (prop->core.isQList()) {
genListProperty(prop, obj);
}
}
-void QDeclarativeCompiler::genListProperty(QDeclarativeParser::Property *prop,
- QDeclarativeParser::Object *obj)
+void QDeclarativeCompiler::genListProperty(QDeclarativeScript::Property *prop,
+ QDeclarativeScript::Object *obj)
{
int listType = enginePrivate->listType(prop->type);
output->addInstruction(pop);
}
-void QDeclarativeCompiler::genPropertyAssignment(QDeclarativeParser::Property *prop,
- QDeclarativeParser::Object *obj,
- QDeclarativeParser::Property *valueTypeProperty)
+void QDeclarativeCompiler::genPropertyAssignment(QDeclarativeScript::Property *prop,
+ QDeclarativeScript::Object *obj,
+ QDeclarativeScript::Property *valueTypeProperty)
{
for (Value *v = prop->values.first(); v; v = Property::ValueList::next(v)) {
}
}
-bool QDeclarativeCompiler::buildIdProperty(QDeclarativeParser::Property *prop,
- QDeclarativeParser::Object *obj)
+bool QDeclarativeCompiler::buildIdProperty(QDeclarativeScript::Property *prop,
+ QDeclarativeScript::Object *obj)
{
if (prop->value ||
prop->values.isMany() ||
prop->values.first()->object)
COMPILE_EXCEPTION(prop, tr("Invalid use of id property"));
- QDeclarativeParser::Value *idValue = prop->values.first();
+ QDeclarativeScript::Value *idValue = prop->values.first();
QString val = idValue->primitive();
COMPILE_CHECK(checkValidId(idValue, val));
return true;
}
-void QDeclarativeCompiler::addId(const QString &id, QDeclarativeParser::Object *obj)
+void QDeclarativeCompiler::addId(const QString &id, QDeclarativeScript::Object *obj)
{
Q_ASSERT(!compileState->ids.value(id));
Q_ASSERT(obj->id == id);
}
QDeclarativeCompilerTypes::ComponentCompileState *
-QDeclarativeCompiler::componentState(QDeclarativeParser::Object *obj)
+QDeclarativeCompiler::componentState(QDeclarativeScript::Object *obj)
{
Q_ASSERT(obj->componentCompileState);
return obj->componentCompileState;
// GridView.row: 10
// }
// GridView is an attached property object.
-bool QDeclarativeCompiler::buildAttachedProperty(QDeclarativeParser::Property *prop,
- QDeclarativeParser::Object *obj,
+bool QDeclarativeCompiler::buildAttachedProperty(QDeclarativeScript::Property *prop,
+ QDeclarativeScript::Object *obj,
const BindingContext &ctxt)
{
Q_ASSERT(prop->value);
// font.family: "Helvetica"
// }
// font is a nested property. pointSize and family are not.
-bool QDeclarativeCompiler::buildGroupedProperty(QDeclarativeParser::Property *prop,
- QDeclarativeParser::Object *obj,
+bool QDeclarativeCompiler::buildGroupedProperty(QDeclarativeScript::Property *prop,
+ QDeclarativeScript::Object *obj,
const BindingContext &ctxt)
{
Q_ASSERT(prop->type != 0);
}
bool QDeclarativeCompiler::buildValueTypeProperty(QObject *type,
- QDeclarativeParser::Object *obj,
- QDeclarativeParser::Object *baseObj,
+ QDeclarativeScript::Object *obj,
+ QDeclarativeScript::Object *baseObj,
const BindingContext &ctxt)
{
if (obj->defaultProperty)
if (prop->values.isMany()) {
COMPILE_EXCEPTION(prop, tr("Single property assignment expected"));
} else if (!prop->values.isEmpty()) {
- QDeclarativeParser::Value *value = prop->values.first();
+ QDeclarativeScript::Value *value = prop->values.first();
if (value->object) {
COMPILE_EXCEPTION(prop, tr("Unexpected object assignment"));
// Build assignments to QML lists. QML lists are properties of type
// QDeclarativeListProperty<T>. List properties can accept a list of
// objects, or a single binding.
-bool QDeclarativeCompiler::buildListProperty(QDeclarativeParser::Property *prop,
- QDeclarativeParser::Object *obj,
+bool QDeclarativeCompiler::buildListProperty(QDeclarativeScript::Property *prop,
+ QDeclarativeScript::Object *obj,
const BindingContext &ctxt)
{
Q_ASSERT(prop->core.isQList());
}
// Compiles an assignment to a QDeclarativeScriptString property
-bool QDeclarativeCompiler::buildScriptStringProperty(QDeclarativeParser::Property *prop,
- QDeclarativeParser::Object *obj,
+bool QDeclarativeCompiler::buildScriptStringProperty(QDeclarativeScript::Property *prop,
+ QDeclarativeScript::Object *obj,
const BindingContext &ctxt)
{
if (prop->values.isMany())
}
// Compile regular property assignments of the form "property: <value>"
-bool QDeclarativeCompiler::buildPropertyAssignment(QDeclarativeParser::Property *prop,
- QDeclarativeParser::Object *obj,
+bool QDeclarativeCompiler::buildPropertyAssignment(QDeclarativeScript::Property *prop,
+ QDeclarativeScript::Object *obj,
const BindingContext &ctxt)
{
obj->addValueProperty(prop);
}
// Compile assigning a single object instance to a regular property
-bool QDeclarativeCompiler::buildPropertyObjectAssignment(QDeclarativeParser::Property *prop,
- QDeclarativeParser::Object *obj,
- QDeclarativeParser::Value *v,
+bool QDeclarativeCompiler::buildPropertyObjectAssignment(QDeclarativeScript::Property *prop,
+ QDeclarativeScript::Object *obj,
+ QDeclarativeScript::Value *v,
const BindingContext &ctxt)
{
Q_ASSERT(prop->index != -1);
v->type = Value::CreatedObject;
} else if (propertyMetaObject == &QDeclarativeComponent::staticMetaObject) {
// Automatic "Component" insertion
- QDeclarativeParser::Object *root = v->object;
- QDeclarativeParser::Object *component = pool->New<Object>();
+ QDeclarativeScript::Object *root = v->object;
+ QDeclarativeScript::Object *component = pool->New<Object>();
component->type = componentTypeRef();
component->typeName = "Qt/Component";
component->metatype = &QDeclarativeComponent::staticMetaObject;
component->location = root->location;
- QDeclarativeParser::Value *componentValue = pool->New<Value>();
+ QDeclarativeScript::Value *componentValue = pool->New<Value>();
componentValue->object = root;
component->getDefaultProperty()->addValue(componentValue);
v->object = component;
// Item {
// NumberAnimation on x { }
// }
-bool QDeclarativeCompiler::buildPropertyOnAssignment(QDeclarativeParser::Property *prop,
- QDeclarativeParser::Object *obj,
- QDeclarativeParser::Object *baseObj,
- QDeclarativeParser::Value *v,
+bool QDeclarativeCompiler::buildPropertyOnAssignment(QDeclarativeScript::Property *prop,
+ QDeclarativeScript::Object *obj,
+ QDeclarativeScript::Object *baseObj,
+ QDeclarativeScript::Value *v,
const BindingContext &ctxt)
{
Q_ASSERT(prop->index != -1);
}
// Compile assigning a literal or binding to a regular property
-bool QDeclarativeCompiler::buildPropertyLiteralAssignment(QDeclarativeParser::Property *prop,
- QDeclarativeParser::Object *obj,
- QDeclarativeParser::Value *v,
+bool QDeclarativeCompiler::buildPropertyLiteralAssignment(QDeclarativeScript::Property *prop,
+ QDeclarativeScript::Object *obj,
+ QDeclarativeScript::Value *v,
const BindingContext &ctxt)
{
Q_ASSERT(prop->index != -1);
}
bool QDeclarativeCompiler::testQualifiedEnumAssignment(const QMetaProperty &prop,
- QDeclarativeParser::Object *obj,
- QDeclarativeParser::Value *v,
+ QDeclarativeScript::Object *obj,
+ QDeclarativeScript::Value *v,
bool *isAssignment)
{
*isAssignment = false;
return true;
v->type = Value::Literal;
- v->value = QDeclarativeParser::Variant((double)value);
+ v->value = QDeclarativeScript::Variant((double)value);
*isAssignment = true;
return true;
}
// Ensures that the dynamic meta specification on obj is valid
-bool QDeclarativeCompiler::checkDynamicMeta(QDeclarativeParser::Object *obj)
+bool QDeclarativeCompiler::checkDynamicMeta(QDeclarativeScript::Object *obj)
{
bool seenDefaultProperty = false;
// Check properties
int dpCount = obj->dynamicProperties.count();
for (Object::DynamicProperty *p = obj->dynamicProperties.first(); p; p = obj->dynamicProperties.next(p)) {
- const QDeclarativeParser::Object::DynamicProperty &prop = *p;
+ const QDeclarativeScript::Object::DynamicProperty &prop = *p;
if (prop.isDefaultProperty) {
if (seenDefaultProperty)
return true;
}
-bool QDeclarativeCompiler::mergeDynamicMetaProperties(QDeclarativeParser::Object *obj)
+bool QDeclarativeCompiler::mergeDynamicMetaProperties(QDeclarativeScript::Object *obj)
{
for (Object::DynamicProperty *p = obj->dynamicProperties.first(); p; p = obj->dynamicProperties.next(p)) {
Q_GLOBAL_STATIC(QAtomicInt, classIndexCounter)
-bool QDeclarativeCompiler::buildDynamicMeta(QDeclarativeParser::Object *obj, DynamicMetaMode mode)
+bool QDeclarativeCompiler::buildDynamicMeta(QDeclarativeScript::Object *obj, DynamicMetaMode mode)
{
Q_ASSERT(obj);
Q_ASSERT(obj->metatype);
return true;
}
-bool QDeclarativeCompiler::checkValidId(QDeclarativeParser::Value *v, const QString &val)
+bool QDeclarativeCompiler::checkValidId(QDeclarativeScript::Value *v, const QString &val)
{
if (val.isEmpty())
COMPILE_EXCEPTION(v, tr( "Invalid empty ID"));
bool QDeclarativeCompiler::compileAlias(QFastMetaBuilder &builder,
QByteArray &data,
- QDeclarativeParser::Object *obj,
+ QDeclarativeScript::Object *obj,
int propIndex, int aliasIndex,
Object::DynamicProperty &prop)
{
if (alias.count() < 1 || alias.count() > 3)
COMPILE_EXCEPTION(prop.defaultValue, tr("Invalid alias reference. An alias reference must be specified as <id>, <id>.<property> or <id>.<value property>.<property>"));
- QDeclarativeParser::Object *idObject = compileState->ids.value(alias.at(0));
+ QDeclarativeScript::Object *idObject = compileState->ids.value(alias.at(0));
if (!idObject)
COMPILE_EXCEPTION(prop.defaultValue, tr("Invalid alias reference. Unable to find id \"%1\"").arg(alias.at(0)));
aliasProperty = valueType->metaObject()->property(valueTypeIndex);
propIdx |= (valueTypeIndex << 16);
+
+ // update the property type
+ type = aliasProperty.type();
+ if (type >= QVariant::UserType)
+ type = 0;
}
if (aliasProperty.isEnumType())
prop.resolvedCustomTypeName = pool->NewByteArray(typeName);
prop.typeRef = builder.newString(typeName.length());
+ int propertyFlags = 0;
+ if (writable)
+ propertyFlags |= QFastMetaBuilder::Writable;
+ if (resettable)
+ propertyFlags |= QFastMetaBuilder::Resettable;
+
builder.setProperty(propIndex, prop.nameRef, prop.typeRef, (QMetaType::Type)type,
- (QFastMetaBuilder::PropertyFlag)(writable?int(QFastMetaBuilder::Writable):0),
+ (QFastMetaBuilder::PropertyFlag)propertyFlags,
propIndex);
return true;
}
-bool QDeclarativeCompiler::buildBinding(QDeclarativeParser::Value *value,
- QDeclarativeParser::Property *prop,
+bool QDeclarativeCompiler::buildBinding(QDeclarativeScript::Value *value,
+ QDeclarativeScript::Property *prop,
const BindingContext &ctxt)
{
Q_ASSERT(prop->index != -1);
return true;
}
-void QDeclarativeCompiler::genBindingAssignment(QDeclarativeParser::Value *binding,
- QDeclarativeParser::Property *prop,
- QDeclarativeParser::Object *obj,
- QDeclarativeParser::Property *valueTypeProperty)
+void QDeclarativeCompiler::genBindingAssignment(QDeclarativeScript::Value *binding,
+ QDeclarativeScript::Property *prop,
+ QDeclarativeScript::Object *obj,
+ QDeclarativeScript::Property *valueTypeProperty)
{
Q_UNUSED(obj);
Q_ASSERT(binding->bindingReference);
return output->contextCaches.count() - 1;
}
-int QDeclarativeCompiler::genValueTypeData(QDeclarativeParser::Property *valueTypeProp,
- QDeclarativeParser::Property *prop)
+int QDeclarativeCompiler::genValueTypeData(QDeclarativeScript::Property *valueTypeProp,
+ QDeclarativeScript::Property *prop)
{
typedef QDeclarativePropertyPrivate QDPP;
QByteArray data = QDPP::saveValueType(prop->parent->metaObject(), prop->index,
return output->indexForByteArray(data);
}
-int QDeclarativeCompiler::genPropertyData(QDeclarativeParser::Property *prop)
+int QDeclarativeCompiler::genPropertyData(QDeclarativeScript::Property *prop)
{
typedef QDeclarativePropertyPrivate QDPP;
QByteArray data = QDPP::saveProperty(prop->parent->metaObject(), prop->index, engine);
QString functionArray(QLatin1String("["));
for (int ii = 0; ii < sharedBindings.count(); ++ii) {
BindingReference *reference = sharedBindings.at(ii);
- QDeclarativeParser::Value *value = reference->value;
+ QDeclarativeScript::Value *value = reference->value;
const QString &expression = reference->rewrittenExpression;
if (ii != 0) functionArray += QLatin1String(",");
Returns true if from can be assigned to a (QObject) property of type
to.
*/
-bool QDeclarativeCompiler::canCoerce(int to, QDeclarativeParser::Object *from)
+bool QDeclarativeCompiler::canCoerce(int to, QDeclarativeScript::Object *from)
{
const QMetaObject *toMo =
enginePrivate->rawMetaObjectForType(to);
/*!
Returns the element name, as written in the QML file, for o.
*/
-QString QDeclarativeCompiler::elementName(QDeclarativeParser::Object *o)
+QString QDeclarativeCompiler::elementName(QDeclarativeScript::Object *o)
{
Q_ASSERT(o);
if (o->type != -1) {
}
}
-QDeclarativeType *QDeclarativeCompiler::toQmlType(QDeclarativeParser::Object *from)
+QDeclarativeType *QDeclarativeCompiler::toQmlType(QDeclarativeScript::Object *from)
{
// ### Optimize
const QMetaObject *mo = from->metatype;
return type;
}
-QStringList QDeclarativeCompiler::deferredProperties(QDeclarativeParser::Object *obj)
+QStringList QDeclarativeCompiler::deferredProperties(QDeclarativeScript::Object *obj)
{
const QMetaObject *mo = obj->metatype;
}
QDeclarativePropertyCache::Data *
-QDeclarativeCompiler::property(QDeclarativeParser::Object *object, int index)
+QDeclarativeCompiler::property(QDeclarativeScript::Object *object, int index)
{
QDeclarativePropertyCache *cache = 0;
}
QDeclarativePropertyCache::Data *
-QDeclarativeCompiler::property(QDeclarativeParser::Object *object, const QHashedStringRef &name, bool *notInRevision)
+QDeclarativeCompiler::property(QDeclarativeScript::Object *object, const QHashedStringRef &name, bool *notInRevision)
{
if (notInRevision) *notInRevision = false;
// This code must match the semantics of QDeclarativePropertyPrivate::findSignalByName
QDeclarativePropertyCache::Data *
-QDeclarativeCompiler::signal(QDeclarativeParser::Object *object, const QHashedStringRef &name, bool *notInRevision)
+QDeclarativeCompiler::signal(QDeclarativeScript::Object *object, const QHashedStringRef &name, bool *notInRevision)
{
if (notInRevision) *notInRevision = false;
}
// This code must match the semantics of QDeclarativePropertyPrivate::findSignalByName
-int QDeclarativeCompiler::indexOfSignal(QDeclarativeParser::Object *object, const QString &name,
+int QDeclarativeCompiler::indexOfSignal(QDeclarativeScript::Object *object, const QString &name,
bool *notInRevision)
{
QDeclarativePropertyCache::Data *d = signal(object, QStringRef(&name), notInRevision);
return d?d->coreIndex:-1;
}
-int QDeclarativeCompiler::indexOfProperty(QDeclarativeParser::Object *object, const QString &name,
+int QDeclarativeCompiler::indexOfProperty(QDeclarativeScript::Object *object, const QString &name,
bool *notInRevision)
{
return indexOfProperty(object, QStringRef(&name), notInRevision);
}
-int QDeclarativeCompiler::indexOfProperty(QDeclarativeParser::Object *object, const QHashedStringRef &name,
+int QDeclarativeCompiler::indexOfProperty(QDeclarativeScript::Object *object, const QHashedStringRef &name,
bool *notInRevision)
{
QDeclarativePropertyCache::Data *d = property(object, name, notInRevision);