53 struct FunctorEvent : QEvent
55 QPointer<QObject> context;
56 std::decay_t<Function> function;
58 FunctorEvent(QObject* context,
Function&& function) :
61 function(std::forward<Function>(function))
65 ~FunctorEvent()
override
74 if (QCoreApplication::instance() !=
nullptr)
76 QCoreApplication::postEvent(
77 QCoreApplication::instance(),
78 new FunctorEvent(context, std::forward<Function>(function)));