diff options
Diffstat (limited to 'src/corelib/kernel/qvariant.cpp')
-rw-r--r-- | src/corelib/kernel/qvariant.cpp | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp index a1e1c71d12..40a401361d 100644 --- a/src/corelib/kernel/qvariant.cpp +++ b/src/corelib/kernel/qvariant.cpp @@ -2254,10 +2254,10 @@ QVariant::QVariant(const QRegularExpression &re) : d(RegularExpression) { v_construct<QRegularExpression>(&d, re); } #endif // QT_CONFIG(regularexpression) -#ifndef QT_BOOTSTRAPPED QVariant::QVariant(const QUuid &uuid) : d(Uuid) { v_construct<QUuid>(&d, uuid); } +#ifndef QT_BOOTSTRAPPED QVariant::QVariant(const QJsonValue &jsonValue) : d(QMetaType::QJsonValue) { v_construct<QJsonValue>(&d, jsonValue); } @@ -2523,7 +2523,7 @@ void QVariant::load(QDataStream &s) return; } } - create(typeId, 0); + create(typeId, nullptr); d.is_null = is_null; if (!isValid()) { @@ -3011,7 +3011,6 @@ QPersistentModelIndex QVariant::toPersistentModelIndex() const } #endif // QT_CONFIG(itemmodel) -#ifndef QT_BOOTSTRAPPED /*! \since 5.0 @@ -3026,6 +3025,7 @@ QUuid QVariant::toUuid() const return qVariantToHelper<QUuid>(d, handlerManager); } +#ifndef QT_BOOTSTRAPPED /*! \since 5.0 @@ -3829,6 +3829,7 @@ bool QVariant::convert(const int type, void *ptr) const /*! \fn bool QVariant::operator<(const QVariant &v) const + \obsolete Compares this QVariant with \a v and returns \c true if this is less than \a v. @@ -3838,10 +3839,15 @@ bool QVariant::convert(const int type, void *ptr) const \warning To make this function work with a custom type registered with qRegisterMetaType(), its comparison operator must be registered using QMetaType::registerComparators(). + + This operator is deprecated as it cannot establish a total order required + for most use of this operator, which is the reason you cannot use QVariant + as the key of a QMap. */ /*! \fn bool QVariant::operator<=(const QVariant &v) const + \obsolete Compares this QVariant with \a v and returns \c true if this is less or equal than \a v. @@ -3851,10 +3857,13 @@ bool QVariant::convert(const int type, void *ptr) const \warning To make this function work with a custom type registered with qRegisterMetaType(), its comparison operator must be registered using QMetaType::registerComparators(). + + This operator is deprecated as it cannot establish a total order. */ /*! \fn bool QVariant::operator>(const QVariant &v) const + \obsolete Compares this QVariant with \a v and returns \c true if this is larger than \a v. @@ -3864,10 +3873,13 @@ bool QVariant::convert(const int type, void *ptr) const \warning To make this function work with a custom type registered with qRegisterMetaType(), its comparison operator must be registered using QMetaType::registerComparators(). + + This operator is deprecated as it cannot establish a total order. */ /*! \fn bool QVariant::operator>=(const QVariant &v) const + \obsolete Compares this QVariant with \a v and returns \c true if this is larger or equal than \a v. @@ -3877,6 +3889,8 @@ bool QVariant::convert(const int type, void *ptr) const \warning To make this function work with a custom type registered with qRegisterMetaType(), its comparison operator must be registered using QMetaType::registerComparators(). + + This operator is deprecated as it cannot establish a total order. */ static bool qIsNumericType(uint tp) |