diff options
Diffstat (limited to 'src/qml/types/qqmllistmodel_p_p.h')
-rw-r--r-- | src/qml/types/qqmllistmodel_p_p.h | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/qml/types/qqmllistmodel_p_p.h b/src/qml/types/qqmllistmodel_p_p.h index 271437e680..65567ab69a 100644 --- a/src/qml/types/qqmllistmodel_p_p.h +++ b/src/qml/types/qqmllistmodel_p_p.h @@ -108,7 +108,7 @@ public: return m_uid; } - static void sync(DynamicRoleModelNode *src, DynamicRoleModelNode *target, QHash<int, QQmlListModel *> *targetModelHash); + static QVector<int> sync(DynamicRoleModelNode *src, DynamicRoleModelNode *target); private: QQmlListModel *m_owner; @@ -216,6 +216,7 @@ public: QObject, VariantMap, DateTime, + Function, MaxDataType }; @@ -260,7 +261,7 @@ public: ListElement(int existingUid); ~ListElement(); - static void sync(ListElement *src, ListLayout *srcLayout, ListElement *target, ListLayout *targetLayout, QHash<int, ListModel *> *targetModelHash); + static QVector<int> sync(ListElement *src, ListLayout *srcLayout, ListElement *target, ListLayout *targetLayout); enum { @@ -283,6 +284,7 @@ private: int setVariantMapProperty(const ListLayout::Role &role, QV4::Object *o); int setVariantMapProperty(const ListLayout::Role &role, QVariantMap *m); int setDateTimeProperty(const ListLayout::Role &role, const QDateTime &dt); + int setFunctionProperty(const ListLayout::Role &role, const QJSValue &f); void setStringPropertyFast(const ListLayout::Role &role, const QString &s); void setDoublePropertyFast(const ListLayout::Role &role, double n); @@ -291,6 +293,7 @@ private: void setListPropertyFast(const ListLayout::Role &role, ListModel *m); void setVariantMapFast(const ListLayout::Role &role, QV4::Object *o); void setDateTimePropertyFast(const ListLayout::Role &role, const QDateTime &dt); + void setFunctionPropertyFast(const ListLayout::Role &role, const QJSValue &f); void clearProperty(const ListLayout::Role &role); @@ -301,6 +304,7 @@ private: QPointer<QObject> *getGuardProperty(const ListLayout::Role &role); QVariantMap *getVariantMapProperty(const ListLayout::Role &role); QDateTime *getDateTimeProperty(const ListLayout::Role &role); + QJSValue *getFunctionProperty(const ListLayout::Role &role); inline char *getPropertyMemory(const ListLayout::Role &role); @@ -375,7 +379,7 @@ public: int getUid() const { return m_uid; } - static void sync(ListModel *src, ListModel *target, QHash<int, ListModel *> *srcModelHash); + static bool sync(ListModel *src, ListModel *target); QObject *getOrCreateModelObject(QQmlListModel *model, int elementIndex); @@ -388,10 +392,11 @@ private: struct ElementSync { - ElementSync() : src(0), target(0) {} - - ListElement *src; - ListElement *target; + ListElement *src = nullptr; + ListElement *target = nullptr; + int srcIndex = -1; + int targetIndex = -1; + QVector<int> changedRoles; }; void newElement(int index); @@ -400,6 +405,7 @@ private: friend class ListElement; friend class QQmlListModelWorkerAgent; + friend class QQmlListModelParser; }; QT_END_NAMESPACE |