|
swift
|
Callable wrapper for a member function with function signature R(Args...). More...
Public Member Functions | |
| CSlot ()=default | |
| Construct an empty slot. | |
| template<typename T , typename U > | |
| CSlot (T *object, R(U::*function)(Args...)) | |
| Construct a slot from the given member function of the given object. | |
| template<typename T > | |
| CSlot (T *object, std::function< R(Args...)> function) | |
| Construct a slot from the given object passing a function and a object. | |
| R | operator() (Args... args) const |
| Call the slot. The behaviour is undefined if the slot is empty. | |
| bool | singleShot (Args... args) const |
| Call function "de-coupled" in original thread. | |
| QObject * | object () const |
| Returns the object which the slot belongs to. Use this as the third argument to QObject::connect to ensure the slot is called in the correct thread. | |
| void | setObject (QObject *object) |
| Set the object which the slot belongs to. Use this as the third argument to QObject::connect to ensure the slot is called in the correct thread. | |
| operator bool () const | |
| True if the slot can be called, false if it is empty. | |
| bool | operator! () const |
| True if the slot is empty or object is null, false if it can be called. | |
| bool | isEmpty () const |
| True if the slot is empty, false if it can be called. | |
| bool | hasNullObject () const |
| True if the object is null. | |
Callable wrapper for a member function with function signature R(Args...).
Allows for easy manipulation of slots to be used as callbacks.