aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlbinding_p.h
diff options
context:
space:
mode:
authorAndrei Golubev <andrei.golubev@qt.io>2021-06-02 14:53:24 +0200
committerAndrei Golubev <andrei.golubev@qt.io>2021-06-03 10:30:53 +0200
commit06893b68c6b1f70cb7ff255db1fa9d14697403fa (patch)
tree38326366d06fb3115f8fe42c45731d82e4dcf888 /src/qml/qml/qqmlbinding_p.h
parent87b6def42a4341a4c6ac697458dd06836818b43b (diff)
Support binding creation from QMetaType of property
QQmlBinding/QQmlPropertyBinding, created from QQmlPropertyData, really only needed QMetaType (which is ideally always in sync with custom data in QQmlPropertyData), so provide the versions that accept QMetaType This way we don't need to care about QQmlPropertyData at all when we know QMetaProperty, which is, for example, the case of object creation compiler Change-Id: Ia7794e5575b71ffaf111dd35b352da36598c631f Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'src/qml/qml/qqmlbinding_p.h')
-rw-r--r--src/qml/qml/qqmlbinding_p.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/qml/qml/qqmlbinding_p.h b/src/qml/qml/qqmlbinding_p.h
index a74e76f475..73bc0a03c8 100644
--- a/src/qml/qml/qqmlbinding_p.h
+++ b/src/qml/qml/qqmlbinding_p.h
@@ -86,6 +86,10 @@ public:
const QQmlPropertyData *property, QV4::Function *function, QObject *obj,
const QQmlRefPointer<QQmlContextData> &ctxt, QV4::ExecutionContext *scope);
+ static QQmlBinding *create(QMetaType propertyType, QV4::Function *function, QObject *obj,
+ const QQmlRefPointer<QQmlContextData> &ctxt,
+ QV4::ExecutionContext *scope);
+
static QQmlBinding *createTranslationBinding(
const QQmlRefPointer<QV4::ExecutableCompilationUnit> &unit,
const QV4::CompiledData::Binding *binding, QObject *obj,
@@ -154,6 +158,7 @@ private:
inline void setEnabledFlag(bool);
static QQmlBinding *newBinding(QQmlEnginePrivate *engine, const QQmlPropertyData *property);
+ static QQmlBinding *newBinding(QQmlEnginePrivate *engine, QMetaType propertyType);
QQmlSourceLocation *m_sourceLocation = nullptr; // used for Qt.binding() created functions
QV4::PersistentValue m_boundFunction; // used for Qt.binding() that are created from a bound function object