46 using QObject::QObject;
52 virtual void run () = 0;
99 template<
typename FireDestrPolicy>
101 ,
public FireDestrPolicy
104 using FunType_t = std::function<typename FireDestrPolicy::Signature_t>;
166 const std::initializer_list<const char*>& signalsList,
171 for (
const auto signal : signalsList)
182 FireDestrPolicy::Invoke (Func_,
this);
183 FireDestrPolicy::Fired (
this);
207 base->deleteLater ();
250 base->deleteLater ();
virtual ~ChoiceDeletePolicy()
Deletes a SlotClosure object after its signal has fired.
constexpr detail::ExprTree< detail::ExprType::LeafStaticPlaceholder, detail::MemberPtrs< Ptr > > f
Delete SlotClosure after this invocation.
SlotClosure(const FunType_t &func, QObject *parent)
Constructs a SlotClosure running a given func with the given parent as a QObject. ...
virtual ~BasicDeletePolicy()=default
Executes a given functor upon a signal (or a list of signals).
static void Fired(SlotClosureBase *)
Do not delete SlotClosure after this invocation.
void Invoke(const std::function< Signature_t > &f, SlotClosureBase *)
Delete
Whether the SlotClosure shall be deleted.
static void Invoke(const std::function< Signature_t > &f, SlotClosureBase *base)
static void Fired(SlotClosureBase *)
Base class for SlotClosure.
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...
Delegates the SlotClosure deletion decision to the signal handler.
void run() override
Triggers the function and invokes the destroy policy.
std::function< typename FireDestrPolicy::Signature_t > FunType_t
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...
static void Fired(SlotClosureBase *base)
Does not delete a SlotClosure object.