From f10e70cd5953681e5ad11a0ce59e357df82d6e6b Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Fri, 31 Jul 2009 16:43:19 +1000 Subject: doc --- src/declarative/extra/qmlxmllistmodel.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/declarative/extra/qmlxmllistmodel.h b/src/declarative/extra/qmlxmllistmodel.h index 3b6ffb4..18d33fb 100644 --- a/src/declarative/extra/qmlxmllistmodel.h +++ b/src/declarative/extra/qmlxmllistmodel.h @@ -121,7 +121,7 @@ public: QString namespaceDeclarations() const; void setNamespaceDeclarations(const QString&); - enum Status { Idle, Loading, Error }; + enum Status { Idle, Loading, Error }; // ### should include Null for consistency? Status status() const; qreal progress() const; -- cgit v0.12 From c823c27033254d3561982678fb32a4485d844d9a Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Mon, 3 Aug 2009 11:44:27 +1000 Subject: Remove some warnings --- src/declarative/qml/qmlcompiler.cpp | 231 ++++++++++++++-------------- src/declarative/qml/qmlengine.cpp | 107 ++++++------- src/declarative/qml/qmlmetatype.cpp | 56 +++---- src/declarative/qml/qmlvaluetype.cpp | 4 +- src/declarative/util/qmlfollow.cpp | 2 +- src/declarative/util/qmlstate.cpp | 19 +-- src/declarative/util/qmlstateoperations.cpp | 10 +- 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 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(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(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 &bvs) for (int ii = 0; ii < bvs.count; ++ii) { QmlBinding *bv = bvs.at(ii); if(bv) { - QmlBindingPrivate *p = + QmlBindingPrivate *p = static_cast(QObjectPrivate::get(bv)); p->mePtr = 0; } @@ -138,7 +138,7 @@ void QmlEnginePrivate::clear(SimpleList &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(object)); - QmlSimpleDeclarativeData *data = + QmlSimpleDeclarativeData *data = static_cast(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(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(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(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(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(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 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 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(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(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(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(object.data().toQObject()); #ifdef PROPERTY_DEBUG @@ -829,7 +829,7 @@ void QmlContextScriptClass::setProperty(QScriptValue &object, { Q_UNUSED(name); - QmlContext *bindContext = + QmlContext *bindContext = static_cast(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(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(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(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(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 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; } -- cgit v0.12 From 77e802215ad8d3d94fb1821abf1932540ee7fb9f Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Mon, 3 Aug 2009 13:45:35 +1000 Subject: Use QPalette::ColorGroup directly. --- src/declarative/util/qmlpalette.cpp | 18 +++++++----------- src/declarative/util/qmlpalette.h | 10 +++------- 2 files changed, 10 insertions(+), 18 deletions(-) diff --git a/src/declarative/util/qmlpalette.cpp b/src/declarative/util/qmlpalette.cpp index 6fade03..3756878 100644 --- a/src/declarative/util/qmlpalette.cpp +++ b/src/declarative/util/qmlpalette.cpp @@ -260,27 +260,23 @@ QColor QmlPalette::darker(const QColor& color) const } /*! - \qmlproperty enum Palette::colorGroup + \qmlproperty QPalette::ColorGroup Palette::colorGroup - The color group of the palette. It can be one of: - \list - \o Active - used for the window that has focus. - \o Inactive - used for other windows. - \o Disabled - used for widgets that are disabled for some reason. - \endlist + The color group of the palette. It can be Active, Inactive or Disabled. + Active is the default. \sa QPalette::ColorGroup */ -QmlPalette::ColorGroup QmlPalette::colorGroup() const +QPalette::ColorGroup QmlPalette::colorGroup() const { Q_D(const QmlPalette); - return (QmlPalette::ColorGroup)int(d->group); + return d->group; } -void QmlPalette::setColorGroup(ColorGroup colorGroup) +void QmlPalette::setColorGroup(QPalette::ColorGroup colorGroup) { Q_D(QmlPalette); - d->group = (QPalette::ColorGroup)int(colorGroup); + d->group = colorGroup; emit paletteChanged(); } diff --git a/src/declarative/util/qmlpalette.h b/src/declarative/util/qmlpalette.h index 7de5e0e..4c2cc31 100644 --- a/src/declarative/util/qmlpalette.h +++ b/src/declarative/util/qmlpalette.h @@ -57,9 +57,8 @@ class Q_DECLARATIVE_EXPORT QmlPalette : public QObject { Q_OBJECT Q_DECLARE_PRIVATE(QmlPalette) - Q_ENUMS(ColorGroup) - Q_PROPERTY(ColorGroup colorGroup READ colorGroup WRITE setColorGroup NOTIFY paletteChanged) + Q_PROPERTY(QPalette::ColorGroup colorGroup READ colorGroup WRITE setColorGroup NOTIFY paletteChanged) Q_PROPERTY(QColor window READ window NOTIFY paletteChanged) Q_PROPERTY(QColor windowText READ windowText NOTIFY paletteChanged) Q_PROPERTY(QColor base READ base NOTIFY paletteChanged) @@ -78,9 +77,6 @@ public: QmlPalette(QObject *parent=0); ~QmlPalette(); - enum ColorGroup { Disabled = QPalette::Disabled, Active = QPalette::Active, - Inactive = QPalette::Inactive, Normal = QPalette::Normal }; - QColor window() const; QColor windowText() const; @@ -99,8 +95,8 @@ public: QColor highlight() const; QColor highlightedText() const; - ColorGroup colorGroup() const; - void setColorGroup(ColorGroup); + QPalette::ColorGroup colorGroup() const; + void setColorGroup(QPalette::ColorGroup); // FIXME: Move to utility class? Q_INVOKABLE QColor lighter(const QColor&) const; -- cgit v0.12 From a23e4d3f55e7072ae3919092652b2dc915fc887f Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Mon, 3 Aug 2009 14:38:11 +1000 Subject: Improve calculator demo and add missing text property to QmlPalette. --- demos/declarative/calculator/CalcButton.qml | 57 +++++++-------------- demos/declarative/calculator/calculator.qml | 13 ++--- .../declarative/calculator/pics/button-pressed.png | Bin 644 -> 0 bytes .../declarative/calculator/pics/button-pressed.sci | 5 -- demos/declarative/calculator/pics/button.png | Bin 635 -> 0 bytes demos/declarative/calculator/pics/button.sci | 5 -- demos/declarative/calculator/pics/clear.png | Bin 611 -> 0 bytes src/declarative/util/qmlpalette.cpp | 12 +++++ src/declarative/util/qmlpalette.h | 2 + 9 files changed, 39 insertions(+), 55 deletions(-) delete mode 100644 demos/declarative/calculator/pics/button-pressed.png delete mode 100644 demos/declarative/calculator/pics/button-pressed.sci delete mode 100644 demos/declarative/calculator/pics/button.png delete mode 100644 demos/declarative/calculator/pics/button.sci delete mode 100644 demos/declarative/calculator/pics/clear.png diff --git a/demos/declarative/calculator/CalcButton.qml b/demos/declarative/calculator/CalcButton.qml index 5eb7fe1..ebb1967 100644 --- a/demos/declarative/calculator/CalcButton.qml +++ b/demos/declarative/calculator/CalcButton.qml @@ -1,62 +1,41 @@ import Qt 4.6 -Item { +Rect { property string operation property bool toggable : false property bool toggled : false + signal clicked id: Button; width: 50; height: 30 - - Script { - function buttonClicked(operation) { - if (Button.toggable == true) { - if (Button.toggled == true) { - Button.toggled = false; - Button.state = 'Toggled'; - } else { - Button.toggled = true; - Button.state = ''; - } - } - else - doOp(operation); - } - } - - Image { - id: Image - source: "pics/button.sci" - width: Button.width; height: Button.height + border.color: Palette.mid; radius: 6 + gradient: Gradient { + GradientStop { id: G1; position: 0.0; color: Palette.lighter(Palette.button) } + GradientStop { id: G2; position: 1.0; color: Palette.button } } - Image { - id: ImagePressed - source: "pics/button-pressed.sci" - width: Button.width; height: Button.height - opacity: 0 - } - - Text { - anchors.centerIn: Image - text: Button.operation - color: "white" - font.bold: true - } + Text { anchors.centerIn: parent; text: operation; color: Palette.buttonText } MouseRegion { id: MouseRegion - anchors.fill: Button - onClicked: { buttonClicked(Button.operation) } + anchors.fill: parent + onClicked: { + doOp(operation); + Button.clicked(); + if (!Button.toggable) return; + Button.toggled ? Button.toggled = false : Button.toggled = true + } } states: [ State { name: "Pressed"; when: MouseRegion.pressed == true - SetProperties { target: ImagePressed; opacity: 1 } + SetProperties { target: G1; color: Palette.dark } + SetProperties { target: G2; color: Palette.button } }, State { name: "Toggled"; when: Button.toggled == true - SetProperties { target: ImagePressed; opacity: 1 } + SetProperties { target: G1; color: Palette.dark } + SetProperties { target: G2; color: Palette.button } } ] } diff --git a/demos/declarative/calculator/calculator.qml b/demos/declarative/calculator/calculator.qml index 576fea9..a4e16e4 100644 --- a/demos/declarative/calculator/calculator.qml +++ b/demos/declarative/calculator/calculator.qml @@ -2,22 +2,23 @@ import Qt 4.6 Rect { id: MainWindow; - width: 320; height: 270; color: "black" + width: 320; height: 270; color: Palette.window + Palette { id: Palette } Script { source: "calculator.js" } VerticalLayout { - spacing: 2; margin: 2 + x: 2; spacing: 10; margin: 2 Rect { id: Container - width: 316; height: 60; z: 2 - border.color: "white"; color: "#343434" + width: 316; height: 50; z: 2 + border.color: Palette.dark; color: Palette.base Text { id: CurNum font.bold: true; font.size: 16 - color: "white" + color: Palette.text anchors.right: Container.right anchors.rightMargin: 5 anchors.verticalCenter: Container.verticalCenter @@ -25,7 +26,7 @@ Rect { Text { id: CurrentOperation - color: "white" + color: Palette.text font.bold: true; font.size: 16 anchors.left: Container.left anchors.leftMargin: 5 diff --git a/demos/declarative/calculator/pics/button-pressed.png b/demos/declarative/calculator/pics/button-pressed.png deleted file mode 100644 index 1a24cee..0000000 Binary files a/demos/declarative/calculator/pics/button-pressed.png and /dev/null differ diff --git a/demos/declarative/calculator/pics/button-pressed.sci b/demos/declarative/calculator/pics/button-pressed.sci deleted file mode 100644 index f3bc860..0000000 --- a/demos/declarative/calculator/pics/button-pressed.sci +++ /dev/null @@ -1,5 +0,0 @@ -gridLeft: 5 -gridTop: 5 -gridBottom: 5 -gridRight: 5 -imageFile: button-pressed.png diff --git a/demos/declarative/calculator/pics/button.png b/demos/declarative/calculator/pics/button.png deleted file mode 100644 index 88c8bf8..0000000 Binary files a/demos/declarative/calculator/pics/button.png and /dev/null differ diff --git a/demos/declarative/calculator/pics/button.sci b/demos/declarative/calculator/pics/button.sci deleted file mode 100644 index b1c7929..0000000 --- a/demos/declarative/calculator/pics/button.sci +++ /dev/null @@ -1,5 +0,0 @@ -gridLeft: 5 -gridTop: 5 -gridBottom: 5 -gridRight: 5 -imageFile: button.png diff --git a/demos/declarative/calculator/pics/clear.png b/demos/declarative/calculator/pics/clear.png deleted file mode 100644 index fb07a27c..0000000 Binary files a/demos/declarative/calculator/pics/clear.png and /dev/null differ diff --git a/src/declarative/util/qmlpalette.cpp b/src/declarative/util/qmlpalette.cpp index 3756878..e714bc7 100644 --- a/src/declarative/util/qmlpalette.cpp +++ b/src/declarative/util/qmlpalette.cpp @@ -124,6 +124,18 @@ QColor QmlPalette::base() const } /*! + \qmlproperty color Palette::text + The text color of the current color group. + + \sa QPalette::ColorRole +*/ +QColor QmlPalette::text() const +{ + Q_D(const QmlPalette); + return d->palette.color(d->group, QPalette::Text); +} + +/*! \qmlproperty color Palette::alternateBase The alternate base color of the current color group. diff --git a/src/declarative/util/qmlpalette.h b/src/declarative/util/qmlpalette.h index 4c2cc31..e381814 100644 --- a/src/declarative/util/qmlpalette.h +++ b/src/declarative/util/qmlpalette.h @@ -62,6 +62,7 @@ class Q_DECLARATIVE_EXPORT QmlPalette : public QObject Q_PROPERTY(QColor window READ window NOTIFY paletteChanged) Q_PROPERTY(QColor windowText READ windowText NOTIFY paletteChanged) Q_PROPERTY(QColor base READ base NOTIFY paletteChanged) + Q_PROPERTY(QColor text READ text NOTIFY paletteChanged) Q_PROPERTY(QColor alternateBase READ alternateBase NOTIFY paletteChanged) Q_PROPERTY(QColor button READ button NOTIFY paletteChanged) Q_PROPERTY(QColor buttonText READ buttonText NOTIFY paletteChanged) @@ -81,6 +82,7 @@ public: QColor windowText() const; QColor base() const; + QColor text() const; QColor alternateBase() const; QColor button() const; -- cgit v0.12 From 1896f6ef76c2af482f0c572f236e74a082aa9456 Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Mon, 3 Aug 2009 15:00:54 +1000 Subject: Fix Flickr rotation --- demos/declarative/flickr/flickr.qml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/demos/declarative/flickr/flickr.qml b/demos/declarative/flickr/flickr.qml index 57fc349..c0a1a87 100644 --- a/demos/declarative/flickr/flickr.qml +++ b/demos/declarative/flickr/flickr.qml @@ -33,9 +33,10 @@ Item { id: Wrapper; width: 85; height: 85 scale: Wrapper.PathView.scale; z: Wrapper.PathView.z - transform: [ - Rotation3D { id: Rotation; origin.x: 30; axis.x: 30; axis.y: 60; angle: Wrapper.PathView.angle } - ] + transform: Rotation3D { + id: Rotation; origin.x: Wrapper.width/2; origin.y: Wrapper.height/2 + axis.y: 1; angle: Wrapper.PathView.angle + } Connection { sender: ImageDetails; signal: "closed()" @@ -112,14 +113,14 @@ Item { } } ] - + } } ] Item { id: Background - + anchors.fill: parent Image { source: "content/pics/background.png"; anchors.fill: parent } -- cgit v0.12