diff options
author | Fabian Kosmale <fabian.kosmale@qt.io> | 2021-04-28 15:36:18 +0200 |
---|---|---|
committer | Fabian Kosmale <fabian.kosmale@qt.io> | 2021-05-04 07:57:46 +0200 |
commit | 1e0be201c3a48e9cc6fe503b2f1a695bd3846072 (patch) | |
tree | e70437871a4023045b02cf48f58b1888b89aa859 /src | |
parent | 12b8283f899ebcf401d974927314b9531334a56e (diff) |
QUntypedBindable: Allow controlled access to internals
In declarative, we need direct access to the bindable's pointers. Enable
this via a internal only helper struct in qproperty_p.h.
Change-Id: I56e4622f570ff08f85f1161af608658ea510671e
Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/kernel/qproperty.h | 1 | ||||
-rw-r--r-- | src/corelib/kernel/qproperty_p.h | 13 |
2 files changed, 14 insertions, 0 deletions
diff --git a/src/corelib/kernel/qproperty.h b/src/corelib/kernel/qproperty.h index 7924049698..1faf87aadc 100644 --- a/src/corelib/kernel/qproperty.h +++ b/src/corelib/kernel/qproperty.h @@ -566,6 +566,7 @@ Q_CORE_EXPORT void printMetaTypeMismatch(QMetaType actual, QMetaType expected); class QUntypedBindable { + friend struct QUntypedBindablePrivate; // allows access to internal data protected: QUntypedPropertyData *data = nullptr; const QtPrivate::QBindableInterface *iface = nullptr; diff --git a/src/corelib/kernel/qproperty_p.h b/src/corelib/kernel/qproperty_p.h index 6a074efebb..b2bba3d6f4 100644 --- a/src/corelib/kernel/qproperty_p.h +++ b/src/corelib/kernel/qproperty_p.h @@ -629,6 +629,19 @@ Q_CORE_EXPORT BindingEvaluationState *suspendCurrentBindingStatus(); Q_CORE_EXPORT void restoreBindingStatus(BindingEvaluationState *status); } +struct QUntypedBindablePrivate +{ + static QtPrivate::QBindableInterface const *getInterface(const QUntypedBindable &bindable) + { + return bindable.iface; + } + + static QUntypedPropertyData *getPropertyData(const QUntypedBindable &bindable) + { + return bindable.data; + } +}; + QT_END_NAMESPACE #endif // QPROPERTY_P_H |