📄 qglobal.cpp
字号:
*//*! \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*//*! \variable QSysInfo::WordSize \brief 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 Windows operating system. On Windows, the QSysInfo::WindowsVersion variable gives the version of the system on which the application is run. MS-DOS-based versions: \value WV_32s Windows 3.1 wth Win 32s \value WV_95 Windows 95 \value WV_98 Windows 98 \value WV_Me Windows Me NT-based versions: \value WV_NT Windows NT \value WV_2000 Windows 2000 \value WV_XP Windows XP \value WV_2003 Windows Server 2003 \value WV_VISTA Windows Vista CE-based versions: \value WV_CE Windows CE \value WV_CENET Windows CE .NET The following masks can be used for testing whether a Windows version is MS-DOS-based, NT-based, or CE-based: \value WV_DOS_based MS-DOS-based version of Windows \value WV_NT_based NT-based version of Windows \value WV_CE_based CE-based version of Windows \sa MacVersion*//*! \enum QSysInfo::MacVersion This enum provides symbolic names for the various versions of the Macintosh operating system. On Mac, the QSysInfo::MacintoshVersion variable gives the version of the system on which the application is run. \value MV_9 Mac OS 9 (unsupported) \value MV_10_0 Mac OS X 10.0 \value MV_10_1 Mac OS X 10.1 \value MV_10_2 Mac OS X 10.2 \value MV_10_3 Mac OS X 10.3 \value MV_10_4 Mac OS X 10.4 \value MV_Unknown An unknown and currently unsupported platform \value MV_CHEETAH Apple codename for MV_10_0 \value MV_PUMA Apple codename for MV_10_1 \value MV_JAGUAR Apple codename for MV_10_2 \value MV_PANTHER Apple codename for MV_10_3 \value MV_TIGER Apple codename for MV_10_4 \sa WinVersion*//*! \macro Q_WS_MAC \relates <QtGlobal> Defined on Mac OS X. \sa Q_WS_WIN, Q_WS_X11, Q_WS_QWS*//*! \macro Q_WS_WIN \relates <QtGlobal> Defined on Windows. \sa Q_WS_MAC, Q_WS_X11, Q_WS_QWS*//*! \macro Q_WS_X11 \relates <QtGlobal> Defined on X11. \sa Q_WS_MAC, Q_WS_WIN, Q_WS_QWS*//*! \macro Q_WS_QWS \relates <QtGlobal> Defined on Qtopia Core. \sa Q_WS_MAC, Q_WS_WIN, Q_WS_X11*//*! \macro Q_OS_DARWIN \relates <QtGlobal> Defined on Darwin OS (synonym for Q_OS_MAC).*//*! \macro Q_OS_MSDOS \relates <QtGlobal> Defined on MS-DOS and Windows.*//*! \macro Q_OS_OS2 \relates <QtGlobal> Defined on OS/2.*//*! \macro Q_OS_OS2EMX \relates <QtGlobal> Defined on XFree86 on OS/2 (not PM).*//*! \macro Q_OS_WIN32 \relates <QtGlobal> Defined on Win32 (Windows 98/ME and Windows NT/2000/XP).*//*! \macro Q_OS_CYGWIN \relates <QtGlobal> Defined on Cygwin.*//*! \macro Q_OS_SOLARIS \relates <QtGlobal> Defined on Sun Solaris.*//*! \macro Q_OS_HPUX \relates <QtGlobal> Defined on HP-UX.*//*! \macro Q_OS_ULTRIX \relates <QtGlobal> Defined on DEC Ultrix.*//*! \macro Q_OS_LINUX \relates <QtGlobal> Defined on Linux.*//*! \macro Q_OS_FREEBSD \relates <QtGlobal> Defined on FreeBSD.*//*! \macro Q_OS_NETBSD \relates <QtGlobal> Defined on NetBSD.*//*! \macro Q_OS_OPENBSD \relates <QtGlobal> Defined on OpenBSD.*//*! \macro Q_OS_BSDI \relates <QtGlobal> Defined on BSD/OS.*//*! \macro Q_OS_IRIX \relates <QtGlobal> Defined on SGI Irix.*//*! \macro Q_OS_OSF \relates <QtGlobal> Defined on HP Tru64 UNIX.*//*! \macro Q_OS_SCO \relates <QtGlobal> Defined on SCO OpenServer 5.*//*! \macro Q_OS_UNIXWARE \relates <QtGlobal> Defined on UnixWare 7, Open UNIX 8.*//*! \macro Q_OS_AIX \relates <QtGlobal> Defined on AIX.*//*! \macro Q_OS_HURD \relates <QtGlobal> Defined on GNU Hurd.*//*! \macro Q_OS_DGUX \relates <QtGlobal> Defined on DG/UX.*//*! \macro Q_OS_RELIANT \relates <QtGlobal> Defined on Reliant UNIX.*//*! \macro Q_OS_DYNIX \relates <QtGlobal> Defined on DYNIX/ptx.*//*! \macro Q_OS_QNX \relates <QtGlobal> Defined on QNX.*//*! \macro Q_OS_QNX6 \relates <QtGlobal> Defined on QNX RTP 6.1.*//*! \macro Q_OS_LYNX \relates <QtGlobal> Defined on LynxOS.*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -