|
Krita Source Code Documentation
|
#include <kis_signal_auto_connection.h>
Public Member Functions | |
| template<class Sender , class Signal , class Receiver , class Method > | |
| KisSignalAutoConnection (Sender sender, Signal signal, Receiver receiver, Method method, Qt::ConnectionType type=Qt::AutoConnection) | |
| ~KisSignalAutoConnection () | |
Private Member Functions | |
| KisSignalAutoConnection (const KisSignalAutoConnection &rhs) | |
Private Attributes | |
| QMetaObject::Connection | m_connection |
A special wrapper class that represents a connection between two QObject objects. It creates the connection on the construction and disconnects it on destruction.
WARNING: never use QScopedPointer::reset() for updating the connection like:
QScopedPointer<KisSignalAutoConnection> conn; ... void Something::setCanvas(KoCanvasBase * canvas) { conn.reset(new KisSignalAutoConnection(...)); }
The object stored in a scoped pointer will be destructed after the new object created which will cause you object to become disconnected.
Instead use two-stage updates: conn.reset(); conn.reset(new KisSignalAutoConnection(...));
Definition at line 34 of file kis_signal_auto_connection.h.
|
inline |
Creates a connection object and starts the requested connection
Definition at line 41 of file kis_signal_auto_connection.h.
|
inline |
Definition at line 48 of file kis_signal_auto_connection.h.
References m_connection.
|
private |
|
private |
Definition at line 57 of file kis_signal_auto_connection.h.