diff options
author | Marco Bubke <marco.bubke@nokia.com> | 2011-08-31 14:27:56 +0200 |
---|---|---|
committer | Marco Bubke <marco.bubke@nokia.com> | 2011-08-31 18:49:01 +0200 |
commit | 1e60fbfba4982d7c7991542aa1c980d798a1df4c (patch) | |
tree | b28ef3a7027a64c40362d714002dd9514d181acb /share/qtcreator/qml/qmlpuppet/instances/objectnodeinstance.cpp | |
parent | 9250b611c823ed00f9ef98d4db0bf84293d5b1a8 (diff) |
QmlDesigner.NodeInstances: Add support for new list interface
Change-Id: Icd20f2a921c94f8bac73f9f61b61a34561ee2d3f
Reviewed-on: http://codereview.qt.nokia.com/3973
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@nokia.com>
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Diffstat (limited to 'share/qtcreator/qml/qmlpuppet/instances/objectnodeinstance.cpp')
-rw-r--r-- | share/qtcreator/qml/qmlpuppet/instances/objectnodeinstance.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/share/qtcreator/qml/qmlpuppet/instances/objectnodeinstance.cpp b/share/qtcreator/qml/qmlpuppet/instances/objectnodeinstance.cpp index 21545cb2bc..8bbe0773be 100644 --- a/share/qtcreator/qml/qmlpuppet/instances/objectnodeinstance.cpp +++ b/share/qtcreator/qml/qmlpuppet/instances/objectnodeinstance.cpp @@ -289,7 +289,12 @@ static QVariant objectToVariant(QObject *object) static bool hasFullImplementedListInterface(const QDeclarativeListReference &list) { + +#if QT_VERSION<0x050000 return list.isValid() && list.canCount() && list.canAt() && list.canAppend() && list.canClear(); +#else + return !list.isManipulatable(); +#endif } static void removeObjectFromList(const QDeclarativeProperty &property, QObject *objectToBeRemoved, QDeclarativeEngine * engine) @@ -719,7 +724,11 @@ void allSubObject(QObject *object, QObjectList &objectList) if (metaProperty.isReadable() && QDeclarativeMetaType::isList(metaProperty.userType())) { QDeclarativeListReference list(object, metaProperty.name()); +#if QT_VERSION<0x050000 if (list.canCount() && list.canAt()) { +#else + if (list.isReadable()) { +#endif for (int i = 0; i < list.count(); i++) { QObject *propertyObject = list.at(i); allSubObject(propertyObject, objectList); |