summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFabian Kosmale <fabian.kosmale@qt.io>2021-04-28 15:36:18 +0200
committerFabian Kosmale <fabian.kosmale@qt.io>2021-05-04 07:57:46 +0200
commit1e0be201c3a48e9cc6fe503b2f1a695bd3846072 (patch)
treee70437871a4023045b02cf48f58b1888b89aa859 /src
parent12b8283f899ebcf401d974927314b9531334a56e (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.h1
-rw-r--r--src/corelib/kernel/qproperty_p.h13
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