|
Qx v0.7
Qt Extensions Library
|
The qx-concepts header file provides a set of various convenience functions that are are designed to facilitate common fundamental tasks with as brief syntax as possible.
#include <type_traits>#include <utility>#include <QMetaObject>#include <QObject>#include "qx/utility/qx-typetraits.h"#include "qx/utility/qx-concepts.h"Go to the source code of this file.
Classes | |
| struct | qxFuncAggregate< Functors > |
| class | Qx::ScopedConnection |
| The ScopedConnection class disconnects a connection when it goes out of scope. More... | |
Namespaces | |
| namespace | Qx |
The Qx namespace is the main namespace through which all non-global functionality of the Qx library is accessed. | |
Concepts | |
| concept | Qx::arrowable_container_type |
Typedefs | |
| template<typename T> | |
| using | Qx::container_arrow_result |
Functions | |
| template<arrowable_container_type T> | |
| container_arrow_result< T > | Qx::container_arrow_operator (T &data) |
| template<typename T> | |
| const T | qxAsConst (T &&t) |
| template<typename T> | |
| std::add_const< T >::type | qxAsConst (T &t) |
| template<typename T> | |
| void | qxDelete (T *&pointer) |
| template<typename PointerToMemberFunction, typename Functor> | |
| ScopedConnection | Qx::scopedConnect (const QObject *sender, PointerToMemberFunction signal, Functor &&functor) |
| const T qxAsConst | ( | T && | t | ) |
Serves the same purpose as std::as_const() (preventing implicitly-shared Qt containers from detaching), but this version works for rvalues, albeit with some efficiency concerns depending on the nature of t.
| std::add_const< T >::type qxAsConst | ( | T & | t | ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Equivalent to std::as_const(T& t).
This overload exists so that qxAsConst can consistently be used everywhere for both lvalues and rvalues, instead of having to employ mixed usage of qxAsConst() and std::as_const().
| void qxDelete | ( | T *& | pointer | ) |
Calls delete on pointer and then sets it to nullptr .