aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmllist.h
diff options
context:
space:
mode:
authorUnai IRIGOYEN <u.irigoyen@gmail.com>2019-11-04 21:45:29 +0100
committerUlf Hermann <ulf.hermann@qt.io>2020-08-22 22:44:32 +0200
commit1876bd4215ccf5bbaa6f571177db889ba4bc8eff (patch)
treec0f6305b305119d7c509f1ef4cee908f62b689f3 /src/qml/qml/qqmllist.h
parent3d195d33ece3f8fd7cd7d8e6163fe038fc7fc036 (diff)
Add override behaviors to QQmlListProperty
[ChangeLog][QQmlListProperty] When overriding a QQmlListProperty in a derived QML type, the default behavior is to append the derived class elements to the base class ones. This introduces a macro to allow replacing the base type contents either always or if the property is not the default one. Fixes: QTBUG-77529 Change-Id: Ib1abbf52e341c043344c347c612928b47856fb3e Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/qml/qml/qqmllist.h')
-rw-r--r--src/qml/qml/qqmllist.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/qml/qml/qqmllist.h b/src/qml/qml/qqmllist.h
index 313d7449fe..199f10196a 100644
--- a/src/qml/qml/qqmllist.h
+++ b/src/qml/qml/qqmllist.h
@@ -50,6 +50,10 @@ QT_BEGIN_NAMESPACE
class QObject;
struct QMetaObject;
+#define QML_LIST_PROPERTY_ASSIGN_BEHAVIOR_APPEND Q_CLASSINFO("QML.ListPropertyAssignBehavior", "Append")
+#define QML_LIST_PROPERTY_ASSIGN_BEHAVIOR_REPLACE_IF_NOT_DEFAULT Q_CLASSINFO("QML.ListPropertyAssignBehavior", "ReplaceIfNotDefault")
+#define QML_LIST_PROPERTY_ASSIGN_BEHAVIOR_REPLACE Q_CLASSINFO("QML.ListPropertyAssignBehavior", "Replace")
+
#ifndef QQMLLISTPROPERTY
#define QQMLLISTPROPERTY
template<typename T>