38 inline operator bool()
const {
return static_cast<bool>(mConnection); }
42template<
typename Po
interToMemberFunction,
typename Functor>
45 return QObject::connect(sender, std::forward<PointerToMemberFunction>(signal), std::forward<Functor>(functor));
51 std::conditional_t<std::is_class_v<target_type<T>>,
target_type<T>*,
void>>;
56template<arrowable_container_type T>
59 if constexpr(defines_member_ptr<T> || std::is_pointer_v<T>)
72template<
typename... Functors>
74 using Functors::operator()...;
93typename std::add_const<T>::type
qxAsConst(T& t) {
return qAsConst(t); }
The ScopedConnection class disconnects a connection when it goes out of scope.
Definition qx-helpers.h:20
~ScopedConnection()
Definition qx-helpers.h:33
ScopedConnection(ScopedConnection &&other)=default
ScopedConnection(const QMetaObject::Connection &connection)
Definition qx-helpers.h:28
ScopedConnection & operator=(ScopedConnection &&other)=default
Definition qx-helpers.h:54
The Qx namespace is the main namespace through which all non-global functionality of the Qx library i...
Definition qx-abstracterror.cpp:13
container_arrow_result< T > container_arrow_operator(T &data)
Definition qx-helpers.h:57
std::conditional_t< defines_member_ptr< T >, T &, std::conditional_t< std::is_class_v< target_type< T > >, target_type< T > *, void > > container_arrow_result
Definition qx-helpers.h:50
std::remove_pointer_t< std::remove_reference_t< T > > target_type
Definition qx-typetraits.h:22
ScopedConnection scopedConnect(const QObject *sender, PointerToMemberFunction signal, Functor &&functor)
Definition qx-helpers.h:43
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
bool disconnect(const QMetaObject::Connection &connection)
The qx-concepts header file provides a library of general purpose concepts as an extension of the sta...
void qxDelete(T *&pointer)
Definition qx-helpers.h:96
const T qxAsConst(T &&t)
Definition qx-helpers.h:90
The qx-typetraits header file provides a library of general purpose type-traits as an extension of th...
Definition qx-helpers.h:73