aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlpropertybinding_p.h
diff options
context:
space:
mode:
authorFabian Kosmale <fabian.kosmale@qt.io>2021-02-26 10:22:33 +0100
committerFabian Kosmale <fabian.kosmale@qt.io>2021-03-04 12:53:46 +0100
commit50e984c07229b753d6558610e7fa7c7df733fe50 (patch)
tree3c802a88a36ea081988c454cebb59fa5648ac417 /src/qml/qml/qqmlpropertybinding_p.h
parent776d1f0bf02c5dc2a9dac4c5bd906f4421abf2f4 (diff)
Introduce QQmlAnyBinding as an abstraction over bindings
QQmlAnyBinding is meant to abstract over the differences between classical, QQmlAbstractBinding derived bindings and the newer QPropertyBindingPrivate based ones. It can be used to store, receive, remove, create and set bindings of both types. In addition, this patches adds the functionality to create a QQmlPropertyBinding from a code string, which was so far only possible with QQmlBinding; and adds a few methods to QBiPointer to ease the implementation of QQmlAnyBinding. Task-number: QTBUG-91000 Change-Id: I7076d6fb426f315f32c1b054c5c3ba56312bed29 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/qml/qml/qqmlpropertybinding_p.h')
-rw-r--r--src/qml/qml/qqmlpropertybinding_p.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/qml/qml/qqmlpropertybinding_p.h b/src/qml/qml/qqmlpropertybinding_p.h
index 4dcd5c1879..7c7fac866a 100644
--- a/src/qml/qml/qqmlpropertybinding_p.h
+++ b/src/qml/qml/qqmlpropertybinding_p.h
@@ -101,6 +101,11 @@ public:
QObject *obj, const QQmlRefPointer<QQmlContextData> &ctxt,
QV4::ExecutionContext *scope, QObject *target,
QQmlPropertyIndex targetIndex);
+ static QUntypedPropertyBinding createFromCodeString(const QQmlPropertyData *property,
+ const QString &str, QObject *obj,
+ const QQmlRefPointer<QQmlContextData> &ctxt,
+ const QString &url, quint16 lineNumber,
+ QObject *target, QQmlPropertyIndex targetIndex);
static QUntypedPropertyBinding createFromBoundFunction(const QQmlPropertyData *pd, QV4::BoundFunction *function,
QObject *obj, const QQmlRefPointer<QQmlContextData> &ctxt,
@@ -157,7 +162,7 @@ inline constexpr BindingFunctionVTable bindingFunctionVTable<QQmlPropertyBinding
class QQmlTranslationPropertyBinding
{
public:
- static QUntypedPropertyBinding create(const QQmlPropertyData *pd,
+ static QUntypedPropertyBinding Q_QML_PRIVATE_EXPORT create(const QQmlPropertyData *pd,
const QQmlRefPointer<QV4::ExecutableCompilationUnit> &compilationUnit,
const QV4::CompiledData::Binding *binding);
};