summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/declarative/qml/qmlcompiler.cpp231
-rw-r--r--src/declarative/qml/qmlengine.cpp107
-rw-r--r--src/declarative/qml/qmlmetatype.cpp56
-rw-r--r--src/declarative/qml/qmlvaluetype.cpp4
-rw-r--r--src/declarative/util/qmlfollow.cpp2
-rw-r--r--src/declarative/util/qmlstate.cpp19
-rw-r--r--src/declarative/util/qmlstateoperations.cpp10
7 files changed, 217 insertions, 212 deletions
diff --git a/src/declarative/qml/qmlcompiler.cpp b/src/declarative/qml/qmlcompiler.cpp
index 59cf15d..091b7bb 100644
--- a/src/declarative/qml/qmlcompiler.cpp
+++ b/src/declarative/qml/qmlcompiler.cpp
@@ -89,7 +89,7 @@ QmlCompiler::QmlCompiler()
*/
bool QmlCompiler::isError() const
{
- return !exceptions.isEmpty();
+ return !exceptions.isEmpty();
}
/*!
@@ -113,7 +113,7 @@ bool QmlCompiler::isValidId(const QString &val)
return false;
QChar u(QLatin1Char('_'));
- for (int ii = 0; ii < val.count(); ++ii)
+ for (int ii = 0; ii < val.count(); ++ii)
if (val.at(ii) != u &&
((ii == 0 && !val.at(ii).isLetter()) ||
(ii != 0 && !val.at(ii).isLetterOrNumber())) )
@@ -140,12 +140,12 @@ bool QmlCompiler::isAttachedPropertyName(const QByteArray &name)
*/
bool QmlCompiler::isSignalPropertyName(const QByteArray &name)
{
- return name.length() >= 3 && name.startsWith("on") &&
+ return name.length() >= 3 && name.startsWith("on") &&
'A' <= name.at(2) && 'Z' >= name.at(2);
}
/*!
- Inserts an error into the QmlCompiler error list, and returns false
+ Inserts an error into the QmlCompiler error list, and returns false
(failure).
\a token is used to source the error line and column, and \a desc is the
@@ -169,7 +169,7 @@ bool QmlCompiler::isSignalPropertyName(const QByteArray &name)
error.setDescription(exceptionDescription.trimmed()); \
exceptions << error; \
return false; \
- }
+ }
/*!
Returns false if \a is false, otherwise does nothing.
@@ -186,13 +186,13 @@ bool QmlCompiler::isSignalPropertyName(const QByteArray &name)
This test corresponds to action taken by genLiteralAssignment(). Any change
made here, must have a corresponding action in genLiteralAssigment().
*/
-bool QmlCompiler::testLiteralAssignment(const QMetaProperty &prop,
+bool QmlCompiler::testLiteralAssignment(const QMetaProperty &prop,
QmlParser::Value *v)
{
QString string = v->value.asScript();
if (!prop.isWritable())
- COMPILE_EXCEPTION(v, "Invalid property assignment: read-only property");
+ COMPILE_EXCEPTION(v, "Invalid property assignment: read-only property");
if (prop.isEnumType()) {
int value;
@@ -300,9 +300,9 @@ bool QmlCompiler::testLiteralAssignment(const QMetaProperty &prop,
int t = prop.type();
if (t == QVariant::UserType)
t = prop.userType();
- QmlMetaType::StringConverter converter =
+ QmlMetaType::StringConverter converter =
QmlMetaType::customStringConverter(t);
- if (!converter)
+ if (!converter)
COMPILE_EXCEPTION(v, "Invalid property assignment: unknown type" << prop.type());
}
break;
@@ -408,7 +408,7 @@ void QmlCompiler::genLiteralAssignment(const QMetaProperty &prop,
case QVariant::Time:
{
QTime time = QTime::fromString(string, Qt::ISODate);
- int data[] = { time.hour(), time.minute(),
+ int data[] = { time.hour(), time.minute(),
time.second(), time.msec() };
int index = output->indexForInt(data, 4);
instr.type = QmlInstruction::StoreTime;
@@ -434,7 +434,7 @@ void QmlCompiler::genLiteralAssignment(const QMetaProperty &prop,
case QVariant::PointF:
{
bool ok;
- QPointF point =
+ QPointF point =
QmlStringConverters::pointFFromString(string, &ok);
float data[] = { point.x(), point.y() };
int index = output->indexForFloat(data, 2);
@@ -466,7 +466,7 @@ void QmlCompiler::genLiteralAssignment(const QMetaProperty &prop,
{
bool ok;
QRectF rect = QmlStringConverters::rectFFromString(string, &ok);
- float data[] = { rect.x(), rect.y(),
+ float data[] = { rect.x(), rect.y(),
rect.width(), rect.height() };
int index = output->indexForFloat(data, 4);
if (type == QVariant::RectF)
@@ -523,14 +523,14 @@ void QmlCompiler::reset(QmlCompiledData *data)
Compile \a unit, and store the output in \a out. \a engine is the QmlEngine
with which the QmlCompiledData will be associated.
- Returns true on success, false on failure. On failure, the compile errors
+ Returns true on success, false on failure. On failure, the compile errors
are available from errors().
- If the environment variant QML_COMPILER_DUMP is set
+ If the environment variant QML_COMPILER_DUMP is set
(eg. QML_COMPILER_DUMP=1) the compiled instructions will be dumped to stderr
on a successful compiler.
*/
-bool QmlCompiler::compile(QmlEngine *engine,
+bool QmlCompiler::compile(QmlEngine *engine,
QmlCompositeTypeData *unit,
QmlCompiledData *out)
{
@@ -555,8 +555,8 @@ bool QmlCompiler::compile(QmlEngine *engine,
if (ref.component->isError()) {
QmlError error;
- error.setUrl(output->url);
- error.setDescription(QLatin1String("Unable to create type ") +
+ error.setUrl(output->url);
+ error.setDescription(QLatin1String("Unable to create type ") +
unit->data.types().at(ii));
exceptions << error;
exceptions << ref.component->errors();
@@ -565,7 +565,7 @@ bool QmlCompiler::compile(QmlEngine *engine,
}
ref.ref = tref.unit;
ref.ref->addref();
- }
+ }
ref.className = unit->data.types().at(ii).toLatin1();
out->types << ref;
}
@@ -620,13 +620,13 @@ void QmlCompiler::compileTree(Object *tree)
}
bool QmlCompiler::buildObject(Object *obj, const BindingContext &ctxt)
-{
+{
Q_ASSERT (obj->type != -1);
- const QmlCompiledData::TypeReference &tr =
+ const QmlCompiledData::TypeReference &tr =
output->types.at(obj->type);
obj->metatype = tr.metaObject();
- if (tr.component)
+ if (tr.component)
obj->url = tr.component->url();
if (tr.type)
obj->typeName = tr.type->qmlTypeName();
@@ -652,10 +652,10 @@ bool QmlCompiler::buildObject(Object *obj, const BindingContext &ctxt)
if (obj->parserStatusCast != -1)
compileState.parserStatusCount++;
- // Check if this is a custom parser type. Custom parser types allow
+ // Check if this is a custom parser type. Custom parser types allow
// assignments to non-existant properties. These assignments are then
// compiled by the type.
- bool isCustomParser = output->types.at(obj->type).type &&
+ bool isCustomParser = output->types.at(obj->type).type &&
output->types.at(obj->type).type->customParser() != 0;
QList<QmlCustomParserProperty> customProps;
@@ -663,7 +663,7 @@ bool QmlCompiler::buildObject(Object *obj, const BindingContext &ctxt)
QStringList deferredList = deferredProperties(obj);
// Must do id property first. This is to ensure that the id given to any
- // id reference created matches the order in which the objects are
+ // id reference created matches the order in which the objects are
// instantiated
foreach(Property *prop, obj->properties) {
if (prop->name == "id") {
@@ -697,8 +697,8 @@ bool QmlCompiler::buildObject(Object *obj, const BindingContext &ctxt)
}
}
- if (canDefer && !deferredList.isEmpty() &&
- deferredList.contains(prop->name))
+ if (canDefer && !deferredList.isEmpty() &&
+ deferredList.contains(prop->name))
prop->isDeferred = true;
}
@@ -722,8 +722,8 @@ bool QmlCompiler::buildObject(Object *obj, const BindingContext &ctxt)
canDefer = ids == compileState.ids.count();
}
- if (canDefer && !deferredList.isEmpty() &&
- deferredList.contains(prop->name))
+ if (canDefer && !deferredList.isEmpty() &&
+ deferredList.contains(prop->name))
prop->isDeferred = true;
}
@@ -808,12 +808,12 @@ void QmlCompiler::genObjectBody(QmlParser::Object *obj)
output->bytecode << defer;
foreach(Property *prop, obj->valueProperties) {
- if (!prop->isDeferred)
+ if (!prop->isDeferred)
continue;
genValueProperty(prop, obj);
}
- output->bytecode[deferIdx].defer.deferCount =
+ output->bytecode[deferIdx].defer.deferCount =
output->bytecode.count() - deferIdx - 1;
}
@@ -828,7 +828,7 @@ void QmlCompiler::genObjectBody(QmlParser::Object *obj)
QmlInstruction assign;
assign.type = QmlInstruction::AssignSignalObject;
assign.line = v->location.start.line;
- assign.assignSignalObject.signal =
+ assign.assignSignalObject.signal =
output->indexForByteArray(prop->name);
output->bytecode << assign;
@@ -838,7 +838,7 @@ void QmlCompiler::genObjectBody(QmlParser::Object *obj)
store.type = QmlInstruction::StoreSignal;
store.line = v->location.start.line;
store.storeSignal.signalIndex = prop->index;
- store.storeSignal.value =
+ store.storeSignal.value =
output->indexForString(v->value.asScript().trimmed());
output->bytecode << store;
@@ -908,7 +908,7 @@ void QmlCompiler::genComponent(QmlParser::Object *obj)
create.line = root->location.start.line;
create.createComponent.endLine = root->location.end.line;
output->bytecode << create;
- int count = output->bytecode.count();
+ int count = output->bytecode.count();
ComponentCompileState oldCompileState = compileState;
compileState = componentState(root);
@@ -941,7 +941,7 @@ void QmlCompiler::genComponent(QmlParser::Object *obj)
}
}
-bool QmlCompiler::buildComponent(QmlParser::Object *obj,
+bool QmlCompiler::buildComponent(QmlParser::Object *obj,
const BindingContext &ctxt)
{
// The special "Component" element can only have the id property and a
@@ -953,7 +953,7 @@ bool QmlCompiler::buildComponent(QmlParser::Object *obj,
(obj->properties.count() == 1 && obj->properties.begin().key() != "id"))
COMPILE_EXCEPTION(obj, "Invalid component specification");
- if (obj->properties.count())
+ if (obj->properties.count())
idProp = *obj->properties.begin();
if (idProp && (idProp->value || idProp->values.count() > 1 || !isValidId(idProp->values.first()->primitive())))
COMPILE_EXCEPTION(obj, "Invalid component id specification");
@@ -969,15 +969,15 @@ bool QmlCompiler::buildComponent(QmlParser::Object *obj,
}
// Check the Component tree is well formed
- if (obj->defaultProperty &&
+ if (obj->defaultProperty &&
(obj->defaultProperty->value || obj->defaultProperty->values.count() > 1 ||
(obj->defaultProperty->values.count() == 1 && !obj->defaultProperty->values.first()->object)))
COMPILE_EXCEPTION(obj, "Invalid component body specification");
Object *root = 0;
- if (obj->defaultProperty && obj->defaultProperty->values.count())
+ if (obj->defaultProperty && obj->defaultProperty->values.count())
root = obj->defaultProperty->values.first()->object;
-
+
if (!root)
COMPILE_EXCEPTION(obj, "Cannot create empty component specification");
@@ -987,14 +987,14 @@ bool QmlCompiler::buildComponent(QmlParser::Object *obj,
return true;
}
-bool QmlCompiler::buildComponentFromRoot(QmlParser::Object *obj,
+bool QmlCompiler::buildComponentFromRoot(QmlParser::Object *obj,
const BindingContext &ctxt)
{
ComponentCompileState oldComponentCompileState = compileState;
compileState = ComponentCompileState();
compileState.root = obj;
- if (obj)
+ if (obj)
COMPILE_CHECK(buildObject(obj, ctxt));
COMPILE_CHECK(completeComponentBuild());
@@ -1005,16 +1005,16 @@ bool QmlCompiler::buildComponentFromRoot(QmlParser::Object *obj,
}
-// Build a sub-object. A sub-object is one that was not created directly by
+// 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 QmlCompiler::buildSubObject(Object *obj, const BindingContext &ctxt)
{
Q_ASSERT(obj->metatype);
- Q_ASSERT(ctxt.isSubContext()); // sub-objects must always be in a binding
+ Q_ASSERT(ctxt.isSubContext()); // sub-objects must always be in a binding
// sub-context
- if (obj->defaultProperty)
+ if (obj->defaultProperty)
COMPILE_CHECK(buildProperty(obj->defaultProperty, obj, ctxt));
foreach(Property *prop, obj->properties) {
@@ -1051,7 +1051,7 @@ int QmlCompiler::findSignalByName(const QMetaObject *mo, const QByteArray &name)
int idx = methodName.indexOf('(');
methodName = methodName.left(idx);
- if (methodName == name)
+ if (methodName == name)
return ii;
}
return -1;
@@ -1094,7 +1094,7 @@ bool QmlCompiler::buildSignal(QmlParser::Property *prop, QmlParser::Object *obj,
prop->values.at(0)->type = Value::SignalExpression;
}
}
-
+
return true;
}
@@ -1102,7 +1102,7 @@ bool QmlCompiler::buildSignal(QmlParser::Property *prop, QmlParser::Object *obj,
/*!
Returns true if (value) property \a prop exists on obj, false otherwise.
*/
-bool QmlCompiler::doesPropertyExist(QmlParser::Property *prop,
+bool QmlCompiler::doesPropertyExist(QmlParser::Property *prop,
QmlParser::Object *obj)
{
if(isAttachedPropertyName(prop->name) || prop->name == "id")
@@ -1118,12 +1118,12 @@ bool QmlCompiler::doesPropertyExist(QmlParser::Property *prop,
return idx != -1;
}
}
-
+
return false;
}
-bool QmlCompiler::buildProperty(QmlParser::Property *prop,
- QmlParser::Object *obj,
+bool QmlCompiler::buildProperty(QmlParser::Property *prop,
+ QmlParser::Object *obj,
const BindingContext &ctxt)
{
if (prop->isEmpty())
@@ -1172,7 +1172,7 @@ bool QmlCompiler::buildProperty(QmlParser::Property *prop,
}
}
- // We can't error here as the "id" property does not require a
+ // We can't error here as the "id" property does not require a
// successful index resolution
if (p.name()) {
int t = p.type();
@@ -1187,11 +1187,11 @@ bool QmlCompiler::buildProperty(QmlParser::Property *prop,
if (!prop->isDefault && prop->name == "id" && !ctxt.isSubContext()) {
// The magic "id" behaviour doesn't apply when "id" is resolved as a
- // default property or to sub-objects (which are always in binding
+ // default property or to sub-objects (which are always in binding
// sub-contexts)
COMPILE_CHECK(buildIdProperty(prop, obj));
- if (prop->type == QVariant::String &&
- prop->values.at(0)->value.isString())
+ if (prop->type == QVariant::String &&
+ prop->values.at(0)->value.isString())
COMPILE_CHECK(buildPropertyAssignment(prop, obj, ctxt));
} else if (isAttachedPropertyName(prop->name)) {
@@ -1210,7 +1210,7 @@ bool QmlCompiler::buildProperty(QmlParser::Property *prop,
COMPILE_CHECK(buildGroupedProperty(prop, obj, ctxt));
- } else if (QmlMetaType::isQmlList(prop->type) ||
+ } else if (QmlMetaType::isQmlList(prop->type) ||
QmlMetaType::isList(prop->type)) {
COMPILE_CHECK(buildListProperty(prop, obj, ctxt));
@@ -1224,7 +1224,7 @@ bool QmlCompiler::buildProperty(QmlParser::Property *prop,
return true;
}
-void QmlCompiler::genValueProperty(QmlParser::Property *prop,
+void QmlCompiler::genValueProperty(QmlParser::Property *prop,
QmlParser::Object *obj)
{
if (QmlMetaType::isQmlList(prop->type) || QmlMetaType::isList(prop->type)) {
@@ -1234,7 +1234,7 @@ void QmlCompiler::genValueProperty(QmlParser::Property *prop,
}
}
-void QmlCompiler::genListProperty(QmlParser::Property *prop,
+void QmlCompiler::genListProperty(QmlParser::Property *prop,
QmlParser::Object *obj)
{
QmlInstruction::Type fetchType;
@@ -1291,7 +1291,7 @@ void QmlCompiler::genListProperty(QmlParser::Property *prop,
output->bytecode << pop;
}
-void QmlCompiler::genPropertyAssignment(QmlParser::Property *prop,
+void QmlCompiler::genPropertyAssignment(QmlParser::Property *prop,
QmlParser::Object *obj,
QmlParser::Property *valueTypeProperty)
{
@@ -1326,7 +1326,7 @@ void QmlCompiler::genPropertyAssignment(QmlParser::Property *prop,
store.storeObject.propertyIndex = prop->index;
output->bytecode << store;
- }
+ }
} else if (v->type == Value::ValueSource) {
genObject(v->object);
@@ -1338,7 +1338,7 @@ void QmlCompiler::genPropertyAssignment(QmlParser::Property *prop,
store.assignValueSource.property = QmlMetaPropertyPrivate::saveValueType(valueTypeProperty->index, prop->index);
store.assignValueSource.owner = 1;
} else {
- store.assignValueSource.property =
+ store.assignValueSource.property =
QmlMetaPropertyPrivate::saveProperty(prop->index);
store.assignValueSource.owner = 0;
}
@@ -1353,12 +1353,12 @@ void QmlCompiler::genPropertyAssignment(QmlParser::Property *prop,
QMetaProperty mp = obj->metaObject()->property(prop->index);
genLiteralAssignment(mp, v);
- }
+ }
}
}
-bool QmlCompiler::buildIdProperty(QmlParser::Property *prop,
+bool QmlCompiler::buildIdProperty(QmlParser::Property *prop,
QmlParser::Object *obj)
{
if (prop->value ||
@@ -1404,7 +1404,7 @@ void QmlCompiler::saveComponentState()
savedCompileStates.insert(compileState.root, compileState);
}
-QmlCompiler::ComponentCompileState
+QmlCompiler::ComponentCompileState
QmlCompiler::componentState(QmlParser::Object *obj)
{
Q_ASSERT(savedCompileStates.contains(obj));
@@ -1416,7 +1416,7 @@ QmlCompiler::componentState(QmlParser::Object *obj)
// GridView.row: 10
// }
// GridView is an attached property object.
-bool QmlCompiler::buildAttachedProperty(QmlParser::Property *prop,
+bool QmlCompiler::buildAttachedProperty(QmlParser::Property *prop,
QmlParser::Object *obj,
const BindingContext &ctxt)
{
@@ -1447,10 +1447,10 @@ bool QmlCompiler::buildGroupedProperty(QmlParser::Property *prop,
Q_ASSERT(prop->index != -1);
if (prop->type < QVariant::UserType) {
- QmlEnginePrivate *ep =
+ QmlEnginePrivate *ep =
static_cast<QmlEnginePrivate *>(QObjectPrivate::get(engine));
if (ep->valueTypes[prop->type]) {
- COMPILE_CHECK(buildValueTypeProperty(ep->valueTypes[prop->type],
+ COMPILE_CHECK(buildValueTypeProperty(ep->valueTypes[prop->type],
prop->value, ctxt.incr()));
obj->addValueTypeProperty(prop);
} else {
@@ -1461,7 +1461,7 @@ bool QmlCompiler::buildGroupedProperty(QmlParser::Property *prop,
// Load the nested property's meta type
prop->value->metatype = QmlMetaType::metaObjectForType(prop->type);
if (!prop->value->metatype)
- COMPILE_EXCEPTION(prop, "Cannot nest non-QObject property" <<
+ COMPILE_EXCEPTION(prop, "Cannot nest non-QObject property" <<
prop->name);
obj->addGroupedProperty(prop);
@@ -1472,7 +1472,7 @@ bool QmlCompiler::buildGroupedProperty(QmlParser::Property *prop,
return true;
}
-bool QmlCompiler::buildValueTypeProperty(QObject *type,
+bool QmlCompiler::buildValueTypeProperty(QObject *type,
QmlParser::Object *obj,
const BindingContext &ctxt)
{
@@ -1494,11 +1494,11 @@ bool QmlCompiler::buildValueTypeProperty(QObject *type,
Value *value = prop->values.at(0);
if (value->object) {
- const QMetaObject *c =
+ const QMetaObject *c =
output->types.at(value->object->type).metaObject();
- bool isPropertyValue = false;
+ bool isPropertyValue = false;
while (c && !isPropertyValue) {
- isPropertyValue =
+ isPropertyValue =
(c == &QmlPropertyValueSource::staticMetaObject);
c = c->superClass();
}
@@ -1539,7 +1539,7 @@ bool QmlCompiler::buildListProperty(QmlParser::Property *prop,
QmlParser::Object *obj,
const BindingContext &ctxt)
{
- Q_ASSERT(QmlMetaType::isList(prop->type) ||
+ Q_ASSERT(QmlMetaType::isList(prop->type) ||
QmlMetaType::isQmlList(prop->type));
int t = prop->type;
@@ -1586,7 +1586,7 @@ bool QmlCompiler::buildListProperty(QmlParser::Property *prop,
if (!canCoerce(listType, v->object)) {
COMPILE_EXCEPTION(v, "Cannot assign object to list");
}
- }
+ }
} else if (v->value.isScript()) {
if (assignedBinding)
@@ -1642,7 +1642,7 @@ bool QmlCompiler::buildPropertyAssignment(QmlParser::Property *prop,
return true;
}
-// Compile assigning a single object instance to a regular property
+// Compile assigning a single object instance to a regular property
bool QmlCompiler::buildPropertyObjectAssignment(QmlParser::Property *prop,
QmlParser::Object *obj,
QmlParser::Value *v,
@@ -1665,21 +1665,21 @@ bool QmlCompiler::buildPropertyObjectAssignment(QmlParser::Property *prop,
v->type = Value::CreatedObject;
} else {
- // Normally buildObject() will set this up, but we need the static
+ // Normally buildObject() will set this up, but we need the static
// meta object earlier to test for assignability. It doesn't matter
// that there may still be outstanding synthesized meta object changes
// on this type, as they are not relevant for assignability testing
v->object->metatype = output->types.at(v->object->type).metaObject();
Q_ASSERT(v->object->metaObject());
- // We want to raw metaObject here as the raw metaobject is the
- // actual property type before we applied any extensions that might
+ // We want to raw metaObject here as the raw metaobject is the
+ // actual property type before we applied any extensions that might
// effect the properties on the type, but don't effect assignability
- const QMetaObject *propertyMetaObject =
+ const QMetaObject *propertyMetaObject =
QmlMetaType::rawMetaObjectForType(prop->type);
-
+
// Will be true if the assigned type inherits QmlPropertyValueSource
- bool isPropertyValue = false;
+ bool isPropertyValue = false;
// Will be true if the assgned type inherits propertyMetaObject
bool isAssignable = false;
// Determine isPropertyValue and isAssignable values
@@ -1729,7 +1729,7 @@ bool QmlCompiler::buildPropertyObjectAssignment(QmlParser::Property *prop,
return true;
}
-// Compile assigning a literal or binding to a regular property
+// Compile assigning a literal or binding to a regular property
bool QmlCompiler::buildPropertyLiteralAssignment(QmlParser::Property *prop,
QmlParser::Object *obj,
QmlParser::Value *v,
@@ -1762,16 +1762,16 @@ bool QmlCompiler::checkDynamicMeta(QmlParser::Object *obj)
// Check properties
for (int ii = 0; ii < obj->dynamicProperties.count(); ++ii) {
- const QmlParser::Object::DynamicProperty &prop =
+ const QmlParser::Object::DynamicProperty &prop =
obj->dynamicProperties.at(ii);
if (prop.isDefaultProperty) {
if (seenDefaultProperty)
COMPILE_EXCEPTION(obj, "Duplicate default property");
seenDefaultProperty = true;
- }
-
- if (propNames.contains(prop.name))
+ }
+
+ if (propNames.contains(prop.name))
COMPILE_EXCEPTION(obj, "Duplicate property name");
propNames.insert(prop.name);
@@ -1802,7 +1802,7 @@ bool QmlCompiler::mergeDynamicMetaProperties(QmlParser::Object *obj)
continue;
Property *property = 0;
- if (p.isDefaultProperty)
+ if (p.isDefaultProperty)
property = obj->getDefaultProperty();
else
property = obj->getProperty(p.name);
@@ -1821,7 +1821,7 @@ bool QmlCompiler::mergeDynamicMetaProperties(QmlParser::Object *obj)
bool QmlCompiler::buildDynamicMeta(QmlParser::Object *obj, DynamicMetaMode mode)
{
- if (obj->dynamicProperties.isEmpty() &&
+ if (obj->dynamicProperties.isEmpty() &&
obj->dynamicSignals.isEmpty() &&
obj->dynamicSlots.isEmpty())
return true;
@@ -1839,7 +1839,7 @@ bool QmlCompiler::buildDynamicMeta(QmlParser::Object *obj, DynamicMetaMode mode)
for (int ii = 0; ii < obj->dynamicProperties.count(); ++ii) {
const Object::DynamicProperty &p = obj->dynamicProperties.at(ii);
- int propIdx =
+ int propIdx =
obj->metaObject()->indexOfProperty(p.name.constData());
if (-1 != propIdx) {
QMetaProperty prop = obj->metaObject()->property(propIdx);
@@ -1847,8 +1847,8 @@ bool QmlCompiler::buildDynamicMeta(QmlParser::Object *obj, DynamicMetaMode mode)
COMPILE_EXCEPTION(&p, "Cannot override FINAL property");
}
- if (p.isDefaultProperty &&
- (p.type != Object::DynamicProperty::Alias ||
+ if (p.isDefaultProperty &&
+ (p.type != Object::DynamicProperty::Alias ||
mode == ResolveAliases))
builder.addClassInfo("DefaultProperty", p.name);
@@ -1937,7 +1937,7 @@ bool QmlCompiler::buildDynamicMeta(QmlParser::Object *obj, DynamicMetaMode mode)
b.setParameterNames(s.parameterNames);
((QmlVMEMetaData *)dynamicData.data())->methodCount++;
- QmlVMEMetaData::MethodData methodData =
+ QmlVMEMetaData::MethodData methodData =
{ s.parameterNames.count(), 0, s.body.length(), 0 };
dynamicData.append((char *)&methodData, sizeof(methodData));
@@ -1945,19 +1945,19 @@ bool QmlCompiler::buildDynamicMeta(QmlParser::Object *obj, DynamicMetaMode mode)
for (int ii = 0; ii < obj->dynamicSlots.count(); ++ii) {
const Object::DynamicSlot &s = obj->dynamicSlots.at(ii);
- QmlVMEMetaData::MethodData *data =
+ QmlVMEMetaData::MethodData *data =
((QmlVMEMetaData *)dynamicData.data())->methodData() + ii;
data->bodyOffset = dynamicData.size();
- dynamicData.append((const char *)s.body.constData(),
+ dynamicData.append((const char *)s.body.constData(),
(s.body.length() * sizeof(QChar)));
}
obj->metadata = builder.toRelocatableData();
builder.fromRelocatableData(&obj->extObject, obj->metatype, obj->metadata);
- if (mode == IgnoreAliases && hasAlias)
+ if (mode == IgnoreAliases && hasAlias)
compileState.aliasingObjects << obj;
obj->synthdata = dynamicData;
@@ -1969,7 +1969,7 @@ bool QmlCompiler::buildDynamicMeta(QmlParser::Object *obj, DynamicMetaMode mode)
static QStringList astNodeToStringList(QmlJS::AST::Node *node)
{
if (node->kind == QmlJS::AST::Node::Kind_IdentifierExpression) {
- QString name =
+ QString name =
static_cast<QmlJS::AST::IdentifierExpression *>(node)->name->asString();
return QStringList() << name;
} else if (node->kind == QmlJS::AST::Node::Kind_FieldMemberExpression) {
@@ -1980,13 +1980,13 @@ static QStringList astNodeToStringList(QmlJS::AST::Node *node)
return rv;
rv.append(expr->name->asString());
return rv;
- }
+ }
return QStringList();
}
-bool QmlCompiler::compileAlias(QMetaObjectBuilder &builder,
+bool QmlCompiler::compileAlias(QMetaObjectBuilder &builder,
QByteArray &data,
- Object *obj,
+ Object *obj,
const Object::DynamicProperty &prop)
{
if (!prop.defaultValue)
@@ -1994,27 +1994,27 @@ bool QmlCompiler::compileAlias(QMetaObjectBuilder &builder,
if (prop.defaultValue->values.count() != 1 ||
prop.defaultValue->values.at(0)->object ||
- !prop.defaultValue->values.at(0)->value.isScript())
+ !prop.defaultValue->values.at(0)->value.isScript())
COMPILE_EXCEPTION(prop.defaultValue, "Invalid alias location");
QmlJS::AST::Node *node = prop.defaultValue->values.at(0)->value.asAST();
- if (!node)
+ if (!node)
COMPILE_EXCEPTION(obj, "No property alias location"); // ### Can this happen?
QStringList alias = astNodeToStringList(node);
- if (alias.count() != 2)
+ if (alias.count() != 2)
COMPILE_EXCEPTION(prop.defaultValue, "Invalid alias location");
- if (!compileState.ids.contains(alias.at(0)))
+ if (!compileState.ids.contains(alias.at(0)))
COMPILE_EXCEPTION(prop.defaultValue, "Invalid alias location");
Object *idObject = compileState.ids[alias.at(0)];
int propIdx = idObject->metaObject()->indexOfProperty(alias.at(1).toUtf8().constData());
- if (-1 == propIdx)
+ if (-1 == propIdx)
COMPILE_EXCEPTION(prop.defaultValue, "Invalid alias location");
-
+
QMetaProperty aliasProperty = idObject->metaObject()->property(propIdx);
data.append((const char *)&idObject->idIndex, sizeof(idObject->idIndex));
@@ -2025,7 +2025,7 @@ bool QmlCompiler::compileAlias(QMetaObjectBuilder &builder,
return true;
}
-bool QmlCompiler::buildBinding(QmlParser::Value *value,
+bool QmlCompiler::buildBinding(QmlParser::Value *value,
QmlParser::Property *prop,
const BindingContext &ctxt)
{
@@ -2035,7 +2035,7 @@ bool QmlCompiler::buildBinding(QmlParser::Value *value,
QMetaProperty mp = prop->parent->metaObject()->property(prop->index);
if (!mp.isWritable() && !QmlMetaType::isList(prop->type))
- COMPILE_EXCEPTION(prop, "Invalid property assignment: read-only property");
+ COMPILE_EXCEPTION(prop, "Invalid property assignment: read-only property");
BindingReference reference;
reference.expression = value->value;
@@ -2047,11 +2047,12 @@ bool QmlCompiler::buildBinding(QmlParser::Value *value,
return true;
}
-void QmlCompiler::genBindingAssignment(QmlParser::Value *binding,
- QmlParser::Property *prop,
+void QmlCompiler::genBindingAssignment(QmlParser::Value *binding,
+ QmlParser::Property *prop,
QmlParser::Object *obj,
QmlParser::Property *valueTypeProperty)
{
+ Q_UNUSED(obj);
Q_ASSERT(compileState.bindings.contains(binding));
const BindingReference &ref = compileState.bindings.value(binding);
@@ -2069,11 +2070,11 @@ void QmlCompiler::genBindingAssignment(QmlParser::Value *binding,
Q_ASSERT(ref.bindingContext.owner == 0 ||
(ref.bindingContext.owner != 0 && valueTypeProperty));
if (ref.bindingContext.owner) {
- store.assignBinding.property =
- QmlMetaPropertyPrivate::saveValueType(valueTypeProperty->index,
+ store.assignBinding.property =
+ QmlMetaPropertyPrivate::saveValueType(valueTypeProperty->index,
prop->index);
} else {
- store.assignBinding.property =
+ store.assignBinding.property =
QmlMetaPropertyPrivate::saveProperty(prop->index);
}
store.assignBinding.value = dataRef;
@@ -2106,8 +2107,8 @@ bool QmlCompiler::completeComponentBuild()
expr.expression = binding.expression;
bs.compile(expr);
- if (bs.isValid())
- binding.compiledData =
+ if (bs.isValid())
+ binding.compiledData =
QByteArray(bs.compileData(), bs.compileDataSize());
}
@@ -2115,12 +2116,12 @@ bool QmlCompiler::completeComponentBuild()
}
/*!
- Returns true if from can be assigned to a (QObject) property of type
+ Returns true if from can be assigned to a (QObject) property of type
to.
*/
bool QmlCompiler::canCoerce(int to, QmlParser::Object *from)
{
- const QMetaObject *toMo =
+ const QMetaObject *toMo =
QmlMetaType::rawMetaObjectForType(to);
const QMetaObject *fromMo = from->metaObject();
@@ -2135,7 +2136,7 @@ bool QmlCompiler::canCoerce(int to, QmlParser::Object *from)
QmlType *QmlCompiler::toQmlType(QmlParser::Object *from)
{
// ### Optimize
- const QMetaObject *mo = from->metatype;
+ const QMetaObject *mo = from->metatype;
QmlType *type = 0;
while (!type && mo) {
type = QmlMetaType::qmlType(mo);
diff --git a/src/declarative/qml/qmlengine.cpp b/src/declarative/qml/qmlengine.cpp
index 321feb9..a7eb220 100644
--- a/src/declarative/qml/qmlengine.cpp
+++ b/src/declarative/qml/qmlengine.cpp
@@ -94,12 +94,12 @@ struct StaticQtMetaObject : public QObject
};
QmlEnginePrivate::QmlEnginePrivate(QmlEngine *e)
-: rootContext(0), currentBindContext(0), currentExpression(0),
+: rootContext(0), currentBindContext(0), currentExpression(0),
isDebugging(false), contextClass(0), objectClass(0), valueTypeClass(0),
scriptEngine(this), rootComponent(0), networkAccessManager(0), typeManager(e),
uniqueId(1)
{
- QScriptValue qtObject =
+ QScriptValue qtObject =
scriptEngine.newQMetaObject(StaticQtMetaObject::get());
scriptEngine.globalObject().setProperty(QLatin1String("Qt"), qtObject);
}
@@ -115,7 +115,7 @@ QmlEnginePrivate::~QmlEnginePrivate()
delete networkAccessManager;
networkAccessManager = 0;
- for(int ii = 0; ii < bindValues.count(); ++ii)
+ for(int ii = 0; ii < bindValues.count(); ++ii)
clear(bindValues[ii]);
for(int ii = 0; ii < parserStatus.count(); ++ii)
clear(parserStatus[ii]);
@@ -126,7 +126,7 @@ void QmlEnginePrivate::clear(SimpleList<QmlBinding> &bvs)
for (int ii = 0; ii < bvs.count; ++ii) {
QmlBinding *bv = bvs.at(ii);
if(bv) {
- QmlBindingPrivate *p =
+ QmlBindingPrivate *p =
static_cast<QmlBindingPrivate *>(QObjectPrivate::get(bv));
p->mePtr = 0;
}
@@ -138,7 +138,7 @@ void QmlEnginePrivate::clear(SimpleList<QmlParserStatus> &pss)
{
for (int ii = 0; ii < pss.count; ++ii) {
QmlParserStatus *ps = pss.at(ii);
- if(ps)
+ if(ps)
ps->d = 0;
}
pss.clear();
@@ -166,7 +166,7 @@ void QmlEnginePrivate::init()
scriptEngine.globalObject().setProperty(QLatin1String("createComponent"),
scriptEngine.newFunction(QmlEnginePrivate::createComponent, 1));
- if (QCoreApplication::instance()->thread() == q->thread() &&
+ if (QCoreApplication::instance()->thread() == q->thread() &&
QmlEngineDebugServer::isDebuggingEnabled()) {
qmlEngineDebugServer();
isDebugging = true;
@@ -279,14 +279,14 @@ QScriptValue QmlEnginePrivate::propertyObject(const QScriptString &propName,
\brief The QmlEngine class provides an environment for instantiating QML components.
\mainclass
- Each QML component is instantiated in a QmlContext. QmlContext's are
+ Each QML component is instantiated in a QmlContext. QmlContext's are
essential for passing data to QML components. In QML, contexts are arranged
hierarchically and this hierarchy is managed by the QmlEngine.
Prior to creating any QML components, an application must have created a
QmlEngine to gain access to a QML context. The following example shows how
to create a simple Text item.
-
+
\code
QmlEngine engine;
QmlComponent component(&engine, "Text { text: \"Hello world!\" }");
@@ -317,7 +317,7 @@ QmlEngine::QmlEngine(QObject *parent)
/*!
Destroys the QmlEngine.
- Any QmlContext's created on this engine will be invalidated, but not
+ Any QmlContext's created on this engine will be invalidated, but not
destroyed (unless they are parented to the QmlEngine object).
*/
QmlEngine::~QmlEngine()
@@ -340,13 +340,13 @@ void QmlEngine::clearComponentCache()
}
/*!
- Returns the engine's root context.
+ Returns the engine's root context.
- The root context is automatically created by the QmlEngine. Data that
+ The root context is automatically created by the QmlEngine. Data that
should be available to all QML component instances instantiated by the
engine should be put in the root context.
- Additional data that should only be available to a subset of component
+ Additional data that should only be available to a subset of component
instances should be added to sub-contexts parented to the root context.
*/
QmlContext *QmlEngine::rootContext()
@@ -374,13 +374,13 @@ void QmlEngine::setNetworkAccessManager(QNetworkAccessManager *network)
Returns the common QNetworkAccessManager used by all QML elements
instantiated by this engine.
- The default implements no caching, cookiejar, etc., just a default
+ The default implements no caching, cookiejar, etc., just a default
QNetworkAccessManager.
*/
QNetworkAccessManager *QmlEngine::networkAccessManager() const
{
Q_D(const QmlEngine);
- if (!d->networkAccessManager)
+ if (!d->networkAccessManager)
d->networkAccessManager = new QNetworkAccessManager;
return d->networkAccessManager;
}
@@ -389,7 +389,7 @@ QNetworkAccessManager *QmlEngine::networkAccessManager() const
Return the base URL for this engine. The base URL is only used to resolve
components when a relative URL is passed to the QmlComponent constructor.
- If a base URL has not been explicitly set, this method returns the
+ If a base URL has not been explicitly set, this method returns the
application's current working directory.
\sa setBaseUrl()
@@ -405,7 +405,7 @@ QUrl QmlEngine::baseUrl() const
}
/*!
- Set the base URL for this engine to \a url.
+ Set the base URL for this engine to \a url.
\sa baseUrl()
*/
@@ -427,7 +427,7 @@ QmlContext *QmlEngine::contextForObject(const QObject *object)
QObjectPrivate *priv = QObjectPrivate::get(const_cast<QObject *>(object));
- QmlSimpleDeclarativeData *data =
+ QmlSimpleDeclarativeData *data =
static_cast<QmlSimpleDeclarativeData *>(priv->declarativeData);
return data?data->context:0;
@@ -444,7 +444,7 @@ void QmlEngine::setContextForObject(QObject *object, QmlContext *context)
{
QObjectPrivate *priv = QObjectPrivate::get(object);
- QmlSimpleDeclarativeData *data =
+ QmlSimpleDeclarativeData *data =
static_cast<QmlSimpleDeclarativeData *>(priv->declarativeData);
if (data && data->context) {
@@ -487,7 +487,7 @@ QmlEngine *qmlEngine(const QObject *obj)
QObject *qmlAttachedPropertiesObjectById(int id, const QObject *object, bool create)
{
- QmlExtendedDeclarativeData *edata =
+ QmlExtendedDeclarativeData *edata =
QmlExtendedDeclarativeData::get(const_cast<QObject *>(object), true);
QObject *rv = edata->attachedProperties.value(id);
@@ -500,7 +500,7 @@ QObject *qmlAttachedPropertiesObjectById(int id, const QObject *object, bool cre
rv = pf(const_cast<QObject *>(object));
- if (rv)
+ if (rv)
edata->attachedProperties.insert(id, rv);
return rv;
@@ -508,7 +508,7 @@ QObject *qmlAttachedPropertiesObjectById(int id, const QObject *object, bool cre
void QmlSimpleDeclarativeData::destroyed(QObject *object)
{
- if (context)
+ if (context)
context->d_func()->contextObjects.removeAll(object);
}
@@ -537,7 +537,7 @@ QScriptEngine *QmlEngine::scriptEngine()
to the special needs of QML requiring more functionality than a standard
QtScript QObject.
*/
-QScriptValue QmlEnginePrivate::qmlScriptObject(QObject* object,
+QScriptValue QmlEnginePrivate::qmlScriptObject(QObject* object,
QmlEngine* engine)
{
QScriptEngine *scriptEngine = QmlEnginePrivate::getScriptEngine(engine);
@@ -597,12 +597,12 @@ QScriptValue QmlEnginePrivate::qmlScriptObject(QObject* object,
If you want to just create an arbitrary string of QML, instead of
loading a qml file, consider the createQmlObject() function.
*/
-QScriptValue QmlEnginePrivate::createComponent(QScriptContext *ctxt,
+QScriptValue QmlEnginePrivate::createComponent(QScriptContext *ctxt,
QScriptEngine *engine)
{
QmlComponentJS* c;
- QmlEnginePrivate *activeEnginePriv =
+ QmlEnginePrivate *activeEnginePriv =
static_cast<QmlScriptEngine*>(engine)->p;
QmlEngine* activeEngine = activeEnginePriv->q_func();
@@ -646,11 +646,11 @@ QScriptValue QmlEnginePrivate::createComponent(QScriptContext *ctxt,
*/
QScriptValue QmlEnginePrivate::createQmlObject(QScriptContext *ctxt, QScriptEngine *engine)
{
- QmlEnginePrivate *activeEnginePriv =
+ QmlEnginePrivate *activeEnginePriv =
static_cast<QmlScriptEngine*>(engine)->p;
QmlEngine* activeEngine = activeEnginePriv->q_func();
- if(ctxt->argumentCount() < 2)
+ if(ctxt->argumentCount() < 2)
return engine->nullValue();
QString qml = ctxt->argument(0).toString();
@@ -664,7 +664,7 @@ QScriptValue QmlEnginePrivate::createQmlObject(QScriptContext *ctxt, QScriptEngi
if(component.isError()) {
QList<QmlError> errors = component.errors();
qWarning() <<"QmlEngine::createQmlObject():";
- foreach (const QmlError &error, errors)
+ foreach (const QmlError &error, errors)
qWarning() << " " << error;
return engine->nullValue();
@@ -675,7 +675,7 @@ QScriptValue QmlEnginePrivate::createQmlObject(QScriptContext *ctxt, QScriptEngi
if(component.isError()) {
QList<QmlError> errors = component.errors();
qWarning() <<"QmlEngine::createQmlObject():";
- foreach (const QmlError &error, errors)
+ foreach (const QmlError &error, errors)
qWarning() << " " << error;
return engine->nullValue();
@@ -690,14 +690,14 @@ QScriptValue QmlEnginePrivate::createQmlObject(QScriptContext *ctxt, QScriptEngi
}
QmlScriptClass::QmlScriptClass(QmlEngine *bindengine)
-: QScriptClass(QmlEnginePrivate::getScriptEngine(bindengine)),
+: QScriptClass(QmlEnginePrivate::getScriptEngine(bindengine)),
engine(bindengine)
{
}
QVariant QmlScriptClass::toVariant(QmlEngine *engine, const QScriptValue &val)
{
- QmlEnginePrivate *ep =
+ QmlEnginePrivate *ep =
static_cast<QmlEnginePrivate *>(QObjectPrivate::get(engine));
QScriptClass *sc = val.scriptClass();
@@ -708,12 +708,12 @@ QVariant QmlScriptClass::toVariant(QmlEngine *engine, const QScriptValue &val)
} else if (sc == ep->objectClass) {
return QVariant::fromValue(val.data().toQObject());
} else if (sc == ep->valueTypeClass) {
- QmlValueTypeReference ref =
+ QmlValueTypeReference ref =
qvariant_cast<QmlValueTypeReference>(val.data().toVariant());
if (!ref.object)
return QVariant();
-
+
QMetaProperty p = ref.object->metaObject()->property(ref.property);
return p.read(ref.object);
}
@@ -735,13 +735,13 @@ QmlContextScriptClass::~QmlContextScriptClass()
{
}
-QScriptClass::QueryFlags
+QScriptClass::QueryFlags
QmlContextScriptClass::queryProperty(const QScriptValue &object,
const QScriptString &name,
QueryFlags flags, uint *id)
{
Q_UNUSED(flags);
- QmlContext *bindContext =
+ QmlContext *bindContext =
static_cast<QmlContext*>(object.data().toQObject());
QueryFlags rv = 0;
@@ -755,11 +755,11 @@ QmlContextScriptClass::queryProperty(const QScriptValue &object,
if (bindContext->d_func()->propertyNames.contains(propName)) {
rv |= HandlesReadAccess;
*id = VariantPropertyId;
- }
+ }
for (int ii = 0; !rv && ii < bindContext->d_func()->defaultObjects.count(); ++ii) {
rv = QmlEnginePrivate::get(engine)->queryObject(propName, id, bindContext->d_func()->defaultObjects.at(ii));
- if (rv)
+ if (rv)
*id |= (ii << 24);
}
@@ -767,10 +767,10 @@ QmlContextScriptClass::queryProperty(const QScriptValue &object,
}
QScriptValue QmlContextScriptClass::property(const QScriptValue &object,
- const QScriptString &name,
+ const QScriptString &name,
uint id)
{
- QmlContext *bindContext =
+ QmlContext *bindContext =
static_cast<QmlContext*>(object.data().toQObject());
#ifdef PROPERTY_DEBUG
@@ -829,7 +829,7 @@ void QmlContextScriptClass::setProperty(QScriptValue &object,
{
Q_UNUSED(name);
- QmlContext *bindContext =
+ QmlContext *bindContext =
static_cast<QmlContext*>(object.data().toQObject());
#ifdef PROPERTY_DEBUG
@@ -863,12 +863,13 @@ QmlValueTypeScriptClass::~QmlValueTypeScriptClass()
{
}
-QmlValueTypeScriptClass::QueryFlags
+QmlValueTypeScriptClass::QueryFlags
QmlValueTypeScriptClass::queryProperty(const QScriptValue &object,
const QScriptString &name,
QueryFlags flags, uint *id)
{
- QmlValueTypeReference ref =
+ Q_UNUSED(flags);
+ QmlValueTypeReference ref =
qvariant_cast<QmlValueTypeReference>(object.data().toVariant());
if (!ref.object)
@@ -883,7 +884,7 @@ QmlValueTypeScriptClass::queryProperty(const QScriptValue &object,
QMetaProperty prop = ref.object->metaObject()->property(idx);
- QmlValueTypeScriptClass::QueryFlags rv =
+ QmlValueTypeScriptClass::QueryFlags rv =
QmlValueTypeScriptClass::HandlesReadAccess;
if (prop.isWritable())
rv |= QmlValueTypeScriptClass::HandlesWriteAccess;
@@ -892,10 +893,11 @@ QmlValueTypeScriptClass::queryProperty(const QScriptValue &object,
}
QScriptValue QmlValueTypeScriptClass::property(const QScriptValue &object,
- const QScriptString &name,
+ const QScriptString &name,
uint id)
{
- QmlValueTypeReference ref =
+ Q_UNUSED(name);
+ QmlValueTypeReference ref =
qvariant_cast<QmlValueTypeReference>(object.data().toVariant());
if (!ref.object)
@@ -914,7 +916,8 @@ void QmlValueTypeScriptClass::setProperty(QScriptValue &object,
uint id,
const QScriptValue &value)
{
- QmlValueTypeReference ref =
+ Q_UNUSED(name);
+ QmlValueTypeReference ref =
qvariant_cast<QmlValueTypeReference>(object.data().toVariant());
if (!ref.object)
@@ -983,7 +986,7 @@ QScriptClass::QueryFlags QmlObjectScriptClass::queryProperty(const QScriptValue
}
QScriptValue QmlObjectScriptClass::property(const QScriptValue &object,
- const QScriptString &name,
+ const QScriptString &name,
uint id)
{
QObject *obj = object.data().toQObject();
@@ -993,7 +996,7 @@ QScriptValue QmlObjectScriptClass::property(const QScriptValue &object,
qWarning() << "QmlObject Property:" << propName << obj;
#endif
- QScriptValue rv =
+ QScriptValue rv =
QmlEnginePrivate::get(engine)->propertyObject(name, obj, id);
if (rv.isValid()) {
#ifdef PROPERTY_DEBUG
@@ -1227,7 +1230,7 @@ void QmlEnginePrivate::Imports::setBaseUrl(const QUrl& url)
*/
void QmlEngine::addImportPath(const QString& path)
{
- if (qmlImportTrace())
+ if (qmlImportTrace())
qDebug() << "QmlEngine::addImportPath" << path;
Q_D(QmlEngine);
d->fileImportPath.prepend(path);
@@ -1250,7 +1253,7 @@ void QmlEngine::addImportPath(const QString& path)
bool QmlEnginePrivate::addToImport(Imports* imports, const QString& uri, const QString& prefix, const QString& version, QmlScriptParser::Import::Type importType) const
{
bool ok = imports->d->add(imports->base,uri,prefix,version,importType,fileImportPath);
- if (qmlImportTrace())
+ if (qmlImportTrace())
qDebug() << "QmlEngine::addToImport(" << imports << uri << prefix << version << (importType==QmlScriptParser::Import::Library? "Library" : "File") << ": " << ok;
return ok;
}
@@ -1279,7 +1282,7 @@ bool QmlEnginePrivate::resolveType(const Imports& imports, const QByteArray& typ
if (!t) t = QmlMetaType::qmlType(type);
if (t) {
if (type_return) *type_return = t;
- if (qmlImportTrace())
+ if (qmlImportTrace())
qDebug() << "QmlEngine::resolveType" << type << "= (builtin)";
return true;
}
@@ -1291,12 +1294,12 @@ bool QmlEnginePrivate::resolveType(const Imports& imports, const QByteArray& typ
if (url.isValid()) {
if (url_return) *url_return = url;
- if (qmlImportTrace())
+ if (qmlImportTrace())
qDebug() << "QmlEngine::resolveType" << type << "=" << url;
return true;
}
}
- if (qmlImportTrace())
+ if (qmlImportTrace())
qDebug() << "QmlEngine::resolveType" << type << " not found";
return false;
}
diff --git a/src/declarative/qml/qmlmetatype.cpp b/src/declarative/qml/qmlmetatype.cpp
index a037702..5fe3eff 100644
--- a/src/declarative/qml/qmlmetatype.cpp
+++ b/src/declarative/qml/qmlmetatype.cpp
@@ -104,7 +104,7 @@ class QmlTypePrivate
{
public:
QmlTypePrivate();
-
+
void init() const;
bool m_isInterface : 1;
@@ -128,7 +128,7 @@ public:
QmlTypePrivate::QmlTypePrivate()
: m_isInterface(false), m_iid(0), m_typeId(0), m_listId(0), m_qmlListId(0),
m_opFunc(0), m_baseMetaObject(0), m_attachedPropertiesFunc(0), m_attachedPropertiesType(0),
- m_parserStatusCast(-1), m_extFunc(0), m_extMetaObject(0), m_index(-1),
+ m_parserStatusCast(-1), m_extFunc(0), m_extMetaObject(0), m_index(-1),
m_customParser(0), m_isSetup(false)
{
}
@@ -149,11 +149,11 @@ QmlType::QmlType(int type, int listType, int qmlListType,
}
QmlType::QmlType(int type, int listType, int qmlListType,
- QmlPrivate::Func opFunc, const char *qmlName,
- const QMetaObject *metaObject,
- QmlAttachedPropertiesFunc attachedPropertiesFunc,
+ QmlPrivate::Func opFunc, const char *qmlName,
+ const QMetaObject *metaObject,
+ QmlAttachedPropertiesFunc attachedPropertiesFunc,
const QMetaObject *attachedType,
- int parserStatusCast, QmlPrivate::CreateFunc extFunc,
+ int parserStatusCast, QmlPrivate::CreateFunc extFunc,
const QMetaObject *extMetaObject, int index,
QmlCustomParser *customParser)
: d(new QmlTypePrivate)
@@ -195,7 +195,7 @@ void QmlTypePrivate::init() const
QMetaObject *mmo = new QMetaObject;
*mmo = *m_extMetaObject;
mmo->d.superdata = mo;
- QmlProxyMetaObject::ProxyData data = { mmo, m_extFunc, 0 };
+ QmlProxyMetaObject::ProxyData data = { mmo, m_extFunc, 0, 0 };
m_metaObjects << data;
}
@@ -207,9 +207,9 @@ void QmlTypePrivate::init() const
QMetaObject *mmo = new QMetaObject;
*mmo = *t->d->m_extMetaObject;
mmo->d.superdata = m_baseMetaObject;
- if (!m_metaObjects.isEmpty())
+ if (!m_metaObjects.isEmpty())
m_metaObjects.last().metaObject->d.superdata = mmo;
- QmlProxyMetaObject::ProxyData data = { mmo, t->d->m_extFunc, 0 };
+ QmlProxyMetaObject::ProxyData data = { mmo, t->d->m_extFunc, 0, 0 };
m_metaObjects << data;
}
}
@@ -217,9 +217,9 @@ void QmlTypePrivate::init() const
}
for (int ii = 0; ii < m_metaObjects.count(); ++ii) {
- m_metaObjects[ii].propertyOffset =
+ m_metaObjects[ii].propertyOffset =
m_metaObjects.at(ii).metaObject->propertyOffset();
- m_metaObjects[ii].methodOffset =
+ m_metaObjects[ii].methodOffset =
m_metaObjects.at(ii).metaObject->methodOffset();
}
@@ -276,7 +276,7 @@ QObject *QmlType::create() const
QObject *rv = 0;
d->m_opFunc(QmlPrivate::Create, 0, v, v, (void **)&rv);
- if (rv && !d->m_metaObjects.isEmpty())
+ if (rv && !d->m_metaObjects.isEmpty())
(void *)new QmlProxyMetaObject(rv, &d->m_metaObjects);
return rv;
@@ -386,7 +386,7 @@ int QmlType::index() const
}
int QmlMetaType::registerInterface(const QmlPrivate::MetaTypeIds &id,
- QmlPrivate::Func listFunction,
+ QmlPrivate::Func listFunction,
const char *iid)
{
QWriteLocker lock(metaTypeDataLock());
@@ -404,11 +404,11 @@ int QmlMetaType::registerInterface(const QmlPrivate::MetaTypeIds &id,
if (!type->qmlTypeName().isEmpty())
data->nameToType.insert(type->qmlTypeName(), type);
- if (data->interfaces.size() < id.typeId)
+ if (data->interfaces.size() < id.typeId)
data->interfaces.resize(id.typeId + 16);
- if (data->qmllists.size() < id.qmlListId)
+ if (data->qmllists.size() < id.qmlListId)
data->qmllists.resize(id.qmlListId + 16);
- if (data->lists.size() < id.listId)
+ if (data->lists.size() < id.listId)
data->lists.resize(id.listId + 16);
data->interfaces.setBit(id.typeId, true);
data->qmllists.setBit(id.qmlListId, true);
@@ -484,16 +484,16 @@ int QmlMetaType::registerType(const QmlPrivate::MetaTypeIds &id, QmlPrivate::Fun
data->idToType.insert(type->qListTypeId(), type);
data->idToType.insert(type->qmlListTypeId(), type);
- if (!type->qmlTypeName().isEmpty())
+ if (!type->qmlTypeName().isEmpty())
data->nameToType.insert(type->qmlTypeName(), type);
data->metaObjectToType.insert(type->baseMetaObject(), type);
-
- if (data->objects.size() <= id.typeId)
+
+ if (data->objects.size() <= id.typeId)
data->objects.resize(id.typeId + 16);
- if (data->qmllists.size() <= id.qmlListId)
+ if (data->qmllists.size() <= id.qmlListId)
data->qmllists.resize(id.qmlListId + 16);
- if (data->lists.size() <= id.listId)
+ if (data->lists.size() <= id.listId)
data->lists.resize(id.listId + 16);
data->objects.setBit(id.typeId, true);
data->qmllists.setBit(id.qmlListId, true);
@@ -518,7 +518,7 @@ QObject *QmlMetaType::toQObject(const QVariant &v)
if (!isObject(v.userType()))
return 0;
- // NOTE: This assumes a cast to QObject does not alter the
+ // NOTE: This assumes a cast to QObject does not alter the
// object pointer
QObject *rv = *(QObject **)v.constData();
return rv;
@@ -527,7 +527,7 @@ QObject *QmlMetaType::toQObject(const QVariant &v)
/*
Returns the item type for a list of type \a id.
*/
-int QmlMetaType::listType(int id)
+int QmlMetaType::listType(int id)
{
QReadLocker lock(metaTypeDataLock());
QmlMetaTypeData *data = metaTypeData();
@@ -574,7 +574,7 @@ bool QmlMetaType::append(const QVariant &list, const QVariant &item)
QmlMetaTypeData *data = metaTypeData();
QmlType *type = data->idToType.value(userType);
lock.unlock();
- if (type && type->qListTypeId() == userType &&
+ if (type && type->qListTypeId() == userType &&
item.userType() == type->typeId()) {
type->listAppend(list, item);
return true;
@@ -703,7 +703,7 @@ QmlAttachedPropertiesFunc QmlMetaType::attachedPropertiesFuncById(int id)
return data->types.at(id)->attachedPropertiesFunction();
}
-QmlAttachedPropertiesFunc
+QmlAttachedPropertiesFunc
QmlMetaType::attachedPropertiesFunc(const QByteArray &name)
{
QReadLocker lock(metaTypeDataLock());
@@ -876,8 +876,8 @@ QVariant QmlMetaType::listAt(const QVariant &v, int idx)
return 0;
}
-/*!
- A custom string convertor allows you to specify a function pointer that
+/*!
+ A custom string convertor allows you to specify a function pointer that
returns a variant of \a type. For example, if you have written your own icon
class that you want to support as an object property assignable in QML:
@@ -902,7 +902,7 @@ void QmlMetaType::registerCustomStringConverter(int type, StringConverter conver
}
/*!
- Return the custom string converter for \a type, previously installed through
+ Return the custom string converter for \a type, previously installed through
registerCustomStringConverter()
*/
QmlMetaType::StringConverter QmlMetaType::customStringConverter(int type)
diff --git a/src/declarative/qml/qmlvaluetype.cpp b/src/declarative/qml/qmlvaluetype.cpp
index e93fbc1..ca968fc 100644
--- a/src/declarative/qml/qmlvaluetype.cpp
+++ b/src/declarative/qml/qmlvaluetype.cpp
@@ -46,13 +46,13 @@ QT_BEGIN_NAMESPACE
QmlValueTypeFactory::QmlValueTypeFactory()
{
// ### Optimize
- for (int ii = 0; ii < (QVariant::UserType - 1); ++ii)
+ for (unsigned int ii = 0; ii < (QVariant::UserType - 1); ++ii)
valueTypes[ii] = valueType(ii);
}
QmlValueTypeFactory::~QmlValueTypeFactory()
{
- for (int ii = 0; ii < (QVariant::UserType - 1); ++ii)
+ for (unsigned int ii = 0; ii < (QVariant::UserType - 1); ++ii)
delete valueTypes[ii];
}
diff --git a/src/declarative/util/qmlfollow.cpp b/src/declarative/util/qmlfollow.cpp
index 987ccb0..1fb321c 100644
--- a/src/declarative/util/qmlfollow.cpp
+++ b/src/declarative/util/qmlfollow.cpp
@@ -66,13 +66,13 @@ public:
qreal velocityms;
int lastTime;
qreal mass;
+ bool useMass;
qreal spring;
qreal damping;
qreal velocity;
qreal epsilon;
qreal modulus;
bool haveModulus;
- bool useMass;
bool enabled;
enum Mode {
diff --git a/src/declarative/util/qmlstate.cpp b/src/declarative/util/qmlstate.cpp
index af60a6f..b5ba909 100644
--- a/src/declarative/util/qmlstate.cpp
+++ b/src/declarative/util/qmlstate.cpp
@@ -53,16 +53,16 @@ QT_BEGIN_NAMESPACE
DEFINE_BOOL_CONFIG_OPTION(stateChangeDebug, STATECHANGE_DEBUG);
-Action::Action()
+Action::Action()
: restore(true), actionDone(false), reverseEvent(false), fromBinding(0), toBinding(0), event(0),
specifiedObject(0)
{
}
-Action::Action(QObject *target, const QString &propertyName,
+Action::Action(QObject *target, const QString &propertyName,
const QVariant &value)
: restore(true), actionDone(false), reverseEvent(false), toValue(value), fromBinding(0),
- toBinding(0), event(0), specifiedObject(target),
+ toBinding(0), event(0), specifiedObject(target),
specifiedProperty(propertyName)
{
property = QmlMetaProperty::createProperty(target, propertyName);
@@ -112,6 +112,7 @@ void ActionEvent::clearReverseBindings()
bool ActionEvent::override(ActionEvent *other)
{
+ Q_UNUSED(other);
return false;
}
@@ -213,7 +214,7 @@ QmlBinding *QmlState::when() const
return d->when;
}
-void QmlState::setWhen(QmlBinding *when)
+void QmlState::setWhen(QmlBinding *when)
{
Q_D(QmlState);
d->when = when;
@@ -300,7 +301,7 @@ void QmlStatePrivate::complete()
// Generate a list of actions for this state. This includes coelescing state
// actions that this state "extends"
-QmlStateOperation::ActionList
+QmlStateOperation::ActionList
QmlStatePrivate::generateActionList(QmlStateGroup *group) const
{
QmlStateOperation::ActionList applyList;
@@ -342,7 +343,7 @@ void QmlState::cancel()
d->transitionManager.cancel();
}
-void Action::deleteFromBinding()
+void Action::deleteFromBinding()
{
if (fromBinding) {
property.setBinding(0);
@@ -362,7 +363,7 @@ void QmlState::apply(QmlStateGroup *group, QmlTransition *trans, QmlState *rever
d->reverting.clear();
if (revert) {
- QmlStatePrivate *revertPrivate =
+ QmlStatePrivate *revertPrivate =
static_cast<QmlStatePrivate*>(revert->d_ptr);
d->revertList = revertPrivate->revertList;
revertPrivate->revertList.clear();
@@ -419,7 +420,7 @@ void QmlState::apply(QmlStateGroup *group, QmlTransition *trans, QmlState *rever
}
}
}
-
+
// Any reverts from a previous state that aren't carried forth
// into this state need to be translated into apply actions
for (int ii = 0; ii < d->revertList.count(); ++ii) {
@@ -466,7 +467,7 @@ void QmlState::apply(QmlStateGroup *group, QmlTransition *trans, QmlState *rever
// Output for debugging
if (stateChangeDebug()) {
foreach(const Action &action, applyList) {
- qWarning() << " Action:" << action.property.object()
+ qWarning() << " Action:" << action.property.object()
<< action.property.name() << action.toValue;
}
}
diff --git a/src/declarative/util/qmlstateoperations.cpp b/src/declarative/util/qmlstateoperations.cpp
index 7caf3ed..1f53bee 100644
--- a/src/declarative/util/qmlstateoperations.cpp
+++ b/src/declarative/util/qmlstateoperations.cpp
@@ -457,22 +457,22 @@ QList<Action> QmlSetAnchors::extraActions()
if (d->target) {
Action a;
a.fromValue = d->origX;
- a.property = QmlMetaProperty(d->target, "x");
+ a.property = QmlMetaProperty(d->target, QLatin1String("x"));
extra << a;
a.fromValue = d->origY;
- a.property = QmlMetaProperty(d->target, "y");
+ a.property = QmlMetaProperty(d->target, QLatin1String("y"));
extra << a;
a.fromValue = d->origWidth;
- a.property = QmlMetaProperty(d->target, "width");
+ a.property = QmlMetaProperty(d->target, QLatin1String("width"));
extra << a;
a.fromValue = d->origHeight;
- a.property = QmlMetaProperty(d->target, "height");
+ a.property = QmlMetaProperty(d->target, QLatin1String("height"));
extra << a;
}
-
+
return extra;
}