34 #include <Pt/Function.h>
35 #include <Pt/Method.h>
36 #include <Pt/ConstMethod.h>
37 #include <Pt/Connectable.h>
42 class DelegateBase :
public Connectable
48 DelegateBase(
const DelegateBase& rhs)
49 { DelegateBase::operator=(rhs); }
51 DelegateBase&
operator=(
const DelegateBase& other)
55 if( other._target.isValid() )
57 const Slot* slot = other._target.slot();
58 _target = Connection( *
this, slot->clone() );
64 bool isConnected()
const
66 return _target.isValid();
69 virtual void onConnectionOpen(
const Connection& c)
79 Connectable::onConnectionOpen(c);
82 virtual void onConnectionClose(
const Connection& c)
84 Connectable::onConnectionClose(c);
93 void disconnectSlot(
const Slot& slot)
95 if( _target.isValid() && _target.slot()->equals(slot) )
105 #include <Pt/Delegate.tpp>
Endpoint of a signal/slot connection.
Definition: Slot.h:21
Connectable & operator=(const Connectable &rhs)
Assignment operator.
Connectable()
Default constructor.