47 #define QT_VERSION_STR "4.8.5"
51 #define QT_VERSION 0x040805
55 #define QT_VERSION_CHECK(major, minor, patch) ((major<<16)|(minor<<8)|(patch))
57 #define QT_PACKAGEDATE_STR "2013-06-07"
59 #define QT_PACKAGE_TAG "0529dc9b2542dcb46c2e2cc1a3422fc83c6ae6ef"
61 #if !defined(QT_BUILD_MOC)
73 # define QT_PREPEND_NAMESPACE(name) ::name
74 # define QT_USE_NAMESPACE
75 # define QT_BEGIN_NAMESPACE
76 # define QT_END_NAMESPACE
77 # define QT_BEGIN_INCLUDE_NAMESPACE
78 # define QT_END_INCLUDE_NAMESPACE
79 # define QT_BEGIN_MOC_NAMESPACE
80 # define QT_END_MOC_NAMESPACE
81 # define QT_FORWARD_DECLARE_CLASS(name) class name;
82 # define QT_FORWARD_DECLARE_STRUCT(name) struct name;
83 # define QT_MANGLE_NAMESPACE(name) name
87 # define QT_PREPEND_NAMESPACE(name) ::QT_NAMESPACE::name
88 # define QT_USE_NAMESPACE using namespace ::QT_NAMESPACE;
89 # define QT_BEGIN_NAMESPACE namespace QT_NAMESPACE {
90 # define QT_END_NAMESPACE }
91 # define QT_BEGIN_INCLUDE_NAMESPACE }
92 # define QT_END_INCLUDE_NAMESPACE namespace QT_NAMESPACE {
93 # define QT_BEGIN_MOC_NAMESPACE QT_USE_NAMESPACE
94 # define QT_END_MOC_NAMESPACE
95 # define QT_FORWARD_DECLARE_CLASS(name) \
96 QT_BEGIN_NAMESPACE class name; QT_END_NAMESPACE \
97 using QT_PREPEND_NAMESPACE(name);
99 # define QT_FORWARD_DECLARE_STRUCT(name) \
100 QT_BEGIN_NAMESPACE struct name; QT_END_NAMESPACE \
101 using QT_PREPEND_NAMESPACE(name);
103 # define QT_MANGLE_NAMESPACE0(x) x
104 # define QT_MANGLE_NAMESPACE1(a, b) a##_##b
105 # define QT_MANGLE_NAMESPACE2(a, b) QT_MANGLE_NAMESPACE1(a,b)
106 # define QT_MANGLE_NAMESPACE(name) QT_MANGLE_NAMESPACE2( \
107 QT_MANGLE_NAMESPACE0(name), QT_MANGLE_NAMESPACE0(QT_NAMESPACE))
109 namespace QT_NAMESPACE {}
111 # ifndef QT_BOOTSTRAPPED
112 # ifndef QT_NO_USING_NAMESPACE
127 # define QT_BEGIN_NAMESPACE
128 # define QT_END_NAMESPACE
129 # define QT_USE_NAMESPACE
130 # define QT_BEGIN_INCLUDE_NAMESPACE
131 # define QT_END_INCLUDE_NAMESPACE
135 #if defined(Q_OS_MAC) && !defined(Q_CC_INTEL)
136 #define QT_BEGIN_HEADER extern "C++" {
137 #define QT_END_HEADER }
138 #define QT_BEGIN_INCLUDE_HEADER }
139 #define QT_END_INCLUDE_HEADER extern "C++" {
141 #define QT_BEGIN_HEADER
142 #define QT_END_HEADER
143 #define QT_BEGIN_INCLUDE_HEADER
144 #define QT_END_INCLUDE_HEADER extern "C++"
181 #if defined(__APPLE__) && (defined(__GNUC__) || defined(__xlC__) || defined(__xlc__))
185 # define Q_OS_DARWIN64
187 # define Q_OS_DARWIN32
189 #elif defined(__SYMBIAN32__) || defined(SYMBIAN)
190 # define Q_OS_SYMBIAN
191 # define Q_NO_POSIX_SIGNALS
192 # define QT_NO_GETIFADDRS
193 #elif defined(__CYGWIN__)
195 #elif defined(MSDOS) || defined(_MSDOS)
197 #elif defined(__OS2__)
198 # if defined(__EMX__)
203 #elif !defined(SAG_COM) && (defined(WIN64) || defined(_WIN64) || defined(__WIN64__))
206 #elif !defined(SAG_COM) && (defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__))
207 # if defined(WINCE) || defined(_WIN32_WCE)
212 #elif defined(__MWERKS__) && defined(__INTEL__)
214 #elif defined(__sun) || defined(sun)
215 # define Q_OS_SOLARIS
216 #elif defined(hpux) || defined(__hpux)
218 #elif defined(__ultrix) || defined(ultrix)
221 # define Q_OS_RELIANT
222 #elif defined(__native_client__)
224 #elif defined(__linux__) || defined(__linux)
226 #elif defined(__FreeBSD__) || defined(__DragonFly__)
227 # define Q_OS_FREEBSD
229 #elif defined(__NetBSD__)
232 #elif defined(__OpenBSD__)
233 # define Q_OS_OPENBSD
235 #elif defined(__bsdi__)
240 #elif defined(__osf__)
244 #elif defined(__Lynx__)
246 #elif defined(__GNU__)
248 #elif defined(__DGUX__)
250 #elif defined(__QNXNTO__)
252 #elif defined(_SEQUENT_)
254 #elif defined(_SCO_DS)
256 #elif defined(__USLC__)
257 # define Q_OS_UNIXWARE
258 #elif defined(__svr4__) && defined(i386)
259 # define Q_OS_UNIXWARE
260 #elif defined(__INTEGRITY)
261 # define Q_OS_INTEGRITY
262 #elif defined(VXWORKS)
263 # define Q_OS_VXWORKS
264 #elif defined(__MAKEDEPEND__)
266 # error "Qt has not been ported to this OS - talk to qt-bugs@trolltech.com"
269 #if defined(Q_OS_WIN32) || defined(Q_OS_WIN64) || defined(Q_OS_WINCE)
273 #if defined(Q_OS_DARWIN)
276 # if defined(Q_OS_DARWIN64)
278 # elif defined(Q_OS_DARWIN32)
283 #ifdef QT_AUTODETECT_COCOA
285 # define QT_MAC_USE_COCOA 1
286 # define QT_BUILD_KEY QT_BUILD_KEY_COCOA
288 # define QT_BUILD_KEY QT_BUILD_KEY_CARBON
292 #if defined(Q_WS_MAC64) && !defined(QT_MAC_USE_COCOA) && !defined(QT_BUILD_QMAKE) && !defined(QT_BOOTSTRAPPED)
293 #error "You are building a 64-bit application, but using a 32-bit version of Qt. Check your build configuration."
296 #if defined(Q_OS_MSDOS) || defined(Q_OS_OS2) || defined(Q_OS_WIN)
298 #elif !defined(Q_OS_UNIX)
302 #if defined(Q_OS_DARWIN) && !defined(QT_LARGEFILE_SUPPORT)
303 # define QT_LARGEFILE_SUPPORT 64
307 # ifdef MAC_OS_X_VERSION_MIN_REQUIRED
308 # undef MAC_OS_X_VERSION_MIN_REQUIRED
310 # define MAC_OS_X_VERSION_MIN_REQUIRED MAC_OS_X_VERSION_10_4
311 # include <AvailabilityMacros.h>
312 # if !defined(MAC_OS_X_VERSION_10_3)
313 # define MAC_OS_X_VERSION_10_3 MAC_OS_X_VERSION_10_2 + 1
315 # if !defined(MAC_OS_X_VERSION_10_4)
316 # define MAC_OS_X_VERSION_10_4 MAC_OS_X_VERSION_10_3 + 1
318 # if !defined(MAC_OS_X_VERSION_10_5)
319 # define MAC_OS_X_VERSION_10_5 MAC_OS_X_VERSION_10_4 + 1
321 # if !defined(MAC_OS_X_VERSION_10_6)
322 # define MAC_OS_X_VERSION_10_6 MAC_OS_X_VERSION_10_5 + 1
324 # if !defined(MAC_OS_X_VERSION_10_7)
325 # define MAC_OS_X_VERSION_10_7 MAC_OS_X_VERSION_10_6 + 1
327 # if !defined(MAC_OS_X_VERSION_10_8)
328 # define MAC_OS_X_VERSION_10_8 MAC_OS_X_VERSION_10_7 + 1
330 # if (MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_8)
331 # warning "This version of Mac OS X is unsupported"
335 #ifdef __LSB_VERSION__
336 # if __LSB_VERSION__ < 40
337 # error "This version of the Linux Standard Base is unsupported"
340 # define QT_LINUXBASE
377 # define Q_OUTOFLINE_TEMPLATE inline
380 # define Q_CONSTRUCTOR_FUNCTION0(AFUNC) \
381 static const int AFUNC ## _init_variable_ = AFUNC();
382 # define Q_CONSTRUCTOR_FUNCTION(AFUNC) Q_CONSTRUCTOR_FUNCTION0(AFUNC)
383 # define Q_DESTRUCTOR_FUNCTION0(AFUNC) \
384 class AFUNC ## _dest_class_ { \
386 inline AFUNC ## _dest_class_() { } \
387 inline ~ AFUNC ## _dest_class_() { AFUNC(); } \
388 } AFUNC ## _dest_instance_;
389 # define Q_DESTRUCTOR_FUNCTION(AFUNC) Q_DESTRUCTOR_FUNCTION0(AFUNC)
394 #if defined(__DMC__) || defined(__SC__)
397 # if defined(__SC__) && __SC__ < 0x750
398 # define Q_NO_EXPLICIT_KEYWORD
400 # define Q_NO_USING_KEYWORD
402 #elif defined(__MWERKS__)
404 # if defined(__EMU_SYMBIAN_OS__)
405 # define Q_CC_NOKIAX86
409 #elif defined(_MSC_VER)
411 # define Q_CC_MSVC_NET
412 # define Q_CANNOT_DELETE_CONSTANT
413 # define Q_OUTOFLINE_TEMPLATE inline
414 # define Q_NO_TEMPLATE_FRIENDS
415 # define Q_ALIGNOF(type) __alignof(type)
416 # define Q_DECL_ALIGN(n) __declspec(align(n))
418 # if defined(__INTEL_COMPILER)
422 # if (defined(Q_CC_MSVC) && defined(_M_X64))
425 # undef QT_HAVE_3DNOW
428 #if defined(Q_CC_MSVC) && _MSC_VER >= 1600
429 # define Q_COMPILER_RVALUE_REFS
430 # define Q_COMPILER_AUTO_FUNCTION
431 # define Q_COMPILER_AUTO_TYPE
432 # define Q_COMPILER_LAMBDA
433 # define Q_COMPILER_DECLTYPE
439 #elif defined(__BORLANDC__) || defined(__TURBOC__)
441 # define Q_INLINE_TEMPLATE
442 # if __BORLANDC__ < 0x502
443 # define Q_NO_BOOL_TYPE
444 # define Q_NO_EXPLICIT_KEYWORD
446 # define Q_NO_USING_KEYWORD
448 #elif defined(__WATCOMC__)
452 #elif defined(__GCCE__)
454 # define QT_VISIBILITY_AVAILABLE
455 # if defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__)
456 # define QT_HAVE_ARMV6
462 #elif defined(__ARMCC__) || defined(__CC_ARM)
464 # if __TARGET_ARCH_ARM >= 6
465 # define QT_HAVE_ARMV6
468 # define __is_empty(X) false
469 # define __is_pod(X) false
470 #elif defined(__GNUC__)
472 # define Q_C_CALLBACKS
473 # if defined(__MINGW32__)
476 # if defined(__INTEL_COMPILER)
480 # if defined(__clang__)
485 # define Q_NO_DEPRECATED_CONSTRUCTORS
487 # if __GNUC__ == 2 && __GNUC_MINOR__ <= 7
488 # define Q_FULL_TEMPLATE_INSTANTIATION
491 # if __GNUC__ == 2 && __GNUC_MINOR__ <= 95
492 # define Q_NO_USING_KEYWORD
493 # define QT_NO_STL_WCHAR
495 # if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
496 # define Q_ALIGNOF(type) __alignof__(type)
497 # define Q_TYPEOF(expr) __typeof__(expr)
498 # define Q_DECL_ALIGN(n) __attribute__((__aligned__(n)))
500 # if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
501 # define Q_LIKELY(expr) __builtin_expect(!!(expr), true)
502 # define Q_UNLIKELY(expr) __builtin_expect(!!(expr), false)
505 # if defined(Q_OS_HPUX) && __GNUC__ == 3 && __GNUC_MINOR__ >= 1
506 # define Q_WRONG_SB_CTYPE_MACROS
509 # if __GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ <= 3)
510 # define Q_NO_TEMPLATE_FRIENDS
513 # if defined(Q_OS_DARWIN) && __GNUC__ == 3 && (__GNUC_MINOR__ >= 1 && __GNUC_MINOR__ < 3)
514 # define Q_BROKEN_DEBUG_STREAM
516 # if (defined(Q_CC_GNU) || defined(Q_CC_INTEL)) && !defined(QT_MOC_CPP)
517 # define Q_PACKED __attribute__ ((__packed__))
518 # define Q_NO_PACKED_REFERENCE
519 # ifndef __ARM_EABI__
520 # define QT_NO_ARM_EABI
523 # if defined(__GXX_EXPERIMENTAL_CXX0X__)
524 # if (__GNUC__ * 100 + __GNUC_MINOR__) >= 403
526 # define Q_COMPILER_RVALUE_REFS
527 # define Q_COMPILER_DECLTYPE
529 # if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404
531 # define Q_COMPILER_VARIADIC_TEMPLATES
532 # define Q_COMPILER_AUTO_FUNCTION
533 # define Q_COMPILER_AUTO_TYPE
534 # define Q_COMPILER_EXTERN_TEMPLATES
535 # define Q_COMPILER_DEFAULT_DELETE_MEMBERS
536 # define Q_COMPILER_CLASS_ENUM
537 # define Q_COMPILER_INITIALIZER_LISTS
539 # if (__GNUC__ * 100 + __GNUC_MINOR__) >= 405
541 # define Q_COMPILER_LAMBDA
542 # define Q_COMPILER_UNICODE_STRINGS
544 # if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406
546 # define Q_COMPILER_CONSTEXPR
573 #elif defined(__xlC__)
575 # define Q_FULL_TEMPLATE_INSTANTIATION
577 # define Q_NO_BOOL_TYPE
578 # define Q_NO_EXPLICIT_KEYWORD
579 # define Q_NO_USING_KEYWORD
581 # define Q_OUTOFLINE_TEMPLATE inline
582 # define Q_BROKEN_TEMPLATE_SPECIALIZATION
583 # define Q_CANNOT_DELETE_CONSTANT
584 # elif __xlC__ >= 0x0600
585 # define Q_ALIGNOF(type) __alignof__(type)
586 # define Q_TYPEOF(expr) __typeof__(expr)
587 # define Q_DECL_ALIGN(n) __attribute__((__aligned__(n)))
588 # define Q_PACKED __attribute__((__packed__))
596 #elif defined(__DECCXX) || defined(__DECC)
600 # if defined(__EDG__)
606 # if !defined(_BOOL_EXISTS)
607 # define Q_NO_BOOL_TYPE
610 # define Q_NO_USING_KEYWORD
613 # if __DECCXX_VER < 60060000
615 # define Q_BROKEN_TEMPLATE_SPECIALIZATION
616 # define Q_CANNOT_DELETE_CONSTANT
619 # define Q_OUTOFLINE_TEMPLATE inline
625 # if defined(__EDG__)
633 #elif !defined(Q_OS_HPUX) && (defined(__EDG) || defined(__EDG__))
642 # if !defined(_BOOL) && !defined(__BOOL_DEFINED)
643 # define Q_NO_BOOL_TYPE
647 # if defined(__COMO__)
649 # define Q_C_CALLBACKS
655 # elif defined(__KCC)
657 # define Q_NO_USING_KEYWORD
660 # elif defined(__INTEL_COMPILER)
664 # elif defined(__ghs)
667 # elif defined(__DCC__)
669 # undef Q_NO_BOOL_TYPE
670 # if !defined(__bool)
671 # define Q_NO_BOOL_TYPE
675 # elif defined(__USLC__) && defined(__SCO_VERSION__)
678 # if !defined(__SCO_VERSION__) || (__SCO_VERSION__ < 302200010)
679 # define Q_OUTOFLINE_TEMPLATE inline
681 # define Q_NO_USING_KEYWORD
684 # elif defined(CENTERLINE_CLPP) || defined(OBJECTCENTER)
686 # define Q_NO_USING_KEYWORD
690 # elif defined(sinix)
692 # define Q_NO_USING_KEYWORD
695 # elif defined(__sgi)
697 # define Q_NO_USING_KEYWORD
698 # define Q_NO_TEMPLATE_FRIENDS
699 # if defined(_COMPILER_VERSION) && (_COMPILER_VERSION >= 740)
700 # define Q_OUTOFLINE_TEMPLATE inline
701 # pragma set woff 3624,3625,3649
707 #elif defined(_DIAB_TOOL)
711 #elif defined(__HIGHC__)
714 #elif defined(__SUNPRO_CC) || defined(__SUNPRO_C)
720 # if __SUNPRO_CC >= 0x500
721 # define QT_NO_TEMPLATE_TEMPLATE_PARAMETERS
723 # if __SUNPRO_CC >= 0x590
724 # define Q_ALIGNOF(type) __alignof__(type)
725 # define Q_TYPEOF(expr) __typeof__(expr)
726 # define Q_DECL_ALIGN(n) __attribute__((__aligned__(n)))
728 # if __SUNPRO_CC >= 0x550
729 # define Q_DECL_EXPORT __global
731 # if __SUNPRO_CC < 0x5a0
732 # define Q_NO_TEMPLATE_FRIENDS
735 # define Q_NO_BOOL_TYPE
737 # if defined(__SUNPRO_CC_COMPAT) && (__SUNPRO_CC_COMPAT <= 4)
738 # define Q_NO_USING_KEYWORD
740 # define Q_C_CALLBACKS
743 # define Q_NO_BOOL_TYPE
744 # define Q_NO_EXPLICIT_KEYWORD
745 # define Q_NO_USING_KEYWORD
754 # define Q_NO_BOOL_TYPE
756 # define Q_BROKEN_TEMPLATE_SPECIALIZATION
758 #elif defined(Q_OS_HPUX)
760 # if defined(__HP_aCC) || __cplusplus >= 199707L
761 # define Q_NO_TEMPLATE_FRIENDS
763 # if __HP_aCC-0 < 060000
764 # define QT_NO_TEMPLATE_TEMPLATE_PARAMETERS
765 # define Q_DECL_EXPORT __declspec(dllexport)
766 # define Q_DECL_IMPORT __declspec(dllimport)
768 # if __HP_aCC-0 >= 061200
769 # define Q_DECL_ALIGN(n) __attribute__((aligned(n)))
771 # if __HP_aCC-0 >= 062000
772 # define Q_DECL_EXPORT __attribute__((visibility("default")))
773 # define Q_DECL_HIDDEN __attribute__((visibility("hidden")))
774 # define Q_DECL_IMPORT Q_DECL_EXPORT
778 # define Q_NO_BOOL_TYPE
779 # define Q_FULL_TEMPLATE_INSTANTIATION
780 # define Q_BROKEN_TEMPLATE_SPECIALIZATION
781 # define Q_NO_EXPLICIT_KEYWORD
783 # define Q_NO_USING_KEYWORD
785 #elif defined(__WINSCW__) && !defined(Q_CC_NOKIAX86)
786 # define Q_CC_NOKIAX86
789 # error "Qt has not been tested with this compiler - talk to qt-bugs@trolltech.com"
794 # if __INTEL_COMPILER < 1200
795 # define Q_NO_TEMPLATE_FRIENDS
797 # if defined(__GXX_EXPERIMENTAL_CXX0X__) || defined(__GXX_EXPERIMENTAL_CPP0X__)
798 # if __INTEL_COMPILER >= 1100
799 # define Q_COMPILER_RVALUE_REFS
800 # define Q_COMPILER_EXTERN_TEMPLATES
801 # define Q_COMPILER_DECLTYPE
802 # elif __INTEL_COMPILER >= 1200
803 # define Q_COMPILER_VARIADIC_TEMPLATES
804 # define Q_COMPILER_AUTO_TYPE
805 # define Q_COMPILER_DEFAULT_DELETE_MEMBERS
806 # define Q_COMPILER_CLASS_ENUM
807 # define Q_COMPILER_LAMBDA
814 # undef Q_NO_PACKED_REFERENCE
818 # define Q_LIKELY(x) (x)
821 # define Q_UNLIKELY(x) (x)
824 #ifndef Q_CONSTRUCTOR_FUNCTION
825 # define Q_CONSTRUCTOR_FUNCTION0(AFUNC) \
826 static const int AFUNC ## __init_variable__ = AFUNC();
827 # define Q_CONSTRUCTOR_FUNCTION(AFUNC) Q_CONSTRUCTOR_FUNCTION0(AFUNC)
830 #ifndef Q_DESTRUCTOR_FUNCTION
831 # define Q_DESTRUCTOR_FUNCTION0(AFUNC) \
832 class AFUNC ## __dest_class__ { \
834 inline AFUNC ## __dest_class__() { } \
835 inline ~ AFUNC ## __dest_class__() { AFUNC(); } \
836 } AFUNC ## __dest_instance__;
837 # define Q_DESTRUCTOR_FUNCTION(AFUNC) Q_DESTRUCTOR_FUNCTION0(AFUNC)
840 #ifndef Q_REQUIRED_RESULT
841 # if defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1))
842 # define Q_REQUIRED_RESULT __attribute__ ((warn_unused_result))
844 # define Q_REQUIRED_RESULT
848 #ifndef Q_COMPILER_MANGLES_RETURN_TYPE
849 # if defined(Q_CC_MSVC)
850 # define Q_COMPILER_MANGLES_RETURN_TYPE
855 # if defined(Q_OS_QNX) || defined(Q_OS_BLACKBERRY)
857 # if defined(_YVALS) || defined(_LIBCPP_VER)
861 # ifdef Q_COMPILER_INITIALIZER_LISTS
862 # undef Q_COMPILER_INITIALIZER_LISTS
881 #if defined(Q_OS_MSDOS)
883 # error "Qt requires Win32 and does not work with Windows 3.x"
884 #elif defined(_WIN32_X11_)
886 #elif defined(Q_OS_WIN32)
888 # if defined(Q_OS_WIN64)
891 #elif defined(Q_OS_WINCE)
894 # if defined(Q_OS_WINCE_WM)
895 # define Q_WS_WINCE_WM
897 #elif defined(Q_OS_OS2)
899 # error "Qt does not work with OS/2 Presentation Manager or Workplace Shell"
900 #elif defined(Q_OS_UNIX)
901 # if defined(Q_OS_MAC) && !defined(__USE_WS_X11__) && !defined(Q_WS_QWS) && !defined(Q_WS_QPA)
904 # if defined(Q_OS_MAC64)
906 # elif defined(Q_OS_MAC32)
909 # elif defined(Q_OS_SYMBIAN)
910 # if !defined(QT_NO_S60)
913 # elif !defined(Q_WS_QWS) && !defined(Q_WS_QPA)
918 #if defined(Q_WS_WIN16) || defined(Q_WS_WIN32) || defined(Q_WS_WINCE)
937 #if defined(Q_OS_WIN) && !defined(Q_CC_GNU) && !defined(Q_CC_MWERKS)
938 # define Q_INT64_C(c) c ## i64
939 # define Q_UINT64_C(c) c ## ui64
941 typedef unsigned __int64
quint64;
943 # define Q_INT64_C(c) static_cast<long long>(c ## LL)
944 # define Q_UINT64_C(c) static_cast<unsigned long long>(c ## ULL)
952 #ifndef QT_POINTER_SIZE
953 # if defined(Q_OS_WIN64)
954 # define QT_POINTER_SIZE 8
955 # elif defined(Q_OS_WIN32) || defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN)
956 # define QT_POINTER_SIZE 4
960 #define Q_INIT_RESOURCE_EXTERN(name) \
961 extern int QT_MANGLE_NAMESPACE(qInitResources_ ## name) ();
963 #define Q_INIT_RESOURCE(name) \
964 do { extern int QT_MANGLE_NAMESPACE(qInitResources_ ## name) (); \
965 QT_MANGLE_NAMESPACE(qInitResources_ ## name) (); } while (0)
966 #define Q_CLEANUP_RESOURCE(name) \
967 do { extern int QT_MANGLE_NAMESPACE(qCleanupResources_ ## name) (); \
968 QT_MANGLE_NAMESPACE(qCleanupResources_ ## name) (); } while (0)
970 #if defined(__cplusplus)
978 template <
int>
struct QIntegerForSize;
979 template <>
struct QIntegerForSize<1> {
typedef quint8 Unsigned;
typedef qint8 Signed; };
980 template <>
struct QIntegerForSize<2> {
typedef quint16 Unsigned;
typedef qint16 Signed; };
981 template <>
struct QIntegerForSize<4> {
typedef quint32 Unsigned;
typedef qint32 Signed; };
982 template <>
struct QIntegerForSize<8> {
typedef quint64 Unsigned;
typedef qint64 Signed; };
983 template <
class T>
struct QIntegerForSizeof: QIntegerForSize<sizeof(T)> { };
984 typedef QIntegerForSizeof<void*>::Unsigned quintptr;
985 typedef QIntegerForSizeof<void*>::Signed qptrdiff;
992 typedef unsigned char uchar;
993 typedef unsigned short ushort;
994 typedef unsigned int uint;
995 typedef unsigned long ulong;
998 #if defined(Q_NO_BOOL_TYPE)
999 #error "Compiler doesn't support the bool type"
1006 #ifndef QT_LINUXBASE
1017 # define FALSE false
1024 #ifndef QT_NO_KEYWORDS
1025 # if defined(Q_CC_MIPS) || (defined(Q_CC_HPACC) && defined(__ia64))
1026 # define for if(0){}else for
1034 #if defined(Q_CC_MSVC)
1035 # define QT_STATIC_CONST static
1036 # define QT_STATIC_CONST_IMPL
1038 # define QT_STATIC_CONST static const
1039 # define QT_STATIC_CONST_IMPL const
1045 #if defined(Q_MOC_RUN)
1046 # define Q_DECL_DEPRECATED Q_DECL_DEPRECATED
1047 #elif (defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && (__GNUC__ - 0 > 3 || (__GNUC__ - 0 == 3 && __GNUC_MINOR__ - 0 >= 2))) || defined(Q_CC_RVCT)
1048 # define Q_DECL_DEPRECATED __attribute__ ((__deprecated__))
1049 #elif defined(Q_CC_MSVC)
1050 # define Q_DECL_DEPRECATED __declspec(deprecated)
1051 # if defined (Q_CC_INTEL)
1052 # define Q_DECL_VARIABLE_DEPRECATED
1056 # define Q_DECL_DEPRECATED
1058 #ifndef Q_DECL_VARIABLE_DEPRECATED
1059 # define Q_DECL_VARIABLE_DEPRECATED Q_DECL_DEPRECATED
1061 #ifndef Q_DECL_CONSTRUCTOR_DEPRECATED
1062 # if defined(Q_MOC_RUN)
1063 # define Q_DECL_CONSTRUCTOR_DEPRECATED Q_DECL_CONSTRUCTOR_DEPRECATED
1064 # elif defined(Q_NO_DEPRECATED_CONSTRUCTORS)
1065 # define Q_DECL_CONSTRUCTOR_DEPRECATED
1067 # define Q_DECL_CONSTRUCTOR_DEPRECATED Q_DECL_DEPRECATED
1071 #if defined(QT_NO_DEPRECATED)
1073 # undef QT3_SUPPORT_WARNINGS
1075 # undef QT_DEPRECATED
1076 # undef QT_DEPRECATED_VARIABLE
1077 # undef QT_DEPRECATED_CONSTRUCTOR
1078 #elif defined(QT_DEPRECATED_WARNINGS)
1081 # undef QT3_SUPPORT_WARNINGS
1082 # define QT3_SUPPORT_WARNINGS
1084 # undef QT_DEPRECATED
1085 # define QT_DEPRECATED Q_DECL_DEPRECATED
1086 # undef QT_DEPRECATED_VARIABLE
1087 # define QT_DEPRECATED_VARIABLE Q_DECL_VARIABLE_DEPRECATED
1088 # undef QT_DEPRECATED_CONSTRUCTOR
1089 # define QT_DEPRECATED_CONSTRUCTOR explicit Q_DECL_CONSTRUCTOR_DEPRECATED
1091 # undef QT_DEPRECATED
1092 # define QT_DEPRECATED
1093 # undef QT_DEPRECATED_VARIABLE
1094 # define QT_DEPRECATED_VARIABLE
1095 # undef QT_DEPRECATED_CONSTRUCTOR
1096 # define QT_DEPRECATED_CONSTRUCTOR
1099 #if defined(QT3_SUPPORT_WARNINGS)
1100 # if !defined(QT_COMPAT_WARNINGS)
1101 # define QT_COMPAT_WARNINGS
1104 # define QT3_SUPPORT Q_DECL_DEPRECATED
1105 # undef QT3_SUPPORT_VARIABLE
1106 # define QT3_SUPPORT_VARIABLE Q_DECL_VARIABLE_DEPRECATED
1107 # undef QT3_SUPPORT_CONSTRUCTOR
1108 # define QT3_SUPPORT_CONSTRUCTOR explicit Q_DECL_CONSTRUCTOR_DEPRECATED
1109 #elif defined(QT3_SUPPORT)
1110 # if !defined(QT_COMPAT)
1114 # define QT3_SUPPORT
1115 # undef QT3_SUPPORT_VARIABLE
1116 # define QT3_SUPPORT_VARIABLE
1117 # undef QT3_SUPPORT_CONSTRUCTOR
1118 # define QT3_SUPPORT_CONSTRUCTOR explicit
1122 #ifndef QT_MOC_COMPAT
1123 # if defined(QT3_SUPPORT)
1124 # define QT_MOC_COMPAT QT3_SUPPORT
1126 # define QT_MOC_COMPAT
1129 # undef QT_MOC_COMPAT
1130 # define QT_MOC_COMPAT
1133 #ifdef QT_ASCII_CAST_WARNINGS
1134 # define QT_ASCII_CAST_WARN Q_DECL_DEPRECATED
1135 # if defined(Q_CC_GNU) && __GNUC__ < 4
1137 # define QT_ASCII_CAST_WARN_CONSTRUCTOR
1139 # define QT_ASCII_CAST_WARN_CONSTRUCTOR Q_DECL_CONSTRUCTOR_DEPRECATED
1142 # define QT_ASCII_CAST_WARN
1143 # define QT_ASCII_CAST_WARN_CONSTRUCTOR
1146 #if defined(__i386__) || defined(_WIN32) || defined(_WIN32_WCE)
1147 # if defined(Q_CC_GNU)
1148 #if !defined(Q_CC_INTEL) && ((100*(__GNUC__ - 0) + 10*(__GNUC_MINOR__ - 0) + __GNUC_PATCHLEVEL__) >= 332)
1149 # define QT_FASTCALL __attribute__((regparm(3)))
1151 # define QT_FASTCALL
1153 # elif defined(Q_CC_MSVC)
1154 # define QT_FASTCALL __fastcall
1156 # define QT_FASTCALL
1159 # define QT_FASTCALL
1162 #ifdef Q_COMPILER_CONSTEXPR
1163 # define Q_DECL_CONSTEXPR constexpr
1165 # define Q_DECL_CONSTEXPR
1170 #if defined(Q_WS_WIN)
1171 # if defined(Q_CC_MINGW)
1172 # define QT_ENSURE_STACK_ALIGNED_FOR_SSE __attribute__ ((force_align_arg_pointer))
1174 # define QT_ENSURE_STACK_ALIGNED_FOR_SSE
1176 # define QT_WIN_CALLBACK CALLBACK QT_ENSURE_STACK_ALIGNED_FOR_SSE
1179 typedef int QNoImplicitBoolCast;
1181 #if defined(QT_ARCH_ARM) || defined(QT_ARCH_ARMV6) || defined(QT_ARCH_AVR32) || (defined(QT_ARCH_MIPS) && (defined(Q_WS_QWS) || defined(Q_WS_QPA) || defined(Q_OS_WINCE))) || defined(QT_ARCH_SH) || defined(QT_ARCH_SH4A)
1186 #if defined(QT_COORD_TYPE)
1187 typedef QT_COORD_TYPE qreal;
1188 #elif defined(QT_NO_FPU) || defined(QT_ARCH_ARM) || defined(QT_ARCH_WINDOWSCE) || defined(QT_ARCH_SYMBIAN)
1189 typedef float qreal;
1191 typedef double qreal;
1198 template <
typename T>
1199 Q_DECL_CONSTEXPR
inline T qAbs(
const T &
t) {
return t >= 0 ? t : -
t; }
1201 Q_DECL_CONSTEXPR
inline int qRound(qreal d)
1202 {
return d >= qreal(0.0) ?
int(d + qreal(0.5)) :
int(d -
int(d-1) + qreal(0.5)) +
int(d-1); }
1204 #if defined(QT_NO_FPU) || defined(QT_ARCH_ARM) || defined(QT_ARCH_WINDOWSCE) || defined(QT_ARCH_SYMBIAN)
1205 Q_DECL_CONSTEXPR
inline qint64 qRound64(
double d)
1208 Q_DECL_CONSTEXPR
inline qint64 qRound64(qreal d)
1212 template <
typename T>
1213 Q_DECL_CONSTEXPR
inline const T &qMin(
const T &
a,
const T &
b) {
return (a < b) ? a :
b; }
1214 template <
typename T>
1215 Q_DECL_CONSTEXPR
inline const T &qMax(
const T &a,
const T &b) {
return (a < b) ? b :
a; }
1216 template <
typename T>
1217 Q_DECL_CONSTEXPR
inline const T &qBound(
const T &min,
const T &val,
const T &
max)
1218 {
return qMax(min, qMin(max, val)); }
1221 typedef qint8 Q_INT8;
1232 #if defined(Q_OS_WIN64)
1233 typedef __int64 Q_LONG;
1234 typedef unsigned __int64 Q_ULONG;
1236 typedef long Q_LONG;
1237 typedef unsigned long Q_ULONG;
1240 # define QABS(a) qAbs(a)
1241 # define QMAX(a, b) qMax((a), (b))
1242 # define QMIN(a, b) qMin((a), (b))
1251 #ifndef QT_BUILD_KEY
1252 #define QT_BUILD_KEY "unspecified"
1255 #if defined(Q_WS_MAC)
1256 # ifndef QMAC_QMENUBAR_NO_EVENT
1257 # define QMAC_QMENUBAR_NO_EVENT
1261 #if !defined(Q_WS_QWS) && !defined(QT_NO_COP)
1265 #if defined(Q_OS_VXWORKS)
1266 # define QT_NO_CRASHHANDLER // no popen
1267 # define QT_NO_PROCESS // no exec*, no fork
1269 # define QT_NO_SHAREDMEMORY // only POSIX, no SysV and in the end...
1270 # define QT_NO_SYSTEMSEMAPHORE // not needed at all in a flat address space
1271 # define QT_NO_QWS_MULTIPROCESS // no processes
1276 #define QT_SUPPORTS(FEATURE) (!defined(QT_NO_##FEATURE))
1278 #if defined(Q_OS_LINUX) && defined(Q_CC_RVCT)
1279 # define Q_DECL_EXPORT __attribute__((visibility("default")))
1280 # define Q_DECL_IMPORT __attribute__((visibility("default")))
1281 # define Q_DECL_HIDDEN __attribute__((visibility("hidden")))
1284 #ifndef Q_DECL_EXPORT
1285 # if defined(Q_OS_WIN) || defined(Q_CC_NOKIAX86) || defined(Q_CC_RVCT)
1286 # define Q_DECL_EXPORT __declspec(dllexport)
1287 # elif defined(QT_VISIBILITY_AVAILABLE)
1288 # define Q_DECL_EXPORT __attribute__((visibility("default")))
1289 # define Q_DECL_HIDDEN __attribute__((visibility("hidden")))
1291 # ifndef Q_DECL_EXPORT
1292 # define Q_DECL_EXPORT
1295 #ifndef Q_DECL_IMPORT
1296 # if defined(Q_OS_WIN) || defined(Q_CC_NOKIAX86) || defined(Q_CC_RVCT)
1297 # define Q_DECL_IMPORT __declspec(dllimport)
1299 # define Q_DECL_IMPORT
1302 #ifndef Q_DECL_HIDDEN
1303 # define Q_DECL_HIDDEN
1311 #if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
1312 # if defined(QT_NODLL)
1315 # elif defined(QT_MAKEDLL)
1316 # if defined(QT_DLL)
1319 # if defined(QT_BUILD_CORE_LIB)
1320 # define Q_CORE_EXPORT Q_DECL_EXPORT
1322 # define Q_CORE_EXPORT Q_DECL_IMPORT
1324 # if defined(QT_BUILD_GUI_LIB)
1325 # define Q_GUI_EXPORT Q_DECL_EXPORT
1327 # define Q_GUI_EXPORT Q_DECL_IMPORT
1329 # if defined(QT_BUILD_SQL_LIB)
1330 # define Q_SQL_EXPORT Q_DECL_EXPORT
1332 # define Q_SQL_EXPORT Q_DECL_IMPORT
1334 # if defined(QT_BUILD_NETWORK_LIB)
1335 # define Q_NETWORK_EXPORT Q_DECL_EXPORT
1337 # define Q_NETWORK_EXPORT Q_DECL_IMPORT
1339 # if defined(QT_BUILD_SVG_LIB)
1340 # define Q_SVG_EXPORT Q_DECL_EXPORT
1342 # define Q_SVG_EXPORT Q_DECL_IMPORT
1344 # if defined(QT_BUILD_DECLARATIVE_LIB)
1345 # define Q_DECLARATIVE_EXPORT Q_DECL_EXPORT
1347 # define Q_DECLARATIVE_EXPORT Q_DECL_IMPORT
1349 # if defined(QT_BUILD_OPENGL_LIB)
1350 # define Q_OPENGL_EXPORT Q_DECL_EXPORT
1352 # define Q_OPENGL_EXPORT Q_DECL_IMPORT
1354 # if defined(QT_BUILD_MULTIMEDIA_LIB)
1355 # define Q_MULTIMEDIA_EXPORT Q_DECL_EXPORT
1357 # define Q_MULTIMEDIA_EXPORT Q_DECL_IMPORT
1359 # if defined(QT_BUILD_OPENVG_LIB)
1360 # define Q_OPENVG_EXPORT Q_DECL_EXPORT
1362 # define Q_OPENVG_EXPORT Q_DECL_IMPORT
1364 # if defined(QT_BUILD_XML_LIB)
1365 # define Q_XML_EXPORT Q_DECL_EXPORT
1367 # define Q_XML_EXPORT Q_DECL_IMPORT
1369 # if defined(QT_BUILD_XMLPATTERNS_LIB)
1370 # define Q_XMLPATTERNS_EXPORT Q_DECL_EXPORT
1372 # define Q_XMLPATTERNS_EXPORT Q_DECL_IMPORT
1374 # if defined(QT_BUILD_SCRIPT_LIB)
1375 # define Q_SCRIPT_EXPORT Q_DECL_EXPORT
1377 # define Q_SCRIPT_EXPORT Q_DECL_IMPORT
1379 # if defined(QT_BUILD_SCRIPTTOOLS_LIB)
1380 # define Q_SCRIPTTOOLS_EXPORT Q_DECL_EXPORT
1382 # define Q_SCRIPTTOOLS_EXPORT Q_DECL_IMPORT
1384 # if defined(QT_BUILD_CANVAS_LIB)
1385 # define Q_CANVAS_EXPORT Q_DECL_EXPORT
1387 # define Q_CANVAS_EXPORT Q_DECL_IMPORT
1389 # if defined(QT_BUILD_COMPAT_LIB)
1390 # define Q_COMPAT_EXPORT Q_DECL_EXPORT
1392 # define Q_COMPAT_EXPORT Q_DECL_IMPORT
1394 # if defined(QT_BUILD_DBUS_LIB)
1395 # define Q_DBUS_EXPORT Q_DECL_EXPORT
1397 # define Q_DBUS_EXPORT Q_DECL_IMPORT
1399 # define Q_TEMPLATEDLL
1400 # elif defined(QT_DLL)
1401 # define Q_CORE_EXPORT Q_DECL_IMPORT
1402 # define Q_GUI_EXPORT Q_DECL_IMPORT
1403 # define Q_SQL_EXPORT Q_DECL_IMPORT
1404 # define Q_NETWORK_EXPORT Q_DECL_IMPORT
1405 # define Q_SVG_EXPORT Q_DECL_IMPORT
1406 # define Q_DECLARATIVE_EXPORT Q_DECL_IMPORT
1407 # define Q_CANVAS_EXPORT Q_DECL_IMPORT
1408 # define Q_OPENGL_EXPORT Q_DECL_IMPORT
1409 # define Q_MULTIMEDIA_EXPORT Q_DECL_IMPORT
1410 # define Q_OPENVG_EXPORT Q_DECL_IMPORT
1411 # define Q_XML_EXPORT Q_DECL_IMPORT
1412 # define Q_XMLPATTERNS_EXPORT Q_DECL_IMPORT
1413 # define Q_SCRIPT_EXPORT Q_DECL_IMPORT
1414 # define Q_SCRIPTTOOLS_EXPORT Q_DECL_IMPORT
1415 # define Q_COMPAT_EXPORT Q_DECL_IMPORT
1416 # define Q_DBUS_EXPORT Q_DECL_IMPORT
1417 # define Q_TEMPLATEDLL
1419 # define Q_NO_DECLARED_NOT_DEFINED
1421 # if defined(Q_OS_LINUX) && defined(Q_CC_BOR)
1422 # define Q_TEMPLATEDLL
1423 # define Q_NO_DECLARED_NOT_DEFINED
1429 #if !defined(Q_CORE_EXPORT)
1430 # if defined(QT_SHARED)
1431 # define Q_CORE_EXPORT Q_DECL_EXPORT
1432 # define Q_GUI_EXPORT Q_DECL_EXPORT
1433 # define Q_SQL_EXPORT Q_DECL_EXPORT
1434 # define Q_NETWORK_EXPORT Q_DECL_EXPORT
1435 # define Q_SVG_EXPORT Q_DECL_EXPORT
1436 # define Q_DECLARATIVE_EXPORT Q_DECL_EXPORT
1437 # define Q_OPENGL_EXPORT Q_DECL_EXPORT
1438 # define Q_MULTIMEDIA_EXPORT Q_DECL_EXPORT
1439 # define Q_OPENVG_EXPORT Q_DECL_EXPORT
1440 # define Q_XML_EXPORT Q_DECL_EXPORT
1441 # define Q_XMLPATTERNS_EXPORT Q_DECL_EXPORT
1442 # define Q_SCRIPT_EXPORT Q_DECL_EXPORT
1443 # define Q_SCRIPTTOOLS_EXPORT Q_DECL_EXPORT
1444 # define Q_COMPAT_EXPORT Q_DECL_EXPORT
1445 # define Q_DBUS_EXPORT Q_DECL_EXPORT
1447 # define Q_CORE_EXPORT
1448 # define Q_GUI_EXPORT
1449 # define Q_SQL_EXPORT
1450 # define Q_NETWORK_EXPORT
1451 # define Q_SVG_EXPORT
1452 # define Q_DECLARATIVE_EXPORT
1453 # define Q_OPENGL_EXPORT
1454 # define Q_MULTIMEDIA_EXPORT
1455 # define Q_OPENVG_EXPORT
1456 # define Q_XML_EXPORT
1457 # define Q_XMLPATTERNS_EXPORT
1458 # define Q_SCRIPT_EXPORT
1459 # define Q_SCRIPTTOOLS_EXPORT
1460 # define Q_COMPAT_EXPORT
1461 # define Q_DBUS_EXPORT
1467 #if defined(Q_CC_MINGW)
1468 # if defined(QT_BUILD_CORE_LIB)
1469 # define Q_CORE_EXPORT_INLINE Q_CORE_EXPORT inline
1471 # define Q_CORE_EXPORT_INLINE inline
1473 # if defined(QT_BUILD_GUI_LIB)
1474 # define Q_GUI_EXPORT_INLINE Q_GUI_EXPORT inline
1476 # define Q_GUI_EXPORT_INLINE inline
1478 # if defined(QT_BUILD_COMPAT_LIB)
1479 # define Q_COMPAT_EXPORT_INLINE Q_COMPAT_EXPORT inline
1481 # define Q_COMPAT_EXPORT_INLINE inline
1483 #elif defined(Q_CC_RVCT)
1487 # define Q_CORE_EXPORT_INLINE inline
1488 # define Q_GUI_EXPORT_INLINE inline
1489 # define Q_COMPAT_EXPORT_INLINE inline
1491 # define Q_CORE_EXPORT_INLINE Q_CORE_EXPORT inline
1492 # define Q_GUI_EXPORT_INLINE Q_GUI_EXPORT inline
1493 # define Q_COMPAT_EXPORT_INLINE Q_COMPAT_EXPORT inline
1501 #if defined(QT_BUILD_INTERNAL) && (defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)) && defined(QT_MAKEDLL)
1502 # define Q_AUTOTEST_EXPORT Q_DECL_EXPORT
1503 #elif defined(QT_BUILD_INTERNAL) && (defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)) && defined(QT_DLL)
1504 # define Q_AUTOTEST_EXPORT Q_DECL_IMPORT
1505 #elif defined(QT_BUILD_INTERNAL) && !(defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)) && defined(QT_SHARED)
1506 # define Q_AUTOTEST_EXPORT Q_DECL_EXPORT
1508 # define Q_AUTOTEST_EXPORT
1511 inline void qt_noop(
void) {}
1521 #ifdef QT_BOOTSTRAPPED
1522 # define QT_NO_EXCEPTIONS
1524 #if !defined(QT_NO_EXCEPTIONS) && defined(Q_CC_GNU) && !defined (__EXCEPTIONS) && !defined(Q_MOC_RUN)
1525 # define QT_NO_EXCEPTIONS
1528 #ifdef QT_NO_EXCEPTIONS
1529 # define QT_TRY if (true)
1530 # define QT_CATCH(A) else
1531 # define QT_THROW(A) qt_noop()
1532 # define QT_RETHROW qt_noop()
1535 # define QT_CATCH(A) catch (A)
1536 # define QT_THROW(A) throw A
1537 # define QT_RETHROW throw
1545 class Q_CORE_EXPORT QSysInfo {
1548 WordSize = (
sizeof(
void *)<<3)
1551 #if defined(QT_BUILD_QMAKE)
1557 static const int ByteOrder;
1558 #elif defined(Q_BYTE_ORDER)
1564 , ByteOrder = <platform-dependent>
1565 # elif Q_BYTE_ORDER == Q_BIG_ENDIAN
1566 , ByteOrder = BigEndian
1567 # elif Q_BYTE_ORDER == Q_LITTLE_ENDIAN
1568 , ByteOrder = LittleEndian
1570 # error "Undefined byte order"
1574 # error "Qt not configured correctly, please run configure"
1576 #if defined(Q_WS_WIN) || defined(Q_OS_CYGWIN)
1582 WV_DOS_based= 0x000f,
1590 WV_WINDOWS7 = 0x0090,
1591 WV_WINDOWS8 = 0x00a0,
1592 WV_NT_based = 0x00f0,
1600 WV_6_1 = WV_WINDOWS7,
1601 WV_6_2 = WV_WINDOWS8,
1607 WV_CE_based = 0x0f00
1609 static const WinVersion WindowsVersion;
1610 static WinVersion windowsVersion();
1615 MV_Unknown = 0x0000,
1630 MV_CHEETAH = MV_10_0,
1632 MV_JAGUAR = MV_10_2,
1633 MV_PANTHER = MV_10_3,
1635 MV_LEOPARD = MV_10_5,
1636 MV_SNOWLEOPARD = MV_10_6,
1638 MV_MOUNTAINLION = MV_10_8
1640 static const MacVersion MacintoshVersion;
1643 enum SymbianVersion {
1644 SV_Unknown = 1000000,
1658 static SymbianVersion symbianVersion();
1661 SV_S60_Unknown = SV_Unknown,
1662 SV_S60_3_1 = SV_9_2,
1663 SV_S60_3_2 = SV_9_3,
1664 SV_S60_5_0 = SV_9_4,
1665 SV_S60_5_1 = SV_SF_2,
1666 SV_S60_5_2 = SV_SF_3,
1667 SV_S60_5_3 = SV_API_5_3,
1668 SV_S60_5_4 = SV_API_5_4,
1669 SV_S60_5_5 = SV_API_5_5
1671 static S60Version s60Version();
1675 Q_CORE_EXPORT
const char *qVersion();
1676 Q_CORE_EXPORT
bool qSharedBuild();
1678 #if defined(Q_OS_MAC)
1679 inline int qMacVersion() {
return QSysInfo::MacintoshVersion; }
1683 inline QT3_SUPPORT
bool qSysInfo(
int *wordSize,
bool *bigEndian)
1685 *wordSize = QSysInfo::WordSize;
1686 *bigEndian = (QSysInfo::ByteOrder == QSysInfo::BigEndian);
1691 #if defined(Q_WS_WIN) || defined(Q_OS_CYGWIN)
1692 #if defined(QT3_SUPPORT)
1693 inline QT3_SUPPORT
bool qt_winUnicode() {
return true; }
1694 inline QT3_SUPPORT
int qWinVersion() {
return QSysInfo::WindowsVersion; }
1698 #define QT_WA(unicode, ansi) unicode
1699 #define QT_WA_INLINE(unicode, ansi) (unicode)
1703 #ifndef Q_OUTOFLINE_TEMPLATE
1704 # define Q_OUTOFLINE_TEMPLATE
1706 #ifndef Q_INLINE_TEMPLATE
1707 # define Q_INLINE_TEMPLATE inline
1711 # define Q_TYPENAME typename
1718 #if defined(Q_CC_INTEL) && !defined(Q_OS_WIN) || defined(Q_CC_RVCT)
1719 template <
typename T>
1720 inline void qUnused(T &
x) { (
void)x; }
1721 # define Q_UNUSED(x) qUnused(x);
1723 # define Q_UNUSED(x) (void)x;
1735 #if defined(Q_OS_SYMBIAN) && defined(NDEBUG) && !defined(QT_NO_DEBUG)
1736 # define QT_NO_DEBUG
1739 #if !defined(QT_NO_DEBUG) && !defined(QT_DEBUG)
1744 # define qPrintable(string) QString(string).toLocal8Bit().constData()
1747 Q_CORE_EXPORT
void qDebug(
const char *, ...)
1748 #if defined(Q_CC_GNU) && !defined(__INSURE__)
1749 __attribute__ ((
format (printf, 1, 2)))
1753 Q_CORE_EXPORT
void qWarning(
const char *, ...)
1754 #if defined(Q_CC_GNU) && !defined(__INSURE__)
1755 __attribute__ ((
format (printf, 1, 2)))
1760 Q_CORE_EXPORT
QString qt_error_string(
int errorCode = -1);
1761 Q_CORE_EXPORT
void qCritical(
const char *, ...)
1762 #if defined(Q_CC_GNU) && !defined(__INSURE__)
1763 __attribute__ ((
format (printf, 1, 2)))
1766 Q_CORE_EXPORT
void qFatal(
const char *, ...)
1767 #if defined(Q_CC_GNU) && !defined(__INSURE__)
1768 __attribute__ ((
format (printf, 1, 2)))
1773 Q_CORE_EXPORT QT3_SUPPORT
void qSystemWarning(
const char *msg,
int code = -1);
1775 Q_CORE_EXPORT
void qErrnoWarning(
int code,
const char *msg, ...);
1776 Q_CORE_EXPORT
void qErrnoWarning(
const char *msg, ...);
1778 #if (defined(QT_NO_DEBUG_OUTPUT) || defined(QT_NO_TEXTSTREAM)) && !defined(QT_NO_DEBUG_STREAM)
1779 #define QT_NO_DEBUG_STREAM
1789 #ifndef QT_NO_DEBUG_STREAM
1797 #ifdef QT_NO_WARNING_OUTPUT
1801 #define QT_NO_QDEBUG_MACRO while (false) qDebug
1802 #ifdef QT_NO_DEBUG_OUTPUT
1803 # define qDebug QT_NO_QDEBUG_MACRO
1805 #define QT_NO_QWARNING_MACRO while (false) qWarning
1806 #ifdef QT_NO_WARNING_OUTPUT
1807 # define qWarning QT_NO_QWARNING_MACRO
1811 Q_CORE_EXPORT
void qt_assert(
const char *assertion,
const char *file,
int line);
1813 #if !defined(Q_ASSERT)
1814 # ifndef QT_NO_DEBUG
1815 # define Q_ASSERT(cond) ((!(cond)) ? qt_assert(#cond,__FILE__,__LINE__) : qt_noop())
1817 # define Q_ASSERT(cond) qt_noop()
1821 #if defined(QT_NO_DEBUG) && !defined(QT_PAINT_DEBUG)
1822 #define QT_NO_PAINT_DEBUG
1825 Q_CORE_EXPORT
void qt_assert_x(
const char *where,
const char *what,
const char *file,
int line);
1827 #if !defined(Q_ASSERT_X)
1828 # ifndef QT_NO_DEBUG
1829 # define Q_ASSERT_X(cond, where, what) ((!(cond)) ? qt_assert_x(where, what,__FILE__,__LINE__) : qt_noop())
1831 # define Q_ASSERT_X(cond, where, what) qt_noop()
1835 Q_CORE_EXPORT
void qt_check_pointer(
const char *,
int);
1836 Q_CORE_EXPORT
void qBadAlloc();
1838 #ifdef QT_NO_EXCEPTIONS
1839 # if defined(QT_NO_DEBUG)
1840 # define Q_CHECK_PTR(p) qt_noop()
1842 # define Q_CHECK_PTR(p) do {if(!(p))qt_check_pointer(__FILE__,__LINE__);} while (0)
1845 # define Q_CHECK_PTR(p) do { if (!(p)) qBadAlloc(); } while (0)
1848 template <
typename T>
1849 inline T *q_check_ptr(T *
p) { Q_CHECK_PTR(p);
return p; }
1851 #if (defined(Q_CC_GNU) && !defined(Q_OS_SOLARIS)) || defined(Q_CC_HPACC) || defined(Q_CC_DIAB)
1852 # define Q_FUNC_INFO __PRETTY_FUNCTION__
1853 #elif defined(_MSC_VER)
1854 # define Q_FUNC_INFO __FUNCSIG__
1856 # if defined(Q_OS_SOLARIS) || defined(Q_CC_XLC) || defined(Q_OS_SYMBIAN) || defined(Q_OS_INTEGRITY)
1857 # define Q_FUNC_INFO __FILE__ "(line number unavailable)"
1861 # define QT_STRINGIFY2(x) #x
1862 # define QT_STRINGIFY(x) QT_STRINGIFY2(x)
1863 # define Q_FUNC_INFO __FILE__ ":" QT_STRINGIFY(__LINE__)
1867 # if !defined(Q_CC_MIPS) && !defined(Q_CC_RVCT) && !defined(Q_CC_NOKIAX86)
1868 # undef QT_STRINGIFY2
1869 # undef QT_STRINGIFY
1873 enum QtMsgType { QtDebugMsg, QtWarningMsg, QtCriticalMsg, QtFatalMsg, QtSystemMsg = QtCriticalMsg };
1875 Q_CORE_EXPORT
void qt_message_output(QtMsgType,
const char *buf);
1877 typedef void (*QtMsgHandler)(QtMsgType,
const char *);
1878 Q_CORE_EXPORT QtMsgHandler qInstallMsgHandler(QtMsgHandler);
1881 inline QT3_SUPPORT
void qSuppressObsoleteWarnings(
bool =
true) {}
1882 inline QT3_SUPPORT
void qObsolete(
const char *,
const char * = 0,
const char * = 0) {}
1885 #if defined(QT_NO_THREAD)
1887 template <
typename T>
1892 inline QGlobalStatic(T *
p) : pointer(p) { }
1893 inline ~QGlobalStatic() { pointer = 0; }
1896 #define Q_GLOBAL_STATIC(TYPE, NAME) \
1897 static TYPE *NAME() \
1899 static TYPE thisVariable; \
1900 static QGlobalStatic<TYPE > thisGlobalStatic(&thisVariable); \
1901 return thisGlobalStatic.pointer; \
1904 #define Q_GLOBAL_STATIC_WITH_ARGS(TYPE, NAME, ARGS) \
1905 static TYPE *NAME() \
1907 static TYPE thisVariable ARGS; \
1908 static QGlobalStatic<TYPE > thisGlobalStatic(&thisVariable); \
1909 return thisGlobalStatic.pointer; \
1912 #define Q_GLOBAL_STATIC_WITH_INITIALIZER(TYPE, NAME, INITIALIZER) \
1913 static TYPE *NAME() \
1915 static TYPE thisVariable; \
1916 static QGlobalStatic<TYPE > thisGlobalStatic(0); \
1917 if (!thisGlobalStatic.pointer) { \
1918 TYPE *x = thisGlobalStatic.pointer = &thisVariable; \
1921 return thisGlobalStatic.pointer; \
1930 template <
typename T>
1939 template <
typename T>
1940 class QGlobalStaticDeleter
1943 QGlobalStatic<T> &globalStatic;
1944 QGlobalStaticDeleter(QGlobalStatic<T> &_globalStatic)
1945 : globalStatic(_globalStatic)
1948 inline ~QGlobalStaticDeleter()
1950 delete globalStatic.pointer;
1951 globalStatic.pointer = 0;
1952 globalStatic.destroyed =
true;
1956 #define Q_GLOBAL_STATIC_INIT(TYPE, NAME) \
1957 static QGlobalStatic<TYPE > this_ ## NAME \
1958 = { Q_BASIC_ATOMIC_INITIALIZER(0), false }
1960 #define Q_GLOBAL_STATIC(TYPE, NAME) \
1961 static TYPE *NAME() \
1963 Q_GLOBAL_STATIC_INIT(TYPE, _StaticVar_); \
1964 if (!this__StaticVar_.pointer && !this__StaticVar_.destroyed) { \
1965 TYPE *x = new TYPE; \
1966 if (!this__StaticVar_.pointer.testAndSetOrdered(0, x)) \
1969 static QGlobalStaticDeleter<TYPE > cleanup(this__StaticVar_); \
1971 return this__StaticVar_.pointer; \
1974 #define Q_GLOBAL_STATIC_WITH_ARGS(TYPE, NAME, ARGS) \
1975 static TYPE *NAME() \
1977 Q_GLOBAL_STATIC_INIT(TYPE, _StaticVar_); \
1978 if (!this__StaticVar_.pointer && !this__StaticVar_.destroyed) { \
1979 TYPE *x = new TYPE ARGS; \
1980 if (!this__StaticVar_.pointer.testAndSetOrdered(0, x)) \
1983 static QGlobalStaticDeleter<TYPE > cleanup(this__StaticVar_); \
1985 return this__StaticVar_.pointer; \
1988 #define Q_GLOBAL_STATIC_WITH_INITIALIZER(TYPE, NAME, INITIALIZER) \
1989 static TYPE *NAME() \
1991 Q_GLOBAL_STATIC_INIT(TYPE, _StaticVar_); \
1992 if (!this__StaticVar_.pointer && !this__StaticVar_.destroyed) { \
1993 QScopedPointer<TYPE > x(new TYPE); \
1995 if (this__StaticVar_.pointer.testAndSetOrdered(0, x.data())) { \
1996 static QGlobalStaticDeleter<TYPE > cleanup(this__StaticVar_); \
2000 return this__StaticVar_.pointer; \
2010 inline explicit QBool(
bool B) : b(B) {}
2011 inline operator const void *()
const
2012 {
return b ?
static_cast<const void *
>(
this) : static_cast<const void *>(0); }
2015 inline bool operator==(QBool b1,
bool b2) {
return !b1 == !b2; }
2016 inline bool operator==(
bool b1, QBool b2) {
return !b1 == !b2; }
2017 inline bool operator==(QBool b1, QBool b2) {
return !b1 == !b2; }
2018 inline bool operator!=(QBool b1,
bool b2) {
return !b1 != !b2; }
2019 inline bool operator!=(
bool b1, QBool b2) {
return !b1 != !b2; }
2020 inline bool operator!=(QBool b1, QBool b2) {
return !b1 != !b2; }
2022 Q_DECL_CONSTEXPR
static inline bool qFuzzyCompare(
double p1,
double p2)
2024 return (qAbs(p1 - p2) <= 0.000000000001 * qMin(qAbs(p1), qAbs(p2)));
2027 Q_DECL_CONSTEXPR
static inline bool qFuzzyCompare(
float p1,
float p2)
2029 return (qAbs(p1 - p2) <= 0.00001
f * qMin(qAbs(p1), qAbs(p2)));
2035 Q_DECL_CONSTEXPR
static inline bool qFuzzyIsNull(
double d)
2037 return qAbs(d) <= 0.000000000001;
2043 Q_DECL_CONSTEXPR
static inline bool qFuzzyIsNull(
float f)
2045 return qAbs(f) <= 0.00001f;
2053 static inline bool qIsNull(
double d)
2069 static inline bool qIsNull(
float f)
2089 #ifdef Q_FULL_TEMPLATE_INSTANTIATION
2090 # define Q_DUMMY_COMPARISON_OPERATOR(C) \
2091 bool operator==(const C&) const { \
2092 qWarning(#C"::operator==(const "#C"&) was called"); \
2096 # define Q_DUMMY_COMPARISON_OPERATOR(C)
2109 template <
typename T>
inline bool qIsDetached(T &) {
return true; }
2111 template <
typename T>
2119 isLarge = (
sizeof(T)>
sizeof(
void*)),
2124 template <
typename T>
2147 Q_PRIMITIVE_TYPE = 0x1,
2149 Q_MOVABLE_TYPE = 0x2,
2153 #define Q_DECLARE_TYPEINFO_BODY(TYPE, FLAGS) \
2154 class QTypeInfo<TYPE > \
2158 isComplex = (((FLAGS) & Q_PRIMITIVE_TYPE) == 0), \
2159 isStatic = (((FLAGS) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), \
2160 isLarge = (sizeof(TYPE)>sizeof(void*)), \
2161 isPointer = false, \
2162 isDummy = (((FLAGS) & Q_DUMMY_TYPE) != 0) \
2164 static inline const char *name() { return #TYPE; } \
2167 #define Q_DECLARE_TYPEINFO(TYPE, FLAGS) \
2169 Q_DECLARE_TYPEINFO_BODY(TYPE, FLAGS)
2172 template <
typename T>
2173 inline void qSwap(T &value1, T &value2)
2181 swap(value1, value2);
2195 #define Q_DECLARE_SHARED_STL(TYPE)
2197 #define Q_DECLARE_SHARED_STL(TYPE) \
2200 template<> inline void swap<QT_PREPEND_NAMESPACE(TYPE)>(QT_PREPEND_NAMESPACE(TYPE) &value1, QT_PREPEND_NAMESPACE(TYPE) &value2) \
2201 { swap(value1.data_ptr(), value2.data_ptr()); } \
2206 #define Q_DECLARE_SHARED(TYPE) \
2207 template <> inline bool qIsDetached<TYPE>(TYPE &t) { return t.isDetached(); } \
2208 template <> inline void qSwap<TYPE>(TYPE &value1, TYPE &value2) \
2209 { qSwap(value1.data_ptr(), value2.data_ptr()); } \
2210 Q_DECLARE_SHARED_STL(TYPE)
2237 Q_CORE_EXPORT
void *qMalloc(
size_t size);
2238 Q_CORE_EXPORT
void qFree(
void *ptr);
2239 Q_CORE_EXPORT
void *qRealloc(
void *ptr,
size_t size);
2240 Q_CORE_EXPORT
void *qMallocAligned(
size_t size,
size_t alignment);
2241 Q_CORE_EXPORT
void *qReallocAligned(
void *ptr,
size_t size,
size_t oldsize,
size_t alignment);
2242 Q_CORE_EXPORT
void qFreeAligned(
void *ptr);
2243 Q_CORE_EXPORT
void *qMemCopy(
void *dest,
const void *
src,
size_t n);
2244 Q_CORE_EXPORT
void *qMemSet(
void *dest,
int c,
size_t n);
2252 #if !defined(QT_CC_WARNINGS)
2253 # define QT_NO_WARNINGS
2255 #if defined(QT_NO_WARNINGS)
2256 # if defined(Q_CC_MSVC)
2257 # pragma warning(disable: 4251)
2258 # pragma warning(disable: 4244)
2259 # pragma warning(disable: 4275)
2260 # pragma warning(disable: 4514)
2261 # pragma warning(disable: 4800)
2262 # pragma warning(disable: 4097)
2263 # pragma warning(disable: 4706)
2264 # pragma warning(disable: 4786)
2265 # pragma warning(disable: 4660)
2266 # pragma warning(disable: 4355)
2267 # pragma warning(disable: 4231)
2268 # pragma warning(disable: 4710)
2269 # pragma warning(disable: 4530)
2270 # elif defined(Q_CC_BOR)
2271 # pragma option -w-inl
2272 # pragma option -w-aus
2281 class Q_CORE_EXPORT QFlag
2285 inline QFlag(
int i);
2286 inline operator int()
const {
return i; }
2289 inline QFlag::QFlag(
int ai) : i(ai) {}
2291 class Q_CORE_EXPORT QIncompatibleFlag
2295 inline explicit QIncompatibleFlag(
int i);
2296 inline operator int()
const {
return i; }
2299 inline QIncompatibleFlag::QIncompatibleFlag(
int ai) : i(ai) {}
2302 #ifndef Q_NO_TYPESAFE_FLAGS
2304 template<
typename Enum>
2307 typedef void **Zero;
2310 typedef Enum enum_type;
2311 Q_DECL_CONSTEXPR
inline QFlags(
const QFlags &
f) : i(f.i) {}
2312 Q_DECL_CONSTEXPR
inline QFlags(Enum
f) : i(f) {}
2313 Q_DECL_CONSTEXPR
inline QFlags(Zero = 0) : i(0) {}
2314 inline QFlags(QFlag
f) : i(f) {}
2316 inline QFlags &operator=(
const QFlags &
f) { i = f.i;
return *
this; }
2317 inline QFlags &operator&=(
int mask) { i &=
mask;
return *
this; }
2318 inline QFlags &operator&=(uint
mask) { i &=
mask;
return *
this; }
2319 inline QFlags &operator|=(QFlags
f) { i |= f.i;
return *
this; }
2320 inline QFlags &operator|=(Enum
f) { i |=
f;
return *
this; }
2321 inline QFlags &operator^=(QFlags
f) { i ^= f.i;
return *
this; }
2322 inline QFlags &operator^=(Enum
f) { i ^=
f;
return *
this; }
2324 Q_DECL_CONSTEXPR
inline operator int()
const {
return i; }
2326 Q_DECL_CONSTEXPR
inline QFlags
operator|(QFlags
f)
const {
return QFlags(Enum(i | f.i)); }
2327 Q_DECL_CONSTEXPR
inline QFlags
operator|(Enum f)
const {
return QFlags(Enum(i | f)); }
2328 Q_DECL_CONSTEXPR
inline QFlags
operator^(QFlags f)
const {
return QFlags(Enum(i ^ f.i)); }
2329 Q_DECL_CONSTEXPR
inline QFlags
operator^(Enum f)
const {
return QFlags(Enum(i ^ f)); }
2330 Q_DECL_CONSTEXPR
inline QFlags
operator&(
int mask)
const {
return QFlags(Enum(i & mask)); }
2331 Q_DECL_CONSTEXPR
inline QFlags
operator&(uint mask)
const {
return QFlags(Enum(i & mask)); }
2332 Q_DECL_CONSTEXPR
inline QFlags
operator&(Enum f)
const {
return QFlags(Enum(i & f)); }
2333 Q_DECL_CONSTEXPR
inline QFlags operator~()
const {
return QFlags(Enum(~i)); }
2335 Q_DECL_CONSTEXPR
inline bool operator!()
const {
return !i; }
2337 inline bool testFlag(Enum f)
const {
return (i & f) == f && (f != 0 || i ==
int(f) ); }
2340 #define Q_DECLARE_FLAGS(Flags, Enum)\
2341 typedef QFlags<Enum> Flags;
2343 #define Q_DECLARE_INCOMPATIBLE_FLAGS(Flags) \
2344 inline QIncompatibleFlag operator|(Flags::enum_type f1, int f2) \
2345 { return QIncompatibleFlag(int(f1) | f2); }
2347 #define Q_DECLARE_OPERATORS_FOR_FLAGS(Flags) \
2348 Q_DECL_CONSTEXPR inline QFlags<Flags::enum_type> operator|(Flags::enum_type f1, Flags::enum_type f2) \
2349 { return QFlags<Flags::enum_type>(f1) | f2; } \
2350 Q_DECL_CONSTEXPR inline QFlags<Flags::enum_type> operator|(Flags::enum_type f1, QFlags<Flags::enum_type> f2) \
2351 { return f2 | f1; } Q_DECLARE_INCOMPATIBLE_FLAGS(Flags)
2356 #define Q_DECLARE_FLAGS(Flags, Enum)\
2358 #define Q_DECLARE_OPERATORS_FOR_FLAGS(Flags)
2362 #if defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && !defined(Q_CC_RVCT)
2364 template <
typename T>
2365 class QForeachContainer {
2367 inline QForeachContainer(
const T&
t) :
c(t), brk(0), i(
c.begin()), e(
c.
end()) { }
2370 typename T::const_iterator i, e;
2373 #define Q_FOREACH(variable, container) \
2374 for (QForeachContainer<__typeof__(container)> _container_(container); \
2375 !_container_.brk && _container_.i != _container_.e; \
2376 __extension__ ({ ++_container_.brk; ++_container_.i; })) \
2377 for (variable = *_container_.i;; __extension__ ({--_container_.brk; break;}))
2381 struct QForeachContainerBase {};
2383 template <
typename T>
2384 class QForeachContainer :
public QForeachContainerBase {
2386 inline QForeachContainer(
const T&
t):
c(t), brk(0), i(
c.begin()), e(
c.
end()){};
2389 mutable typename T::const_iterator i, e;
2390 inline bool condition()
const {
return (!brk++ && i != e); }
2393 template <
typename T>
inline T *qForeachPointer(
const T &) {
return 0; }
2395 template <
typename T>
inline QForeachContainer<T> qForeachContainerNew(
const T&
t)
2396 {
return QForeachContainer<T>(
t); }
2398 template <
typename T>
2399 inline const QForeachContainer<T> *qForeachContainer(
const QForeachContainerBase *base,
const T *)
2400 {
return static_cast<const QForeachContainer<T> *
>(base); }
2402 #if defined(Q_CC_MIPS)
2406 # define Q_FOREACH(variable,container) \
2408 for (const QForeachContainerBase &_container_ = qForeachContainerNew(container); \
2409 qForeachContainer(&_container_, true ? 0 : qForeachPointer(container))->condition(); \
2410 ++qForeachContainer(&_container_, true ? 0 : qForeachPointer(container))->i) \
2411 for (variable = *qForeachContainer(&_container_, true ? 0 : qForeachPointer(container))->i; \
2412 qForeachContainer(&_container_, true ? 0 : qForeachPointer(container))->brk; \
2413 --qForeachContainer(&_container_, true ? 0 : qForeachPointer(container))->brk)
2415 #elif defined(Q_CC_DIAB)
2417 # define Q_FOREACH(variable,container) \
2419 for (const QForeachContainerBase &_container_ = qForeachContainerNew(container); \
2420 qForeachContainer(&_container_, (__typeof__(container) *) 0)->condition(); \
2421 ++qForeachContainer(&_container_, (__typeof__(container) *) 0)->i) \
2422 for (variable = *qForeachContainer(&_container_, (__typeof__(container) *) 0)->i; \
2423 qForeachContainer(&_container_, (__typeof__(container) *) 0)->brk; \
2424 --qForeachContainer(&_container_, (__typeof__(container) *) 0)->brk)
2427 # define Q_FOREACH(variable, container) \
2428 for (const QForeachContainerBase &_container_ = qForeachContainerNew(container); \
2429 qForeachContainer(&_container_, true ? 0 : qForeachPointer(container))->condition(); \
2430 ++qForeachContainer(&_container_, true ? 0 : qForeachPointer(container))->i) \
2431 for (variable = *qForeachContainer(&_container_, true ? 0 : qForeachPointer(container))->i; \
2432 qForeachContainer(&_container_, true ? 0 : qForeachPointer(container))->brk; \
2433 --qForeachContainer(&_container_, true ? 0 : qForeachPointer(container))->brk)
2434 #endif // MSVC6 || MIPSpro
2438 #define Q_FOREVER for(;;)
2439 #ifndef QT_NO_KEYWORDS
2441 # define foreach Q_FOREACH
2444 # define forever Q_FOREVER
2450 #if defined(QT_NO_DEBUG) && defined(Q_CC_GNU)
2451 # define qMemCopy __builtin_memcpy
2452 # define qMemSet __builtin_memset
2456 template <
typename T>
static inline T *qGetPtrHelper(T *ptr) {
return ptr; }
2457 template <
typename Wrapper>
static inline typename Wrapper::pointer qGetPtrHelper(
const Wrapper &
p) {
return p.data(); }
2459 #define Q_DECLARE_PRIVATE(Class) \
2460 inline Class##Private* d_func() { return reinterpret_cast<Class##Private *>(qGetPtrHelper(d_ptr)); } \
2461 inline const Class##Private* d_func() const { return reinterpret_cast<const Class##Private *>(qGetPtrHelper(d_ptr)); } \
2462 friend class Class##Private;
2464 #define Q_DECLARE_PRIVATE_D(Dptr, Class) \
2465 inline Class##Private* d_func() { return reinterpret_cast<Class##Private *>(Dptr); } \
2466 inline const Class##Private* d_func() const { return reinterpret_cast<const Class##Private *>(Dptr); } \
2467 friend class Class##Private;
2469 #define Q_DECLARE_PUBLIC(Class) \
2470 inline Class* q_func() { return static_cast<Class *>(q_ptr); } \
2471 inline const Class* q_func() const { return static_cast<const Class *>(q_ptr); } \
2474 #define Q_D(Class) Class##Private * const d = d_func()
2475 #define Q_Q(Class) Class * const q = q_func()
2477 #define QT_TR_NOOP(x) (x)
2478 #define QT_TR_NOOP_UTF8(x) (x)
2479 #define QT_TRANSLATE_NOOP(scope, x) (x)
2480 #define QT_TRANSLATE_NOOP_UTF8(scope, x) (x)
2481 #define QT_TRANSLATE_NOOP3(scope, x, comment) {x, comment}
2482 #define QT_TRANSLATE_NOOP3_UTF8(scope, x, comment) {x, comment}
2484 #ifndef QT_NO_TRANSLATION // ### This should enclose the NOOPs above
2489 Q_CORE_EXPORT
QString qtTrId(
const char *
id,
int n = -1);
2491 #define QT_TRID_NOOP(id) id
2493 #endif // QT_NO_TRANSLATION
2495 #define QDOC_PROPERTY(text)
2502 #ifdef QT_NO_DYNAMIC_CAST
2503 # define dynamic_cast QT_PREPEND_NAMESPACE(qt_dynamic_cast_check)
2505 template<
typename T,
typename X>
2506 T qt_dynamic_cast_check(X, T* = 0)
2507 {
return T::dynamic_cast_will_always_fail_because_rtti_is_disabled; }
2515 #define Q_DISABLE_COPY(Class) \
2516 Class(const Class &); \
2517 Class &operator=(const Class &);
2520 Q_CORE_EXPORT
QByteArray qgetenv(
const char *varName);
2521 Q_CORE_EXPORT
bool qputenv(
const char *varName,
const QByteArray&
value);
2523 inline int qIntCast(
double f) {
return int(f); }
2524 inline int qIntCast(
float f) {
return int(f); }
2529 Q_CORE_EXPORT
void qsrand(uint seed);
2530 Q_CORE_EXPORT
int qrand();
2536 #ifndef QT_PRODUCT_LICENSEE
2537 # define QT_PRODUCT_LICENSEE QLibraryInfo::licensee()
2539 #ifndef QT_PRODUCT_LICENSE
2540 # define QT_PRODUCT_LICENSE QLibraryInfo::licensedProducts()
2542 QT3_SUPPORT Q_CORE_EXPORT
const char *qInstallPath();
2543 QT3_SUPPORT Q_CORE_EXPORT
const char *qInstallPathDocs();
2544 QT3_SUPPORT Q_CORE_EXPORT
const char *qInstallPathHeaders();
2545 QT3_SUPPORT Q_CORE_EXPORT
const char *qInstallPathLibs();
2546 QT3_SUPPORT Q_CORE_EXPORT
const char *qInstallPathBins();
2547 QT3_SUPPORT Q_CORE_EXPORT
const char *qInstallPathPlugins();
2548 QT3_SUPPORT Q_CORE_EXPORT
const char *qInstallPathData();
2549 QT3_SUPPORT Q_CORE_EXPORT
const char *qInstallPathTranslations();
2550 QT3_SUPPORT Q_CORE_EXPORT
const char *qInstallPathSysconf();
2553 #if defined(Q_OS_SYMBIAN)
2555 #ifdef SYMBIAN_BUILD_GCE
2556 #define Q_SYMBIAN_SUPPORTS_SURFACES
2558 #define Q_SYMBIAN_FIXED_POINTER_CURSORS
2559 #define Q_SYMBIAN_HAS_EXTENDED_BITMAP_TYPE
2560 #define Q_SYMBIAN_WINDOW_SIZE_CACHE
2561 #define QT_SYMBIAN_SUPPORTS_ADVANCED_POINTER
2564 #ifdef SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
2565 # define QT_SYMBIAN_SUPPORTS_SGIMAGE
2568 #ifdef SYMBIAN_GRAPHICS_SET_SURFACE_TRANSPARENCY_AVAILABLE
2569 # define Q_SYMBIAN_SEMITRANSPARENT_BG_SURFACE
2572 #ifdef SYMBIAN_GRAPHICS_TRANSITION_EFFECTS_SIGNALING_AVAILABLE
2573 # define Q_SYMBIAN_TRANSITION_EFFECTS
2577 #ifdef SYMBIAN_WSERV_AND_CONE_MULTIPLE_SCREENS
2578 #define Q_SYMBIAN_SUPPORTS_MULTIPLE_SCREENS
2581 #ifdef SYMBIAN_GRAPHICS_FIXNATIVEORIENTATION
2582 #define Q_SYMBIAN_SUPPORTS_FIXNATIVEORIENTATION
2586 #define Q_NO_DATA_RELOCATION
2589 #ifdef Q_CC_NOKIAX86
2590 #ifndef QT_NO_CONCURRENT
2591 #define QT_NO_CONCURRENT
2593 #ifndef QT_NO_QFUTURE
2594 #define QT_NO_QFUTURE
2601 namespace std {
class exception; }
2604 Q_CORE_EXPORT
void qt_symbian_throwIfError(
int error);
2605 Q_CORE_EXPORT
void qt_symbian_exception2LeaveL(
const std::exception& ex);
2606 Q_CORE_EXPORT
int qt_symbian_exception2Error(
const std::exception& ex);
2608 #define QT_TRAP_THROWING(_f) \
2611 TRAP(____error, _f); \
2612 qt_symbian_throwIfError(____error); \
2615 #define QT_TRYCATCH_ERROR(_err, _f) \
2620 } catch (const std::exception &____ex) { \
2621 _err = qt_symbian_exception2Error(____ex); \
2625 #define QT_TRYCATCH_LEAVING(_f) \
2628 QT_TRYCATCH_ERROR(____err, _f) \
2629 User::LeaveIfError(____err); \
2640 #define QT_MODULE_CORE 0x00001
2641 #define QT_MODULE_GUI 0x00002
2642 #define QT_MODULE_NETWORK 0x00004
2643 #define QT_MODULE_OPENGL 0x00008
2644 #define QT_MODULE_SQL 0x00010
2645 #define QT_MODULE_XML 0x00020
2646 #define QT_MODULE_QT3SUPPORTLIGHT 0x00040
2647 #define QT_MODULE_QT3SUPPORT 0x00080
2648 #define QT_MODULE_SVG 0x00100
2649 #define QT_MODULE_ACTIVEQT 0x00200
2650 #define QT_MODULE_GRAPHICSVIEW 0x00400
2651 #define QT_MODULE_SCRIPT 0x00800
2652 #define QT_MODULE_XMLPATTERNS 0x01000
2653 #define QT_MODULE_HELP 0x02000
2654 #define QT_MODULE_TEST 0x04000
2655 #define QT_MODULE_DBUS 0x08000
2656 #define QT_MODULE_SCRIPTTOOLS 0x10000
2657 #define QT_MODULE_OPENVG 0x20000
2658 #define QT_MODULE_MULTIMEDIA 0x40000
2659 #define QT_MODULE_DECLARATIVE 0x80000
2662 #define QT_EDITION_CONSOLE (QT_MODULE_CORE \
2663 | QT_MODULE_NETWORK \
2665 | QT_MODULE_SCRIPT \
2666 | QT_MODULE_MULTIMEDIA \
2668 | QT_MODULE_XMLPATTERNS \
2671 #define QT_EDITION_DESKTOPLIGHT (QT_MODULE_CORE \
2673 | QT_MODULE_QT3SUPPORTLIGHT \
2676 #define QT_EDITION_OPENSOURCE (QT_MODULE_CORE \
2678 | QT_MODULE_NETWORK \
2679 | QT_MODULE_OPENGL \
2680 | QT_MODULE_OPENVG \
2682 | QT_MODULE_MULTIMEDIA \
2684 | QT_MODULE_XMLPATTERNS \
2685 | QT_MODULE_SCRIPT \
2686 | QT_MODULE_SCRIPTTOOLS \
2687 | QT_MODULE_QT3SUPPORTLIGHT \
2688 | QT_MODULE_QT3SUPPORT \
2690 | QT_MODULE_DECLARATIVE \
2691 | QT_MODULE_GRAPHICSVIEW \
2695 | QT_MODULE_ACTIVEQT)
2696 #define QT_EDITION_DESKTOP (QT_EDITION_OPENSOURCE)
2697 #define QT_EDITION_UNIVERSAL QT_EDITION_DESKTOP
2698 #define QT_EDITION_ACADEMIC QT_EDITION_DESKTOP
2699 #define QT_EDITION_EDUCATIONAL QT_EDITION_DESKTOP
2700 #define QT_EDITION_EVALUATION QT_EDITION_DESKTOP
2704 # ifdef QT_BUILD_QMAKE
2705 # define QT_EDITION QT_EDITION_DESKTOP
2707 # error "Qt not configured correctly, please run configure"
2711 #define QT_LICENSED_MODULE(x) \
2712 enum QtValidLicenseFor##x##Module { Licensed##x = true };
2717 #if (QT_EDITION & QT_MODULE_CORE)
2718 QT_LICENSED_MODULE(Core)
2720 #if (QT_EDITION & QT_MODULE_GUI)
2721 QT_LICENSED_MODULE(Gui)
2723 #if (QT_EDITION & QT_MODULE_NETWORK)
2724 QT_LICENSED_MODULE(Network)
2726 #if (QT_EDITION & QT_MODULE_OPENGL)
2727 QT_LICENSED_MODULE(OpenGL)
2729 #if (QT_EDITION & QT_MODULE_OPENVG)
2730 QT_LICENSED_MODULE(OpenVG)
2732 #if (QT_EDITION & QT_MODULE_SQL)
2733 QT_LICENSED_MODULE(Sql)
2735 #if (QT_EDITION & QT_MODULE_MULTIMEDIA)
2736 QT_LICENSED_MODULE(Multimedia)
2738 #if (QT_EDITION & QT_MODULE_XML)
2739 QT_LICENSED_MODULE(Xml)
2741 #if (QT_EDITION & QT_MODULE_XMLPATTERNS)
2742 QT_LICENSED_MODULE(XmlPatterns)
2744 #if (QT_EDITION & QT_MODULE_HELP)
2745 QT_LICENSED_MODULE(Help)
2747 #if (QT_EDITION & QT_MODULE_SCRIPT) || defined(QT_BUILD_QMAKE)
2748 QT_LICENSED_MODULE(Script)
2750 #if (QT_EDITION & QT_MODULE_SCRIPTTOOLS)
2751 QT_LICENSED_MODULE(ScriptTools)
2753 #if (QT_EDITION & QT_MODULE_QT3SUPPORTLIGHT)
2754 QT_LICENSED_MODULE(Qt3SupportLight)
2756 #if (QT_EDITION & QT_MODULE_QT3SUPPORT)
2757 QT_LICENSED_MODULE(Qt3Support)
2759 #if (QT_EDITION & QT_MODULE_SVG)
2760 QT_LICENSED_MODULE(Svg)
2762 #if (QT_EDITION & QT_MODULE_DECLARATIVE)
2763 QT_LICENSED_MODULE(Declarative)
2765 #if (QT_EDITION & QT_MODULE_ACTIVEQT)
2766 QT_LICENSED_MODULE(ActiveQt)
2768 #if (QT_EDITION & QT_MODULE_TEST)
2769 QT_LICENSED_MODULE(Test)
2771 #if (QT_EDITION & QT_MODULE_DBUS)
2772 QT_LICENSED_MODULE(DBus)
2775 #define QT_MODULE(x) \
2776 typedef QtValidLicenseFor##x##Module Qt##x##Module;
2778 #ifdef QT_NO_CONCURRENT
2779 # define QT_NO_QFUTURE
2784 #if defined(Q_CC_GNU) && (__GNUC__ < 4)
2785 # define QT_NO_CONCURRENT_MAP
2786 # define QT_NO_CONCURRENT_FILTER
2789 #if defined (__ELF__)
2790 # if defined (Q_OS_LINUX) || defined (Q_OS_SOLARIS) || defined (Q_OS_FREEBSD) || defined (Q_OS_OPENBSD) || defined (Q_OS_IRIX)
2795 #if !(defined(Q_WS_WIN) && !defined(Q_WS_WINCE)) \
2796 && !(defined(Q_WS_MAC) && defined(QT_MAC_USE_COCOA)) \
2797 && !(defined(Q_WS_X11) && !defined(QT_NO_FREETYPE)) \
2798 && !(defined(Q_WS_QPA))
2799 # define QT_NO_RAWFONT
2804 template <
bool B,
typename T =
void>
struct QEnableIf;
2805 template <
typename T>
struct QEnableIf<true, T> {
typedef T Type; };
unsigned int(APIENTRYP PFNGLXGETAGPOFFSETMESAPROC)(const void *pointer)
typedef void(APIENTRYP PFNGLBLENDCOLORPROC)(GLclampf red
#define QT_END_INCLUDE_NAMESPACE
Q_INLINE_TEMPLATE void swap(QT_PREPEND_NAMESPACE(QScopedPointer)< T, Cleanup > &p1, QT_PREPEND_NAMESPACE(QScopedPointer)< T, Cleanup > &p2)
unsigned long long quint64
Q_CORE_EXPORT_INLINE QDebug qWarning()
bool operator==(const Attribute &cA, const AttributeInstance< type > &cB)
This operator compares the two attributes and NOT their values.
Q_CORE_EXPORT QBitArray operator^(const QBitArray &, const QBitArray &)
Q_CORE_EXPORT QBitArray operator&(const QBitArray &, const QBitArray &)
#define QT_BEGIN_NAMESPACE
GLenum GLsizei GLenum format
Q_INLINE_TEMPLATE void qSwap(QScopedPointer< T, Cleanup > &p1, QScopedPointer< T, Cleanup > &p2)
QT_BEGIN_HEADER QT_BEGIN_NAMESPACE typedef signed char qint8
bool operator!=(const QByteArray &a1, const QByteArray &a2)
GLsizei const GLfloat * value
Q_CORE_EXPORT_INLINE QDebug qDebug()
bool qFuzzyCompare(const QMatrix &m1, const QMatrix &m2)
GLubyte GLubyte GLubyte a
#define QT_BEGIN_INCLUDE_NAMESPACE
Q_CORE_EXPORT QBitArray operator|(const QBitArray &, const QBitArray &)
Q_CORE_EXPORT_INLINE QDebug qCritical()
Q_DECLARE_TYPEINFO(QModelIndex, Q_MOVABLE_TYPE)
GLsizei const GLvoid * pointer