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>
bb10
Fabian Kosmale 2021-04-28 15:36:18 +02:00
parent 12b8283f89
commit 1e0be201c3
2 changed files with 14 additions and 0 deletions

View File

@ -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;

View File

@ -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