⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qglobal.cpp

📁 QT 开发环境里面一个很重要的文件
💻 CPP
📖 第 1 页 / 共 5 页
字号:
*//*!    \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 (unsupported)    \value MV_10_1     Mac OS X 10.1 (unsupported)    \value MV_10_2     Mac OS X 10.2 (unsupported)    \value MV_10_3     Mac OS X 10.3    \value MV_10_4     Mac OS X 10.4    \value MV_10_5     Mac OS X 10.5    \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    \value MV_LEOPARD  Apple codename for MV_10_5    \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 all supported versions of Windows.*//*!    \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.*//*!    \macro Q_OS_BSD4    \relates <QtGlobal>    Defined on Any BSD 4.4 system.*//*!    \macro Q_OS_UNIX    \relates <QtGlobal>    Defined on Any UNIX BSD/SYSV system.*//*!    \macro Q_CC_SYM    \relates <QtGlobal>    Defined if the application is compiled using Digital Mars C/C++    (used to be Symantec C++).*//*!    \macro Q_CC_MWERKS    \relates <QtGlobal>    Defined if the application is compiled using Metrowerks    CodeWarrior.*//*!    \macro Q_CC_MSVC    \relates <QtGlobal>    Defined if the application is compiled using Microsoft Visual    C/C++, Intel C++ for Windows.*//*!    \macro Q_CC_BOR    \relates <QtGlobal>    Defined if the application is compiled using Borland/Turbo C++.*//*!    \macro Q_CC_WAT    \relates <QtGlobal>    Defined if the application is compiled using Watcom C++.*//*!    \macro Q_CC_GNU    \relates <QtGlobal>    Defined if the application is compiled using GNU C++.*//*!    \macro Q_CC_COMEAU    \relates <QtGlobal>    Defined if the application is compiled using Comeau C++.*//*!    \macro Q_CC_EDG    \relates <QtGlobal>    Defined if the application is compiled using Edison Design Group    C++.*//*!    \macro Q_CC_OC    \relates <QtGlobal>    Defined if the application is compiled using CenterLine C++.*//*!    \macro Q_CC_SUN    \relates <QtGlobal>    Defined if the application is compiled using Forte Developer, or    Sun Studio C++.*//*!    \macro Q_CC_MIPS    \relates <QtGlobal>    Defined if the application is compiled using MIPSpro C++.*//*!    \macro Q_CC_DEC    \relates <QtGlobal>    Defined if the application is compiled using DEC C++.*//*!    \macro Q_CC_HPACC    \relates <QtGlobal>    Defined if the application is compiled using HP aC++.*//*!    \macro Q_CC_USLC    \relates <QtGlobal>    Defined if the application is compiled using SCO OUDK and UDK.*//*!    \macro Q_CC_CDS    \relates <QtGlobal>    Defined if the application is compiled using Reliant C++.*//*!    \macro Q_CC_KAI    \relates <QtGlobal>    Defined if the application is compiled using KAI C++.*//*!    \macro Q_CC_INTEL    \relates <QtGlobal>    Defined if the application is compiled using Intel C++ for Linux,    Intel C++ for Windows.*//*!    \macro Q_CC_HIGHC    \relates <QtGlobal>    Defined if the application is compiled using MetaWare High C/C++.*//*!    \macro Q_CC_PGI    \relates <QtGlobal>    Defined if the application is compiled using Portland Group C++.*//*!    \macro Q_CC_GHS    \relates <QtGlobal>    Defined if the application is compiled using Green Hills    Optimizing C++ Compilers.*/#if !defined(Q_BYTE_ORDER) && defined(QT_BUILD_QMAKE)// needed to bootstrap qmakestatic const unsigned int qt_one = 1;const int QSysInfo::ByteOrder = ((*((unsigned char *) &qt_one) == 0) ? BigEndian : LittleEndian);#endif#if !defined(QWS) && defined(Q_OS_MAC)#include "private/qcore_mac_p.h"#include "qnamespace.h"// This function has descended from Apple Source Code (FSpLocationFromFullPath),// but changes have been made. [Creates a minimal alias from the full pathname]Q_CORE_EXPORT OSErr qt_mac_create_fsspec(const QString &file, FSSpec *spec){    FSRef fref;    QByteArray utfs = file.toUtf8();    OSErr ret = FSPathMakeRef((const UInt8 *)utfs.data(), &fref, NULL);    if(ret == noErr)        ret = FSGetCatalogInfo(&fref, kFSCatInfoNone, NULL, NULL, spec, NULL);    return ret;}Q_CORE_EXPORT void qt_mac_to_pascal_string(QString s, Str255 str, TextEncoding encoding=0, int len=-1){    if(len == -1)        len = s.length();#if 0    UnicodeMapping mapping;    mapping.unicodeEncoding = CreateTextEncoding(kTextEncodingUnicodeDefault,                                                 kTextEncodingDefaultVariant,                                                 kUnicode16BitFormat);    mapping.otherEncoding = (encoding ? encoding : );    mapping.mappingVersion = kUnicodeUseLatestMapping;    UnicodeToTextInfo info;    OSStatus err = CreateUnicodeToTextInfo(&mapping, &info);    if(err != noErr) {        qDebug("Qt: internal: Unable to create pascal string '%s'::%d [%ld]",               s.left(len).latin1(), (int)encoding, err);        return;    }    const int unilen = len * 2;    const UniChar *unibuf = (UniChar *)s.unicode();    ConvertFromUnicodeToPString(info, unilen, unibuf, str);    DisposeUnicodeToTextInfo(&info);#else    Q_UNUSED(encoding);    CFStringGetPascalString(QCFString(s), str, 256, CFStringGetSystemEncoding());#endif}Q_CORE_EXPORT QString qt_mac_from_pascal_string(const Str255 pstr) {    return QCFString(CFStringCreateWithPascalString(0, pstr, CFStringGetSystemEncoding()));}static QSysInfo::MacVersion macVersion(){#if __LP64__typedef signed int SInt32;#elsetypedef signed long SInt32;#endif    SInt32 gestalt_version;    if (Gestalt(gestaltSystemVersion, &gestalt_version) == noErr) {        if (gestalt_version >= 0x1050 && gestalt_version < 0x1060)            return QSysInfo::MV_10_5;        else if (gestalt_version >= 0x1040 && gestalt_version < 0x1050)            return QSysInfo::MV_10_4;        else if (gestalt_version >= 0x1030 && gestalt_version < 0x1040)            return QSysInfo::MV_10_3;        else if (gestalt_version >= 0x1020 && gestalt_version < 0x1030)            return QSysInfo::MV_10_2;        else if (gestalt_version >= 0x1010 && gestalt_version < 0x1020)            return QSysInfo::MV_10_1;        else if (gestalt_version >= 0x1000 && gestalt_version < 0x1010)            return QSysInfo::MV_10_0;    }    return QSysInfo::MV_Unknown;}const QSysInfo::MacVersion QSysInfo::MacintoshVersion = macVersion();#elif defined(Q_OS_WIN32) || defined(Q_OS_CYGWIN) || defined(Q_OS_TEMP)#include "qt_windows.h"static QSysInfo::WinVersion winVersion(){#ifndef VER_PLATFORM_WIN32s#define VER_PLATFORM_WIN32s            0#endif#ifndef VER_PLATFORM_WIN32_WINDOWS#define VER_PLATFORM_WIN32_WINDOWS  1#endif#ifndef VER_PLATFORM_WIN32_NT#define VER_PLATFORM_WIN32_NT            2#endif#ifndef VER_PLATFORM_WIN32_CE#define VER_PLATFORM_WIN32_CE            3#endif    static QSysInfo::WinVersion winver = QSysInfo::WV_NT;#ifndef Q_OS_TEMP    OSVERSIONINFOA osver;    osver.dwOSVersionInfoSize = sizeof(osver);    GetVersionExA(&osver);#else    DWORD qt_cever = 0;    OSVERSIONINFOW osver;    osver.dwOSVersionInfoSize = sizeof(osver);    GetVersionEx(&osver);    qt_cever = osver.dwMajorVersion * 100;    qt_cever += osver.dwMinorVersion * 10;#endif    switch (osver.dwPlatformId) {    case VER_PLATFORM_WIN32s:        winver = QSysInfo::WV_32s;        break;    case VER_PLATFORM_WIN32_WINDOWS:        // We treat Windows Me (minor 90) the same as Windows 98        if (osver.dwMinorVersion == 90)            winver = QSysInfo::WV_Me;        else if (osver.dwMinorVersion == 10)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -