Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
QPropertyNotifier Class Reference

\inmodule QtCore More...

#include <qproperty.h>

+ Inheritance diagram for QPropertyNotifier:
+ Collaboration diagram for QPropertyNotifier:

Public Member Functions

Q_NODISCARD_CTOR QPropertyNotifier ()=default
 
template<typename Functor >
Q_NODISCARD_CTOR QPropertyNotifier (Functor handler)
 
template<typename Functor , typename Property , typename = typename Property::InheritsQUntypedPropertyData>
Q_NODISCARD_CTOR QPropertyNotifier (const Property &property, Functor handler)
 
- Public Member Functions inherited from QPropertyObserver
constexpr QPropertyObserver ()=default
 
 QPropertyObserver (QPropertyObserver &&other) noexcept
 
QPropertyObserveroperator= (QPropertyObserver &&other) noexcept
 
 ~QPropertyObserver ()
 
template<typename Property , typename = typename Property::InheritsQUntypedPropertyData>
void setSource (const Property &property)
 
void setSource (const QtPrivate::QPropertyBindingData &property)
 

Additional Inherited Members

- Public Types inherited from QPropertyObserverBase
enum  ObserverTag { ObserverNotifiesBinding , ObserverNotifiesChangeHandler , ObserverIsPlaceholder }
 
- Protected Types inherited from QPropertyObserverBase
using ChangeHandler = void(*)(QPropertyObserver *, QUntypedPropertyData *)
 
- Protected Member Functions inherited from QPropertyObserver
 QPropertyObserver (ChangeHandler changeHandler)
 
QUntypedPropertyDataaliasedProperty () const
 

Detailed Description

\inmodule QtCore

The QPropertyNotifier class controls the lifecycle of change callback installed on a QProperty.

QPropertyNotifier is created when registering a callback on a QProperty to listen to changes to the property's value, using QProperty::addNotifier. As long as the change handler is alive, the callback remains installed.

A handler instance can be transferred between C++ scopes using move semantics.

Definition at line 317 of file qproperty.h.

Constructor & Destructor Documentation

◆ QPropertyNotifier() [1/3]

Q_NODISCARD_CTOR QPropertyNotifier::QPropertyNotifier ( )
default

◆ QPropertyNotifier() [2/3]

template<typename Functor >
Q_NODISCARD_CTOR QPropertyNotifier::QPropertyNotifier ( Functor  handler)
inline

Definition at line 325 of file qproperty.h.

◆ QPropertyNotifier() [3/3]

template<typename Functor , typename Property , typename = typename Property::InheritsQUntypedPropertyData>
Q_NODISCARD_CTOR QPropertyNotifier::QPropertyNotifier ( const Property &  property,
Functor  handler 
)
inline

Definition at line 336 of file qproperty.h.


The documentation for this class was generated from the following file: