summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2017-04-09 09:19:41 +0200
committerMarc Mutz <marc.mutz@kdab.com>2017-04-14 17:28:34 +0000
commit564cb03ffbd9ebab1aff78a9848920bf9856be78 (patch)
treedec229e104aa8e9a90bae3540228785240316033
parent98170e4d7bc2fae438b649a8a5afc23705dd2593 (diff)
QVariant: fix docs regarding QUuid
- toUuid(): QUuid is a built-in type, so use type(), not userType() - canConvert()/toUuid(): QUuid converts to and from QString Change-Id: I5262ff7ab093040cb943b6ab9cfffe95491d2b9b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 9d1203bf02abec8b5ab73c4c8a81eb4627336ad8)
-rw-r--r--src/corelib/kernel/qvariant.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp
index 17269b5feb..43604adf26 100644
--- a/src/corelib/kernel/qvariant.cpp
+++ b/src/corelib/kernel/qvariant.cpp
@@ -2525,8 +2525,9 @@ QRegularExpression QVariant::toRegularExpression() const
/*!
\since 5.0
- Returns the variant as a QUuid if the variant has userType() \l
- QUuid; otherwise returns a default constructed QUuid.
+ Returns the variant as a QUuid if the variant has type()
+ \l QMetaType::QUuid or \l QMetaType::QString;
+ otherwise returns a default-constructed QUuid.
\sa canConvert(), convert()
*/
@@ -2994,7 +2995,7 @@ static bool canConvertMetaObject(int fromId, int toId, QObject *fromObject)
\l QMetaType::QDate, \l QMetaType::QDateTime, \l QMetaType::Double,
\l QMetaType::QFont, \l QMetaType::Int, \l QMetaType::QKeySequence,
\l QMetaType::LongLong, \l QMetaType::QStringList, \l QMetaType::QTime,
- \l QMetaType::UInt, \l QMetaType::ULongLong
+ \l QMetaType::UInt, \l QMetaType::ULongLong, \l QMetaType::QUuid
\row \li \l QMetaType::QStringList \li \l QMetaType::QVariantList,
\l QMetaType::QString (if the list contains exactly one item)
\row \li \l QMetaType::QTime \li \l QMetaType::QString
@@ -3004,6 +3005,7 @@ static bool canConvertMetaObject(int fromId, int toId, QObject *fromObject)
\row \li \l QMetaType::ULongLong \li \l QMetaType::Bool,
\l QMetaType::QChar, \l QMetaType::Double, \l QMetaType::Int,
\l QMetaType::LongLong, \l QMetaType::QString, \l QMetaType::UInt
+ \row \li \l QMetaType::QUuid \li \l QMetaType::QString
\endtable
A QVariant containing a pointer to a type derived from QObject will also return true for this