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
QPointer< T > Class Template Reference

#include <qpointer.h>

+ Collaboration diagram for QPointer< T >:

Public Member Functions

Q_NODISCARD_CTOR QPointer () noexcept=default
 
Q_NODISCARD_CTOR constexpr QPointer (std::nullptr_t) noexcept
 
Q_WEAK_OVERLOAD Q_NODISCARD_CTOR QPointer (T *p)
 
template<typename X , if_convertible< X > = true>
Q_NODISCARD_CTOR QPointer (QPointer< X > &&other) noexcept
 
template<typename X , if_convertible< X > = true>
Q_NODISCARD_CTOR QPointer (const QPointer< X > &other) noexcept
 
template<typename X , if_convertible< X > = true>
QPointeroperator= (const QPointer< X > &other) noexcept
 
template<typename X , if_convertible< X > = true>
QPointeroperator= (QPointer< X > &&other) noexcept
 
void swap (QPointer &other) noexcept
 
QPointer< T > & operator= (T *p)
 
T * data () const noexcept
 
T * get () const noexcept
 
T * operator-> () const noexcept
 
T & operator* () const noexcept
 
 operator T* () const noexcept
 
bool isNull () const noexcept
 
void clear () noexcept
 

Friends

template<typename X >
class QPointer
 
void swap (QPointer &lhs, QPointer &rhs) noexcept
 
template<typename X >
bool comparesEqual (const QPointer &lhs, const QPointer< X > &rhs) noexcept
 
bool comparesEqual (const QPointer &lhs, std::nullptr_t) noexcept
 

Detailed Description

template<class T>
class QPointer< T >

Definition at line 18 of file qpointer.h.

Constructor & Destructor Documentation

◆ QPointer() [1/5]

template<class T >
Q_NODISCARD_CTOR QPointer< T >::QPointer ( )
defaultnoexcept

◆ QPointer() [2/5]

template<class T >
Q_NODISCARD_CTOR constexpr QPointer< T >::QPointer ( std::nullptr_t )
inlineconstexprnoexcept

Definition at line 34 of file qpointer.h.

◆ QPointer() [3/5]

template<class T >
Q_WEAK_OVERLOAD Q_NODISCARD_CTOR QPointer< T >::QPointer ( T * p)
inline

Definition at line 37 of file qpointer.h.

◆ QPointer() [4/5]

template<class T >
template<typename X , if_convertible< X > = true>
Q_NODISCARD_CTOR QPointer< T >::QPointer ( QPointer< X > && other)
inlinenoexcept

Definition at line 43 of file qpointer.h.

◆ QPointer() [5/5]

template<class T >
template<typename X , if_convertible< X > = true>
Q_NODISCARD_CTOR QPointer< T >::QPointer ( const QPointer< X > & other)
inlinenoexcept

Definition at line 47 of file qpointer.h.

Member Function Documentation

◆ clear()

template<class T >
void QPointer< T >::clear ( )
inlinenoexcept

Definition at line 88 of file qpointer.h.

◆ data()

template<class T >
T * QPointer< T >::data ( ) const
inlinenoexcept

Definition at line 74 of file qpointer.h.

◆ get()

template<class T >
T * QPointer< T >::get ( ) const
inlinenoexcept

Definition at line 76 of file qpointer.h.

◆ isNull()

template<class T >
bool QPointer< T >::isNull ( ) const
inlinenoexcept

Definition at line 85 of file qpointer.h.

◆ operator T*()

template<class T >
QPointer< T >::operator T* ( ) const
inlinenoexcept

Definition at line 82 of file qpointer.h.

◆ operator*()

template<class T >
T & QPointer< T >::operator* ( ) const
inlinenoexcept

Definition at line 80 of file qpointer.h.

◆ operator->()

template<class T >
T * QPointer< T >::operator-> ( ) const
inlinenoexcept

Definition at line 78 of file qpointer.h.

◆ operator=() [1/3]

template<class T >
template<typename X , if_convertible< X > = true>
QPointer & QPointer< T >::operator= ( const QPointer< X > & other)
inlinenoexcept

Definition at line 51 of file qpointer.h.

◆ operator=() [2/3]

template<class T >
template<typename X , if_convertible< X > = true>
QPointer & QPointer< T >::operator= ( QPointer< X > && other)
inlinenoexcept

Definition at line 58 of file qpointer.h.

◆ operator=() [3/3]

template<class T >
QPointer< T > & QPointer< T >::operator= ( T * p)
inline

Definition at line 71 of file qpointer.h.

◆ swap()

template<class T >
void QPointer< T >::swap ( QPointer< T > & other)
inlinenoexcept

Definition at line 69 of file qpointer.h.

Friends And Related Symbol Documentation

◆ QPointer

template<class T >
template<typename X >
friend class QPointer
friend

Definition at line 25 of file qpointer.h.

◆ comparesEqual [1/2]

template<class T >
template<typename X >
bool comparesEqual ( const QPointer< T > & lhs,
const QPointer< X > & rhs )
friend

Definition at line 96 of file qpointer.h.

◆ comparesEqual [2/2]

template<class T >
bool comparesEqual ( const QPointer< T > & lhs,
std::nullptr_t  )
friend

Definition at line 106 of file qpointer.h.

◆ swap

template<class T >
void swap ( QPointer< T > & lhs,
QPointer< T > & rhs )
friend

Definition at line 91 of file qpointer.h.


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