Krita Source Code Documentation
Loading...
Searching...
No Matches
KisSignalAutoConnectionsStore Class Reference

#include <kis_signal_auto_connection.h>

Public Member Functions

template<class Sender , class Signal , class Receiver , class Method >
void addConnection (Sender sender, Signal signal, Receiver receiver, Method method, Qt::ConnectionType type=Qt::AutoConnection)
 
template<class Sender , class Signal , class Receiver , class Method >
void addUniqueConnection (Sender sender, Signal signal, Receiver receiver, Method method)
 
void clear ()
 
bool isEmpty ()
 

Private Attributes

QVector< KisSignalAutoConnectionSPm_connections
 

Detailed Description

A class to store multiple connections and to be able to stop all of them at once. It is handy when you need to reconnect some other object to the current manager. Then you just call connectionsStore.clear() and then call addConnection() again to recreate them.

Definition at line 70 of file kis_signal_auto_connection.h.

Member Function Documentation

◆ addConnection()

template<class Sender , class Signal , class Receiver , class Method >
void KisSignalAutoConnectionsStore::addConnection ( Sender sender,
Signal signal,
Receiver receiver,
Method method,
Qt::ConnectionType type = Qt::AutoConnection )
inline

Connects sender to receiver with a connection of type type. The connection is saved into the store so can be reset later with clear()

See also
addUniqueConnection()

Definition at line 80 of file kis_signal_auto_connection.h.

83 {
85 new KisSignalAutoConnection(sender, signal,
86 receiver, method, type)));
87 }
QVector< KisSignalAutoConnectionSP > m_connections
QSharedPointer< KisSignalAutoConnection > KisSignalAutoConnectionSP

References m_connections.

◆ addUniqueConnection()

template<class Sender , class Signal , class Receiver , class Method >
void KisSignalAutoConnectionsStore::addUniqueConnection ( Sender sender,
Signal signal,
Receiver receiver,
Method method )
inline

Convenience override for addConnection() that creates a unique connection

See also
addConnection()

Definition at line 95 of file kis_signal_auto_connection.h.

97 {
99 new KisSignalAutoConnection(sender, signal,
100 receiver, method, Qt::UniqueConnection)));
101 }

References m_connections.

◆ clear()

void KisSignalAutoConnectionsStore::clear ( )
inline

Disconnects all the stored connections and removes them from the store

Definition at line 106 of file kis_signal_auto_connection.h.

106 {
107 m_connections.clear();
108 }

References m_connections.

◆ isEmpty()

bool KisSignalAutoConnectionsStore::isEmpty ( )
inline

Definition at line 110 of file kis_signal_auto_connection.h.

110 {
111 return m_connections.isEmpty();
112 }

References m_connections.

Member Data Documentation

◆ m_connections

QVector<KisSignalAutoConnectionSP> KisSignalAutoConnectionsStore::m_connections
private

Definition at line 115 of file kis_signal_auto_connection.h.


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