summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qvariant.cpp
diff options
context:
space:
mode:
authorGeir Vattekar <geir.vattekar@nokia.com>2012-08-20 14:31:32 +0200
committerQt by Nokia <qt-info@nokia.com>2012-08-20 15:56:58 +0200
commitf3fea329fdd4abbc2f2eec0098d0d5aae1c8cc86 (patch)
treef0a9d1cf836e49560a3537a85cc2d23de82d1091 /src/corelib/kernel/qvariant.cpp
parenta03e815b6cf363cd6a2d82e36f0d90bcbd19972c (diff)
Doc: Work on QVariant's equality operator.
Task-number: QTBUG-26018 Change-Id: I6627456d166bc0a036cadeee7bd51aa8e576a818 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
Diffstat (limited to 'src/corelib/kernel/qvariant.cpp')
-rw-r--r--src/corelib/kernel/qvariant.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp
index 8c38259276..fb1292c231 100644
--- a/src/corelib/kernel/qvariant.cpp
+++ b/src/corelib/kernel/qvariant.cpp
@@ -2798,6 +2798,12 @@ bool QVariant::convert(const int type, void *ptr) const
Returns true if \a v1 and \a v2 are equal; otherwise returns false.
+ If \a v1 and \a v2 have the same \l{QVariant::}{type()}, the
+ type's equality operator is used for comparison. If not, it is
+ attempted to \l{QVariant::}{convert()} \a v2 to the same type as
+ \a v1. See \l{QVariant::}{canConvert()} for a list of possible
+ conversions.
+
\warning This function doesn't support custom types registered
with qRegisterMetaType().
*/
@@ -2817,8 +2823,13 @@ bool QVariant::convert(const int type, void *ptr) const
Compares this QVariant with \a v and returns true if they are
equal; otherwise returns false.
- In the case of custom types, their equalness operators are not called.
- Instead the values' addresses are compared.
+ QVariant uses the equality operator of the type() it contains to
+ check for equality. QVariant will try to convert() \a v if its
+ type is not the same as this variant's type. See canConvert() for
+ a list of possible conversions.
+
+ \warning This function doesn't support custom types registered
+ with qRegisterMetaType().
*/
/*!