📄 qglobal.cpp
字号:
\relates <QtGlobal> Typedef for \c{signed short}. This type is guaranteed to be 16-bit on all platforms supported by Qt.*//*! \typedef quint16 \relates <QtGlobal> Typedef for \c{unsigned short}. This type is guaranteed to be 16-bit on all platforms supported by Qt.*//*! \typedef qint32 \relates <QtGlobal> Typedef for \c{signed int}. This type is guaranteed to be 32-bit on all platforms supported by Qt.*//*! \typedef quint32 \relates <QtGlobal> Typedef for \c{unsigned int}. This type is guaranteed to be 32-bit on all platforms supported by Qt.*//*! \typedef qint64 \relates <QtGlobal> Typedef for \c{long long int} (\c __int64 on Windows). This type is guaranteed to be 64-bit on all platforms supported by Qt. Literals of this type can be created using the Q_INT64_C() macro: \code qint64 value = Q_INT64_C(932838457459459); \endcode \sa Q_INT64_C(), quint64, qlonglong*//*! \typedef quint64 \relates <QtGlobal> Typedef for \c{unsigned long long int} (\c{unsigned __int64} on Windows). This type is guaranteed to be 64-bit on all platforms supported by Qt. Literals of this type can be created using the Q_UINT64_C() macro: \code quint64 value = Q_UINT64_C(932838457459459); \endcode \sa Q_UINT64_C(), qint64, qulonglong*//*! \typedef quintptr \relates <QtGlobal> Integral type for representing a pointers (useful for hashing, etc.). Typedef for either quint32 or quint64. This type is guaranteed to be the same size as a pointer on all platforms supported by Qt. On a system with 32-bit pointers, quintptr is a typedef for quint32; on a system with 64-bit pointers, quintptr is a typedef for quint64. Note that quintptr is unsigned. Use qptrdiff for signed values. \sa qptrdiff, quint32, quint64*//*! \typedef qptrdiff \relates <QtGlobal> Integral type for representing pointer differences. Typedef for either qint32 or qint64. This type is guaranteed to be the same size as a pointer on all platforms supported by Qt. On a system with 32-bit pointers, quintptr is a typedef for quint32; on a system with 64-bit pointers, quintptr is a typedef for quint64. Note that qptrdiff is signed. Use quintptr for unsigned values. \sa quintptr, qint32, qint64*//*! \typedef QtMsgHandler \relates <QtGlobal> This is a typedef for a pointer to a function with the following signature: \code void myMsgHandler(QtMsgType, const char *); \endcode \sa QtMsgType, qInstallMsgHandler()*//*! \enum QtMsgType \relates <QtGlobal> This enum describes the messages that can be sent to a message handler (QtMsgHandler). You can use the enum to identify and associate the various message types with the appropriate actions. \value QtDebugMsg A message generated by the qDebug() function. \value QtWarningMsg A message generated by the qWarning() function. \value QtCriticalMsg A message generated by the qCritical() function. \value QtFatalMsg A message generated by the qFatal() function. \value QtSystemMsg \sa QtMsgHandler, qInstallMsgHandler()*//*! \macro qint64 Q_INT64_C(literal) \relates <QtGlobal> Wraps the signed 64-bit integer \a literal in a platform-independent way. For example: \code qint64 value = Q_INT64_C(932838457459459); \endcode \sa qint64, Q_UINT64_C()*//*! \macro quint64 Q_UINT64_C(literal) \relates <QtGlobal> Wraps the unsigned 64-bit integer \a literal in a platform-independent way. For example: \code quint64 value = Q_UINT64_C(932838457459459); \endcode \sa quint64, Q_INT64_C()*//*! \typedef qlonglong \relates <QtGlobal> Typedef for \c{long long int} (\c __int64 on Windows). This is the same as \l qint64. \sa qulonglong, qint64*//*! \typedef qulonglong \relates <QtGlobal> Typedef for \c{unsigned long long int} (\c{unsigned __int64} on Windows). This is the same as \l quint64. \sa quint64, qlonglong*//*! \fn const T &qAbs(const T &value) \relates <QtGlobal> Returns the absolute value of \a value. For example: \code int absoluteValue; int myValue = -4; absoluteValue = qAbs(myValue); // absoluteValue == 4 \endcode*//*! \fn int qRound(qreal value) \relates <QtGlobal> Rounds \a value to the nearest integer. For example: \code qreal valueA = 2.3; qreal valueB = 2.7; int roundedValueA = qRound(valueA); \\ roundedValueA = 2 int roundedValueB = qRound(valueB); \\ roundedValueB = 3 \endcode*//*! \fn qint64 qRound64(qreal value) \relates <QtGlobal> Rounds \a value to the nearest 64-bit integer. For example: \code qreal valueA = 42949672960.3; qreal valueB = 42949672960.7; int roundedValueA = qRound(valueA); \\ roundedValueA = 42949672960 int roundedValueB = qRound(valueB); \\ roundedValueB = 42949672961 \endcode*//*! \fn const T &qMin(const T &value1, const T &value2) \relates <QtGlobal> Returns the minimum of \a value1 and \a value2. For example: \code int myValue = 6; int yourValue = 4; int minValue = qMin(myValue, yourValue); // minValue == yourValue \endcode \sa qMax(), qBound()*//*! \fn const T &qMax(const T &value1, const T &value2) \relates <QtGlobal> Returns the maximum of \a value1 and \a value2. For example: \code int myValue = 6; int yourValue = 4; int maxValue = qMax(myValue, yourValue); // maxValue == myValue \endcode \sa qMin(), qBound()*//*! \fn const T &qBound(const T &min, const T &value, const T &max) \relates <QtGlobal> Returns \a value bounded by \a min and \a max. This is equivalent to qMax(\a min, qMin(\a value, \a max)). For example: \code int myValue = 10; int minValue = 2; int maxValue = 6; int boundedValue = qBound(minValue, myValue, maxValue); // boundedValue == 6 \endcode \sa qMin(), qMax()*//*! \typedef Q_INT8 \relates <QtGlobal> \compat Use \l qint8 instead.*//*! \typedef Q_UINT8 \relates <QtGlobal> \compat Use \l quint8 instead.*//*! \typedef Q_INT16 \relates <QtGlobal> \compat Use \l qint16 instead.*//*! \typedef Q_UINT16 \relates <QtGlobal> \compat Use \l quint16 instead.*//*! \typedef Q_INT32 \relates <QtGlobal> \compat Use \l qint32 instead.*//*! \typedef Q_UINT32 \relates <QtGlobal> \compat Use \l quint32 instead.*//*! \typedef Q_INT64 \relates <QtGlobal> \compat Use \l qint64 instead.*//*! \typedef Q_UINT64 \relates <QtGlobal> \compat Use \l quint64 instead.*//*! \typedef Q_LLONG \relates <QtGlobal> \compat Use \l qint64 instead.*//*! \typedef Q_ULLONG \relates <QtGlobal> \compat Use \l quint64 instead.*//*! \typedef Q_LONG \relates <QtGlobal> \compat Use \c{void *} instead.*//*! \typedef Q_ULONG \relates <QtGlobal> \compat Use \c{void *} instead.*//*! \fn bool qSysInfo(int *wordSize, bool *bigEndian) \relates <QtGlobal> Use QSysInfo::WordSize and QSysInfo::ByteOrder instead.*//*! \fn bool qt_winUnicode() \relates <QtGlobal> Use QSysInfo::WindowsVersion and QSysInfo::WV_DOS_based instead. \sa QSysInfo*//*! \fn int qWinVersion() \relates <QtGlobal> Use QSysInfo::WindowsVersion instead. \sa QSysInfo*//*! \fn int qMacVersion() \relates <QtGlobal> Use QSysInfo::MacintoshVersion instead. \sa QSysInfo*//*! \macro QT_VERSION \relates <QtGlobal> This macro expands a numeric value of the form 0xMMNNPP (MM = major, NN = minor, PP = patch) that specifies Qt's version number. For example, if you compile your application against Qt 4.1.2, the QT_VERSION macro will expand to 0x040102. You can use QT_VERSION to use the latest Qt features where available. For example: \code #if QT_VERSION >= 0x040100 QIcon icon = style()->standardIcon(QStyle::SP_TrashIcon); #else QPixmap pixmap = style()->standardPixmap(QStyle::SP_TrashIcon); QIcon icon(pixmap); #endif \endcode \sa QT_VERSION_STR, qVersion()*//*! \macro QT_VERSION_STR \relates <QtGlobal> This macro expands to a string that specifies Qt's version number (for example, "4.1.2"). This is the version against which the application is compiled. \sa qVersion(), QT_VERSION*//*! \relates <QtGlobal> Returns the version number of Qt at run-time as a string (for example, "4.1.2"). This may be a different version than the version the application was compiled against. \sa QT_VERSION_STR*/const char *qVersion(){ return QT_VERSION_STR;}bool qSharedBuild(){#ifdef QT_SHARED return true;#else return false;#endif}/***************************************************************************** System detection routines *****************************************************************************//*! \class QSysInfo \brief The QSysInfo class provides information about the system. \list \o \l WordSize specifies the size of a pointer for the platform on which the application is compiled. \o \l ByteOrder specifies whether the platform is big-endian or little-endian. \o \l WindowsVersion specifies the version of the Windows operating system on which the application is run (Windows only) \o \l MacintoshVersion specifies the version of the Macintosh operating system on which the application is run (Mac only). \endlist Some constants are defined only on certain platforms. You can use the preprocessor symbols Q_WS_WIN and Q_WS_MAC to test that the application is compiled under Windows or Mac. \sa QLibraryInfo*//*! \enum QSysInfo::Sizes This enum provides platform-specific information about the sizes of data structures used by the underlying architecture. \value WordSize The size in bits of a pointer for the platform on which the application is compiled (32 or 64).*//*! \variable QSysInfo::WindowsVersion \brief the version of the Windows operating system on which the application is run (Windows only)*//*! \variable QSysInfo::MacintoshVersion \brief the version of the Macintosh operating system on which the application is run (Mac only).*//*! \enum QSysInfo::Endian \value BigEndian Big-endian byte order (also called Network byte order) \value LittleEndian Little-endian byte order \value ByteOrder Equals BigEndian or LittleEndian, depending on the platform's byte order.*//*! \enum QSysInfo::WinVersion This enum provides symbolic names for the various versions of the
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -