Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
QEventStorage< Event > Class Template Reference

#include <qevent_p.h>

Collaboration diagram for QEventStorage< Event >:

Public Member Functions

 QEventStorage () noexcept
 QEventStorage (const Event &e)
 ~QEventStorage ()
 operator bool () const noexcept
bool operator! () const noexcept
Eventstore (const Event &e)
EventstoreUnlessAlias (const Event &e)
const Eventoperator* () const
Eventoperator* ()
const Eventoperator-> () const
Eventoperator-> ()

Detailed Description

template<typename Event>
class QEventStorage< Event >
Since
6.9

This class provides a way to store copies of QEvents. QEvents can otherwise only be copied by \l{QEvent::clone()}{cloning}, which allocates the copy on the heap. By befriending concrete QEvent subclasses, QEventStorage gains access to their protected copy constructors.

It is similar to std::optional, but with a more targeted API.

Note that by storing an event in QEventStorage, it may be sliced.

Definition at line 41 of file qevent_p.h.

Constructor & Destructor Documentation

◆ QEventStorage() [1/2]

template<typename Event>
QEventStorage< Event >::QEventStorage ( )
inlinenoexcept

Definition at line 66 of file qevent_p.h.

References m_eventNotSet.

◆ QEventStorage() [2/2]

template<typename Event>
QEventStorage< Event >::QEventStorage ( const Event & e)
inlineexplicit

Definition at line 67 of file qevent_p.h.

◆ ~QEventStorage()

template<typename Event>
QEventStorage< Event >::~QEventStorage ( )
inline

Definition at line 72 of file qevent_p.h.

Member Function Documentation

◆ operator bool()

template<typename Event>
QEventStorage< Event >::operator bool ( ) const
inlineexplicitnoexcept

Definition at line 78 of file qevent_p.h.

◆ operator!()

template<typename Event>
bool QEventStorage< Event >::operator! ( ) const
inlinenoexcept

Definition at line 79 of file qevent_p.h.

◆ operator*() [1/2]

template<typename Event>
Event & QEventStorage< Event >::operator* ( )
inline

Definition at line 102 of file qevent_p.h.

◆ operator*() [2/2]

template<typename Event>
const Event & QEventStorage< Event >::operator* ( ) const
inline

Definition at line 96 of file qevent_p.h.

◆ operator->() [1/2]

template<typename Event>
Event * QEventStorage< Event >::operator-> ( )
inline

Definition at line 114 of file qevent_p.h.

◆ operator->() [2/2]

template<typename Event>
const Event * QEventStorage< Event >::operator-> ( ) const
inline

Definition at line 108 of file qevent_p.h.

◆ store()

template<typename Event>
Event & QEventStorage< Event >::store ( const Event & e)
inline

Definition at line 81 of file qevent_p.h.

Referenced by storeUnlessAlias().

Here is the caller graph for this function:

◆ storeUnlessAlias()

template<typename Event>
Event & QEventStorage< Event >::storeUnlessAlias ( const Event & e)
inline

Definition at line 89 of file qevent_p.h.

References store().

Here is the call graph for this function:

Member Data Documentation

◆ m_event

template<typename Event>
Event QEventStorage< Event >::m_event

Definition at line 47 of file qevent_p.h.

◆ m_eventNotSet

template<typename Event>
char QEventStorage< Event >::m_eventNotSet

Definition at line 46 of file qevent_p.h.

Referenced by QEventStorage().


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