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>
141struct has_operator_equal<T, std::void_t<
decltype(
bool(std::declval<
const T&>() == std::declval<
const T&>()))>>
149struct expand_operator_equal_tuple;
156template<
typename T,
bool>
157struct expand_operator_equal_container : expand_operator_equal_tuple<T> {};
160struct expand_operator_equal_container<T,
true> :
163 std::is_same<T,
typename T::value_type>,
164 expand_operator_equal<
typename T::value_type>
165 >, expand_operator_equal_tuple<T>> {};
168template<
typename ...
T>
172struct expand_operator_equal_tuple : has_operator_equal<T> {};
174struct expand_operator_equal_tuple<
std::optional<T>> : expand_operator_equal_recursive<T> {};
175template<
typename T1,
typename T2>
176struct expand_operator_equal_tuple<
std::pair<T1, T2>> : expand_operator_equal_recursive<T1, T2> {};
177template<
typename ...T>
178struct expand_operator_equal_tuple<
std::tuple<T...>> : expand_operator_equal_recursive<T...> {};
179template<
typename ...T>
180struct expand_operator_equal_tuple<
std::variant<T...>> : expand_operator_equal_recursive<T...> {};
183template <
typename,
typename =
void>
189template<
typename T,
bool = is_container<T>::value>
190struct expand_operator_less_than_container;
192struct expand_operator_less_than_tuple;
197template<
typename T,
bool>
198struct expand_operator_less_than_container : expand_operator_less_than_tuple<T> {};
200struct expand_operator_less_than_container<T,
true> :
203 std::is_same<T,
typename T::value_type>,
204 expand_operator_less_than<
typename T::value_type>
205 >, expand_operator_less_than_tuple<T>
208template<
typename ...
T>
212struct expand_operator_less_than_tuple : has_operator_less_than<T> {};
214struct expand_operator_less_than_tuple<
std::optional<T>> : expand_operator_less_than_recursive<T> {};
215template<
typename T1,
typename T2>
216struct expand_operator_less_than_tuple<
std::pair<T1, T2>> : expand_operator_less_than_recursive<T1, T2> {};
217template<
typename ...T>
218struct expand_operator_less_than_tuple<
std::tuple<T...>> : expand_operator_less_than_recursive<T...> {};
219template<
typename ...T>
220struct expand_operator_less_than_tuple<
std::variant<T...>> : expand_operator_less_than_recursive<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.
QPropertyNotifier addNotifier(Functor f)
Subscribes the given functor f as a callback that is called whenever the value of the property change...
QObjectBindableProperty(const T &initialValue)
Constructs a property with the provided initialValue.
QObjectBindableProperty()=default
void notify()
Programmatically signals a change of the property.
QPropertyChangeHandler< Functor > onValueChanged(Functor f)
Registers the given functor f as a callback that shall be called whenever the value of the property c...
QObjectBindableProperty(T &&initialValue)
Move-Constructs a property with the provided initialValue.
parameter_type value() const
Returns the value of the property.
bool setBinding(const QUntypedPropertyBinding &newBinding)
This is an overloaded member function, provided for convenience. It differs from the above function o...
operator parameter_type() const
void setValue(rvalue_ref t)
Assigns newValue to this property and removes the property's associated binding, if present.
QPropertyBinding< T > takeBinding()
Disassociates the binding expression from this property and returns it.
arrow_operator_result operator->() const
const QtPrivate::QPropertyBindingData & bindingData() const
parameter_type operator*() const
QObjectBindableProperty(Functor &&f, const QPropertyBindingSourceLocation &location=QT_PROPERTY_DEFAULT_BINDING_LOCATION, typename std::enable_if_t< std::is_invocable_r_v< T, Functor & > > *=nullptr)
void setValue(parameter_type t)
QPropertyBinding< T > setBinding(const QPropertyBinding< T > &newBinding)
Associates the value of this property with the provided newBinding expression and returns the previou...
QObjectBindableProperty(const QPropertyBinding< T > &binding)
QPropertyBinding< T > binding() const
Returns the binding expression that is associated with this property.
bool hasBinding() const
Returns true if the property is associated with a binding; false otherwise.
QObjectBindableProperty & operator=(rvalue_ref newValue)
QPropertyBinding< T > setBinding(Functor &&f, const QPropertyBindingSourceLocation &location=QT_PROPERTY_DEFAULT_BINDING_LOCATION, std::enable_if_t< std::is_invocable_v< Functor > > *=nullptr)
QObjectBindableProperty & operator=(parameter_type newValue)
QPropertyChangeHandler< Functor > subscribe(Functor f)
Subscribes the given functor f as a callback that is called immediately and whenever the value of the...
\macro Q_OBJECT_BINDABLE_PROPERTY(containingClass, type, name, signal)
QPropertyBinding< T > binding() const
operator parameter_type() const
QtPrivate::QPropertyBindingData & bindingData() const
QObjectCompatProperty & operator=(parameter_type newValue)
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)
Q_NODISCARD_CTOR QPropertyChangeHandler(Functor handler)
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
ChangeHandler changeHandler
QPropertyBindingPrivate * binding
QProperty(rvalue_ref initialValue)
void setValue(rvalue_ref newValue)
QPropertyChangeHandler< Functor > subscribe(Functor f)
Subscribes the given functor f as a callback that is called immediately and whenever the value of the...
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...
QPropertyNotifier addNotifier(Functor f)
Subscribes the given functor f as a callback that is called whenever the value of the property change...
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
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()/Qt::endPropertyUpdateGroup().
~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
Combined button and popup list for selecting options.
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
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 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)
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
static constexpr quintptr MetaTypeAccessorFlag