13#include <rpp/subjects/publish_subject.hpp>
15#include <rppqt/sources/fwd.hpp>
20namespace rppqt::details
22 template<
typename... Args>
27 decltype(std::declval<subject>().get_observer()) observer;
29 template<
typename... Vals>
30 void operator()(Vals&&... vals)
const
32 observer.on_next(std::make_tuple(std::forward<Vals>(vals)...));
36 template<
typename Arg>
40 decltype(std::declval<subject>().get_observer()) observer;
42 template<rpp::constra
int::decayed_same_as<Arg> Val>
43 void operator()(Val&& val)
const
45 observer.on_next(std::forward<Val>(val));
53 decltype(std::declval<subject>().get_observer()) observer;
55 void operator()()
const
62namespace rppqt::source
75 template<std::derived_from<QObject> TSignalQObject, std::derived_from<TSignalQObject> TObject,
typename R,
typename... Args>
76 auto from_signal(
const TObject&
object, R (TSignalQObject::*signal)(Args...))
79 const auto subj =
typename on_next_impl::subject{};
81 QObject::connect(&
object, signal, on_next_impl{subj.get_observer()});
82 QObject::connect(&
object, &QObject::destroyed, [observer = subj.get_observer()] { observer.on_completed(); });
84 return subj.get_observable();
Subject which just multicasts values to observers subscribed on it. It contains two parts: observer a...
Definition publish_subject.hpp:81
auto from_signal(const TObject &object, R(TSignalQObject::*signal)(Args...))
Creates rpp::observable that emits a items from provided QT signal.
Definition from_signal.hpp:76
Definition from_signal.hpp:24