Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qvariant.h File Reference
#include <QtCore/qatomic.h>
#include <QtCore/qcontainerfwd.h>
#include <QtCore/qmetatype.h>
#include <QtCore/qdebug.h>
#include <memory>
#include <QtCore/q20type_traits.h>
#include <QtCore/q23utility.h>
#include <variant>
#include <QtCore/qlist.h>
#include <QtCore/qstringlist.h>
#include <QtCore/qbytearraylist.h>
#include <QtCore/qhash.h>
#include <QtCore/qmap.h>
#include <QtCore/qobject.h>
+ Include dependency graph for qvariant.h:

Go to the source code of this file.

Classes

class  QVariant
 \inmodule QtCore More...
 
struct  QVariant::PrivateShared
 
struct  QVariant::Private
 
class  QtPrivate::QVariantTypeCoercer
 
class  QVariantRef< Pointer >
 The QVariantRef acts as a non-const reference to a QVariant. More...
 
class  QVariantConstPointer
 Emulated const pointer to QVariant based on a pointer. More...
 
class  QVariantPointer< Pointer >
 QVariantPointer is a template class that emulates a pointer to QVariant based on a pointer. More...
 

Namespaces

namespace  QtPrivate
 \macro QT_NAMESPACE
 

Macros

#define Q_MK_GET(cvref)
 

Functions

template<typename T >
qvariant_cast (const QVariant &)
 
Q_CORE_EXPORT QDataStreamoperator>> (QDataStream &s, QVariant &p)
 
Q_CORE_EXPORT QDataStreamoperator<< (QDataStream &s, const QVariant &p)
 
void swap (QVariant &value1, QVariant &value2) noexcept
 
template<typename T >
qvariant_cast (QVariant &&v)
 
template<>
QVariant qvariant_cast< QVariant > (const QVariant &v)
 

Variables

template<>
constexpr bool QtPrivate::qIsRelocatable< QVariant > = true
 

Macro Definition Documentation

◆ Q_MK_GET

#define Q_MK_GET (   cvref)
Value:
template <typename T> \
friend T cvref get(QVariant cvref v) \
{ \
if constexpr (std::is_const_v<T cvref>) \
Q_ASSERT(!v.d.is_null); \
Q_ASSERT(v.d.type() == QMetaType::fromType<q20::remove_cvref_t<T>>()); \
return static_cast<T cvref>(*get_if<T>(&v)); \
} \
/* end */
static constexpr QMetaType fromType()
Definition qmetatype.h:2612
\inmodule QtCore
Definition qvariant.h:64
std::remove_cv_t< std::remove_reference_t< T > > remove_cvref_t
static QDBusError::ErrorType get(const char *name)
GLsizei const GLfloat * v
[13]
#define Q_ASSERT(cond)
Definition qrandom.cpp:47

Definition at line 640 of file qvariant.h.

Function Documentation

◆ operator<<()

Q_CORE_EXPORT QDataStream & operator<< ( QDataStream s,
const QVariant p 
)
related

◆ operator>>()

Q_CORE_EXPORT QDataStream & operator>> ( QDataStream s,
QVariant p 
)
related

◆ qvariant_cast() [1/2]

template<typename T >
T qvariant_cast ( const QVariant v)
related

Definition at line 746 of file qvariant.h.

Referenced by QSSGSceneDesc::PropertySetter< Ret, Class, Arg >::set(), and QSSGSceneDesc::PropertyProxySetter< Ret, Arg >::set().

+ Here is the caller graph for this function:

◆ qvariant_cast() [2/2]

template<typename T >
T qvariant_cast ( QVariant &&  v)
inline

Definition at line 763 of file qvariant.h.

◆ qvariant_cast< QVariant >()

template<>
QVariant qvariant_cast< QVariant > ( const QVariant v)
inline

Definition at line 792 of file qvariant.h.

References QMetaType::QVariant.

◆ swap()

void swap ( QVariant value1,
QVariant value2 
)
inlinenoexcept

Definition at line 741 of file qvariant.h.

References swap(), and value2.

+ Here is the call graph for this function: