Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qvariant.cpp File Reference

(285a2a75b4342e73d3165378d7af6c48d2f06492)

#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 1152 of file qvariant.cpp.

Function Documentation

◆ canBeNumericallyCompared()

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

Definition at line 2231 of file qvariant.cpp.

References QMetaType::IsEnumeration, and qIsNumericType().

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 2341 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 2358 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 2265 of file qvariant.cpp.

References canBeNumericallyCompared(), Q_ASSERT, qIsFloatingPoint(), QMetaType::QReal, and t2.

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 2387 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 2226 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 2203 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 1863 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 2376 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 2324 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 1153 of file qvariant.cpp.

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

◆ Qt5FirstGuiType

constexpr int Qt5FirstGuiType = 64
constexpr

Definition at line 1202 of file qvariant.cpp.

Referenced by QVariant::load().

◆ Qt5KeySequence

constexpr int Qt5KeySequence = 75
constexpr

Definition at line 1206 of file qvariant.cpp.

Referenced by QVariant::save().

◆ Qt5LastCoreType

constexpr int Qt5LastCoreType = QMetaType::QCborMap
constexpr

Definition at line 1201 of file qvariant.cpp.

Referenced by QVariant::save().

◆ Qt5LastGuiType

constexpr int Qt5LastGuiType = 87
constexpr

Definition at line 1203 of file qvariant.cpp.

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

◆ Qt5QQuaternion

constexpr int Qt5QQuaternion = 85
constexpr

Definition at line 1207 of file qvariant.cpp.

Referenced by QVariant::save().

◆ Qt5RegExp

constexpr int Qt5RegExp = 27
constexpr

Definition at line 1205 of file qvariant.cpp.

Referenced by QVariant::load().

◆ Qt5SizePolicy

constexpr int Qt5SizePolicy = 121
constexpr

Definition at line 1204 of file qvariant.cpp.

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

◆ Qt5UserType

constexpr int Qt5UserType = 1024
constexpr

Definition at line 1200 of file qvariant.cpp.

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

◆ Qt6ToQt5GuiTypeDelta

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

Definition at line 1209 of file qvariant.cpp.

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