forked from qt-creator/qt-creator
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>
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user