src/corelib/kernel/qvariant.h
changeset 30 5dc02b23752f
parent 18 2f34d5167611
equal deleted inserted replaced
29:b72c6db6890b 30:5dc02b23752f
    58 
    58 
    59 class QBitArray;
    59 class QBitArray;
    60 class QDataStream;
    60 class QDataStream;
    61 class QDate;
    61 class QDate;
    62 class QDateTime;
    62 class QDateTime;
       
    63 class QEasingCurve;
    63 class QLine;
    64 class QLine;
    64 class QLineF;
    65 class QLineF;
    65 class QLocale;
    66 class QLocale;
    66 class QMatrix;
    67 class QMatrix;
    67 class QTransform;
    68 class QTransform;
   126         SizeF = 22,
   127         SizeF = 22,
   127         Line = 23,
   128         Line = 23,
   128         LineF = 24,
   129         LineF = 24,
   129         Point = 25,
   130         Point = 25,
   130         PointF = 26,
   131         PointF = 26,
   131 	RegExp = 27,
   132         RegExp = 27,
   132         Hash = 28,
   133         Hash = 28,
   133         LastCoreType = Hash,
   134         EasingCurve = 29,
       
   135         LastCoreType = EasingCurve,
   134 
   136 
   135         // value 62 is internally reserved
   137         // value 62 is internally reserved
   136 #ifdef QT3_SUPPORT
   138 #ifdef QT3_SUPPORT
   137         ColorGroup = 63,
   139         ColorGroup = 63,
   138 #endif
   140 #endif
   217     QVariant(const QUrl &url);
   219     QVariant(const QUrl &url);
   218     QVariant(const QLocale &locale);
   220     QVariant(const QLocale &locale);
   219 #ifndef QT_NO_REGEXP
   221 #ifndef QT_NO_REGEXP
   220     QVariant(const QRegExp &regExp);
   222     QVariant(const QRegExp &regExp);
   221 #endif
   223 #endif
       
   224 #ifndef QT_BOOTSTRAPPED
       
   225     QVariant(const QEasingCurve &easing);
       
   226 #endif
   222     QVariant(Qt::GlobalColor color);
   227     QVariant(Qt::GlobalColor color);
   223 
   228 
   224     QVariant& operator=(const QVariant &other);
   229     QVariant& operator=(const QVariant &other);
   225 
   230 
   226     Type type() const;
   231     Type type() const;
   277 #endif
   282 #endif
   278     QUrl toUrl() const;
   283     QUrl toUrl() const;
   279     QLocale toLocale() const;
   284     QLocale toLocale() const;
   280 #ifndef QT_NO_REGEXP
   285 #ifndef QT_NO_REGEXP
   281     QRegExp toRegExp() const;
   286     QRegExp toRegExp() const;
       
   287 #endif
       
   288 #ifndef QT_BOOTSTRAPPED
       
   289     QEasingCurve toEasingCurve() const;
   282 #endif
   290 #endif
   283 
   291 
   284 #ifdef QT3_SUPPORT
   292 #ifdef QT3_SUPPORT
   285     inline QT3_SUPPORT int &asInt();
   293     inline QT3_SUPPORT int &asInt();
   286     inline QT3_SUPPORT uint &asUInt();
   294     inline QT3_SUPPORT uint &asUInt();
   579     return T();
   587     return T();
   580 }
   588 }
   581 
   589 
   582 template<> inline QVariant qvariant_cast<QVariant>(const QVariant &v)
   590 template<> inline QVariant qvariant_cast<QVariant>(const QVariant &v)
   583 {
   591 {
   584     static const int vid = qRegisterMetaType<QVariant>("QVariant");
   592     if (v.userType() == QMetaType::QVariant)
   585     if (vid == v.userType())
       
   586         return *reinterpret_cast<const QVariant *>(v.constData());
   593         return *reinterpret_cast<const QVariant *>(v.constData());
   587     return v;
   594     return v;
   588 }
   595 }
   589 
   596 
   590 template<typename T>
   597 template<typename T>