Commit 1e60fbfb authored by Marco Bubke's avatar Marco Bubke

QmlDesigner.NodeInstances: Add support for new list interface

Change-Id: Icd20f2a921c94f8bac73f9f61b61a34561ee2d3f
Reviewed-on: http://codereview.qt.nokia.com/3973Reviewed-by: default avatarThomas Hartmann <Thomas.Hartmann@nokia.com>
Reviewed-by: default avatarQt Sanity Bot <qt_sanity_bot@ovi.com>
parent 9250b611
......@@ -96,7 +96,11 @@ void NodeInstanceSignalSpy::registerObject(QObject *spiedObject, const QString &
if (metaProperty.isReadable()
&& QDeclarativeMetaType::isList(metaProperty.userType())) {
QDeclarativeListReference list(spiedObject, 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);
if (propertyObject)
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment