summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWarwick Allison <warwick.allison@nokia.com>2009-07-23 05:44:45 (GMT)
committerWarwick Allison <warwick.allison@nokia.com>2009-07-23 05:44:45 (GMT)
commitdd652f37353a01e0172e20f1e7ef24b001a281db (patch)
tree09d91be634c4e6ac6a663fb09a9058697e16c96c
parent053cf70e8454cb612a1152777eecf71f12843abe (diff)
downloadQt-dd652f37353a01e0172e20f1e7ef24b001a281db.zip
Qt-dd652f37353a01e0172e20f1e7ef24b001a281db.tar.gz
Qt-dd652f37353a01e0172e20f1e7ef24b001a281db.tar.bz2
Temporary fix for Attached properties
and correct fix for Qt/4.6/Component reference. Attached properties should be resolved like other types (i.e. through the QmlEngine::resolveType functions), otherwise non-Qt attached properties will not work, and constructs like this will not work: Wrapper.Qt.PathView.scale
-rw-r--r--src/declarative/qml/qmlcompiler.cpp6
-rw-r--r--src/declarative/qml/qmlmetatype.cpp2
2 files changed, 4 insertions, 4 deletions
diff --git a/src/declarative/qml/qmlcompiler.cpp b/src/declarative/qml/qmlcompiler.cpp
index 477e6a5..3d38311 100644
--- a/src/declarative/qml/qmlcompiler.cpp
+++ b/src/declarative/qml/qmlcompiler.cpp
@@ -1011,7 +1011,7 @@ bool QmlCompiler::buildSubObject(Object *obj, const BindingContext &ctxt)
int QmlCompiler::componentTypeRef()
{
- QmlType *t = QmlMetaType::qmlType("Component");
+ QmlType *t = QmlMetaType::qmlType("Qt/4.6/Component");
for (int ii = output->types.count() - 1; ii >= 0; --ii) {
if (output->types.at(ii).type == t)
return ii;
@@ -1123,7 +1123,7 @@ bool QmlCompiler::buildProperty(QmlParser::Property *prop,
COMPILE_EXCEPTION(prop, "Attached properties cannot be used here");
}
- QmlType *type = QmlMetaType::qmlType(prop->name);
+ QmlType *type = QmlMetaType::qmlType("Qt/4.6/"+prop->name); // XXX Should not hard-code namespace
if (!type || !type->attachedPropertiesType())
COMPILE_EXCEPTION(prop, "Non-existant attached object");
@@ -1394,7 +1394,7 @@ bool QmlCompiler::buildAttachedProperty(QmlParser::Property *prop,
const BindingContext &ctxt)
{
Q_ASSERT(prop->value);
- int id = QmlMetaType::attachedPropertiesFuncId(prop->name);
+ int id = QmlMetaType::attachedPropertiesFuncId("Qt/4.6/"+prop->name); // XXX Should not hard-code namespace
Q_ASSERT(id != -1); // This is checked in compileProperty()
prop->index = id;
diff --git a/src/declarative/qml/qmlmetatype.cpp b/src/declarative/qml/qmlmetatype.cpp
index f65ead8..3552b44 100644
--- a/src/declarative/qml/qmlmetatype.cpp
+++ b/src/declarative/qml/qmlmetatype.cpp
@@ -675,7 +675,7 @@ int QmlMetaType::attachedPropertiesFuncId(const QByteArray &name)
QReadLocker lock(metaTypeDataLock());
QmlMetaTypeData *data = metaTypeData();
- QmlType *type = data->nameToType.value(name);
+ QmlType *type = data->nameToType.value("Qt/4.6/"+name); // XXX Should not hard-code namespace
if (type && type->attachedPropertiesFunction())
return type->index();
else