7#include <QtCore/qtconfigmacros.h>
8#include <QtCore/qtdeprecationmarkers.h>
10#if defined(__cpp_lib_three_way_comparison) && defined(__cpp_lib_concepts)
21#pragma qt_class(QtTypeTraits)
22#pragma qt_sync_stop_processing
28template <
typename Enum>
29constexpr std::underlying_type_t<Enum> qToUnderlying(Enum e)
noexcept
31 return static_cast<std::underlying_type_t<Enum>>(e);
35#if QT_DEPRECATED_SINCE(6
, 6
)
39QT_DEPRECATED_VERSION_X_6_6(
"Use std::as_const() instead.")
40constexpr typename std::add_const<T>::type &qAsConst(T &t)
noexcept {
return t; }
43void qAsConst(
const T &&) =
delete;
48#ifndef QT_NO_QEXCHANGE
51template <
typename T,
typename U = T>
57 t =
std::forward<U>(newValue);
74#define QSEIT_EXCLUDE(X)
75 template <> struct is_standard_or_extended_integer_type_helper<X> : std::false_type {}
94template<
typename T,
typename U,
102 using type =
decltype(T() + U());
106template <
typename T,
typename U>
110
111
112
113
114
115
116
117
118
119
120
121
126template <
typename,
typename =
void>
137QT_WARNING_DISABLE_FLOAT_COMPARE
138template <
typename,
typename =
void>
156template<
typename T,
bool>
168template<
typename ...
T>
175template<
typename T1,
typename T2>
177template<
typename ...T>
179template<
typename ...T>
183template <
typename,
typename =
void>
197template<
typename T,
bool>
208template<
typename ...
T>
215template<
typename T1,
typename T2>
217template<
typename ...T>
219template<
typename ...T>
224template<
typename T,
typename =
void>
239template <
typename Container,
typename T>
247template <
typename Container,
typename T>
250template <
typename ...
T>
256template <
typename ...
T>
264template <
typename T,
typename U>
266#if defined(__cpp_lib_three_way_comparison) && defined(__cpp_lib_concepts)
269template <
typename T,
typename U>
275template<
typename T,
typename U>
293template <
typename Stream,
typename,
typename =
void>
295template <
typename Stream,
typename T>
298template <
typename Stream,
typename T>
304template <
typename Stream,
typename,
typename =
void>
306template <
typename Stream,
typename T>
309template <
typename Stream,
typename T>
314template <
typename Stream,
typename T>
QPropertyBinding< T > makeBinding(const QPropertyBindingSourceLocation &location=QT_PROPERTY_DEFAULT_BINDING_LOCATION) const
Constructs a binding evaluating to the underlying property's value, using a specified source location...
QPropertyBinding< T > binding() const
Returns the currently set binding of the underlying property.
T value() const
Returns the underlying property's current value.
void setValue(const T &value)
Sets the underlying property's value to value.
friend class QPropertyAlias
QBindable(QObject *obj, const QMetaProperty &property)
QPropertyBinding< T > setBinding(Functor &&f, const QPropertyBindingSourceLocation &location=QT_PROPERTY_DEFAULT_BINDING_LOCATION, std::enable_if_t< std::is_invocable_v< Functor > > *=nullptr)
QBindable(const QUntypedBindable &b)
QPropertyBinding< T > setBinding(const QPropertyBinding< T > &binding)
Sets the underlying property's binding to binding.
QBindable(QObject *obj, const char *property)
QPropertyBinding< T > takeBinding()
Removes the currently set binding of the underlying property and returns it.
QObjectBindableProperty(const T &initialValue)
Constructs a property with the provided initialValue.
QObjectBindableProperty()=default
typename QPropertyData< T >::rvalue_ref rvalue_ref
typename QPropertyData< T >::value_type value_type
QObjectBindableProperty(T &&initialValue)
Move-Constructs a property with the provided initialValue.
typename QPropertyData< T >::arrow_operator_result arrow_operator_result
QObjectBindableProperty(Functor &&f, const QPropertyBindingSourceLocation &location=QT_PROPERTY_DEFAULT_BINDING_LOCATION, typename std::enable_if_t< std::is_invocable_r_v< T, Functor & > > *=nullptr)
QObjectBindableProperty(const QPropertyBinding< T > &binding)
typename QPropertyData< T >::parameter_type parameter_type
\macro Q_OBJECT_BINDABLE_PROPERTY(containingClass, type, name, signal)
QPropertyBinding< T > binding() const
operator parameter_type() const
typename QPropertyData< T >::value_type value_type
QtPrivate::QPropertyBindingData & bindingData() const
QObjectCompatProperty & operator=(parameter_type newValue)
typename QPropertyData< T >::arrow_operator_result arrow_operator_result
typename QPropertyData< T >::parameter_type parameter_type
parameter_type value() const
QObjectCompatProperty()=default
QPropertyChangeHandler< Functor > onValueChanged(Functor f)
void setValue(parameter_type t)
void removeBindingUnlessInWrapper()
bool setBinding(const QUntypedPropertyBinding &newBinding)
QPropertyBinding< T > setBinding(Functor &&f, const QPropertyBindingSourceLocation &location=QT_PROPERTY_DEFAULT_BINDING_LOCATION, std::enable_if_t< std::is_invocable_v< Functor > > *=nullptr)
arrow_operator_result operator->() const
QObjectCompatProperty(T &&initialValue)
QPropertyNotifier addNotifier(Functor f)
parameter_type operator*() const
QObjectCompatProperty(const T &initialValue)
QPropertyBinding< T > takeBinding()
QPropertyChangeHandler< Functor > subscribe(Functor f)
QPropertyBinding< T > setBinding(const QPropertyBinding< T > &newBinding)
\macro Q_OBJECT_COMPAT_PROPERTY(containingClass, type, name, callback)
QObjectComputedProperty()=default
parameter_type value() const
QPropertyBinding(const QUntypedPropertyBinding &binding)
QPropertyBinding()=default
QPropertyBinding(Functor &&f, const QPropertyBindingSourceLocation &location)
static constexpr bool UseReferences
void setValueBypassingBindings(parameter_type v)
Sets the data value stored in this property to v.
QPropertyData(parameter_type t)
parameter_type valueBypassingBindings() const
Returns the data stored in this property.
@ ObserverNotifiesBinding
@ ObserverNotifiesChangeHandler
QUntypedPropertyData * aliasData
void(*)(QPropertyObserver *, QUntypedPropertyData *) ChangeHandler
ChangeHandler changeHandler
QPropertyBindingPrivate * binding
typename QPropertyData< T >::arrow_operator_result arrow_operator_result
QProperty(rvalue_ref initialValue)
void setValue(rvalue_ref newValue)
typename QPropertyData< T >::value_type value_type
QPropertyChangeHandler< Functor > subscribe(Functor f)
QPropertyBinding< T > takeBinding()
Disassociates the binding expression from this property and returns it.
bool setBinding(const QUntypedPropertyBinding &newBinding)
This is an overloaded member function, provided for convenience. It differs from the above function o...
friend void operator!=(const QProperty &, const QProperty< U > &) QPROPERTY_DECL_DELETED_EQ_OP
QPropertyNotifier addNotifier(Functor f)
typename QPropertyData< T >::rvalue_ref rvalue_ref
QPropertyChangeHandler< Functor > onValueChanged(Functor f)
Registers the given functor f as a callback that shall be called whenever the value of the property c...
QPropertyBinding< T > setBinding(Functor &&f, const QPropertyBindingSourceLocation &location=QT_PROPERTY_DEFAULT_BINDING_LOCATION, std::enable_if_t< std::is_invocable_v< Functor > > *=nullptr)
void setValue(parameter_type newValue)
Assigns newValue to this property and removes the property's associated binding, if present.
QProperty()=default
Constructs a property with a default constructed instance of T.
QProperty(const QPropertyBinding< T > &binding)
Constructs a property that is tied to the provided binding expression.
parameter_type value() const
Returns the value of the property.
QPropertyBinding< T > setBinding(const QPropertyBinding< T > &newBinding)
Associates the value of this property with the provided newBinding expression and returns the previou...
QProperty(Functor &&f, const QPropertyBindingSourceLocation &location=QT_PROPERTY_DEFAULT_BINDING_LOCATION, typename std::enable_if_t< std::is_invocable_r_v< T, Functor & > > *=nullptr)
const QtPrivate::QPropertyBindingData & bindingData() const
typename QPropertyData< T >::parameter_type parameter_type
QProperty< T > & operator=(rvalue_ref newValue)
arrow_operator_result operator->() const
QProperty< T > & operator=(parameter_type newValue)
Assigns newValue to this property and returns a reference to this QProperty.
QPropertyBinding< T > binding() const
Returns the binding expression that is associated with this property.
parameter_type operator*() const
operator parameter_type() const
~QProperty()=default
Destroys the property.
QProperty(parameter_type initialValue)
RAII class around Qt::beginPropertyUpdateGroup()/QtendPropertyUpdateGroup().
~QTimerPrivate() override
QTimerPrivate(QTimer *qq)
void setIntervalDuration(std::chrono::nanoseconds nsec)
static constexpr int INV_TIMER
void setInterval(int msec)
QTimerPrivate(std::chrono::nanoseconds nsec, QChronoTimer *qq)
QUntypedPropertyBinding binding() const
Returns the underlying property's binding if there is any, or a default constructed QUntypedPropertyB...
QUntypedPropertyBinding makeBinding(const QPropertyBindingSourceLocation &location=QT_PROPERTY_DEFAULT_BINDING_LOCATION) const
Creates a binding returning the underlying properties' value, using a specified source location.
bool hasBinding() const
Returns true if the underlying property has a binding.
constexpr QUntypedBindable()=default
Default-constructs a QUntypedBindable.
QMetaType metaType() const
const QtPrivate::QBindableInterface * iface
QPropertyChangeHandler< Functor > onValueChanged(Functor f) const
Installs f as a change handler.
QUntypedPropertyBinding takeBinding()
Removes the currently set binding from the property and returns it.
QPropertyNotifier addNotifier(Functor f)
Installs f as a change handler.
QUntypedPropertyData * data
bool isValid() const
Returns true if the QUntypedBindable is valid.
bool setBinding(const QUntypedPropertyBinding &binding)
Sets the underlying property's binding to binding.
QUntypedBindable(Property *p)
Constructs a QUntypedBindable from the property property.
QPropertyChangeHandler< Functor > subscribe(Functor f) const
Behaves like a call to f followed by onValueChanged(f),.
constexpr QUntypedBindable(QUntypedPropertyData *d, const QtPrivate::QBindableInterface *i)
void observe(QPropertyObserver *observer) const
static constexpr QBindableInterface iface
QPrivateSlotObject(Func f)
QPropertyBindingData & bindingData()
friend class QT_PREPEND_NAMESPACE(QUntypedBindable)
const QMetaProperty & metaProperty() const
static QPropertyAdaptorSlotObject * cast(QSlotObjectBase *ptr, int propertyIndex)
const QPropertyBindingData & bindingData() const
const T & const_reference()
constexpr bool has_ostream_operator_v
constexpr bool is_dereferenceable_v
constexpr bool has_operator_equal_v
constexpr bool has_stream_operator_v
constexpr bool has_operator_compare_three_way_v
constexpr bool has_istream_operator_v
std::disjunction< std::is_base_of< Container, T >, QTypeTraits::has_operator_equal< T > > has_operator_equal_container
std::disjunction< std::is_base_of< Container, T >, QTypeTraits::has_operator_less_than< T > > has_operator_less_than_container
constexpr bool has_operator_compare_three_way_with_v
constexpr bool has_operator_less_than_v
void printMetaTypeMismatch(QMetaType actual, QMetaType expected)
void printUnsuitableBindableWarning(QAnyStringView prefix, BindableWarnings::Reason reason)
void setter(QUntypedPropertyData *d, const void *value)
void getter(const QUntypedPropertyData *d, void *value)
bool bindingWrapper(QMetaType type, QUntypedPropertyData *d, QtPrivate::QPropertyBindingFunction binding, QUntypedPropertyData *temp, void *value)
QUntypedPropertyBinding setBinding(QUntypedPropertyData *d, const QUntypedPropertyBinding &binding)
constexpr QBindableInterface iface
bool bindingWrapper(QMetaType type, QUntypedPropertyData *d, QtPrivate::QPropertyBindingFunction binding)
QUntypedPropertyBinding makeBinding(const QUntypedPropertyData *d, const QPropertyBindingSourceLocation &location)
void setObserver(const QUntypedPropertyData *d, QPropertyObserver *observer)
void assertObjectType(QObjectPrivate *d)
Q_CORE_EXPORT bool isAnyBindingEvaluating()
Q_CORE_EXPORT void restoreBindingStatus(BindingEvaluationState *status)
constexpr bool is_standard_or_extended_integer_type_v
const QObject * getQObject(const QObjectPrivate *d)
Q_CORE_EXPORT bool isPropertyInBindingWrapper(const QUntypedPropertyData *property)
auto makePropertyBinding(Functor &&f, const QPropertyBindingSourceLocation &location=QT_PROPERTY_DEFAULT_BINDING_LOCATION, std::enable_if_t< std::is_invocable_v< Functor > > *=nullptr)
Q_CORE_EXPORT void beginPropertyUpdateGroup()
QPropertyBinding< PropertyType > makePropertyBinding(const QProperty< PropertyType > &otherProperty, const QPropertyBindingSourceLocation &location=QT_PROPERTY_DEFAULT_BINDING_LOCATION)
Q_CORE_EXPORT void endPropertyUpdateGroup()
#define QT_CONCAT(B, M, m, u)
QBindingStorage * qGetBindingStorage(QObjectPrivate *o)
QBindingStorage * qGetBindingStorage(QObjectPrivate::ExtraData *ed)
const QBindingStorage * qGetBindingStorage(const QObjectPrivate *o)
#define QPROPERTY_DECL_DELETED_EQ_OP
#define Q_OBJECT_BINDABLE_PROPERTY_WITH_ARGS(...)
#define QT_PROPERTY_DEFAULT_BINDING_LOCATION
#define Q_OBJECT_COMPUTED_PROPERTY(Class, Type, name, ...)
#define Q_OBJECT_COMPAT_PROPERTY_WITH_ARGS(...)
constexpr T qExchange(T &t, U &&newValue) noexcept(std::conjunction_v< std::is_nothrow_move_constructible< T >, std::is_nothrow_assignable< T &, U > >)
QBindingObserverPtr()=default
QPropertyObserver * operator->()
QPropertyBindingPrivate * binding() const noexcept
static QPropertyProxyBindingData * proxyData(QtPrivate::QPropertyBindingData *ptr)
static void fixupAfterMove(QtPrivate::QPropertyBindingData *ptr)
Q_ALWAYS_INLINE void addObserver(QPropertyObserver *observer)
const QtPrivate::QPropertyBindingData * ptr
int observerCount() const
static QPropertyBindingDataPointer get(QProperty< T > &property)
QPropertyBindingPrivate * binding() const
void setObservers(QPropertyObserver *observer)
QPropertyObserverPointer firstObserver() const
void setFirstObserver(QPropertyObserver *observer)
~QPropertyObserverNodeProtector()
QPropertyObserver * next() const
void noSelfDependencies(QPropertyBindingPrivate *binding)
void notify(QUntypedPropertyData *propertyDataPtr)
QPropertyBindingPrivate * binding() const
void evaluateBindings(PendingBindingObserverList &bindingObservers, QBindingStatus *status)
void observeProperty(QPropertyBindingDataPointer property)
QPropertyObserverPointer nextObserver() const
void setBindingToNotify_unsafe(QPropertyBindingPrivate *binding)
void setChangeHandler(QPropertyObserver::ChangeHandler changeHandler)
void setBindingToNotify(QPropertyBindingPrivate *binding)
void(* BeginCallback)(QObject *caller, int signal_or_method_index, void **argv)
BeginCallback slot_begin_callback
EndCallback slot_end_callback
EndCallback signal_end_callback
BeginCallback signal_begin_callback
void(* EndCallback)(QObject *caller, int signal_or_method_index)
static QtPrivate::QBindableInterface const * getInterface(const QUntypedBindable &bindable)
static QUntypedPropertyData * getPropertyData(const QUntypedBindable &bindable)
QPropertyBindingPrivate * binding
QVarLengthArray< const QPropertyBindingData *, 8 > alreadyCaptureProperties
BindingEvaluationState(QPropertyBindingPrivate *binding, QBindingStatus *status)
BindingEvaluationState * previousState
~BindingEvaluationState()
BindingEvaluationState ** currentState
QtPrivate::BindingEvaluationState ** currentlyEvaluatingBindingList
CompatPropertySafePoint * previousState
CompatPropertySafePoint ** currentState
~CompatPropertySafePoint()
QUntypedPropertyData * property
QtPrivate::BindingEvaluationState * bindingState
void(*)(const QUntypedPropertyData *d, void *value) Getter
void(*)(const QUntypedPropertyData *d, QPropertyObserver *observer) SetObserver
void(*)(QUntypedPropertyData *d, const void *value) Setter
static constexpr quintptr MetaTypeAccessorFlag