summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/qmlcompiler.cpp
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-02-23 01:15:19 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-02-23 01:15:19 (GMT)
commit39d728dd76efa10ca297b76ed08a5cd1c0235b3f (patch)
tree4eb8a92abef1d07f6adac8f9fa3ae4237461e64f /src/declarative/qml/qmlcompiler.cpp
parent69b1784edb6dd82f26100d0e539bfa8a65bdd35d (diff)
parent14447cbbf7ee93e03286112b5b27d20961fd9551 (diff)
downloadQt-39d728dd76efa10ca297b76ed08a5cd1c0235b3f.zip
Qt-39d728dd76efa10ca297b76ed08a5cd1c0235b3f.tar.gz
Qt-39d728dd76efa10ca297b76ed08a5cd1c0235b3f.tar.bz2
Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-qml into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/qt-qml: Make uncached text painting work for richtext too. Updated based on change to transformOrign Documentation Update Doc fix Remove race condition in remote pixmap cancelling. Replace QmlList* and QList* support with a single QmlListProperty type Rename MouseRegion -> MouseArea Update QmlChanges with animation API changes. Document the default velocity of EaseFollow Remove use of unexprted private classes. Fix compile error on Solaris Increase durations when testing Behaviors. Add cached path rounded rect painting benchmark. Remove use of direct event posting. Use QTest::keyClick() for keys.
Diffstat (limited to 'src/declarative/qml/qmlcompiler.cpp')
-rw-r--r--src/declarative/qml/qmlcompiler.cpp103
1 files changed, 31 insertions, 72 deletions
diff --git a/src/declarative/qml/qmlcompiler.cpp b/src/declarative/qml/qmlcompiler.cpp
index 2b1081e..bbae201 100644
--- a/src/declarative/qml/qmlcompiler.cpp
+++ b/src/declarative/qml/qmlcompiler.cpp
@@ -1495,8 +1495,7 @@ bool QmlCompiler::buildProperty(QmlParser::Property *prop,
COMPILE_CHECK(buildGroupedProperty(prop, obj, ctxt));
- } else if (QmlEnginePrivate::get(engine)->isQmlList(prop->type) ||
- QmlMetaType::isList(prop->type)) {
+ } else if (QmlEnginePrivate::get(engine)->isList(prop->type)) {
COMPILE_CHECK(buildListProperty(prop, obj, ctxt));
@@ -1552,8 +1551,7 @@ QmlCompiler::buildPropertyInNamespace(QmlEnginePrivate::ImportedNamespace *ns,
void QmlCompiler::genValueProperty(QmlParser::Property *prop,
QmlParser::Object *obj)
{
- if (QmlEnginePrivate::get(engine)->isQmlList(prop->type) ||
- QmlMetaType::isList(prop->type)) {
+ if (QmlEnginePrivate::get(engine)->isList(prop->type)) {
genListProperty(prop, obj);
} else {
genPropertyAssignment(prop, obj);
@@ -1563,22 +1561,10 @@ void QmlCompiler::genValueProperty(QmlParser::Property *prop,
void QmlCompiler::genListProperty(QmlParser::Property *prop,
QmlParser::Object *obj)
{
- QmlInstruction::Type fetchType;
- QmlInstruction::Type storeType;
- int listType;
-
- if (QmlEnginePrivate::get(engine)->isQmlList(prop->type)) {
- fetchType = QmlInstruction::FetchQmlList;
- storeType = QmlInstruction::StoreObjectQmlList;
- listType = QmlEnginePrivate::get(engine)->qmlListType(prop->type);
- } else {
- fetchType = QmlInstruction::FetchQList;
- storeType = QmlInstruction::StoreObjectQList;
- listType = QmlMetaType::listType(prop->type);
- }
+ int listType = QmlEnginePrivate::get(engine)->listType(prop->type);
QmlInstruction fetch;
- fetch.type = fetchType;
+ fetch.type = QmlInstruction::FetchQList;
fetch.line = prop->location.start.line;
fetch.fetchQmlList.property = prop->index;
bool listTypeIsInterface = QmlMetaType::isInterface(listType);
@@ -1598,7 +1584,7 @@ void QmlCompiler::genListProperty(QmlParser::Property *prop,
output->bytecode << assign;
} else {
QmlInstruction store;
- store.type = storeType;
+ store.type = QmlInstruction::StoreObjectQList;
store.line = prop->location.start.line;
output->bytecode << store;
}
@@ -1895,67 +1881,40 @@ bool QmlCompiler::buildListProperty(QmlParser::Property *prop,
QmlParser::Object *obj,
const BindingContext &ctxt)
{
- Q_ASSERT(QmlMetaType::isList(prop->type) ||
- QmlEnginePrivate::get(engine)->isQmlList(prop->type));
+ Q_ASSERT(QmlEnginePrivate::get(engine)->isList(prop->type));
int t = prop->type;
obj->addValueProperty(prop);
- if (QmlEnginePrivate::get(engine)->isQmlList(t)) {
- int listType = QmlEnginePrivate::get(engine)->qmlListType(t);
- bool listTypeIsInterface = QmlMetaType::isInterface(listType);
-
- for (int ii = 0; ii < prop->values.count(); ++ii) {
- Value *v = prop->values.at(ii);
- if (v->object) {
- v->type = Value::CreatedObject;
- COMPILE_CHECK(buildObject(v->object, ctxt));
-
- // We check object coercian here. We check interface assignment
- // at runtime.
- if (!listTypeIsInterface) {
- if (!canCoerce(listType, v->object)) {
- COMPILE_EXCEPTION(v, QCoreApplication::translate("QmlCompiler","Cannot assign object to list"));
- }
- }
+ int listType = QmlEnginePrivate::get(engine)->listType(t);
+ bool listTypeIsInterface = QmlMetaType::isInterface(listType);
- } else {
- COMPILE_EXCEPTION(v, QCoreApplication::translate("QmlCompiler","Cannot assign primitives to lists"));
- }
- }
+ bool assignedBinding = false;
+ for (int ii = 0; ii < prop->values.count(); ++ii) {
+ Value *v = prop->values.at(ii);
+ if (v->object) {
+ v->type = Value::CreatedObject;
+ COMPILE_CHECK(buildObject(v->object, ctxt));
- } else {
- int listType = QmlMetaType::listType(t);
- bool listTypeIsInterface = QmlMetaType::isInterface(listType);
-
- bool assignedBinding = false;
- for (int ii = 0; ii < prop->values.count(); ++ii) {
- Value *v = prop->values.at(ii);
- if (v->object) {
- v->type = Value::CreatedObject;
- COMPILE_CHECK(buildObject(v->object, ctxt));
-
- // We check object coercian here. We check interface assignment
- // at runtime.
- if (!listTypeIsInterface) {
- if (!canCoerce(listType, v->object)) {
- COMPILE_EXCEPTION(v, QCoreApplication::translate("QmlCompiler","Cannot assign object to list"));
- }
+ // We check object coercian here. We check interface assignment
+ // at runtime.
+ if (!listTypeIsInterface) {
+ if (!canCoerce(listType, v->object)) {
+ COMPILE_EXCEPTION(v, QCoreApplication::translate("QmlCompiler","Cannot assign object to list"));
}
+ }
- } else if (v->value.isScript()) {
- if (assignedBinding)
- COMPILE_EXCEPTION(v, QCoreApplication::translate("QmlCompiler","Can only assign one binding to lists"));
+ } else if (v->value.isScript()) {
+ if (assignedBinding)
+ COMPILE_EXCEPTION(v, QCoreApplication::translate("QmlCompiler","Can only assign one binding to lists"));
- assignedBinding = true;
- COMPILE_CHECK(buildBinding(v, prop, ctxt));
- v->type = Value::PropertyBinding;
- } else {
- COMPILE_EXCEPTION(v, QCoreApplication::translate("QmlCompiler","Cannot assign primitives to lists"));
- }
+ assignedBinding = true;
+ COMPILE_CHECK(buildBinding(v, prop, ctxt));
+ v->type = Value::PropertyBinding;
+ } else {
+ COMPILE_EXCEPTION(v, QCoreApplication::translate("QmlCompiler","Cannot assign primitives to lists"));
}
-
}
return true;
@@ -2335,10 +2294,10 @@ bool QmlCompiler::buildDynamicMeta(QmlParser::Object *obj, DynamicMetaMode mode)
propertyType = QMetaType::QObjectStar;
} else {
readonly = true;
- type = "QmlList<";
+ type = "QmlListProperty<";
type.append(customTypeName);
- type.append("*>*");
- propertyType = qMetaTypeId<QmlList<QObject*>* >();
+ type.append(">");
+ propertyType = qMetaTypeId<QmlListProperty<QObject> >();
}
}
break;