diff options
author | Thierry Bastian <thierry.bastian@nokia.com> | 2009-08-14 15:04:42 (GMT) |
---|---|---|
committer | Thierry Bastian <thierry.bastian@nokia.com> | 2009-08-14 15:05:50 (GMT) |
commit | 3c8f4512df30dee4a867a498fff6d2b27b881e4b (patch) | |
tree | f6cec8256c40fe72514cfbd304f1eb85bd916e4d /src/xmlpatterns | |
parent | 533807d5c06be28694665fc889ec1942c59ab705 (diff) | |
download | Qt-3c8f4512df30dee4a867a498fff6d2b27b881e4b.zip Qt-3c8f4512df30dee4a867a498fff6d2b27b881e4b.tar.gz Qt-3c8f4512df30dee4a867a498fff6d2b27b881e4b.tar.bz2 |
QVariant: more work on avoinding conversion between float and doubles
we call QVariant::toReal instead of toDouble when needed
Diffstat (limited to 'src/xmlpatterns')
-rw-r--r-- | src/xmlpatterns/data/qatomicvalue.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/xmlpatterns/data/qatomicvalue.cpp b/src/xmlpatterns/data/qatomicvalue.cpp index 24f1a01..8559c80 100644 --- a/src/xmlpatterns/data/qatomicvalue.cpp +++ b/src/xmlpatterns/data/qatomicvalue.cpp @@ -134,7 +134,7 @@ Item AtomicValue::toXDM(const QVariant &value) Q_ASSERT_X(value.isValid(), Q_FUNC_INFO, "QVariants sent to Patternist must be valid."); - switch(value.type()) + switch(value.userType()) { case QVariant::Char: /* Fallthrough. A single codepoint is a string in XQuery. */ @@ -166,6 +166,8 @@ Item AtomicValue::toXDM(const QVariant &value) return Date::fromDateTime(QDateTime(value.toDate(), QTime(), Qt::UTC)); case QVariant::DateTime: return DateTime::fromDateTime(value.toDateTime()); + case QMetaType::Float: + return Item(Double::fromValue(value.toFloat())); case QVariant::Double: return Item(Double::fromValue(value.toDouble())); default: |