📄 qglobal.h
字号:
#elif defined(QCONFIG_SMALL)#include "qconfig-small.h"#elif defined(QCONFIG_MEDIUM)#include "qconfig-medium.h"#elif defined(QCONFIG_LARGE)#include "qconfig-large.h"#else // everything...#include "qconfig.h"#endif#endif#ifndef QT_BUILD_KEY#define QT_BUILD_KEY "unspecified"#endif// prune to local config#include "qmodules.h"#ifndef QT_MODULE_DIALOGS# define QT_NO_DIALOG#endif#ifndef QT_MODULE_ICONVIEW# define QT_NO_ICONVIEW#endif#ifndef QT_MODULE_WORKSPACE# define QT_NO_WORKSPACE#endif#ifndef QT_MODULE_NETWORK#define QT_NO_NETWORK#endif#ifndef QT_MODULE_CANVAS# define QT_NO_CANVAS#endif#ifndef QT_MODULE_TABLE#define QT_NO_TABLE#endif#ifndef QT_MODULE_XML# define QT_NO_XML#endif#ifndef QT_MODULE_OPENGL# define QT_NO_OPENGL#endif#if !defined(QT_MODULE_SQL)# define QT_NO_SQL#endif#if defined(Q_WS_MAC9)//No need for menu merging# ifndef QMAC_QMENUBAR_NO_MERGE# define QMAC_QMENUBAR_NO_MERGE# endif//Mac9 does not use quartz# ifndef QMAC_NO_QUARTZ# define QMAC_NO_QUARTZ# endif# ifndef QMAC_QMENUBAR_NO_EVENT# define QMAC_QMENUBAR_NO_EVENT# endif#endif#if defined(Q_WS_MACX) //for no nobody uses quartz, just putting in first level hooks# ifndef QMAC_NO_QUARTZ# define QMAC_NO_QUARTZ# endif# 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#ifndef QT_H#include "qfeatures.h"#endif // QT_H//// 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# define Q_EXPORT __declspec(dllexport)# define Q_TEMPLATEDLL# define Q_TEMPLATE_EXTERN# undef Q_DISABLE_COPY /* avoid unresolved externals */# elif defined(QT_DLL) /* use a Qt DLL library */# define Q_EXPORT __declspec(dllimport)# define Q_TEMPLATEDLL# ifndef Q_TEMPLATE_EXTERN# if defined(Q_CC_MSVC_NET)# define Q_TEMPLATE_EXTERN extern# else# define Q_TEMPLATE_EXTERN# endif# endif# undef Q_DISABLE_COPY /* avoid unresolved externals */# endif#elif defined(Q_OS_LINUX) && defined(Q_CC_BOR)# if defined(QT_SHARED) /* create a Qt shared library */# define Q_EXPORT __declspec(dllexport)# define Q_TEMPLATEDLL# define Q_TEMPLATE_EXTERN# undef Q_DISABLE_COPY /* avoid unresolved externals */# else# define Q_TEMPLATEDLL# define Q_TEMPLATE_EXTERN# undef Q_DISABLE_COPY /* avoid unresolved externals */# endif#else# undef QT_MAKEDLL /* ignore these for other platforms */# undef QT_DLL#endif#ifndef Q_EXPORT# define Q_EXPORT#endif//// Some platform specific stuff//#if defined(Q_WS_WIN)extern Q_EXPORT bool qt_winunicode;#endif//// System information//Q_EXPORT const char *qVersion();Q_EXPORT bool qSysInfo( int *wordSize, bool *bigEndian );Q_EXPORT bool qSharedBuild();#if defined(Q_OS_MAC)int qMacVersion();#elif defined(Q_WS_WIN)Q_EXPORT int qWinVersion();#if defined(UNICODE)#define QT_WA( uni, ansi ) if ( qt_winunicode ) { uni } else { ansi }#define QT_WA_INLINE( uni, ansi ) ( qt_winunicode ? uni : ansi )#else#define QT_WA( uni, ansi ) ansi#define QT_WA_INLINE( uni, ansi ) ansi#endif#endif#ifdef Q_OS_TEMP#ifdef QT_WA#undef QT_WA#undef QT_WA_INLINE#endif#define QT_WA( uni, ansi ) uni#define QT_WA_INLINE( uni, ansi ) ( uni )#endif#ifndef Q_INLINE_TEMPLATES# define Q_INLINE_TEMPLATES#endif#ifndef Q_TYPENAME# define Q_TYPENAME typename#endif//// Use to avoid "unused parameter" warnings//#define Q_UNUSED(x) (void)x;//// Debugging and error handling//#if !defined(QT_NO_CHECK)# define QT_CHECK_STATE // check state of objects etc.# define QT_CHECK_RANGE // check range of indexes etc.# define QT_CHECK_NULL // check null pointers# define QT_CHECK_MATH // check math functions#endif#if !defined(QT_NO_DEBUG) && !defined(QT_DEBUG)# define QT_DEBUG // display debug messages# if !defined(QT_NO_COMPAT) // compatibility with Qt 2# if !defined(NO_DEBUG) && !defined(DEBUG)# if !defined(Q_OS_MACX) // clash with MacOS X headers# define DEBUG# endif# endif# endif#endifQ_EXPORT void qDebug( const char *, ... ) // print debug message#if defined(Q_CC_GNU) && !defined(__INSURE__) __attribute__ ((format (printf, 1, 2)))#endif;Q_EXPORT void qWarning( const char *, ... ) // print warning message#if defined(Q_CC_GNU) && !defined(__INSURE__) __attribute__ ((format (printf, 1, 2)))#endif;Q_EXPORT void qFatal( const char *, ... ) // print fatal message and exit#if defined(Q_CC_GNU) __attribute__ ((format (printf, 1, 2)))#endif;Q_EXPORT void qSystemWarning( const char *, int code = -1 );#if !defined(QT_CLEAN_NAMESPACE) // compatibility with Qt 1Q_EXPORT void debug( const char *, ... ) // print debug message#if defined(Q_CC_GNU) && !defined(__INSURE__) __attribute__ ((format (printf, 1, 2)))#endif;Q_EXPORT void warning( const char *, ... ) // print warning message#if defined(Q_CC_GNU) && !defined(__INSURE__) __attribute__ ((format (printf, 1, 2)))#endif;Q_EXPORT void fatal( const char *, ... ) // print fatal message and exit#if defined(Q_CC_GNU) && !defined(__INSURE__) __attribute__ ((format (printf, 1, 2)))#endif;#endif // QT_CLEAN_NAMESPACE#if !defined(Q_ASSERT)# if defined(QT_CHECK_STATE)# if defined(QT_FATAL_ASSERT)# define Q_ASSERT(x) ((x) ? (void)0 : qFatal("ASSERT: \"%s\" in %s (%d)",#x,__FILE__,__LINE__))# else# define Q_ASSERT(x) ((x) ? (void)0 : qWarning("ASSERT: \"%s\" in %s (%d)",#x,__FILE__,__LINE__))# endif# else# define Q_ASSERT(x)# endif#endif#if !defined(QT_NO_COMPAT) // compatibility with Qt 2# if !defined(ASSERT)# if !defined(Q_OS_TEMP)# define ASSERT(x) Q_ASSERT(x)# endif# endif#endif // QT_NO_COMPATQ_EXPORT bool qt_check_pointer( bool c, const char *, int );#if defined(QT_CHECK_NULL)# define Q_CHECK_PTR(p) (qt_check_pointer((p)==0,__FILE__,__LINE__))#else# define Q_CHECK_PTR(p)#endif#if !defined(QT_NO_COMPAT) // compatibility with Qt 2# if !defined(CHECK_PTR)# define CHECK_PTR(x) Q_CHECK_PTR(x)# endif#endif // QT_NO_COMPATenum QtMsgType { QtDebugMsg, QtWarningMsg, QtFatalMsg };typedef void (*QtMsgHandler)(QtMsgType, const char *);Q_EXPORT QtMsgHandler qInstallMsgHandler( QtMsgHandler );#if !defined(QT_NO_COMPAT) // compatibility with Qt 2typedef QtMsgHandler msg_handler;#endif // QT_NO_COMPATQ_EXPORT void qSuppressObsoleteWarnings( bool = TRUE );Q_EXPORT void qObsolete( const char *obj, const char *oldfunc, const char *newfunc );Q_EXPORT void qObsolete( const char *obj, const char *oldfunc );Q_EXPORT void qObsolete( const char *message );//// Install paths from configure//Q_EXPORT const char *qInstallPath();Q_EXPORT const char *qInstallPathDocs();Q_EXPORT const char *qInstallPathHeaders();Q_EXPORT const char *qInstallPathLibs();Q_EXPORT const char *qInstallPathBins();Q_EXPORT const char *qInstallPathPlugins();Q_EXPORT const char *qInstallPathData();Q_EXPORT const char *qInstallPathTranslations();Q_EXPORT const char *qInstallPathSysconf();#endif // __cplusplus// compilers which follow outdated template instantiation rules// require a class to have a comparison operator to exist when// a QValueList of this type is instantiated. It's not actually// used in the list, though. Hence the dummy implementation.// Just in case other code relies on it we better trigger a warning// mandating a real implementation.#ifdef Q_FULL_TEMPLATE_INSTANTIATION# define Q_DUMMY_COMPARISON_OPERATOR(C) \ bool operator==( const C& ) const { \ qWarning( #C"::operator==( const "#C"& ) got called." ); \ return FALSE; \ }#else# define Q_DUMMY_COMPARISON_OPERATOR(C)#endif#endif // QGLOBAL_H//// Avoid some particularly useless warnings from some stupid compilers.// To get ALL C++ compiler warnings, define QT_CC_WARNINGS or comment out// the line "#define QT_NO_WARNINGS"//#if !defined(QT_CC_WARNINGS)# define QT_NO_WARNINGS#endif#if defined(QT_NO_WARNINGS)# if defined(Q_CC_MSVC)# pragma warning(disable: 4244) // 'conversion' conversion from 'type1' to 'type2', possible loss of data# pragma warning(disable: 4275) // non - DLL-interface classkey 'identifier' used as base for DLL-interface classkey 'identifier'# pragma warning(disable: 4514) // unreferenced inline/local function has been removed# pragma warning(disable: 4800) // 'type' : forcing value to bool 'true' or 'false' (performance warning)# pragma warning(disable: 4097) // typedef-name 'identifier1' used as synonym for class-name 'identifier2'# pragma warning(disable: 4706) // assignment within conditional expression# pragma warning(disable: 4786) // truncating debug info after 255 characters# pragma warning(disable: 4660) // template-class specialization 'identifier' is already instantiated# pragma warning(disable: 4355) // 'this' : used in base member initializer list# pragma warning(disable: 4231) // nonstandard extension used : 'extern' before template explicit instantiation# pragma warning(disable: 4710) // function not inlined# elif defined(Q_CC_BOR)# pragma option -w-inl# pragma option -w-aus# pragma warn -inl# pragma warn -pia# pragma warn -ccc# pragma warn -rch# pragma warn -sig# endif#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -