QtBase  v6.3.1
Public Member Functions | Public Attributes | Protected Member Functions | List of all members
NotifyObject Class Reference
Inheritance diagram for NotifyObject:
Inheritance graph
[legend]
Collaboration diagram for NotifyObject:
Collaboration graph
[legend]

Public Member Functions

 NotifyObject ()
 
void clearNotifications ()
 
- Public Member Functions inherited from SenderObject
 SenderObject ()
 
void emitSignal1AfterRecursion ()
 
void emitSignal1 ()
 
void emitSignal2 ()
 
void emitSignal3 ()
 
void emitSignal4 ()
 
Q_INVOKABLE void invoke1 ()
 
Q_SCRIPTABLE void sinvoke1 ()
 
void emitNoArg ()
 
void emitIntArg (int value)
 
void emitConstRefArg (const QString &value)
 
void emitMultipleArgs (int value1, double value2, const QString &value3)
 
void emitTupleArgSignal (const std::tuple< int, double, QString > &t)
 
void emitMultiArgsWithTupleSignal1 (int value, const std::tuple< int, double, QString > &t)
 
void emitMultiArgsWithTupleSignal2 (const std::tuple< int, double, QString > &t, int value)
 
void emitMultiArgsWithPairSignal1 (int value, const std::pair< int, double > &p)
 
void emitMultiArgsWithPairSignal2 (const std::pair< int, double > &p, int value)
 
void emitNoArgPrivateSignal ()
 
void emitIntArgPrivateSignal (int value)
 
void emitMultiArgsPrivateSignal (int value1, double value2, const QString &value3)
 
void emitTupleArgPrivateSignal (const std::tuple< int, double, QString > &t)
 
void emitMultiArgsWithTuplePrivateSignal1 (int value, const std::tuple< int, double, QString > &t)
 
void emitMultiArgsWithTuplePrivateSignal2 (const std::tuple< int, double, QString > &t, int value)
 
void emitMultiArgsWithPairPrivateSignal1 (int value, const std::pair< int, double > &p)
 
void emitMultiArgsWithPairPrivateSignal2 (const std::pair< int, double > &p, int value)
 
- Public Member Functions inherited from QObject
Q_INVOKABLE QObject (QObject *parent=nullptr)
 
virtual ~QObject ()
 
virtual bool event (QEvent *event)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
QString objectName () const
 
void setObjectName (const QString &name)
 
QBindable< QStringbindableObjectName ()
 
bool isWidgetType () const
 
bool isWindowType () const
 
bool signalsBlocked () const noexcept
 
bool blockSignals (bool b) noexcept
 
QThreadthread () const
 
void moveToThread (QThread *thread)
 
int startTimer (int interval, Qt::TimerType timerType=Qt::CoarseTimer)
 
void killTimer (int id)
 
template<typename T >
T findChild (const QString &aName=QString(), Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 
template<typename T >
QList< TfindChildren (const QString &aName, Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 
template<typename T >
QList< TfindChildren (Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 
const QObjectListchildren () const
 
void setParent (QObject *parent)
 
void installEventFilter (QObject *filterObj)
 
void removeEventFilter (QObject *obj)
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const char *member, Qt::ConnectionType type=Qt::AutoConnection) const
 
bool disconnect (const char *signal=nullptr, const QObject *receiver=nullptr, const char *member=nullptr) const
 
bool disconnect (const QObject *receiver, const char *member=nullptr) const
 
void dumpObjectTree () const
 
void dumpObjectInfo () const
 
bool setProperty (const char *name, const QVariant &value)
 
QVariant property (const char *name) const
 
QList< QByteArraydynamicPropertyNames () const
 
QBindingStoragebindingStorage ()
 
const QBindingStoragebindingStorage () const
 
QObjectparent () const
 
bool inherits (const char *classname) const
 
- Public Member Functions inherited from ReceiverObject
 ReceiverObject ()
 
void reset ()
 
bool called (int slot)
 

Public Attributes

QList< QMetaMethodconnectedSignals
 
QList< QMetaMethoddisconnectedSignals
 
- Public Attributes inherited from SenderObject
int aPublicSlotCalled
 
- Public Attributes inherited from ReceiverObject
int sequence_slot1
 
int sequence_slot2
 
int sequence_slot3
 
int sequence_slot4
 
int count_slot1
 
int count_slot2
 
int count_slot3
 
int count_slot4
 

Protected Member Functions

void connectNotify (const QMetaMethod &signal) override
 
void disconnectNotify (const QMetaMethod &signal) override
 
- Protected Member Functions inherited from SenderObject
Q_INVOKABLE QT_MOC_COMPAT void invoke2 ()
 
Q_INVOKABLE QT_MOC_COMPAT void invoke2 (int)
 
Q_SCRIPTABLE QT_MOC_COMPAT void sinvoke2 ()
 
- Protected Member Functions inherited from QObject
QObjectsender () const
 
int senderSignalIndex () const
 
int receivers (const char *signal) const
 
bool isSignalConnected (const QMetaMethod &signal) const
 
virtual void timerEvent (QTimerEvent *event)
 
virtual void childEvent (QChildEvent *event)
 
virtual void customEvent (QEvent *event)
 
 QObject (QObjectPrivate &dd, QObject *parent=nullptr)
 

Additional Inherited Members

- Public Slots inherited from SenderObject
void aPublicSlot ()
 
- Public Slots inherited from QObject
void deleteLater ()
 
- Public Slots inherited from ReceiverObject
void slot1 ()
 
void slot2 ()
 
void slot3 ()
 
void slot4 ()
 
- Signals inherited from SenderObject
void signal1 ()
 
void signal2 ()
 
void signal3 ()
 
void signal4 ()
 
QT_MOC_COMPAT void signal5 ()
 
void signal6 (void)
 
void signal7 (int, const QString &)
 
void noArgSignal ()
 
void intArgSignal (int value)
 
void constRefArg (const QString &value)
 
void multipleArgs (int value1, double value2, const QString &value3)
 
void tupleArgSignal (const std::tuple< int, double, QString > &t)
 
void multiArgsWithTupleSignal1 (int value, const std::tuple< int, double, QString > &t)
 
void multiArgsWithTupleSignal2 (const std::tuple< int, double, QString > &t, int value)
 
void multiArgsWithPairSignal1 (int value, const std::pair< int, double > &p)
 
void multiArgsWithPairSignal2 (const std::pair< int, double > &p, int value)
 
void noArgPrivateSignal (QPrivateSignal)
 
void intArgPrivateSignal (int value, QPrivateSignal)
 
void multiArgsPrivateSignal (int value1, double value2, const QString &value3, QPrivateSignal)
 
void tupleArgPrivateSignal (const std::tuple< int, double, QString > &t, QPrivateSignal)
 
void multiArgsWithTuplePrivateSignal1 (int value, const std::tuple< int, double, QString > &t, QPrivateSignal)
 
void multiArgsWithTuplePrivateSignal2 (const std::tuple< int, double, QString > &t, int value, QPrivateSignal)
 
void multiArgsWithPairPrivateSignal1 (int value, const std::pair< int, double > &p, QPrivateSignal)
 
void multiArgsWithPairPrivateSignal2 (const std::pair< int, double > &p, int value, QPrivateSignal)
 
- Signals inherited from QObject
void destroyed (QObject *=nullptr)
 
void objectNameChanged (const QString &objectName, QPrivateSignal)
 
- Static Public Member Functions inherited from QObject
static QMetaObject::Connection connect (const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
 
static QMetaObject::Connection connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type=Qt::AutoConnection)
 
template<typename Func1 , typename Func2 >
static QMetaObject::Connection connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiver, Func2 slot, Qt::ConnectionType type=Qt::AutoConnection)
 
static QMetaObject::Connection ::type connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, Func2 slot)
 
