6 #include <QtCore/QObject>
7 #include <QtCore/QPointer>
21 template <
typename SmartSlotT>
22 inline auto connectUntil(
auto* sender,
auto signal, QObject* context, SmartSlotT&& smartSlot,
25 auto* cHolder =
new QObject(context);
28 return QObject::connect(
29 sender, signal, cHolder,
30 [sl = std::forward<SmartSlotT>(smartSlot), cHolder]<
typename... Ts>
31 requires std::invocable<SmartSlotT, Ts...>
32 (
const Ts&... args)
mutable {
33 static_assert(std::is_same_v<
decltype(sl(args...)),
bool>);
41 template <
typename ContextT,
typename SlotT>
42 [[deprecated(
"Use QObject::connect() with Qt::SingleShotConnection, or QtFuture::connect()")]]
46 return QObject::connect(sender, signal, context, slot,
47 Qt::ConnectionType(connType | Qt::SingleShotConnection));
66 (*
this)->disconnect(subscriber);