SILICON
Loading...
Searching...
No Matches
CallbackScope Class Reference

#include <lifetime.hpp>

Public Member Functions

QObject * context () noexcept
template<class Sender, class Signal, class Callback>
QMetaObject::Connection connect (Sender *sender, Signal signal, Callback &&callback)
template<class Callback>
auto guard (Callback callback) const

Private Attributes

QObject receiver

Detailed Description

A connection context that expires before its owner's state and Qt children. Declare it after the state callbacks use. Destroying the context disconnects subscriptions and discards queued calls; a connection handle alone does neither.

Definition at line 34 of file lifetime.hpp.

Member Function Documentation

◆ connect()

template<class Sender, class Signal, class Callback>
QMetaObject::Connection connect ( Sender * sender,
Signal signal,
Callback && callback )
inline

Definition at line 39 of file lifetime.hpp.

◆ context()

QObject * context ( )
inlinenoexcept

Definition at line 36 of file lifetime.hpp.

◆ guard()

template<class Callback>
auto guard ( Callback callback) const
inline

Definition at line 44 of file lifetime.hpp.

Member Data Documentation

◆ receiver

QObject receiver
private

Definition at line 50 of file lifetime.hpp.


The documentation for this class was generated from the following file: