diff -r b72c6db6890b -r 5dc02b23752f src/corelib/kernel/qvariant.cpp --- a/src/corelib/kernel/qvariant.cpp Wed Jun 23 19:07:03 2010 +0300 +++ b/src/corelib/kernel/qvariant.cpp Tue Jul 06 15:10:48 2010 +0300 @@ -46,6 +46,7 @@ #include "qdebug.h" #include "qmap.h" #include "qdatetime.h" +#include "qeasingcurve.h" #include "qlist.h" #include "qstring.h" #include "qstringlist.h" @@ -146,6 +147,11 @@ v_construct(x, copy); break; #endif +#ifndef QT_BOOTSTRAPPED + case QVariant::EasingCurve: + v_construct(x, copy); + break; +#endif case QVariant::Int: x->data.i = copy ? *static_cast(copy) : 0; break; @@ -259,6 +265,11 @@ v_clear(d); break; #endif +#ifndef QT_BOOTSTRAPPED + case QVariant::EasingCurve: + v_clear(d); + break; +#endif case QVariant::LongLong: case QVariant::ULongLong: case QVariant::Double: @@ -317,6 +328,9 @@ case QVariant::PointF: return v_cast(d)->isNull(); #endif +#ifndef QT_BOOTSTRAPPED + case QVariant::EasingCurve: +#endif case QVariant::Url: case QVariant::Locale: case QVariant::RegExp: @@ -435,6 +449,10 @@ return *v_cast(a) == *v_cast(b); case QVariant::DateTime: return *v_cast(a) == *v_cast(b); +#ifndef QT_BOOTSTRAPPED + case QVariant::EasingCurve: + return *v_cast(a) == *v_cast(b); +#endif case QVariant::ByteArray: return *v_cast(a) == *v_cast(b); case QVariant::BitArray: @@ -1101,6 +1119,11 @@ case QVariant::DateTime: dbg.nospace() << v.toDateTime(); break; +#ifndef QT_BOOTSTRAPPED + case QVariant::EasingCurve: + dbg.nospace() << v.toEasingCurve(); + break; +#endif case QVariant::ByteArray: dbg.nospace() << v.toByteArray(); break; @@ -1269,6 +1292,7 @@ \value Date a QDate \value DateTime a QDateTime \value Double a double + \value EasingCurve a QEasingCurve \value Font a QFont \value Hash a QVariantHash \value Icon a QIcon @@ -1487,6 +1511,13 @@ */ /*! + \since 4.7 + \fn QVariant::QVariant(const QEasingCurve &val) + + Constructs a new variant with an easing curve value, \a val. +*/ + +/*! \fn QVariant::QVariant(const QByteArray &val) Constructs a new variant with a bytearray value, \a val. @@ -1685,6 +1716,10 @@ { d.is_null = false; d.type = Time; v_construct(&d, val); } QVariant::QVariant(const QDateTime &val) { d.is_null = false; d.type = DateTime; v_construct(&d, val); } +#ifndef QT_BOOTSTRAPPED +QVariant::QVariant(const QEasingCurve &val) +{ d.is_null = false; d.type = EasingCurve; v_construct(&d, val); } +#endif QVariant::QVariant(const QList &list) { d.is_null = false; d.type = List; v_construct(&d, list); } QVariant::QVariant(const QMap &map) @@ -1874,7 +1909,7 @@ } #ifndef QT_NO_DATASTREAM -enum { MapFromThreeCount = 35 }; +enum { MapFromThreeCount = 36 }; static const ushort map_from_three[MapFromThreeCount] = { QVariant::Invalid, @@ -1911,7 +1946,8 @@ QVariant::KeySequence, QVariant::Pen, QVariant::LongLong, - QVariant::ULongLong + QVariant::ULongLong, + QVariant::EasingCurve }; /*! @@ -2169,6 +2205,22 @@ } /*! + \since 4.7 + \fn QEasingCurve QVariant::toEasingCurve() const + + Returns the variant as a QEasingCurve if the variant has type() \l + EasingCurve; otherwise returns a default easing curve. + + \sa canConvert(), convert() +*/ +#ifndef QT_BOOTSTRAPPED +QEasingCurve QVariant::toEasingCurve() const +{ + return qVariantToHelper(d, EasingCurve, handler); +} +#endif + +/*! \fn QByteArray QVariant::toByteArray() const Returns the variant as a QByteArray if the variant has type() \l @@ -2609,8 +2661,9 @@ /*QRegExp*/ 0, -/*QHash*/ 0 - +/*QHash*/ 0, + +/*QEasingCurve*/ 0 }; /*!