aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabian Kosmale <fabian.kosmale@qt.io>2021-02-17 15:23:42 +0100
committerFabian Kosmale <fabian.kosmale@qt.io>2021-02-19 08:03:21 +0100
commit8de4ea606a6c105be66b7312597b73aaa4ced37a (patch)
treece21adf4f352e0eefce37b1504c718b74d0db0c0
parent1598ab45c7d4af028894757e5c3d4750e02f53c2 (diff)
QQmlPropertyPrivate::findAliasTarget: add more ergonomic overload
This simply calls the old overload for now and documents what the function does. Change-Id: I14f69dbc1610814c1cd714180d5b4a791e97de3a Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
-rw-r--r--src/qml/qml/qqmlproperty.cpp8
-rw-r--r--src/qml/qml/qqmlproperty_p.h12
2 files changed, 20 insertions, 0 deletions
diff --git a/src/qml/qml/qqmlproperty.cpp b/src/qml/qml/qqmlproperty.cpp
index 8689e90c18..598263e0a3 100644
--- a/src/qml/qml/qqmlproperty.cpp
+++ b/src/qml/qml/qqmlproperty.cpp
@@ -884,6 +884,14 @@ void QQmlPropertyPrivate::findAliasTarget(QObject *object, QQmlPropertyIndex bin
*targetBindingIndex = bindingIndex;
}
+QQmlPropertyPrivate::ResolvedAlias QQmlPropertyPrivate::findAliasTarget(QObject *baseObject, QQmlPropertyIndex baseIndex)
+{
+ ResolvedAlias resolved;
+ findAliasTarget(baseObject, baseIndex, &resolved.targetObject, &resolved.targetIndex);
+ return resolved;
+}
+
+
void QQmlPropertyPrivate::setBinding(QQmlAbstractBinding *binding, BindingFlags flags, QQmlPropertyData::WriteFlags writeFlags)
{
diff --git a/src/qml/qml/qqmlproperty_p.h b/src/qml/qml/qqmlproperty_p.h
index f6e9bddd93..c54d066152 100644
--- a/src/qml/qml/qqmlproperty_p.h
+++ b/src/qml/qml/qqmlproperty_p.h
@@ -114,6 +114,18 @@ public:
QQmlPropertyData::WriteFlags flags = {});
static void findAliasTarget(QObject *, QQmlPropertyIndex, QObject **, QQmlPropertyIndex *);
+ struct ResolvedAlias
+ {
+ QObject *targetObject;
+ QQmlPropertyIndex targetIndex;
+ };
+ /*!
+ \internal
+ Given an alias property specified by \a baseObject and \a baseIndex, this function
+ computes the alias target.
+ */
+ static ResolvedAlias findAliasTarget(QObject *baseObject, QQmlPropertyIndex baseIndex);
+
enum BindingFlag {
None = 0,
DontEnable = 0x1