Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qpointer.h File Reference
#include <QtCore/qsharedpointer.h>
#include <QtCore/qtypeinfo.h>
+ Include dependency graph for qpointer.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  QPointer< T >
 \inmodule QtCore More...
 

Macros

#define DECLARE_COMPARE_SET(T1, A1, T2, A2)
 
#define DECLARE_TEMPLATE_COMPARE_SET(T1, A1, T2, A2)
 

Functions

template<class T >
 Q_DECLARE_TYPEINFO_BODY (QPointer< T >, Q_RELOCATABLE_TYPE)
 
template<typename T >
QPointer< T > qPointerFromVariant (const QVariant &variant)
 
template<class T >
void swap (QPointer< T > &p1, QPointer< T > &p2) noexcept
 

Macro Definition Documentation

◆ DECLARE_COMPARE_SET

#define DECLARE_COMPARE_SET (   T1,
  A1,
  T2,
  A2 
)
Value:
friend bool operator==(T1, T2) \
{ return A1 == A2; } \
friend bool operator!=(T1, T2) \
{ return A1 != A2; }
constexpr bool operator!=(const timespec &t1, const timespec &t2)
bool operator==(const QRandomGenerator &rng1, const QRandomGenerator &rng2)
Definition qrandom.cpp:1219

Definition at line 73 of file qpointer.h.

◆ DECLARE_TEMPLATE_COMPARE_SET

#define DECLARE_TEMPLATE_COMPARE_SET (   T1,
  A1,
  T2,
  A2 
)
Value:
template <typename X> \
friend bool operator==(T1, T2) noexcept \
{ return A1 == A2; } \
template <typename X> \
friend bool operator!=(T1, T2) noexcept \
{ return A1 != A2; }

Definition at line 79 of file qpointer.h.

Function Documentation

◆ Q_DECLARE_TYPEINFO_BODY()

template<class T >
Q_DECLARE_TYPEINFO_BODY ( QPointer< T >  ,
Q_RELOCATABLE_TYPE   
)

◆ qPointerFromVariant()

template<typename T >
template< typename T > QPointer< T > qPointerFromVariant ( const QVariant variant)

Returns a guarded pointer that points to the same object that variant holds.

Definition at line 99 of file qpointer.h.

References QtPrivate::EnableInternalData::internalData(), variant, and QtSharedPointer::weakPointerFromVariant_internal().

+ Here is the call graph for this function:

◆ swap()

template<class T >
void swap ( QPointer< T > &  p1,
QPointer< T > &  p2 
)
inlinenoexcept

Definition at line 106 of file qpointer.h.

References p1, p2, swap(), and QPixmap::swap().

+ Here is the call graph for this function: