40 #ifndef QPROPERTYPRIVATE_H
41 #define QPROPERTYPRIVATE_H
54 #include <QtCore/qglobal.h>
55 #include <QtCore/qtaggedpointer.h>
56 #include <QtCore/qmetatype.h>
64 template<
typename Class,
typename T, auto Offset, auto Setter, auto Signal, auto Getter>
77 class QQmlPropertyBinding;
86 explicit operator T *() {
return d; }
87 explicit operator const T *()
const noexcept {
return d; }
91 T *
take() noexcept {
T *
x = d; d =
nullptr;
return x; }
96 if (d && (--d->
ref == 0))
103 : d(
o.d) {
if (d) d->
addRef(); }
105 void reset(
T *ptr =
nullptr) noexcept;
120 operator
bool ()
const noexcept {
return d !=
nullptr; }
124 { qt_ptr_swap(d,
other.d); }
127 {
return p1.d ==
p2.d; }
129 {
return p1.d !=
p2.d; }
131 {
return p1.d == ptr; }
133 {
return p1.d != ptr; }
135 {
return ptr ==
p2.d; }
137 {
return ptr !=
p2.d; }
163 template <
typename T>
168 class QPropertyBindingData;
185 struct BindingEvaluationState;
203 template<
typename Callable,
typename PropertyType=MSVCWorkAround>
206 static_assert (
alignof(
Callable) <=
alignof(std::max_align_t),
"Bindings do not support overaligned functors!");
209 if constexpr (!std::is_invocable_v<Callable>) {
211 static_assert (std::is_invocable_r_v<bool, Callable, QMetaType, QUntypedPropertyData *> );
212 auto untypedEvaluationFunction =
static_cast<Callable *
>(
f);
213 return std::invoke(*untypedEvaluationFunction, metaType, dataPtr);
214 }
else if constexpr (!std::is_same_v<PropertyType, MSVCWorkAround>) {
218 auto evaluationFunction =
static_cast<Callable *
>(
f);
219 PropertyType newValue = std::invoke(*evaluationFunction);
220 if constexpr (QTypeTraits::has_operator_equal_v<PropertyType>) {
241 template<
typename Callable,
typename PropertyType=MSVCWorkAround>
269 friend struct QT_PREPEND_NAMESPACE(QPropertyBindingDataPointer);
270 friend class QT_PREPEND_NAMESPACE(QQmlPropertyBinding);
271 friend struct QT_PREPEND_NAMESPACE(QPropertyDelayedNotifications);
273 template<
typename Class,
typename T, auto Offset, auto Setter, auto Signal, auto Getter>
274 friend class QT_PREPEND_NAMESPACE(QObjectCompatProperty);
286 static inline constexpr
quintptr DelayedNotificationBit = 0x2;
310 removeBinding_helper();
317 registerWithCurrentlyEvaluatingBinding_helper(currentBinding);
319 void registerWithCurrentlyEvaluatingBinding()
const;
337 if (isNotificationDelayed())
342 void registerWithCurrentlyEvaluatingBinding_helper(BindingEvaluationState *currentBinding)
const;
343 void removeBinding_helper();
345 enum NotificationResult { Delayed, Evaluated };
346 NotificationResult notifyObserver_helper(
351 template <
typename T,
typename Tag>
388 explicit operator bool()
const
398 template <
typename F>
401 template<
typename T,
typename C>
Declares a \l QObjectBindableProperty inside containingClass of type type with name name....
void swap(QPropertyBindingPrivatePtr &other) noexcept
const T * constData() const noexcept
friend bool operator==(std::nullptr_t, const QPropertyBindingPrivatePtr &p2) noexcept
T * data() const noexcept
friend bool operator==(const T *ptr, const QPropertyBindingPrivatePtr &p2) noexcept
friend bool operator==(const QPropertyBindingPrivatePtr &p1, std::nullptr_t) noexcept
T * operator->() noexcept
friend bool operator!=(const QPropertyBindingPrivatePtr &p1, const T *ptr) noexcept
~QPropertyBindingPrivatePtr()
Q_CORE_EXPORT void destroyAndFreeMemory()
QPropertyBindingPrivatePtr(QPropertyBindingPrivatePtr &&o) noexcept
friend bool operator==(const QPropertyBindingPrivatePtr &p1, const QPropertyBindingPrivatePtr &p2) noexcept
friend bool operator!=(std::nullptr_t, const QPropertyBindingPrivatePtr &p2) noexcept
friend bool operator==(const QPropertyBindingPrivatePtr &p1, const T *ptr) noexcept
bool operator!() const noexcept
QPropertyBindingPrivatePtr(const QPropertyBindingPrivatePtr &o) noexcept
T * operator->() const noexcept
void reset(T *ptr=nullptr) noexcept
friend bool operator!=(const QPropertyBindingPrivatePtr &p1, const QPropertyBindingPrivatePtr &p2) noexcept
friend bool operator!=(const QPropertyBindingPrivatePtr &p1, std::nullptr_t) noexcept
QPropertyBindingPrivatePtr(T *data) noexcept
friend bool operator!=(const T *ptr, const QPropertyBindingPrivatePtr &p2) noexcept
QPropertyBindingPrivatePtr() noexcept
QPropertyBindingPrivatePtr & operator=(T *o) noexcept
The QPropertyData class is a helper class for properties with automatic property bindings.
parameter_type valueBypassingBindings() const
void setValueBypassingBindings(parameter_type v)
static constexpr quintptr pointerMask()
QPropertyBindingData & operator=(QPropertyBindingData &&other)=delete
void registerWithCurrentlyEvaluatingBinding(QtPrivate::BindingEvaluationState *currentBinding) const
bool isNotificationDelayed() const
QPropertyBindingData()=default
QPropertyBindingPrivate * binding() const
QTagPreservingPointerToPointer(T **ptr)
QTagPreservingPointerToPointer< T, Tag > & operator=(T **ptr)
QTagPreservingPointerToPointer< T, Tag > & operator=(QTaggedPointer< T, Tag > *ptr)
constexpr QTagPreservingPointerToPointer()=default
quint64 getOffset(const unsigned char *&s, const ElfData &context)
auto it unsigned count const
bool(*)(QMetaType, QUntypedPropertyData *dataPtr, QPropertyBindingFunction) QPropertyBindingWrapper
constexpr BindingFunctionVTable bindingFunctionVTable
void(*)(QUntypedPropertyData *) QPropertyObserverCallback
#define Q_DISABLE_COPY(Class)
#define QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_MOVE_AND_SWAP(Class)
GLint GLint GLint GLint GLint x
[0]
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
QUntypedPropertyData * propertyData
const QtPrivate::QPropertyBindingData * originalBindingData
bool(*)(QMetaType, QUntypedPropertyData *, void *) CallFn
const MoveCtrFn moveConstruct
static constexpr BindingFunctionVTable createFor()
void(*)(void *, void *) MoveCtrFn
const QtPrivate::BindingFunctionVTable * vtable