📄 qglobal.h
字号:
# endif# define Q_C_CALLBACKS/* 4.2 compiler or older */# else# define Q_NO_BOOL_TYPE# define Q_NO_EXPLICIT_KEYWORD# define Q_NO_USING_KEYWORD# endif/* CDS++ does not seem to define __EDG__ or __EDG according to Reliant documentation but nevertheless uses EDG conventions like _BOOL */#elif defined(sinix)# define Q_CC_EDG# define Q_CC_CDS# if !defined(_BOOL)# define Q_NO_BOOL_TYPE# endif# define Q_BROKEN_TEMPLATE_SPECIALIZATION#elif defined(Q_OS_HPUX)/* __HP_aCC was not defined in first aCC releases */# if defined(__HP_aCC) || __cplusplus >= 199707L# define Q_CC_HPACC# else# define Q_CC_HP# define Q_NO_BOOL_TYPE# define Q_FULL_TEMPLATE_INSTANTIATION# define Q_BROKEN_TEMPLATE_SPECIALIZATION# define Q_NO_EXPLICIT_KEYWORD# endif# define Q_NO_USING_KEYWORD /* ### check "using" status */#else# error "Qt has not been tested with this compiler - talk to qt-bugs@trolltech.com"#endif#ifndef Q_PACKED# define Q_PACKED# undef Q_NO_PACKED_REFERENCE#endif#ifndef Q_CONSTRUCTOR_FUNCTION# define Q_CONSTRUCTOR_FUNCTION(AFUNC) \ static const int AFUNC ## __init_variable__ = AFUNC();#endif#ifndef Q_DESTRUCTOR_FUNCTION# define Q_DESTRUCTOR_FUNCTION(AFUNC) \ class AFUNC ## __dest_class__ { \ public: \ inline AFUNC ## __dest_class__() { } \ inline ~ AFUNC ## __dest_class__() { AFUNC(); } \ } AFUNC ## __dest_instance__;#endif/* The window system, must be one of: (Q_WS_x) MACX - Mac OS X MAC9 - Mac OS 9 QWS - Qtopia Core WIN32 - Windows X11 - X Window System PM - unsupported WIN16 - unsupported*/#if defined(Q_OS_MSDOS)# define Q_WS_WIN16# error "Qt requires Win32 and does not work with Windows 3.x"#elif defined(_WIN32_X11_)# define Q_WS_X11#elif defined(Q_OS_WIN32)# define Q_WS_WIN32# if defined(Q_OS_WIN64)# define Q_WS_WIN64# endif#elif defined(Q_OS_OS2)# define Q_WS_PM# error "Qt does not work with OS/2 Presentation Manager or Workplace Shell"#elif defined(Q_OS_UNIX)# if defined(Q_OS_DARWIN) && !defined(__USE_WS_X11__)# define Q_WS_MAC# define Q_WS_MACX# elif !defined(Q_WS_QWS)# define Q_WS_X11# endif#endif#if defined(Q_WS_WIN16) || defined(Q_WS_WIN32)# define Q_WS_WIN#endif/* Size-dependent types (architechture-dependent byte order)*/typedef signed char qint8; /* 8 bit signed */typedef unsigned char quint8; /* 8 bit unsigned */typedef short qint16; /* 16 bit signed */typedef unsigned short quint16; /* 16 bit unsigned */typedef int qint32; /* 32 bit signed */typedef unsigned int quint32; /* 32 bit unsigned */#if defined(Q_OS_WIN) && !defined(Q_CC_GNU)# define Q_INT64_C(c) c ## i64 /* signed 64 bit constant */# define Q_UINT64_C(c) c ## ui64 /* unsigned 64 bit constant */typedef __int64 qint64; /* 64 bit signed */typedef unsigned __int64 quint64; /* 64 bit unsigned */#else# define Q_INT64_C(c) static_cast<long long>(c ## LL) /* signed 64 bit constant */# define Q_UINT64_C(c) static_cast<unsigned long long>(c ## ULL) /* unsigned 64 bit constant */typedef long long qint64; /* 64 bit signed */typedef unsigned long long quint64; /* 64 bit unsigned */#endiftypedef qint64 qlonglong;typedef quint64 qulonglong;#if defined(Q_OS_WIN64)# define QT_POINTER_SIZE 8#elif defined(Q_OS_WIN32)# define QT_POINTER_SIZE 4#endif#define Q_INIT_RESOURCE(name) \ do { extern int qInitResources_ ## name (); \ qInitResources_ ## name (); } while (0)#define Q_CLEANUP_RESOURCE(name) \ do { extern int qCleanupResources_ ## name (); \ qCleanupResources_ ## name (); } while (0)#if defined(__cplusplus)/* Useful type definitions for Qt*/typedef unsigned char uchar;typedef unsigned short ushort;typedef unsigned int uint;typedef unsigned long ulong;#if defined(Q_NO_BOOL_TYPE)#error "Compiler doesn't support the bool type"#endif/* Constant bool values*/#ifndef TRUE#define TRUE true#define FALSE false#endif#if defined(Q_OS_MAC)#define QT_BEGIN_HEADER extern "C++" {#define QT_END_HEADER }#else#define QT_BEGIN_HEADER#define QT_END_HEADER#endifQT_BEGIN_HEADER/* Proper for-scoping in VC++6 and MIPSpro CC*/#if (defined(Q_CC_MSVC) && !defined(Q_CC_MSVC_NET) && !defined(Q_CC_INTEL)) || defined(Q_CC_MIPS)# define for if(0){}else for#endif/* Workaround for static const members on MSVC++.*/#if defined(Q_CC_MSVC)# define QT_STATIC_CONST static# define QT_STATIC_CONST_IMPL#else# define QT_STATIC_CONST static const# define QT_STATIC_CONST_IMPL const#endif/* Warnings and errors when using deprecated methods*/#if defined(Q_MOC_RUN)# define Q_DECL_DEPRECATED Q_DECL_DEPRECATED#elif defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && (__GNUC__ - 0 > 3 || (__GNUC__ - 0 == 3 && __GNUC_MINOR__ - 0 >= 2))# define Q_DECL_DEPRECATED __attribute__ ((__deprecated__))#elif defined(Q_CC_MSVC) && (_MSC_VER >= 1300)# define Q_DECL_DEPRECATED __declspec(deprecated)# if defined (Q_CC_INTEL)# define Q_DECL_VARIABLE_DEPRECATED# else# endif#else# define Q_DECL_DEPRECATED#endif#ifndef Q_DECL_VARIABLE_DEPRECATED# define Q_DECL_VARIABLE_DEPRECATED Q_DECL_DEPRECATED#endif#ifndef QT3_SUPPORT_CONSTRUCTOR# if defined(Q_MOC_RUN)# define Q_DECL_CONSTRUCTOR_DEPRECATED Q_DECL_CONSTRUCTOR_DEPRECATED# elif defined(Q_NO_DEPRECATED_CONSTRUCTORS)# define Q_DECL_CONSTRUCTOR_DEPRECATED# else# define Q_DECL_CONSTRUCTOR_DEPRECATED Q_DECL_DEPRECATED# endif#endif#if defined(QT3_SUPPORT_WARNINGS)# if !defined(QT_COMPAT_WARNINGS) /* also enable compat */# define QT_COMPAT_WARNINGS# endif# undef QT3_SUPPORT# define QT3_SUPPORT Q_DECL_DEPRECATED# undef QT3_SUPPORT_VARIABLE# define QT3_SUPPORT_VARIABLE Q_DECL_VARIABLE_DEPRECATED# undef QT3_SUPPORT_CONSTRUCTOR# define QT3_SUPPORT_CONSTRUCTOR explicit Q_DECL_CONSTRUCTOR_DEPRECATED#elif defined(QT3_SUPPORT) /* define back to nothing */# if !defined(QT_COMPAT) /* also enable qt3 support */# define QT_COMPAT# endif# undef QT3_SUPPORT# define QT3_SUPPORT# undef QT3_SUPPORT_VARIABLE# define QT3_SUPPORT_VARIABLE# undef QT3_SUPPORT_CONSTRUCTOR# define QT3_SUPPORT_CONSTRUCTOR explicit#endif#if defined(QT_COMPAT_WARNINGS)# undef QT_COMPAT# define QT_COMPAT Q_DECL_DEPRECATED# undef QT_COMPAT_VARIABLE# define QT_COMPAT_VARIABLE Q_DECL_VARIABLE_DEPRECATED# undef QT_COMPAT_CONSTRUCTOR# define QT_COMPAT_CONSTRUCTOR explicit Q_DECL_CONSTRUCTOR_DEPRECATED#elif defined(QT_COMPAT) /* define back to nothing */# undef QT_COMPAT# define QT_COMPAT# undef QT_COMPAT_VARIABLE# define QT_COMPAT_VARIABLE# undef QT_COMPAT_CONSTRUCTOR# define QT_COMPAT_CONSTRUCTOR#endif/* moc compats (signals/slots) */#ifndef QT_MOC_COMPAT# if defined(QT3_SUPPORT)# define QT_MOC_COMPAT QT3_SUPPORT# else# define QT_MOC_COMPAT# endif#else# undef QT_MOC_COMPAT# define QT_MOC_COMPAT#endif#ifdef __i386__# if defined(Q_CC_GNU)#if !defined(Q_CC_INTEL) && ((100*(__GNUC__ - 0) + 10*(__GNUC_MINOR__ - 0) + __GNUC_PATCHLEVEL__) >= 332)# define QT_FASTCALL __attribute__((regparm(3)))#else# define QT_FASTCALL#endif# elif defined(Q_CC_MSVC)# define QT_FASTCALL __fastcall# else# define QT_FASTCALL# endif#else# define QT_FASTCALL#endiftypedef int QNoImplicitBoolCast;#if defined(QT_COORD_TYPE)typedef QT_COORD_TYPE qreal;#elif defined(__arm__)typedef float qreal;#elsetypedef double qreal;#endif/* Utility macros and inline functions*/template <typename T>inline T qAbs(const T &t) { return t >= 0 ? t : -t; }inline int qRound(qreal d){ return d >= 0.0 ? int(d + 0.5) : int(d - int(d-1) + 0.5) + int(d-1); }inline qint64 qRound64(qreal d){ return d >= 0.0 ? qint64(d + 0.5) : qint64(d - qint64(d-1) + 0.5) + qint64(d-1); }template <typename T>inline const T &qMin(const T &a, const T &b) { if (a < b) return a; return b; }template <typename T>inline const T &qMax(const T &a, const T &b) { if (a < b) return b; return a; }template <typename T>inline const T &qBound(const T &min, const T &val, const T &max){ return qMax(min, qMin(max, val)); }#ifdef QT3_SUPPORTtypedef qint8 Q_INT8;typedef quint8 Q_UINT8;typedef qint16 Q_INT16;typedef quint16 Q_UINT16;typedef qint32 Q_INT32;typedef quint32 Q_UINT32;typedef qint64 Q_INT64;typedef quint64 Q_UINT64;typedef qint64 Q_LLONG;typedef quint64 Q_ULLONG;#if defined(Q_OS_WIN64)typedef __int64 Q_LONG; /* word up to 64 bit signed */typedef unsigned __int64 Q_ULONG; /* word up to 64 bit unsigned */#elsetypedef long Q_LONG; /* word up to 64 bit signed */typedef unsigned long Q_ULONG; /* word up to 64 bit unsigned */#endif# define QABS(a) qAbs(a)# define QMAX(a, b) qMax((a), (b))# define QMIN(a, b) qMin((a), (b))#endif/* Data stream functions are provided by many classes (defined in qdatastream.h)*/class QDataStream;#ifdef Q_OS_DARWIN# ifdef MAC_OS_X_VERSION_MIN_REQUIRED# undef MAC_OS_X_VERSION_MIN_REQUIRED# endif# define MAC_OS_X_VERSION_MIN_REQUIRED MAC_OS_X_VERSION_10_2# include <AvailabilityMacros.h># if !defined(MAC_OS_X_VERSION_10_3)# define MAC_OS_X_VERSION_10_3 MAC_OS_X_VERSION_10_2 + 1# endif# if !defined(MAC_OS_X_VERSION_10_4)# define MAC_OS_X_VERSION_10_4 MAC_OS_X_VERSION_10_3 + 1# endif# if (MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_4)# error "This version of Mac OS X is unsupported"# endif#endif#ifndef QT_BUILD_KEY#define QT_BUILD_KEY "unspecified"#endif#if defined(Q_WS_MAC)# ifndef QMAC_QMENUBAR_NO_EVENT# define QMAC_QMENUBAR_NO_EVENT# endif#endif#if !defined(Q_WS_QWS) && !defined(QT_NO_COP)# define QT_NO_COP#endif# include <QtCore/qfeatures.h>#ifndef Q_DECL_EXPORT# ifdef Q_OS_WIN# define Q_DECL_EXPORT __declspec(dllexport)# elif defined(QT_VISIBILITY_AVAILABLE)# define Q_DECL_EXPORT __attribute__((visibility("default")))# endif# ifndef Q_DECL_EXPORT# define Q_DECL_EXPORT# endif#endif#ifndef Q_DECL_IMPORT# ifdef Q_OS_WIN# define Q_DECL_IMPORT __declspec(dllimport)# else# define Q_DECL_IMPORT# endif#endif/* Create Qt DLL if QT_DLL is defined (Windows only) or QT_SHARED is defined (Kylix only)*/#if defined(Q_OS_WIN)# if defined(QT_NODLL)# undef QT_MAKEDLL# undef QT_DLL# elif defined(QT_MAKEDLL) /* create a Qt DLL library */# if defined(QT_DLL)# undef QT_DLL# endif# if defined(QT_BUILD_CORE_LIB)# define Q_CORE_EXPORT Q_DECL_EXPORT# else# define Q_CORE_EXPORT Q_DECL_IMPORT# endif# if defined(QT_BUILD_GUI_LIB)# define Q_GUI_EXPORT Q_DECL_EXPORT# else# define Q_GUI_EXPORT Q_DECL_IMPORT# endif# if defined(QT_BUILD_SQL_LIB)# define Q_SQL_EXPORT Q_DECL_EXPORT# else# define Q_SQL_EXPORT Q_DECL_IMPORT# endif# if defined(QT_BUILD_NETWORK_LIB)# define Q_NETWORK_EXPORT Q_DECL_EXPORT# else# define Q_NETWORK_EXPORT Q_DECL_IMPORT# endif# if defined(QT_BUILD_SVG_LIB)# define Q_SVG_EXPORT Q_DECL_EXPORT# else# define Q_SVG_EXPORT Q_DECL_IMPORT# endif# if defined(QT_BUILD_OPENGL_LIB)# define Q_OPENGL_EXPORT Q_DECL_EXPORT# else# define Q_OPENGL_EXPORT Q_DECL_IMPORT# endif# if defined(QT_BUILD_XML_LIB)# define Q_XML_EXPORT Q_DECL_EXPORT# else# define Q_XML_EXPORT Q_DECL_IMPORT# endif# if defined(QT_BUILD_CANVAS_LIB)# define Q_CANVAS_EXPORT Q_DECL_EXPORT# else# define Q_CANVAS_EXPORT Q_DECL_IMPORT# endif# if defined(QT_BUILD_COMPAT_LIB)# define Q_COMPAT_EXPORT Q_DECL_EXPORT# else# define Q_COMPAT_EXPORT Q_DECL_IMPORT# endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -