Qt - 全局数据类型
<QtGlobal>
1 typedef signed char qint8; /* 8 bit signed */ 2 typedef unsigned char quint8; /* 8 bit unsigned */ 3 typedef short qint16; /* 16 bit signed */ 4 typedef unsigned short quint16; /* 16 bit unsigned */ 5 typedef int qint32; /* 32 bit signed */ 6 typedef unsigned int quint32; /* 32 bit unsigned */ 7 #if defined(Q_OS_WIN) && !defined(Q_CC_GNU) && !defined(Q_CC_MWERKS) 8 # define Q_INT64_C(c) c ## i64 /* signed 64 bit constant */ 9 # define Q_UINT64_C(c) c ## ui64 /* unsigned 64 bit constant */ 10 typedef __int64 qint64; /* 64 bit signed */ 11 typedef unsigned __int64 quint64; /* 64 bit unsigned */ 12 #else 13 # define Q_INT64_C(c) static_cast<long long>(c ## LL) /* signed 64 bit constant */ 14 # define Q_UINT64_C(c) static_cast<unsigned long long>(c ## ULL) /* unsigned 64 bit constant */ 15 typedef long long qint64; /* 64 bit signed */ 16 typedef unsigned long long quint64; /* 64 bit unsigned */ 17 #endif 18 19 typedef qint64 qlonglong; 20 typedef quint64 qulonglong; 21 22 template <int> struct QIntegerForSize; 23 template <> struct QIntegerForSize<1> { typedef quint8 Unsigned; typedef qint8 Signed; }; 24 template <> struct QIntegerForSize<2> { typedef quint16 Unsigned; typedef qint16 Signed; }; 25 template <> struct QIntegerForSize<4> { typedef quint32 Unsigned; typedef qint32 Signed; }; 26 template <> struct QIntegerForSize<8> { typedef quint64 Unsigned; typedef qint64 Signed; }; 27 template <class T> struct QIntegerForSizeof: QIntegerForSize<sizeof(T)> { }; 28 typedef QIntegerForSizeof<void*>::Unsigned quintptr; 29 typedef QIntegerForSizeof<void*>::Signed qptrdiff; 30 31 typedef unsigned char uchar; 32 typedef unsigned short ushort; 33 typedef unsigned int uint; 34 typedef unsigned long ulong;