25 using QObject::QObject;
31 virtual void run () = 0;
78 template<
typename FireDestrPolicy>
80 ,
public FireDestrPolicy
83 using FunType_t = std::function<typename FireDestrPolicy::Signature_t>;
145 const std::initializer_list<const char*>& signalsList,
150 for (
const auto signal : signalsList)
161 FireDestrPolicy::Invoke (Func_,
this);
162 FireDestrPolicy::Fired (
this);
186 base->deleteLater ();
229 base->deleteLater ();
SlotClosure(const FunType_t &func, QObject *sender, const char *signal, QObject *parent)
Constructs a SlotClosure running a given func with the given parent as a QObject on the given signal...
virtual ~BasicDeletePolicy()=default
Does not delete a SlotClosure object.
Base class for SlotClosure.
Delete
Whether the SlotClosure shall be deleted.
static void Fired(SlotClosureBase *)
std::function< typename FireDestrPolicy::Signature_t > FunType_t
static void Fired(SlotClosureBase *)
constexpr detail::ExprTree< detail::ExprType::LeafStaticPlaceholder, detail::MemberPtrs< Ptr > > f
SlotClosure(const FunType_t &func, QObject *sender, const std::initializer_list< const char *> &signalsList, QObject *parent)
Constructs a SlotClosure running a given func with the given parent as a QObject on the given signals...
Executes a given functor upon a signal (or a list of signals).
Delegates the SlotClosure deletion decision to the signal handler.
void Invoke(const std::function< Signature_t > &f, SlotClosureBase *)
virtual ~ChoiceDeletePolicy()
SlotClosure(const FunType_t &func, QObject *parent)
Constructs a SlotClosure running a given func with the given parent as a QObject. ...
void run() override
Triggers the function and invokes the destroy policy.
static void Fired(SlotClosureBase *base)
Delete SlotClosure after this invocation.
static void Invoke(const std::function< Signature_t > &f, SlotClosureBase *base)
Deletes a SlotClosure object after its signal has fired.
Do not delete SlotClosure after this invocation.