Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qvariant.cpp File Reference
#include "qvariant_p.h"
#include "qbitarray.h"
#include "qbytearray.h"
#include "qdatastream.h"
#include "qdebug.h"
#include "qmap.h"
#include "qhash.h"
#include "qdatetime.h"
#include "qlist.h"
#include "qstring.h"
#include "qstringlist.h"
#include "qurl.h"
#include "qlocale.h"
#include "quuid.h"
#include "qcborarray.h"
#include "qcborcommon.h"
#include "qcbormap.h"
#include "qjsonvalue.h"
#include "qjsonobject.h"
#include "qjsonarray.h"
#include "qjsondocument.h"
#include "qbytearraylist.h"
#include "private/qlocale_p.h"
#include "qmetatype_p.h"
#include <qmetaobject.h>
#include "qsize.h"
#include "qpoint.h"
#include "qrect.h"
#include "qline.h"
#include <memory>
#include <cmath>
#include <float.h>
#include <cstring>
+ Include dependency graph for qvariant.cpp:

Go to the source code of this file.

Enumerations

enum  { MapFromThreeCount = 36 }
 

Functions

template<typename T >
qNumVariantToHelper (const QVariant::Private &d, bool *ok)
 
static bool qIsNumericType (uint tp)
 
static bool qIsFloatingPoint (uint tp)
 
static bool canBeNumericallyCompared (const QtPrivate::QMetaTypeInterface *iface1, const QtPrivate::QMetaTypeInterface *iface2)
 
static int numericTypePromotion (const QtPrivate::QMetaTypeInterface *iface1, const QtPrivate::QMetaTypeInterface *iface2)
 
template<typename Numeric >
static QPartialOrdering spaceShip (Numeric lhs, Numeric rhs)
 
static QPartialOrdering integralCompare (uint promotedType, const QVariant::Private *d1, const QVariant::Private *d2)
 
static QPartialOrdering numericCompare (const QVariant::Private *d1, const QVariant::Private *d2)
 
static bool qvCanConvertMetaObject (QMetaType fromType, QMetaType toType)
 
static QPartialOrdering pointerCompare (const QVariant::Private *d1, const QVariant::Private *d2)
 

Variables

static const ushort mapIdFromQt3ToCurrent [MapFromThreeCount]
 
constexpr int Qt5UserType = 1024
 
constexpr int Qt5LastCoreType = QMetaType::QCborMap
 
constexpr int Qt5FirstGuiType = 64
 
constexpr int Qt5LastGuiType = 87
 
constexpr int Qt5SizePolicy = 121
 
constexpr int Qt5RegExp = 27
 
constexpr int Qt5KeySequence = 75
 
constexpr int Qt5QQuaternion = 85
 
constexpr int Qt6ToQt5GuiTypeDelta = qToUnderlying(QMetaType::FirstGuiType) - Qt5FirstGuiType
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
MapFromThreeCount 

Definition at line 1165 of file qvariant.cpp.

Function Documentation

◆ canBeNumericallyCompared()

static bool canBeNumericallyCompared ( const QtPrivate::QMetaTypeInterface iface1,
const QtPrivate::QMetaTypeInterface iface2 
)
static

Definition at line 2242 of file qvariant.cpp.

References QtPrivate::QMetaTypeInterface::flags, QMetaType::IsEnumeration, qIsNumericType(), and QtPrivate::QMetaTypeInterface::typeId.

Referenced by QVariant::compare(), QVariant::equals(), and numericTypePromotion().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ integralCompare()

static QPartialOrdering integralCompare ( uint  promotedType,
const QVariant::Private d1,
const QVariant::Private d2 
)
static

Definition at line 2352 of file qvariant.cpp.

References d1, d2, and QPartialOrdering::Unordered.

Referenced by numericCompare().

+ Here is the caller graph for this function:

◆ numericCompare()

static QPartialOrdering numericCompare ( const QVariant::Private d1,
const QVariant::Private d2 
)
static

Definition at line 2369 of file qvariant.cpp.

References d1, d2, QPartialOrdering::Equivalent, integralCompare(), numericTypePromotion(), QMetaType::QReal, r1, r2, spaceShip(), and QPartialOrdering::Unordered.

Referenced by QVariant::compare(), and QVariant::equals().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ numericTypePromotion()

