libQuotient
A Qt library for building matrix clients
Quotient::ConnectionsGuard< T > Class Template Reference

A guard pointer that disconnects an interested object upon destruction. More...

#include <qt_connection_util.h>

Inheritance diagram for Quotient::ConnectionsGuard< T >:
Collaboration diagram for Quotient::ConnectionsGuard< T >:

Public Member Functions

 ConnectionsGuard (T *publisher, QObject *subscriber)
 
 ~ConnectionsGuard ()
 
 ConnectionsGuard (ConnectionsGuard &&)=default
 
ConnectionsGuardoperator= (ConnectionsGuard &&)=default
 

Detailed Description

template<typename T>
class Quotient::ConnectionsGuard< T >

A guard pointer that disconnects an interested object upon destruction.

It's almost QPointer<> except that you have to initialise it with one more additional parameter - a pointer to a QObject that will be disconnected from signals of the underlying pointer upon the guard's destruction. Note that destructing the guard doesn't destruct either QObject.

Definition at line 58 of file qt_connection_util.h.

Constructor & Destructor Documentation

◆ ConnectionsGuard() [1/2]

template<typename T >
Quotient::ConnectionsGuard< T >::ConnectionsGuard ( T *  publisher,
QObject *  subscriber 
)
inline

Definition at line 60 of file qt_connection_util.h.

◆ ~ConnectionsGuard()

template<typename T >
Quotient::ConnectionsGuard< T >::~ConnectionsGuard ( )
inline

Definition at line 63 of file qt_connection_util.h.

◆ ConnectionsGuard() [2/2]

template<typename T >
Quotient::ConnectionsGuard< T >::ConnectionsGuard ( ConnectionsGuard< T > &&  )
default

Member Function Documentation

◆ operator=()

template<typename T >
ConnectionsGuard& Quotient::ConnectionsGuard< T >::operator= ( ConnectionsGuard< T > &&  )
default

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