static QMetaObject::Connection ::type connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const QObject *context, Func2 slot, Qt::ConnectionType type=Qt::AutoConnection)
 
template<typename Func1 , typename Func2 >
static std::enable_if< QtPrivate::FunctionPointer< Func2 >::ArgumentCount==-1 &&!std::is_convertible_v< Func2, const char * >, QMetaObject::Connection >::type connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, Func2 slot)
 
template<typename Func1 , typename Func2 >
static std::enable_if< QtPrivate::FunctionPointer< Func2 >::ArgumentCount==-1 &&!std::is_convertible_v< Func2, const char * >, QMetaObject::Connection >::type connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const QObject *context, Func2 slot, Qt::ConnectionType type=Qt::AutoConnection)
 
static bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *member)
 
static bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &member)
 
static bool disconnect (const QMetaObject::Connection &)
 
template<typename Func1 , typename Func2 >
static bool disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiver, Func2 slot)
 
template<typename Func1 >
static bool disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const QObject *receiver, void **zero)
 
- Static Public Attributes inherited from ReceiverObject
static int sequence = 0
 
- Protected Attributes inherited from QObject
QScopedPointer< QObjectDatad_ptr
 
- Properties inherited from QObject
QString objectName
 the name of this object More...
 

Detailed Description

Definition at line 782 of file tst_qobject.cpp.

Constructor & Destructor Documentation

◆ NotifyObject()

NotifyObject::NotifyObject ( )
inline

Definition at line 785 of file tst_qobject.cpp.

Member Function Documentation

◆ clearNotifications()

void NotifyObject::clearNotifications ( )
inline

Definition at line 790 of file tst_qobject.cpp.

Here is the call graph for this function:

◆ connectNotify()

void NotifyObject::connectNotify ( const QMetaMethod signal)
inlineoverrideprotectedvirtual
Since
5.0

This virtual function is called when something has been connected to signal in this object.

If you want to compare signal with a specific signal, you can use QMetaMethod::fromSignal() as follows:

Warning
This function violates the object-oriented principle of modularity. However, it might be useful when you need to perform expensive initialization only if something is connected to a signal.
This function is called from the thread which performs the connection, which may be a different thread from the thread in which this object lives.
See also
connect(), disconnectNotify()

Reimplemented from QObject.

Definition at line 796 of file tst_qobject.cpp.

Here is the call graph for this function:

◆ disconnectNotify()

void NotifyObject::disconnectNotify ( const QMetaMethod signal)
inlineoverrideprotectedvirtual
Since
5.0

This virtual function is called when something has been disconnected from signal in this object.

See connectNotify() for an example of how to compare signal with a specific signal.

If all signals were disconnected from this object (e.g., the signal argument to disconnect() was \nullptr), disconnectNotify() is only called once, and the signal will be an invalid QMetaMethod (QMetaMethod::isValid() returns false).

Warning
This function violates the object-oriented principle of modularity. However, it might be useful for optimizing access to expensive resources.
This function is called from the thread which performs the disconnection, which may be a different thread from the thread in which this object lives. This function may also be called with a QObject internal mutex locked. It is therefore not allowed to re-enter any of any QObject functions from your reimplementation and if you lock a mutex in your reimplementation, make sure that you don't call QObject functions with that mutex held in other places or it will result in a deadlock.
See also
disconnect(), connectNotify()

Reimplemented from QObject.

Definition at line 798 of file tst_qobject.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ connectedSignals

QList<QMetaMethod> NotifyObject::connectedSignals

Definition at line 788 of file tst_qobject.cpp.

◆ disconnectedSignals

QList<QMetaMethod> NotifyObject::disconnectedSignals

Definition at line 789 of file tst_qobject.cpp.


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