static int numericTypePromotion ( const QtPrivate::QMetaTypeInterface iface1,
const QtPrivate::QMetaTypeInterface iface2 
)
static

Definition at line 2276 of file qvariant.cpp.

References canBeNumericallyCompared(), Q_ASSERT, qIsFloatingPoint(), QMetaType::QReal, QtPrivate::QMetaTypeInterface::size, t2, and QtPrivate::QMetaTypeInterface::typeId.

Referenced by numericCompare().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pointerCompare()

static QPartialOrdering pointerCompare ( const QVariant::Private d1,
const QVariant::Private d2 
)
static

Definition at line 2398 of file qvariant.cpp.

References d1, and d2.

Referenced by QVariant::compare(), and QVariant::equals().

+ Here is the caller graph for this function:

◆ qIsFloatingPoint()

static bool qIsFloatingPoint ( uint  tp)
static

Definition at line 2237 of file qvariant.cpp.

Referenced by numericTypePromotion().

+ Here is the caller graph for this function:

◆ qIsNumericType()

static bool qIsNumericType ( uint  tp)
static

Definition at line 2214 of file qvariant.cpp.

References Q_UINT64_C.

Referenced by canBeNumericallyCompared().

+ Here is the caller graph for this function:

◆ qNumVariantToHelper()

template<typename T >
T qNumVariantToHelper ( const QVariant::Private d,
bool *  ok 
)
inline

Definition at line 1874 of file qvariant.cpp.

References QMetaType::convert(), d, ok, and ret.

+ Here is the call graph for this function:

◆ qvCanConvertMetaObject()

static bool qvCanConvertMetaObject ( QMetaType  fromType,
QMetaType  toType 
)
static

Definition at line 2387 of file qvariant.cpp.

References QMetaType::flags(), QMetaType::metaObject(), and QMetaType::PointerToQObject.

Referenced by QVariant::compare(), and QVariant::equals().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ spaceShip()

template<typename Numeric >
static QPartialOrdering spaceShip ( Numeric  lhs,
Numeric  rhs 
)
static

Definition at line 2335 of file qvariant.cpp.

References QPartialOrdering::Equivalent, QPartialOrdering::Greater, QPartialOrdering::Less, and QPartialOrdering::Unordered.

Referenced by numericCompare().

+ Here is the caller graph for this function:

Variable Documentation

◆ mapIdFromQt3ToCurrent

const ushort mapIdFromQt3ToCurrent[MapFromThreeCount]
static

Definition at line 1166 of file qvariant.cpp.

Referenced by QVariant::load(), and QVariant::save().

◆ Qt5FirstGuiType

constexpr int Qt5FirstGuiType = 64
constexpr

Definition at line 1215 of file qvariant.cpp.

Referenced by QVariant::load().

◆ Qt5KeySequence

constexpr int Qt5KeySequence = 75
constexpr

Definition at line 1219 of file qvariant.cpp.

Referenced by QVariant::save().

◆ Qt5LastCoreType

constexpr int Qt5LastCoreType = QMetaType::QCborMap
constexpr

Definition at line 1214 of file qvariant.cpp.

Referenced by QVariant::save().

◆ Qt5LastGuiType

constexpr int Qt5LastGuiType = 87
constexpr

Definition at line 1216 of file qvariant.cpp.

Referenced by QVariant::load(), and QVariant::save().

◆ Qt5QQuaternion

constexpr int Qt5QQuaternion = 85
constexpr

Definition at line 1220 of file qvariant.cpp.

Referenced by QVariant::save().

◆ Qt5RegExp

constexpr int Qt5RegExp = 27
constexpr

Definition at line 1218 of file qvariant.cpp.

Referenced by QVariant::load().

◆ Qt5SizePolicy

constexpr int Qt5SizePolicy = 121
constexpr

Definition at line 1217 of file qvariant.cpp.

Referenced by QVariant::load(), and QVariant::save().

◆ Qt5UserType

constexpr int Qt5UserType = 1024
constexpr

Definition at line 1213 of file qvariant.cpp.

Referenced by QVariant::load(), and QVariant::save().

◆ Qt6ToQt5GuiTypeDelta

constexpr int Qt6ToQt5GuiTypeDelta = qToUnderlying(QMetaType::FirstGuiType) - Qt5FirstGuiType
constexpr

Definition at line 1222 of file qvariant.cpp.

Referenced by QVariant::load(), and QVariant::save().