diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2011-04-12 16:06:35 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2011-04-12 16:06:35 (GMT) |
commit | 163a4a4c38453cd4ed32c5a436763e11ce580687 (patch) | |
tree | c9162f4b47571300ea17578401122532139561e9 /src/declarative | |
parent | 7190c7be34fe0dbcfbb10b232b40977c758d251a (diff) | |
parent | b6f1dd4151c5bbcb7d4367ec972c9026ab9e68be (diff) | |
download | Qt-163a4a4c38453cd4ed32c5a436763e11ce580687.zip Qt-163a4a4c38453cd4ed32c5a436763e11ce580687.tar.gz Qt-163a4a4c38453cd4ed32c5a436763e11ce580687.tar.bz2 |
Merge branch 4.7 into qt-master-from-4.7
Diffstat (limited to 'src/declarative')
-rw-r--r-- | src/declarative/qml/qdeclarativeboundsignal.cpp | 28 | ||||
-rw-r--r-- | src/declarative/util/qdeclarativelistmodel.cpp | 3 |
2 files changed, 27 insertions, 4 deletions
diff --git a/src/declarative/qml/qdeclarativeboundsignal.cpp b/src/declarative/qml/qdeclarativeboundsignal.cpp index 28dfea9..47a15cb 100644 --- a/src/declarative/qml/qdeclarativeboundsignal.cpp +++ b/src/declarative/qml/qdeclarativeboundsignal.cpp @@ -225,9 +225,35 @@ QDeclarativeBoundSignalParameters::QDeclarativeBoundSignalParameters(const QMeta QMetaPropertyBuilder prop = mob.addProperty(name, "QObject*"); prop.setWritable(false); } else { + QByteArray propType = type; + if (t >= QVariant::UserType || t == QVariant::Invalid) { + //copy of QDeclarativeObjectScriptClass::enumType() + QByteArray scope; + QByteArray name; + int scopeIdx = propType.lastIndexOf("::"); + if (scopeIdx != -1) { + scope = propType.left(scopeIdx); + name = propType.mid(scopeIdx + 2); + } else { + name = propType; + } + const QMetaObject *meta; + if (scope == "Qt") + meta = &QObject::staticQtMetaObject; + else + meta = parent->parent()->metaObject(); //### assumes parent->parent() + for (int i = meta->enumeratorCount() - 1; i >= 0; --i) { + QMetaEnum m = meta->enumerator(i); + if ((m.name() == name) && (scope.isEmpty() || (m.scope() == scope))) { + t = QVariant::Int; + propType = "int"; + break; + } + } + } if (QDeclarativeMetaType::canCopy(t)) { types[ii] = t; - QMetaPropertyBuilder prop = mob.addProperty(name, type); + QMetaPropertyBuilder prop = mob.addProperty(name, propType); prop.setWritable(false); } else { types[ii] = 0x80000000 | t; diff --git a/src/declarative/util/qdeclarativelistmodel.cpp b/src/declarative/util/qdeclarativelistmodel.cpp index fb77ec3..61b2d34 100644 --- a/src/declarative/util/qdeclarativelistmodel.cpp +++ b/src/declarative/util/qdeclarativelistmodel.cpp @@ -1301,9 +1301,6 @@ int NestedListModel::count() const void NestedListModel::clear() { - _rolesOk = false; - roleStrings.clear(); - if (_root) _root->clear(); } |