1 /****************************************************************************
3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
4 ** All rights reserved.
5 ** Contact: Nokia Corporation (qt-info@nokia.com)
7 ** This file is part of the QtCore module of the Qt Toolkit.
9 ** $QT_BEGIN_LICENSE:LGPL$
10 ** No Commercial Usage
11 ** This file contains pre-release code and may not be distributed.
12 ** You may use this file in accordance with the terms and conditions
13 ** contained in the Technology Preview License Agreement accompanying
16 ** GNU Lesser General Public License Usage
17 ** Alternatively, this file may be used under the terms of the GNU Lesser
18 ** General Public License version 2.1 as published by the Free Software
19 ** Foundation and appearing in the file LICENSE.LGPL included in the
20 ** packaging of this file. Please review the following information to
21 ** ensure the GNU Lesser General Public License version 2.1 requirements
22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 ** In addition, as a special exception, Nokia gives you certain additional
25 ** rights. These rights are described in the Nokia Qt LGPL Exception
26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 ** If you have questions regarding the use of this file, please contact
29 ** Nokia at qt-info@nokia.com.
40 ****************************************************************************/
47 #define QT_VERSION_STR "4.7.0"
49 QT_VERSION is (major << 16) + (minor << 8) + patch.
51 #define QT_VERSION 0x040700
53 can be used like #if (QT_VERSION >= QT_VERSION_CHECK(4, 4, 0))
55 #define QT_VERSION_CHECK(major, minor, patch) ((major<<16)|(minor<<8)|(patch))
57 #define QT_PACKAGEDATE_STR "YYYY-MM-DD"
59 #define QT_PACKAGE_TAG ""
61 #if !defined(QT_BUILD_MOC)
62 #include <QtCore/qconfig.h>
67 #ifndef QT_NAMESPACE /* user namespace */
69 # define QT_PREPEND_NAMESPACE(name) ::name
70 # define QT_USE_NAMESPACE
71 # define QT_BEGIN_NAMESPACE
72 # define QT_END_NAMESPACE
73 # define QT_BEGIN_INCLUDE_NAMESPACE
74 # define QT_END_INCLUDE_NAMESPACE
75 # define QT_BEGIN_MOC_NAMESPACE
76 # define QT_END_MOC_NAMESPACE
77 # define QT_FORWARD_DECLARE_CLASS(name) class name;
78 # define QT_FORWARD_DECLARE_STRUCT(name) struct name;
79 # define QT_MANGLE_NAMESPACE(name) name
81 #else /* user namespace */
83 # define QT_PREPEND_NAMESPACE(name) ::QT_NAMESPACE::name
84 # define QT_USE_NAMESPACE using namespace ::QT_NAMESPACE;
85 # define QT_BEGIN_NAMESPACE namespace QT_NAMESPACE {
86 # define QT_END_NAMESPACE }
87 # define QT_BEGIN_INCLUDE_NAMESPACE }
88 # define QT_END_INCLUDE_NAMESPACE namespace QT_NAMESPACE {
89 # define QT_BEGIN_MOC_NAMESPACE QT_USE_NAMESPACE
90 # define QT_END_MOC_NAMESPACE
91 # define QT_FORWARD_DECLARE_CLASS(name) \
92 QT_BEGIN_NAMESPACE class name; QT_END_NAMESPACE \
93 using QT_PREPEND_NAMESPACE(name);
95 # define QT_FORWARD_DECLARE_STRUCT(name) \
96 QT_BEGIN_NAMESPACE struct name; QT_END_NAMESPACE \
97 using QT_PREPEND_NAMESPACE(name);
99 # define QT_MANGLE_NAMESPACE0(x) x
100 # define QT_MANGLE_NAMESPACE1(a, b) a##_##b
101 # define QT_MANGLE_NAMESPACE2(a, b) QT_MANGLE_NAMESPACE1(a,b)
102 # define QT_MANGLE_NAMESPACE(name) QT_MANGLE_NAMESPACE2( \
103 QT_MANGLE_NAMESPACE0(name), QT_MANGLE_NAMESPACE0(QT_NAMESPACE))
105 namespace QT_NAMESPACE
{}
107 # ifndef QT_BOOTSTRAPPED
108 # ifndef QT_NO_USING_NAMESPACE
110 This expands to a "using QT_NAMESPACE" also in _header files_.
111 It is the only way the feature can be used without too much
112 pain, but if people _really_ do not want it they can add
113 DEFINES += QT_NO_USING_NAMESPACE to their .pro files.
119 #endif /* user namespace */
121 #else /* __cplusplus */
123 # define QT_BEGIN_NAMESPACE
124 # define QT_END_NAMESPACE
125 # define QT_USE_NAMESPACE
126 # define QT_BEGIN_INCLUDE_NAMESPACE
127 # define QT_END_INCLUDE_NAMESPACE
129 #endif /* __cplusplus */
131 #if defined(Q_OS_MAC) && !defined(Q_CC_INTEL)
132 #define QT_BEGIN_HEADER extern "C++" {
133 #define QT_END_HEADER }
134 #define QT_BEGIN_INCLUDE_HEADER }
135 #define QT_END_INCLUDE_HEADER extern "C++" {
137 #define QT_BEGIN_HEADER
138 #define QT_END_HEADER
139 #define QT_BEGIN_INCLUDE_HEADER
140 #define QT_END_INCLUDE_HEADER extern "C++"
144 The operating system, must be one of: (Q_OS_x)
146 DARWIN - Darwin OS (synonym for Q_OS_MAC)
148 MSDOS - MS-DOS and Windows
150 OS2EMX - XFree86 on OS/2 (not PM)
151 WIN32 - Win32 (Windows 2000/XP/Vista/7 and Windows Server 2003/2008)
152 WINCE - WinCE (Windows CE 5.0)
154 SOLARIS - Sun Solaris
164 SCO - SCO OpenServer 5
165 UNIXWARE - UnixWare 7, Open UNIX 8
169 RELIANT - Reliant UNIX
174 BSD4 - Any BSD 4.4 system
175 UNIX - Any UNIX BSD/SYSV system
178 #if defined(__APPLE__) && (defined(__GNUC__) || defined(__xlC__) || defined(__xlc__))
182 # define Q_OS_DARWIN64
184 # define Q_OS_DARWIN32
186 #elif defined(__SYMBIAN32__) || defined(SYMBIAN)
187 # define Q_OS_SYMBIAN
188 # define Q_NO_POSIX_SIGNALS
189 # define QT_NO_GETIFADDRS
190 #elif defined(__CYGWIN__)
192 #elif defined(MSDOS) || defined(_MSDOS)
194 #elif defined(__OS2__)
195 # if defined(__EMX__)
200 #elif !defined(SAG_COM) && (defined(WIN64) || defined(_WIN64) || defined(__WIN64__))
203 #elif !defined(SAG_COM) && (defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__))
204 # if defined(WINCE) || defined(_WIN32_WCE)
209 #elif defined(__MWERKS__) && defined(__INTEL__)
211 #elif defined(__sun) || defined(sun)
212 # define Q_OS_SOLARIS
213 #elif defined(hpux) || defined(__hpux)
215 #elif defined(__ultrix) || defined(ultrix)
218 # define Q_OS_RELIANT
219 #elif defined(__linux__) || defined(__linux)
221 #elif defined(__FreeBSD__) || defined(__DragonFly__)
222 # define Q_OS_FREEBSD
224 #elif defined(__NetBSD__)
227 #elif defined(__OpenBSD__)
228 # define Q_OS_OPENBSD
230 #elif defined(__bsdi__)
235 #elif defined(__osf__)
239 #elif defined(__Lynx__)
241 #elif defined(__GNU__)
243 #elif defined(__DGUX__)
245 #elif defined(__QNXNTO__)
247 #elif defined(_SEQUENT_)
249 #elif defined(_SCO_DS) /* SCO OpenServer 5 + GCC */
251 #elif defined(__USLC__) /* all SCO platforms + UDK or OUDK */
252 # define Q_OS_UNIXWARE
253 #elif defined(__svr4__) && defined(i386) /* Open UNIX 8 + GCC */
254 # define Q_OS_UNIXWARE
255 #elif defined(__INTEGRITY)
256 # define Q_OS_INTEGRITY
257 #elif defined(VXWORKS) /* there is no "real" VxWorks define - this has to be set in the mkspec! */
258 # define Q_OS_VXWORKS
259 #elif defined(__MAKEDEPEND__)
261 # error "Qt has not been ported to this OS - talk to qt-bugs@trolltech.com"
264 #if defined(Q_OS_WIN32) || defined(Q_OS_WIN64) || defined(Q_OS_WINCE)
268 #if defined(Q_OS_DARWIN)
269 # define Q_OS_MAC /* Q_OS_MAC is mostly for compatibility, but also more clear */
270 # define Q_OS_MACX /* Q_OS_MACX is only for compatibility.*/
271 # if defined(Q_OS_DARWIN64)
273 # elif defined(Q_OS_DARWIN32)
278 #ifdef QT_AUTODETECT_COCOA
280 # define QT_MAC_USE_COCOA 1
281 # define QT_BUILD_KEY QT_BUILD_KEY_COCOA
283 # define QT_BUILD_KEY QT_BUILD_KEY_CARBON
287 #if defined(Q_OS_MAC64) && !defined(QT_MAC_USE_COCOA) && !defined(QT_BUILD_QMAKE)
288 #error "You are building a 64-bit application, but using a 32-bit version of Qt. Check your build configuration."
291 #if defined(Q_OS_MSDOS) || defined(Q_OS_OS2) || defined(Q_OS_WIN)
293 #elif !defined(Q_OS_UNIX)
297 #if defined(Q_OS_DARWIN) && !defined(QT_LARGEFILE_SUPPORT)
298 # define QT_LARGEFILE_SUPPORT 64
302 # ifdef MAC_OS_X_VERSION_MIN_REQUIRED
303 # undef MAC_OS_X_VERSION_MIN_REQUIRED
305 # define MAC_OS_X_VERSION_MIN_REQUIRED MAC_OS_X_VERSION_10_4
306 # include <AvailabilityMacros.h>
307 # if !defined(MAC_OS_X_VERSION_10_3)
308 # define MAC_OS_X_VERSION_10_3 MAC_OS_X_VERSION_10_2 + 1
310 # if !defined(MAC_OS_X_VERSION_10_4)
311 # define MAC_OS_X_VERSION_10_4 MAC_OS_X_VERSION_10_3 + 1
313 # if !defined(MAC_OS_X_VERSION_10_5)
314 # define MAC_OS_X_VERSION_10_5 MAC_OS_X_VERSION_10_4 + 1
316 # if !defined(MAC_OS_X_VERSION_10_6)
317 # define MAC_OS_X_VERSION_10_6 MAC_OS_X_VERSION_10_5 + 1
319 # if (MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_6)
320 # warning "This version of Mac OS X is unsupported"
324 #ifdef __LSB_VERSION__
325 # if __LSB_VERSION__ < 40
326 # error "This version of the Linux Standard Base is unsupported"
329 # define QT_LINUXBASE
334 The compiler, must be one of: (Q_CC_x)
336 SYM - Digital Mars C/C++ (used to be Symantec C++)
337 MWERKS - Metrowerks CodeWarrior
338 MSVC - Microsoft Visual C/C++, Intel C++ for Windows
339 BOR - Borland/Turbo C++
343 EDG - Edison Design Group C++
345 SUN - Forte Developer, or Sun Studio C++
349 USLC - SCO OUDK and UDK
352 INTEL - Intel C++ for Linux, Intel C++ for Windows
353 HIGHC - MetaWare High C/C++
354 PGI - Portland Group C++
355 GHS - Green Hills Optimizing C++ Compilers
356 GCCE - GCCE (Symbian GCCE builds)
357 RVCT - ARM Realview Compiler Suite
358 NOKIAX86 - Nokia x86 (Symbian WINSCW builds)
361 Should be sorted most to least authoritative.
365 # define Q_OUTOFLINE_TEMPLATE inline
368 /* Symantec C++ is now Digital Mars */
369 #if defined(__DMC__) || defined(__SC__)
371 /* "explicit" semantics implemented in 8.1e but keyword recognized since 7.5 */
372 # if defined(__SC__) && __SC__ < 0x750
373 # define Q_NO_EXPLICIT_KEYWORD
375 # define Q_NO_USING_KEYWORD
377 #elif defined(__MWERKS__)
379 # if defined(__EMU_SYMBIAN_OS__)
380 # define Q_CC_NOKIAX86
382 /* "explicit" recognized since 4.0d1 */
384 #elif defined(_MSC_VER)
386 /* proper support of bool for _MSC_VER >= 1100 */
387 # define Q_CANNOT_DELETE_CONSTANT
388 # define Q_OUTOFLINE_TEMPLATE inline
389 # define Q_NO_TEMPLATE_FRIENDS
390 # define QT_NO_PARTIAL_TEMPLATE_SPECIALIZATION
391 # define Q_ALIGNOF(type) __alignof(type)
392 # define Q_DECL_ALIGN(n) __declspec(align(n))
394 /* Visual C++.Net issues for _MSC_VER >= 1300 */
395 # if _MSC_VER >= 1300
396 # define Q_CC_MSVC_NET
397 # if _MSC_VER < 1310 || (defined(Q_OS_WIN64) && defined(_M_IA64))
400 # undef QT_NO_PARTIAL_TEMPLATE_SPECIALIZATION
403 # define Q_NO_USING_KEYWORD
404 # define QT_NO_MEMBER_TEMPLATES
407 # define QT_NO_QOBJECT_CHECK
409 # define QT_NO_TEMPLATE_TEMPLATE_PARAMETERS
411 /* Intel C++ disguising as Visual C++: the `using' keyword avoids warnings */
412 # if defined(__INTEL_COMPILER)
415 /* x64 does not support mmx intrinsics on windows */
416 # if (defined(Q_OS_WIN64) && defined(_M_X64))
420 # undef QT_HAVE_3DNOW
424 #elif defined(__BORLANDC__) || defined(__TURBOC__)
426 # define Q_INLINE_TEMPLATE
427 # if __BORLANDC__ < 0x502
428 # define Q_NO_BOOL_TYPE
429 # define Q_NO_EXPLICIT_KEYWORD
431 # define Q_NO_USING_KEYWORD
433 #elif defined(__WATCOMC__)
437 #elif defined(__GCCE__)
439 # define QT_VISIBILITY_AVAILABLE
440 # if defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__)
441 # define QT_HAVE_ARMV6
444 /* ARM Realview Compiler Suite
445 RVCT compiler also defines __EDG__ and __GNUC__ (if --gnu flag is given),
446 so check for it before that */
447 #elif defined(__ARMCC__) || defined(__CC_ARM)
449 # if __TARGET_ARCH_ARM >= 6
450 # define QT_HAVE_ARMV6
452 #elif defined(__GNUC__)
454 # define Q_C_CALLBACKS
455 # if defined(__MINGW32__)
458 # if defined(__INTEL_COMPILER)
459 /* Intel C++ also masquerades as GCC 3.2.0 */
461 # define Q_NO_TEMPLATE_FRIENDS
464 # define Q_NO_DEPRECATED_CONSTRUCTORS
466 # if __GNUC__ == 2 && __GNUC_MINOR__ <= 7
467 # define Q_FULL_TEMPLATE_INSTANTIATION
469 /* GCC 2.95 knows "using" but does not support it correctly */
470 # if __GNUC__ == 2 && __GNUC_MINOR__ <= 95
471 # define Q_NO_USING_KEYWORD
472 # define QT_NO_STL_WCHAR
474 # if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
475 # define Q_ALIGNOF(type) __alignof__(type)
476 # define Q_TYPEOF(expr) __typeof__(expr)
477 # define Q_DECL_ALIGN(n) __attribute__((__aligned__(n)))
479 /* GCC 3.1 and GCC 3.2 wrongly define _SB_CTYPE_MACROS on HP-UX */
480 # if defined(Q_OS_HPUX) && __GNUC__ == 3 && __GNUC_MINOR__ >= 1
481 # define Q_WRONG_SB_CTYPE_MACROS
483 /* GCC <= 3.3 cannot handle template friends */
484 # if __GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ <= 3)
485 # define Q_NO_TEMPLATE_FRIENDS
487 /* Apple's GCC 3.1 chokes on our streaming qDebug() */
488 # if defined(Q_OS_DARWIN) && __GNUC__ == 3 && (__GNUC_MINOR__ >= 1 && __GNUC_MINOR__ < 3)
489 # define Q_BROKEN_DEBUG_STREAM
491 # if (defined(Q_CC_GNU) || defined(Q_CC_INTEL)) && !defined(QT_MOC_CPP)
492 # define Q_PACKED __attribute__ ((__packed__))
493 # define Q_NO_PACKED_REFERENCE
494 # ifndef __ARM_EABI__
495 # define QT_NO_ARM_EABI
499 /* IBM compiler versions are a bit messy. There are actually two products:
500 the C product, and the C++ product. The C++ compiler is always packaged
501 with the latest version of the C compiler. Version numbers do not always
502 match. This little table (I'm not sure it's accurate) should be helpful:
504 C++ product C product
506 C Set 3.1 C Compiler 3.0
508 C++ Compiler 3.6.6 C Compiler 4.3
510 Visual Age C++ 4.0 ...
512 Visual Age C++ 5.0 C Compiler 5.0
514 Visual Age C++ 6.0 C Compiler 6.0
517 __xlC__ is the version of the C compiler in hexadecimal notation
518 is only an approximation of the C++ compiler version
519 __IBMCPP__ is the version of the C++ compiler in decimal notation
520 but it is not defined on older compilers like C Set 3.1 */
521 #elif defined(__xlC__)
523 # define Q_FULL_TEMPLATE_INSTANTIATION
525 # define Q_NO_BOOL_TYPE
526 # define Q_NO_EXPLICIT_KEYWORD
527 # define Q_NO_USING_KEYWORD
529 # define Q_OUTOFLINE_TEMPLATE inline
530 # define Q_BROKEN_TEMPLATE_SPECIALIZATION
531 # define Q_CANNOT_DELETE_CONSTANT
532 # elif __xlC__ >= 0x0600
533 # define Q_ALIGNOF(type) __alignof__(type)
534 # define Q_TYPEOF(expr) __typeof__(expr)
535 # define Q_DECL_ALIGN(n) __attribute__((__aligned__(n)))
536 # define Q_PACKED __attribute__((__packed__))
539 /* Older versions of DEC C++ do not define __EDG__ or __EDG - observed
540 on DEC C++ V5.5-004. New versions do define __EDG__ - observed on
542 This compiler is different enough from other EDG compilers to handle
543 it separately anyway. */
544 #elif defined(__DECCXX) || defined(__DECC)
546 /* Compaq C++ V6 compilers are EDG-based but I'm not sure about older
547 DEC C++ V5 compilers. */
548 # if defined(__EDG__)
551 /* Compaq have disabled EDG's _BOOL macro and use _BOOL_EXISTS instead
552 - observed on Compaq C++ V6.3-002.
553 In any case versions prior to Compaq C++ V6.0-005 do not have bool. */
554 # if !defined(_BOOL_EXISTS)
555 # define Q_NO_BOOL_TYPE
557 /* Spurious (?) error messages observed on Compaq C++ V6.5-014. */
558 # define Q_NO_USING_KEYWORD
559 /* Apply to all versions prior to Compaq C++ V6.0-000 - observed on
561 # if __DECCXX_VER < 60060000
563 # define Q_BROKEN_TEMPLATE_SPECIALIZATION
564 # define Q_CANNOT_DELETE_CONSTANT
566 /* avoid undefined symbol problems with out-of-line template members */
567 # define Q_OUTOFLINE_TEMPLATE inline
569 /* The Portland Group C++ compiler is based on EDG and does define __EDG__
570 but the C compiler does not */
573 # if defined(__EDG__)
577 /* Compilers with EDG front end are similar. To detect them we test:
578 __EDG documented by SGI, observed on MIPSpro 7.3.1.1 and KAI C++ 4.0b
579 __EDG__ documented in EDG online docs, observed on Compaq C++ V6.3-002
581 #elif !defined(Q_OS_HPUX) && (defined(__EDG) || defined(__EDG__))
583 /* From the EDG documentation (does not seem to apply to Compaq C++):
585 Defined in C++ mode when bool is a keyword. The name of this
586 predefined macro is specified by a configuration flag. _BOOL
589 Defined in Microsoft C++ mode when bool is a keyword. */
590 # if !defined(_BOOL) && !defined(__BOOL_DEFINED)
591 # define Q_NO_BOOL_TYPE
594 /* The Comeau compiler is based on EDG and does define __EDG__ */
595 # if defined(__COMO__)
597 # define Q_C_CALLBACKS
599 /* The `using' keyword was introduced to avoid KAI C++ warnings
600 but it's now causing KAI C++ errors instead. The standard is
601 unclear about the use of this keyword, and in practice every
602 compiler is using its own set of rules. Forget it. */
603 # elif defined(__KCC)
605 # define Q_NO_USING_KEYWORD
607 /* Using the `using' keyword avoids Intel C++ for Linux warnings */
608 # elif defined(__INTEL_COMPILER)
611 /* Uses CFront, make sure to read the manual how to tweak templates. */
612 # elif defined(__ghs)
615 # elif defined(__DCC__)
617 # undef Q_NO_BOOL_TYPE
618 # if !defined(__bool)
619 # define Q_NO_BOOL_TYPE
622 /* The UnixWare 7 UDK compiler is based on EDG and does define __EDG__ */
623 # elif defined(__USLC__) && defined(__SCO_VERSION__)
625 /* The latest UDK 7.1.1b does not need this, but previous versions do */
626 # if !defined(__SCO_VERSION__) || (__SCO_VERSION__ < 302200010)
627 # define Q_OUTOFLINE_TEMPLATE inline
629 # define Q_NO_USING_KEYWORD /* ### check "using" status */
632 # elif defined(CENTERLINE_CLPP) || defined(OBJECTCENTER)
634 # define Q_NO_USING_KEYWORD
636 /* CDS++ defines __EDG__ although this is not documented in the Reliant
637 documentation. It also follows conventions like _BOOL and this documented */
638 # elif defined(sinix)
640 # define Q_NO_USING_KEYWORD
642 /* The MIPSpro compiler defines __EDG */
643 # elif defined(__sgi)
645 # define Q_NO_USING_KEYWORD /* ### check "using" status */
646 # define Q_NO_TEMPLATE_FRIENDS
647 # if defined(_COMPILER_VERSION) && (_COMPILER_VERSION >= 740)
648 # define Q_OUTOFLINE_TEMPLATE inline
649 # pragma set woff 3624,3625,3649 /* turn off some harmless warnings */
653 /* VxWorks' DIAB toolchain has an additional EDG type C++ compiler
654 (see __DCC__ above). This one is for C mode files (__EDG is not defined) */
655 #elif defined(_DIAB_TOOL)
659 #elif defined(__HIGHC__)
662 #elif defined(__SUNPRO_CC) || defined(__SUNPRO_C)
664 /* 5.0 compiler or better
665 'bool' is enabled by default but can be disabled using -features=nobool
666 in which case _BOOL is not defined
667 this is the default in 4.2 compatibility mode triggered by -compat=4 */
668 # if __SUNPRO_CC >= 0x500
669 # define QT_NO_TEMPLATE_TEMPLATE_PARAMETERS
670 /* see http://developers.sun.com/sunstudio/support/Ccompare.html */
671 # if __SUNPRO_CC >= 0x590
672 # define Q_ALIGNOF(type) __alignof__(type)
673 # define Q_TYPEOF(expr) __typeof__(expr)
674 # define Q_DECL_ALIGN(n) __attribute__((__aligned__(n)))
676 # if __SUNPRO_CC >= 0x550
677 # define Q_DECL_EXPORT __global
679 # if __SUNPRO_CC < 0x5a0
680 # define Q_NO_TEMPLATE_FRIENDS
683 # define Q_NO_BOOL_TYPE
685 # if defined(__SUNPRO_CC_COMPAT) && (__SUNPRO_CC_COMPAT <= 4)
686 # define Q_NO_USING_KEYWORD
688 # define Q_C_CALLBACKS
689 /* 4.2 compiler or older */
691 # define Q_NO_BOOL_TYPE
692 # define Q_NO_EXPLICIT_KEYWORD
693 # define Q_NO_USING_KEYWORD
696 /* CDS++ does not seem to define __EDG__ or __EDG according to Reliant
697 documentation but nevertheless uses EDG conventions like _BOOL */
702 # define Q_NO_BOOL_TYPE
704 # define Q_BROKEN_TEMPLATE_SPECIALIZATION
706 #elif defined(Q_OS_HPUX)
707 /* __HP_aCC was not defined in first aCC releases */
708 # if defined(__HP_aCC) || __cplusplus >= 199707L
709 # define Q_NO_TEMPLATE_FRIENDS
711 # if __HP_aCC-0 < 060000
712 # define QT_NO_TEMPLATE_TEMPLATE_PARAMETERS
713 # define Q_DECL_EXPORT __declspec(dllexport)
714 # define Q_DECL_IMPORT __declspec(dllimport)
716 # if __HP_aCC-0 >= 061200
717 # define Q_DECL_ALIGNED(n) __attribute__((aligned(n)))
719 # if __HP_aCC-0 >= 062000
720 # define Q_DECL_EXPORT __attribute__((visibility("default")))
721 # define Q_DECL_IMPORT Q_DECL_EXPORT
725 # define Q_NO_BOOL_TYPE
726 # define Q_FULL_TEMPLATE_INSTANTIATION
727 # define Q_BROKEN_TEMPLATE_SPECIALIZATION
728 # define Q_NO_EXPLICIT_KEYWORD
730 # define Q_NO_USING_KEYWORD /* ### check "using" status */
732 #elif defined(__WINSCW__) && !defined(Q_CC_NOKIAX86)
733 # define Q_CC_NOKIAX86
737 # error "Qt has not been tested with this compiler - talk to qt-bugs@trolltech.com"
742 # undef Q_NO_PACKED_REFERENCE
745 #ifndef Q_CONSTRUCTOR_FUNCTION
746 # define Q_CONSTRUCTOR_FUNCTION0(AFUNC) \
747 static const int AFUNC ## __init_variable__ = AFUNC();
748 # define Q_CONSTRUCTOR_FUNCTION(AFUNC) Q_CONSTRUCTOR_FUNCTION0(AFUNC)
751 #ifndef Q_DESTRUCTOR_FUNCTION
752 # define Q_DESTRUCTOR_FUNCTION0(AFUNC) \
753 class AFUNC ## __dest_class__ { \
755 inline AFUNC ## __dest_class__() { } \
756 inline ~ AFUNC ## __dest_class__() { AFUNC(); } \
757 } AFUNC ## __dest_instance__;
758 # define Q_DESTRUCTOR_FUNCTION(AFUNC) Q_DESTRUCTOR_FUNCTION0(AFUNC)
761 #ifndef Q_REQUIRED_RESULT
762 # if defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1))
763 # define Q_REQUIRED_RESULT __attribute__ ((warn_unused_result))
765 # define Q_REQUIRED_RESULT
769 #ifndef Q_COMPILER_MANGLES_RETURN_TYPE
770 # if defined(Q_CC_MSVC)
771 # define Q_COMPILER_MANGLES_RETURN_TYPE
776 The window system, must be one of: (Q_WS_x)
780 QWS - Qt for Embedded Linux
782 X11 - X Window System
788 #if defined(Q_OS_MSDOS)
790 # error "Qt requires Win32 and does not work with Windows 3.x"
791 #elif defined(_WIN32_X11_)
793 #elif defined(Q_OS_WIN32)
795 # if defined(Q_OS_WIN64)
798 #elif defined(Q_OS_WINCE)
801 # if defined(Q_OS_WINCE_WM)
802 # define Q_WS_WINCE_WM
804 #elif defined(Q_OS_OS2)
806 # error "Qt does not work with OS/2 Presentation Manager or Workplace Shell"
807 #elif defined(Q_OS_UNIX)
808 # if defined(Q_OS_MAC) && !defined(__USE_WS_X11__) && !defined(Q_WS_QWS)
811 # if defined(Q_OS_MAC64)
813 # elif defined(Q_OS_MAC32)
816 # elif defined(Q_OS_SYMBIAN)
817 # if (defined(__SERIES60_31__) || defined(__S60_32__) || defined(__S60_50__)) && !defined(QT_NO_S60)
820 # elif !defined(Q_WS_QWS)
825 #if defined(Q_WS_WIN16) || defined(Q_WS_WIN32) || defined(Q_WS_WINCE)
833 Size-dependent types (architechture-dependent byte order)
835 Make sure to update QMetaType when changing these typedefs
838 typedef signed char qint8
; /* 8 bit signed */
839 typedef unsigned char quint8
; /* 8 bit unsigned */
840 typedef short qint16
; /* 16 bit signed */
841 typedef unsigned short quint16
; /* 16 bit unsigned */
842 typedef int qint32
; /* 32 bit signed */
843 typedef unsigned int quint32
; /* 32 bit unsigned */
844 #if defined(Q_OS_WIN) && !defined(Q_CC_GNU) && !defined(Q_CC_MWERKS)
845 # define Q_INT64_C(c) c ## i64 /* signed 64 bit constant */
846 # define Q_UINT64_C(c) c ## ui64 /* unsigned 64 bit constant */
847 typedef __int64 qint64
; /* 64 bit signed */
848 typedef unsigned __int64 quint64
; /* 64 bit unsigned */
850 # define Q_INT64_C(c) static_cast<long long>(c ## LL) /* signed 64 bit constant */
851 # define Q_UINT64_C(c) static_cast<unsigned long long>(c ## ULL) /* unsigned 64 bit constant */
852 typedef long long qint64
; /* 64 bit signed */
853 typedef unsigned long long quint64
; /* 64 bit unsigned */
856 typedef qint64 qlonglong
;
857 typedef quint64 qulonglong
;
859 #ifndef QT_POINTER_SIZE
860 # if defined(Q_OS_WIN64)
861 # define QT_POINTER_SIZE 8
862 # elif defined(Q_OS_WIN32) || defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN)
863 # define QT_POINTER_SIZE 4
867 #define Q_INIT_RESOURCE(name) \
868 do { extern int QT_MANGLE_NAMESPACE(qInitResources_ ## name) (); \
869 QT_MANGLE_NAMESPACE(qInitResources_ ## name) (); } while (0)
870 #define Q_CLEANUP_RESOURCE(name) \
871 do { extern int QT_MANGLE_NAMESPACE(qCleanupResources_ ## name) (); \
872 QT_MANGLE_NAMESPACE(qCleanupResources_ ## name) (); } while (0)
874 #if defined(__cplusplus)
877 quintptr and qptrdiff is guaranteed to be the same size as a pointer, i.e.
879 sizeof(void *) == sizeof(quintptr)
880 && sizeof(void *) == sizeof(qptrdiff)
882 template <int> struct QIntegerForSize
;
883 template <> struct QIntegerForSize
<1> { typedef quint8 Unsigned
; typedef qint8 Signed
; };
884 template <> struct QIntegerForSize
<2> { typedef quint16 Unsigned
; typedef qint16 Signed
; };
885 template <> struct QIntegerForSize
<4> { typedef quint32 Unsigned
; typedef qint32 Signed
; };
886 template <> struct QIntegerForSize
<8> { typedef quint64 Unsigned
; typedef qint64 Signed
; };
887 template <class T
> struct QIntegerForSizeof
: QIntegerForSize
<sizeof(T
)> { };
888 typedef QIntegerForSizeof
<void*>::Unsigned quintptr
;
889 typedef QIntegerForSizeof
<void*>::Signed qptrdiff
;
892 Useful type definitions for Qt
895 QT_BEGIN_INCLUDE_NAMESPACE
896 typedef unsigned char uchar
;
897 typedef unsigned short ushort
;
898 typedef unsigned int uint
;
899 typedef unsigned long ulong
;
900 QT_END_INCLUDE_NAMESPACE
902 #if defined(Q_NO_BOOL_TYPE)
903 #error "Compiler doesn't support the bool type"
910 #ifndef QT_LINUXBASE /* the LSB defines TRUE and FALSE for us */
911 /* Symbian OS defines TRUE = 1 and FALSE = 0,
912 redefine to built-in booleans to make autotests work properly */
914 #include <e32def.h> /* Symbian OS defines */
926 Proper for-scoping in VC++6 and MIPSpro CC
928 #ifndef QT_NO_KEYWORDS
929 # if (defined(Q_CC_MSVC) && !defined(Q_CC_MSVC_NET) && !defined(Q_CC_INTEL)) || defined(Q_CC_MIPS) || (defined(Q_CC_HPACC) && defined(__ia64))
930 # define for if(0){}else for
935 Workaround for static const members on MSVC++.
938 #if defined(Q_CC_MSVC)
939 # define QT_STATIC_CONST static
940 # define QT_STATIC_CONST_IMPL
942 # define QT_STATIC_CONST static const
943 # define QT_STATIC_CONST_IMPL const
947 Warnings and errors when using deprecated methods
949 #if defined(Q_MOC_RUN)
950 # define Q_DECL_DEPRECATED Q_DECL_DEPRECATED
951 #elif (defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && (__GNUC__ - 0 > 3 || (__GNUC__ - 0 == 3 && __GNUC_MINOR__ - 0 >= 2))) || defined(Q_CC_RVCT)
952 # define Q_DECL_DEPRECATED __attribute__ ((__deprecated__))
953 #elif defined(Q_CC_MSVC) && (_MSC_VER >= 1300)
954 # define Q_DECL_DEPRECATED __declspec(deprecated)
955 # if defined (Q_CC_INTEL)
956 # define Q_DECL_VARIABLE_DEPRECATED
960 # define Q_DECL_DEPRECATED
962 #ifndef Q_DECL_VARIABLE_DEPRECATED
963 # define Q_DECL_VARIABLE_DEPRECATED Q_DECL_DEPRECATED
965 #ifndef Q_DECL_CONSTRUCTOR_DEPRECATED
966 # if defined(Q_MOC_RUN)
967 # define Q_DECL_CONSTRUCTOR_DEPRECATED Q_DECL_CONSTRUCTOR_DEPRECATED
968 # elif defined(Q_NO_DEPRECATED_CONSTRUCTORS)
969 # define Q_DECL_CONSTRUCTOR_DEPRECATED
971 # define Q_DECL_CONSTRUCTOR_DEPRECATED Q_DECL_DEPRECATED
975 #if defined(QT_NO_DEPRECATED)
976 /* disable Qt3 support as well */
977 # undef QT3_SUPPORT_WARNINGS
979 # undef QT_DEPRECATED
980 # undef QT_DEPRECATED_VARIABLE
981 # undef QT_DEPRECATED_CONSTRUCTOR
982 #elif defined(QT_DEPRECATED_WARNINGS)
983 /* enable Qt3 support warnings as well */
984 # undef QT3_SUPPORT_WARNINGS
985 # define QT3_SUPPORT_WARNINGS
986 # undef QT_DEPRECATED
987 # define QT_DEPRECATED Q_DECL_DEPRECATED
988 # undef QT_DEPRECATED_VARIABLE
989 # define QT_DEPRECATED_VARIABLE Q_DECL_VARIABLE_DEPRECATED
990 # undef QT_DEPRECATED_CONSTRUCTOR
991 # define QT_DEPRECATED_CONSTRUCTOR explicit Q_DECL_CONSTRUCTOR_DEPRECATED
993 # undef QT_DEPRECATED
994 # define QT_DEPRECATED
995 # undef QT_DEPRECATED_VARIABLE
996 # define QT_DEPRECATED_VARIABLE
997 # undef QT_DEPRECATED_CONSTRUCTOR
998 # define QT_DEPRECATED_CONSTRUCTOR
1001 #if defined(QT3_SUPPORT_WARNINGS)
1002 # if !defined(QT_COMPAT_WARNINGS) /* also enable compat */
1003 # define QT_COMPAT_WARNINGS
1006 # define QT3_SUPPORT Q_DECL_DEPRECATED
1007 # undef QT3_SUPPORT_VARIABLE
1008 # define QT3_SUPPORT_VARIABLE Q_DECL_VARIABLE_DEPRECATED
1009 # undef QT3_SUPPORT_CONSTRUCTOR
1010 # define QT3_SUPPORT_CONSTRUCTOR explicit Q_DECL_CONSTRUCTOR_DEPRECATED
1011 #elif defined(QT3_SUPPORT) /* define back to nothing */
1012 # if !defined(QT_COMPAT) /* also enable qt3 support */
1016 # define QT3_SUPPORT
1017 # undef QT3_SUPPORT_VARIABLE
1018 # define QT3_SUPPORT_VARIABLE
1019 # undef QT3_SUPPORT_CONSTRUCTOR
1020 # define QT3_SUPPORT_CONSTRUCTOR explicit
1023 /* moc compats (signals/slots) */
1024 #ifndef QT_MOC_COMPAT
1025 # if defined(QT3_SUPPORT)
1026 # define QT_MOC_COMPAT QT3_SUPPORT
1028 # define QT_MOC_COMPAT
1031 # undef QT_MOC_COMPAT
1032 # define QT_MOC_COMPAT
1035 #ifdef QT_ASCII_CAST_WARNINGS
1036 # define QT_ASCII_CAST_WARN Q_DECL_DEPRECATED
1037 # if defined(Q_CC_GNU) && __GNUC__ < 4
1038 /* gcc < 4 doesn't like Q_DECL_DEPRECATED in front of constructors */
1039 # define QT_ASCII_CAST_WARN_CONSTRUCTOR
1041 # define QT_ASCII_CAST_WARN_CONSTRUCTOR Q_DECL_CONSTRUCTOR_DEPRECATED
1044 # define QT_ASCII_CAST_WARN
1045 # define QT_ASCII_CAST_WARN_CONSTRUCTOR
1048 #if defined(__i386__) || defined(_WIN32) || defined(_WIN32_WCE)
1049 # if defined(Q_CC_GNU)
1050 #if !defined(Q_CC_INTEL) && ((100*(__GNUC__ - 0) + 10*(__GNUC_MINOR__ - 0) + __GNUC_PATCHLEVEL__) >= 332)
1051 # define QT_FASTCALL __attribute__((regparm(3)))
1053 # define QT_FASTCALL
1055 # elif defined(Q_CC_MSVC) && (_MSC_VER > 1300 || defined(Q_CC_INTEL))
1056 # define QT_FASTCALL __fastcall
1058 # define QT_FASTCALL
1061 # define QT_FASTCALL
1064 typedef int QNoImplicitBoolCast
;
1066 #if defined(QT_ARCH_ARM) || defined(QT_ARCH_ARMV6) || defined(QT_ARCH_AVR32) || (defined(QT_ARCH_MIPS) && (defined(Q_WS_QWS) || defined(Q_OS_WINCE))) || defined(QT_ARCH_SH) || defined(QT_ARCH_SH4A)
1070 // This logic must match the one in qmetatype.h
1071 #if defined(QT_COORD_TYPE)
1072 typedef QT_COORD_TYPE qreal
;
1073 #elif defined(QT_NO_FPU) || defined(QT_ARCH_ARM) || defined(QT_ARCH_WINDOWSCE) || defined(QT_ARCH_SYMBIAN)
1074 typedef float qreal
;
1076 typedef double qreal
;
1080 Utility macros and inline functions
1083 template <typename T
>
1084 inline T
qAbs(const T
&t
) { return t
>= 0 ? t
: -t
; }
1086 inline int qRound(qreal d
)
1087 { return d
>= 0.0 ? int(d
+ 0.5) : int(d
- int(d
-1) + 0.5) + int(d
-1); }
1089 #if defined(QT_NO_FPU) || defined(QT_ARCH_ARM) || defined(QT_ARCH_WINDOWSCE) || defined(QT_ARCH_SYMBIAN)
1090 inline qint64
qRound64(double d
)
1091 { return d
>= 0.0 ? qint64(d
+ 0.5) : qint64(d
- qreal(qint64(d
-1)) + 0.5) + qint64(d
-1); }
1093 inline qint64
qRound64(qreal d
)
1094 { return d
>= 0.0 ? qint64(d
+ 0.5) : qint64(d
- qreal(qint64(d
-1)) + 0.5) + qint64(d
-1); }
1097 template <typename T
>
1098 inline const T
&qMin(const T
&a
, const T
&b
) { if (a
< b
) return a
; return b
; }
1099 template <typename T
>
1100 inline const T
&qMax(const T
&a
, const T
&b
) { if (a
< b
) return b
; return a
; }
1101 template <typename T
>
1102 inline const T
&qBound(const T
&min
, const T
&val
, const T
&max
)
1103 { return qMax(min
, qMin(max
, val
)); }
1106 typedef qint8 Q_INT8
;
1107 typedef quint8 Q_UINT8
;
1108 typedef qint16 Q_INT16
;
1109 typedef quint16 Q_UINT16
;
1110 typedef qint32 Q_INT32
;
1111 typedef quint32 Q_UINT32
;
1112 typedef qint64 Q_INT64
;
1113 typedef quint64 Q_UINT64
;
1115 typedef qint64 Q_LLONG
;
1116 typedef quint64 Q_ULLONG
;
1117 #if defined(Q_OS_WIN64)
1118 typedef __int64 Q_LONG
; /* word up to 64 bit signed */
1119 typedef unsigned __int64 Q_ULONG
; /* word up to 64 bit unsigned */
1121 typedef long Q_LONG
; /* word up to 64 bit signed */
1122 typedef unsigned long Q_ULONG
; /* word up to 64 bit unsigned */
1125 # define QABS(a) qAbs(a)
1126 # define QMAX(a, b) qMax((a), (b))
1127 # define QMIN(a, b) qMin((a), (b))
1131 Data stream functions are provided by many classes (defined in qdatastream.h)
1136 #ifndef QT_BUILD_KEY
1137 #define QT_BUILD_KEY "unspecified"
1140 #if defined(Q_WS_MAC)
1141 # ifndef QMAC_QMENUBAR_NO_EVENT
1142 # define QMAC_QMENUBAR_NO_EVENT
1146 #if !defined(Q_WS_QWS) && !defined(QT_NO_COP)
1150 #if defined(Q_OS_VXWORKS)
1151 # define QT_NO_CRASHHANDLER // no popen
1152 # define QT_NO_PROCESS // no exec*, no fork
1154 # define QT_NO_SHAREDMEMORY // only POSIX, no SysV and in the end...
1155 # define QT_NO_SYSTEMSEMAPHORE // not needed at all in a flat address space
1156 # define QT_NO_QWS_MULTIPROCESS // no processes
1159 # include <QtCore/qfeatures.h>
1161 #define QT_SUPPORTS(FEATURE) (!defined(QT_NO_##FEATURE))
1163 #ifndef Q_DECL_EXPORT
1164 # if defined(Q_OS_WIN) || defined(Q_CC_NOKIAX86) || defined(Q_CC_RVCT)
1165 # define Q_DECL_EXPORT __declspec(dllexport)
1166 # elif defined(QT_VISIBILITY_AVAILABLE)
1167 # define Q_DECL_EXPORT __attribute__((visibility("default")))
1169 # ifndef Q_DECL_EXPORT
1170 # define Q_DECL_EXPORT
1173 #ifndef Q_DECL_IMPORT
1174 # if defined(Q_OS_WIN) || defined(Q_CC_NOKIAX86) || defined(Q_CC_RVCT)
1175 # define Q_DECL_IMPORT __declspec(dllimport)
1177 # define Q_DECL_IMPORT
1182 Create Qt DLL if QT_DLL is defined (Windows and Symbian only)
1185 #if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
1186 # if defined(QT_NODLL)
1189 # elif defined(QT_MAKEDLL) /* create a Qt DLL library */
1190 # if defined(QT_DLL)
1193 # if defined(QT_BUILD_CORE_LIB)
1194 # define Q_CORE_EXPORT Q_DECL_EXPORT
1196 # define Q_CORE_EXPORT Q_DECL_IMPORT
1198 # if defined(QT_BUILD_GUI_LIB)
1199 # define Q_GUI_EXPORT Q_DECL_EXPORT
1201 # define Q_GUI_EXPORT Q_DECL_IMPORT
1203 # if defined(QT_BUILD_SQL_LIB)
1204 # define Q_SQL_EXPORT Q_DECL_EXPORT
1206 # define Q_SQL_EXPORT Q_DECL_IMPORT
1208 # if defined(QT_BUILD_NETWORK_LIB)
1209 # define Q_NETWORK_EXPORT Q_DECL_EXPORT
1211 # define Q_NETWORK_EXPORT Q_DECL_IMPORT
1213 # if defined(QT_BUILD_SVG_LIB)
1214 # define Q_SVG_EXPORT Q_DECL_EXPORT
1216 # define Q_SVG_EXPORT Q_DECL_IMPORT
1218 # if defined(QT_BUILD_DECLARATIVE_LIB)
1219 # define Q_DECLARATIVE_EXPORT Q_DECL_EXPORT
1221 # define Q_DECLARATIVE_EXPORT Q_DECL_IMPORT
1223 # if defined(QT_BUILD_OPENGL_LIB)
1224 # define Q_OPENGL_EXPORT Q_DECL_EXPORT
1226 # define Q_OPENGL_EXPORT Q_DECL_IMPORT
1228 # if defined(QT_BUILD_MULTIMEDIA_LIB)
1229 # define Q_MULTIMEDIA_EXPORT Q_DECL_EXPORT
1231 # define Q_MULTIMEDIA_EXPORT Q_DECL_IMPORT
1233 # if defined(QT_BUILD_OPENVG_LIB)
1234 # define Q_OPENVG_EXPORT Q_DECL_EXPORT
1236 # define Q_OPENVG_EXPORT Q_DECL_IMPORT
1238 # if defined(QT_BUILD_XML_LIB)
1239 # define Q_XML_EXPORT Q_DECL_EXPORT
1241 # define Q_XML_EXPORT Q_DECL_IMPORT
1243 # if defined(QT_BUILD_XMLPATTERNS_LIB)
1244 # define Q_XMLPATTERNS_EXPORT Q_DECL_EXPORT
1246 # define Q_XMLPATTERNS_EXPORT Q_DECL_IMPORT
1248 # if defined(QT_BUILD_SCRIPT_LIB)
1249 # define Q_SCRIPT_EXPORT Q_DECL_EXPORT
1251 # define Q_SCRIPT_EXPORT Q_DECL_IMPORT
1253 # if defined(QT_BUILD_SCRIPTTOOLS_LIB)
1254 # define Q_SCRIPTTOOLS_EXPORT Q_DECL_EXPORT
1256 # define Q_SCRIPTTOOLS_EXPORT Q_DECL_IMPORT
1258 # if defined(QT_BUILD_CANVAS_LIB)
1259 # define Q_CANVAS_EXPORT Q_DECL_EXPORT
1261 # define Q_CANVAS_EXPORT Q_DECL_IMPORT
1263 # if defined(QT_BUILD_COMPAT_LIB)
1264 # define Q_COMPAT_EXPORT Q_DECL_EXPORT
1266 # define Q_COMPAT_EXPORT Q_DECL_IMPORT
1268 # define Q_TEMPLATEDLL
1269 # elif defined(QT_DLL) /* use a Qt DLL library */
1270 # define Q_CORE_EXPORT Q_DECL_IMPORT
1271 # define Q_GUI_EXPORT Q_DECL_IMPORT
1272 # define Q_SQL_EXPORT Q_DECL_IMPORT
1273 # define Q_NETWORK_EXPORT Q_DECL_IMPORT
1274 # define Q_SVG_EXPORT Q_DECL_IMPORT
1275 # define Q_DECLARATIVE_EXPORT Q_DECL_IMPORT
1276 # define Q_CANVAS_EXPORT Q_DECL_IMPORT
1277 # define Q_OPENGL_EXPORT Q_DECL_IMPORT
1278 # define Q_MULTIMEDIA_EXPORT Q_DECL_IMPORT
1279 # define Q_OPENVG_EXPORT Q_DECL_IMPORT
1280 # define Q_XML_EXPORT Q_DECL_IMPORT
1281 # define Q_XMLPATTERNS_EXPORT Q_DECL_IMPORT
1282 # define Q_SCRIPT_EXPORT Q_DECL_IMPORT
1283 # define Q_SCRIPTTOOLS_EXPORT Q_DECL_IMPORT
1284 # define Q_COMPAT_EXPORT Q_DECL_IMPORT
1285 # define Q_TEMPLATEDLL
1287 # define Q_NO_DECLARED_NOT_DEFINED
1289 # if defined(Q_OS_LINUX) && defined(Q_CC_BOR)
1290 # define Q_TEMPLATEDLL
1291 # define Q_NO_DECLARED_NOT_DEFINED
1293 # undef QT_MAKEDLL /* ignore these for other platforms */
1297 #if !defined(Q_CORE_EXPORT)
1298 # if defined(QT_SHARED)
1299 # define Q_CORE_EXPORT Q_DECL_EXPORT
1300 # define Q_GUI_EXPORT Q_DECL_EXPORT
1301 # define Q_SQL_EXPORT Q_DECL_EXPORT
1302 # define Q_NETWORK_EXPORT Q_DECL_EXPORT
1303 # define Q_SVG_EXPORT Q_DECL_EXPORT
1304 # define Q_DECLARATIVE_EXPORT Q_DECL_EXPORT
1305 # define Q_OPENGL_EXPORT Q_DECL_EXPORT
1306 # define Q_MULTIMEDIA_EXPORT Q_DECL_EXPORT
1307 # define Q_OPENVG_EXPORT Q_DECL_EXPORT
1308 # define Q_XML_EXPORT Q_DECL_EXPORT
1309 # define Q_XMLPATTERNS_EXPORT Q_DECL_EXPORT
1310 # define Q_SCRIPT_EXPORT Q_DECL_EXPORT
1311 # define Q_SCRIPTTOOLS_EXPORT Q_DECL_EXPORT
1312 # define Q_COMPAT_EXPORT Q_DECL_EXPORT
1314 # define Q_CORE_EXPORT
1315 # define Q_GUI_EXPORT
1316 # define Q_SQL_EXPORT
1317 # define Q_NETWORK_EXPORT
1318 # define Q_SVG_EXPORT
1319 # define Q_DECLARATIVE_EXPORT
1320 # define Q_OPENGL_EXPORT
1321 # define Q_MULTIMEDIA_EXPORT
1322 # define Q_XML_EXPORT
1323 # define Q_XMLPATTERNS_EXPORT
1324 # define Q_SCRIPT_EXPORT
1325 # define Q_SCRIPTTOOLS_EXPORT
1326 # define Q_COMPAT_EXPORT
1330 // Functions marked as Q_GUI_EXPORT_INLINE were exported and inlined by mistake.
1331 // Compilers like MinGW complain that the import attribute is ignored.
1332 #if defined(Q_CC_MINGW)
1333 # if defined(QT_BUILD_CORE_LIB)
1334 # define Q_CORE_EXPORT_INLINE Q_CORE_EXPORT inline
1336 # define Q_CORE_EXPORT_INLINE inline
1338 # if defined(QT_BUILD_GUI_LIB)
1339 # define Q_GUI_EXPORT_INLINE Q_GUI_EXPORT inline
1341 # define Q_GUI_EXPORT_INLINE inline
1343 #elif defined(Q_CC_RVCT)
1344 // we force RVCT not to export inlines by passing --visibility_inlines_hidden
1345 // so we need to just inline it, rather than exporting and inlining
1346 // note: this affects the contents of the DEF files (ie. these functions do not appear)
1347 # define Q_CORE_EXPORT_INLINE inline
1348 # define Q_GUI_EXPORT_INLINE inline
1350 # define Q_CORE_EXPORT_INLINE Q_CORE_EXPORT inline
1351 # define Q_GUI_EXPORT_INLINE Q_GUI_EXPORT inline
1355 No, this is not an evil backdoor. QT_BUILD_INTERNAL just exports more symbols
1356 for Qt's internal unit tests. If you want slower loading times and more
1357 symbols that can vanish from version to version, feel free to define QT_BUILD_INTERNAL.
1359 #if defined(QT_BUILD_INTERNAL) && (defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)) && defined(QT_MAKEDLL)
1360 # define Q_AUTOTEST_EXPORT Q_DECL_EXPORT
1361 #elif defined(QT_BUILD_INTERNAL) && (defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)) && defined(QT_DLL)
1362 # define Q_AUTOTEST_EXPORT Q_DECL_IMPORT
1363 #elif defined(QT_BUILD_INTERNAL) && !(defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)) && defined(QT_SHARED)
1364 # define Q_AUTOTEST_EXPORT Q_DECL_EXPORT
1366 # define Q_AUTOTEST_EXPORT
1369 inline void qt_noop() {}
1371 /* These wrap try/catch so we can switch off exceptions later.
1373 Beware - do not use more than one QT_CATCH per QT_TRY, and do not use
1374 the exception instance in the catch block.
1375 If you can't live with those constraints, don't use these macros.
1376 Use the QT_NO_EXCEPTIONS macro to protect your code instead.
1379 #ifdef QT_BOOTSTRAPPED
1380 # define QT_NO_EXCEPTIONS
1382 #if !defined(QT_NO_EXCEPTIONS) && defined(Q_CC_GNU) && !defined (__EXCEPTIONS) && !defined(Q_MOC_RUN)
1383 # define QT_NO_EXCEPTIONS
1386 #ifdef QT_NO_EXCEPTIONS
1387 # define QT_TRY if (true)
1388 # define QT_CATCH(A) else
1389 # define QT_THROW(A) qt_noop()
1390 # define QT_RETHROW qt_noop()
1393 # define QT_CATCH(A) catch (A)
1394 # define QT_THROW(A) throw A
1395 # define QT_RETHROW throw
1403 class Q_CORE_EXPORT QSysInfo
{
1406 WordSize
= (sizeof(void *)<<3)
1409 #if defined(QT_BUILD_QMAKE)
1414 /* needed to bootstrap qmake */
1415 static const int ByteOrder
;
1416 #elif defined(Q_BYTE_ORDER)
1422 , ByteOrder
= <platform
-dependent
>
1423 # elif Q_BYTE_ORDER == Q_BIG_ENDIAN
1424 , ByteOrder
= BigEndian
1425 # elif Q_BYTE_ORDER == Q_LITTLE_ENDIAN
1426 , ByteOrder
= LittleEndian
1428 # error "Undefined byte order"
1432 # error "Qt not configured correctly, please run configure"
1434 #if defined(Q_WS_WIN) || defined(Q_OS_CYGWIN)
1440 WV_DOS_based
= 0x000f,
1448 WV_WINDOWS7
= 0x0090,
1449 WV_NT_based
= 0x00f0,
1451 /* version numbers */
1457 WV_6_1
= WV_WINDOWS7
,
1463 WV_CE_based
= 0x0f00
1465 static const WinVersion WindowsVersion
;
1466 static WinVersion
windowsVersion();
1471 MV_Unknown
= 0x0000,
1484 MV_CHEETAH
= MV_10_0
,
1486 MV_JAGUAR
= MV_10_2
,
1487 MV_PANTHER
= MV_10_3
,
1489 MV_LEOPARD
= MV_10_5
,
1490 MV_SNOWLEOPARD
= MV_10_6
1492 static const MacVersion MacintoshVersion
;
1495 enum SymbianVersion
{
1496 SV_Unknown
= 0x0000,
1497 //These are the Symbian Ltd versions 9.2-9.4
1501 //Following values are the symbian foundation versions, i.e. Symbian^1 == SV_SF_1
1507 static SymbianVersion
symbianVersion();
1511 SV_S60_3_1
= SV_9_2
,
1512 SV_S60_3_2
= SV_9_3
,
1513 SV_S60_5_0
= SV_9_4
,
1514 //versions beyond 5.0 are to be confirmed - it is better to use symbian version
1515 SV_S60_5_1
= SV_SF_2
,
1516 SV_S60_5_2
= SV_SF_3
1518 static S60Version
s60Version();
1522 Q_CORE_EXPORT
const char *qVersion();
1523 Q_CORE_EXPORT
bool qSharedBuild();
1525 #if defined(Q_OS_MAC)
1526 inline int qMacVersion() { return QSysInfo::MacintoshVersion
; }
1530 inline QT3_SUPPORT
bool qSysInfo(int *wordSize
, bool *bigEndian
)
1532 *wordSize
= QSysInfo::WordSize
;
1533 *bigEndian
= (QSysInfo::ByteOrder
== QSysInfo::BigEndian
);
1538 #if defined(Q_WS_WIN) || defined(Q_OS_CYGWIN)
1539 #if defined(QT3_SUPPORT)
1540 inline QT3_SUPPORT
bool qt_winUnicode() { return true; }
1541 inline QT3_SUPPORT
int qWinVersion() { return QSysInfo::WindowsVersion
; }
1544 // ### Qt 5: remove Win9x support macros QT_WA and QT_WA_INLINE.
1545 #define QT_WA(unicode, ansi) unicode
1546 #define QT_WA_INLINE(unicode, ansi) (unicode)
1548 #endif /* Q_WS_WIN */
1550 #ifndef Q_OUTOFLINE_TEMPLATE
1551 # define Q_OUTOFLINE_TEMPLATE
1553 #ifndef Q_INLINE_TEMPLATE
1554 # define Q_INLINE_TEMPLATE inline
1558 # define Q_TYPENAME typename
1562 Avoid "unused parameter" warnings
1565 #if defined(Q_CC_INTEL) && !defined(Q_OS_WIN) || defined(Q_CC_RVCT)
1566 template <typename T
>
1567 inline void qUnused(T
&x
) { (void)x
; }
1568 # define Q_UNUSED(x) qUnused(x);
1570 # define Q_UNUSED(x) (void)x;
1574 Debugging and error handling
1578 On Symbian we do not know beforehand whether we are compiling in
1579 release or debug mode, so check the Symbian build define here,
1580 and set the QT_NO_DEBUG define appropriately.
1582 #if defined(Q_OS_SYMBIAN) && defined(NDEBUG) && !defined(QT_NO_DEBUG)
1583 # define QT_NO_DEBUG
1586 #if !defined(QT_NO_DEBUG) && !defined(QT_DEBUG)
1591 # define qPrintable(string) (string).toLocal8Bit().constData()
1594 Q_CORE_EXPORT
void qDebug(const char *, ...) /* print debug message */
1595 #if defined(Q_CC_GNU) && !defined(__INSURE__)
1596 __attribute__ ((format (printf
, 1, 2)))
1600 Q_CORE_EXPORT
void qWarning(const char *, ...) /* print warning message */
1601 #if defined(Q_CC_GNU) && !defined(__INSURE__)
1602 __attribute__ ((format (printf
, 1, 2)))
1607 Q_CORE_EXPORT QString
qt_error_string(int errorCode
= -1);
1608 Q_CORE_EXPORT
void qCritical(const char *, ...) /* print critical message */
1609 #if defined(Q_CC_GNU) && !defined(__INSURE__)
1610 __attribute__ ((format (printf
, 1, 2)))
1613 Q_CORE_EXPORT
void qFatal(const char *, ...) /* print fatal message and exit */
1614 #if defined(Q_CC_GNU) && !defined(__INSURE__)
1615 __attribute__ ((format (printf
, 1, 2)))
1620 Q_CORE_EXPORT QT3_SUPPORT
void qSystemWarning(const char *msg
, int code
= -1);
1621 #endif /* QT3_SUPPORT */
1622 Q_CORE_EXPORT
void qErrnoWarning(int code
, const char *msg
, ...);
1623 Q_CORE_EXPORT
void qErrnoWarning(const char *msg
, ...);
1625 #if (defined(QT_NO_DEBUG_OUTPUT) || defined(QT_NO_TEXTSTREAM)) && !defined(QT_NO_DEBUG_STREAM)
1626 #define QT_NO_DEBUG_STREAM
1630 Forward declarations only.
1632 In order to use the qDebug() stream, you must #include<QDebug>
1636 #ifndef QT_NO_DEBUG_STREAM
1637 Q_CORE_EXPORT_INLINE QDebug
qDebug();
1638 Q_CORE_EXPORT_INLINE QDebug
qWarning();
1639 Q_CORE_EXPORT_INLINE QDebug
qCritical();
1641 inline QNoDebug
qDebug();
1644 #define QT_NO_QDEBUG_MACRO while (false) qDebug
1645 #ifdef QT_NO_DEBUG_OUTPUT
1646 # define qDebug QT_NO_QDEBUG_MACRO
1648 #define QT_NO_QWARNING_MACRO while (false) qWarning
1649 #ifdef QT_NO_WARNING_OUTPUT
1650 # define qWarning QT_NO_QWARNING_MACRO
1654 Q_CORE_EXPORT
void qt_assert(const char *assertion
, const char *file
, int line
);
1656 #if !defined(Q_ASSERT)
1657 # ifndef QT_NO_DEBUG
1658 # define Q_ASSERT(cond) ((!(cond)) ? qt_assert(#cond,__FILE__,__LINE__) : qt_noop())
1660 # define Q_ASSERT(cond) qt_noop()
1664 #if defined(QT_NO_DEBUG) && !defined(QT_PAINT_DEBUG)
1665 #define QT_NO_PAINT_DEBUG
1668 Q_CORE_EXPORT
void qt_assert_x(const char *where
, const char *what
, const char *file
, int line
);
1670 #if !defined(Q_ASSERT_X)
1671 # ifndef QT_NO_DEBUG
1672 # define Q_ASSERT_X(cond, where, what) ((!(cond)) ? qt_assert_x(where, what,__FILE__,__LINE__) : qt_noop())
1674 # define Q_ASSERT_X(cond, where, what) qt_noop()
1678 Q_CORE_EXPORT
void qt_check_pointer(const char *, int);
1680 #ifndef QT_NO_EXCEPTIONS
1681 Q_CORE_EXPORT
void qBadAlloc();
1684 #ifdef QT_NO_EXCEPTIONS
1685 # if defined(QT_NO_DEBUG)
1686 # define Q_CHECK_PTR(p) qt_noop();
1688 # define Q_CHECK_PTR(p) do {if(!(p))qt_check_pointer(__FILE__,__LINE__);} while (0)
1691 # define Q_CHECK_PTR(p) do { if (!(p)) qBadAlloc(); } while (0)
1694 template <typename T
>
1695 inline T
*q_check_ptr(T
*p
) { Q_CHECK_PTR(p
); return p
; }
1697 #if (defined(Q_CC_GNU) && !defined(Q_OS_SOLARIS)) || defined(Q_CC_HPACC) || defined(Q_CC_DIAB)
1698 # define Q_FUNC_INFO __PRETTY_FUNCTION__
1699 #elif defined(_MSC_VER)
1700 /* MSVC 2002 doesn't have __FUNCSIG__ nor can it handle QT_STRINGIFY. */
1701 # if _MSC_VER <= 1300
1702 # define Q_FUNC_INFO __FILE__ "(line number unavailable)"
1704 # define Q_FUNC_INFO __FUNCSIG__
1707 # if defined(Q_OS_SOLARIS) || defined(Q_CC_XLC) || defined(Q_OS_SYMBIAN)
1708 # define Q_FUNC_INFO __FILE__ "(line number unavailable)"
1710 /* These two macros makes it possible to turn the builtin line expander into a
1711 * string literal. */
1712 # define QT_STRINGIFY2(x) #x
1713 # define QT_STRINGIFY(x) QT_STRINGIFY2(x)
1714 # define Q_FUNC_INFO __FILE__ ":" QT_STRINGIFY(__LINE__)
1716 /* The MIPSpro and RVCT compilers postpones macro expansion,
1717 and therefore macros must be in scope when being used. */
1718 # if !defined(Q_CC_MIPS) && !defined(Q_CC_RVCT) && !defined(Q_CC_NOKIAX86)
1719 # undef QT_STRINGIFY2
1720 # undef QT_STRINGIFY
1724 enum QtMsgType
{ QtDebugMsg
, QtWarningMsg
, QtCriticalMsg
, QtFatalMsg
, QtSystemMsg
= QtCriticalMsg
};
1726 Q_CORE_EXPORT
void qt_message_output(QtMsgType
, const char *buf
);
1728 typedef void (*QtMsgHandler
)(QtMsgType
, const char *);
1729 Q_CORE_EXPORT QtMsgHandler
qInstallMsgHandler(QtMsgHandler
);
1732 inline QT3_SUPPORT
void qSuppressObsoleteWarnings(bool = true) {}
1733 inline QT3_SUPPORT
void qObsolete(const char *, const char * = 0, const char * = 0) {}
1736 #if defined(QT_NO_THREAD)
1738 template <typename T
>
1743 inline QGlobalStatic(T
*p
) : pointer(p
) { }
1744 inline ~QGlobalStatic() { pointer
= 0; }
1747 #define Q_GLOBAL_STATIC(TYPE, NAME) \
1748 static TYPE *NAME() \
1750 static TYPE this_##NAME; \
1751 static QGlobalStatic<TYPE > global_##NAME(&this_##NAME); \
1752 return global_##NAME.pointer; \
1755 #define Q_GLOBAL_STATIC_WITH_ARGS(TYPE, NAME, ARGS) \
1756 static TYPE *NAME() \
1758 static TYPE this_##NAME ARGS; \
1759 static QGlobalStatic<TYPE > global_##NAME(&this_##NAME); \
1760 return global_##NAME.pointer; \
1763 #define Q_GLOBAL_STATIC_WITH_INITIALIZER(TYPE, NAME, INITIALIZER) \
1764 static TYPE *NAME() \
1766 static TYPE this_##NAME; \
1767 static QGlobalStatic<TYPE > global_##NAME(0); \
1768 if (!global_##NAME.pointer) { \
1769 TYPE *x = global_##NAME.pointer = &this_##NAME; \
1772 return global_##NAME.pointer; \
1777 // forward declaration, since qatomic.h needs qglobal.h
1778 template <typename T
> class QBasicAtomicPointer
;
1780 // POD for Q_GLOBAL_STATIC
1781 template <typename T
>
1785 QBasicAtomicPointer
<T
> pointer
;
1789 // Created as a function-local static to delete a QGlobalStatic<T>
1790 template <typename T
>
1791 class QGlobalStaticDeleter
1794 QGlobalStatic
<T
> &globalStatic
;
1795 QGlobalStaticDeleter(QGlobalStatic
<T
> &_globalStatic
)
1796 : globalStatic(_globalStatic
)
1799 inline ~QGlobalStaticDeleter()
1801 delete globalStatic
.pointer
;
1802 globalStatic
.pointer
= 0;
1803 globalStatic
.destroyed
= true;
1807 #define Q_GLOBAL_STATIC_INIT(TYPE, NAME) \
1808 static QGlobalStatic<TYPE > this_##NAME = { Q_BASIC_ATOMIC_INITIALIZER(0), false }
1810 #define Q_GLOBAL_STATIC(TYPE, NAME) \
1811 Q_GLOBAL_STATIC_INIT(TYPE, NAME); \
1812 static TYPE *NAME() \
1814 if (!this_##NAME.pointer && !this_##NAME.destroyed) { \
1815 TYPE *x = new TYPE; \
1816 if (!this_##NAME.pointer.testAndSetOrdered(0, x)) \
1819 static QGlobalStaticDeleter<TYPE > cleanup(this_##NAME); \
1821 return this_##NAME.pointer; \
1824 #define Q_GLOBAL_STATIC_WITH_ARGS(TYPE, NAME, ARGS) \
1825 Q_GLOBAL_STATIC_INIT(TYPE, NAME); \
1826 static TYPE *NAME() \
1828 if (!this_##NAME.pointer && !this_##NAME.destroyed) { \
1829 TYPE *x = new TYPE ARGS; \
1830 if (!this_##NAME.pointer.testAndSetOrdered(0, x)) \
1833 static QGlobalStaticDeleter<TYPE > cleanup(this_##NAME); \
1835 return this_##NAME.pointer; \
1838 #define Q_GLOBAL_STATIC_WITH_INITIALIZER(TYPE, NAME, INITIALIZER) \
1839 Q_GLOBAL_STATIC_INIT(TYPE, NAME); \
1840 static TYPE *NAME() \
1842 if (!this_##NAME.pointer && !this_##NAME.destroyed) { \
1843 QScopedPointer<TYPE > x(new TYPE); \
1845 if (this_##NAME.pointer.testAndSetOrdered(0, x.data())) { \
1846 static QGlobalStaticDeleter<TYPE > cleanup(this_##NAME); \
1850 return this_##NAME.pointer; \
1860 inline explicit QBool(bool B
) : b(B
) {}
1861 inline operator const void *() const
1862 { return b
? static_cast<const void *>(this) : static_cast<const void *>(0); }
1865 inline bool operator==(QBool b1
, bool b2
) { return !b1
== !b2
; }
1866 inline bool operator==(bool b1
, QBool b2
) { return !b1
== !b2
; }
1867 inline bool operator==(QBool b1
, QBool b2
) { return !b1
== !b2
; }
1868 inline bool operator!=(QBool b1
, bool b2
) { return !b1
!= !b2
; }
1869 inline bool operator!=(bool b1
, QBool b2
) { return !b1
!= !b2
; }
1870 inline bool operator!=(QBool b1
, QBool b2
) { return !b1
!= !b2
; }
1872 static inline bool qFuzzyCompare(double p1
, double p2
)
1874 return (qAbs(p1
- p2
) <= 0.000000000001 * qMin(qAbs(p1
), qAbs(p2
)));
1877 static inline bool qFuzzyCompare(float p1
, float p2
)
1879 return (qAbs(p1
- p2
) <= 0.00001f
* qMin(qAbs(p1
), qAbs(p2
)));
1885 static inline bool qFuzzyIsNull(double d
)
1887 return qAbs(d
) <= 0.000000000001;
1893 static inline bool qFuzzyIsNull(float f
)
1895 return qAbs(f
) <= 0.00001f
;
1899 This function tests a double for a null value. It doesn't
1900 check whether the actual value is 0 or close to 0, but whether
1903 static inline bool qIsNull(double d
)
1911 return val
.u
== quint64(0);
1915 This function tests a float for a null value. It doesn't
1916 check whether the actual value is 0 or close to 0, but whether
1919 static inline bool qIsNull(float f
)
1931 Compilers which follow outdated template instantiation rules
1932 require a class to have a comparison operator to exist when
1933 a QList of this type is instantiated. It's not actually
1934 used in the list, though. Hence the dummy implementation.
1935 Just in case other code relies on it we better trigger a warning
1936 mandating a real implementation.
1939 #ifdef Q_FULL_TEMPLATE_INSTANTIATION
1940 # define Q_DUMMY_COMPARISON_OPERATOR(C) \
1941 bool operator==(const C&) const { \
1942 qWarning(#C"::operator==(const "#C"&) was called"); \
1946 # define Q_DUMMY_COMPARISON_OPERATOR(C)
1951 QTypeInfo - type trait functionality
1952 qIsDetached - data sharing functionality
1955 #ifndef QT_NO_PARTIAL_TEMPLATE_SPECIALIZATION
1958 The catch-all template.
1961 template <typename T
> inline bool qIsDetached(T
&) { return true; }
1963 template <typename T
>
1971 isLarge
= (sizeof(T
)>sizeof(void*)),
1976 template <typename T
>
1991 template <typename T
> char QTypeInfoHelper(T
*(*)());
1992 void* QTypeInfoHelper(...);
1994 template <typename T
> inline bool qIsDetached(T
&) { return true; }
1996 template <typename T
>
2001 isPointer
= (1 == sizeof(QTypeInfoHelper((T(*)())0))),
2002 isComplex
= !isPointer
,
2003 isStatic
= !isPointer
,
2004 isLarge
= (sizeof(T
)>sizeof(void*)),
2009 #endif /* QT_NO_PARTIAL_TEMPLATE_SPECIALIZATION */
2012 Specialize a specific type with:
2014 Q_DECLARE_TYPEINFO(type, flags);
2016 where 'type' is the name of the type to specialize and 'flags' is
2017 logically-OR'ed combination of the flags below.
2019 enum { /* TYPEINFO flags */
2021 Q_PRIMITIVE_TYPE
= 0x1,
2023 Q_MOVABLE_TYPE
= 0x2,
2027 #define Q_DECLARE_TYPEINFO(TYPE, FLAGS) \
2029 class QTypeInfo<TYPE > \
2033 isComplex = (((FLAGS) & Q_PRIMITIVE_TYPE) == 0), \
2034 isStatic = (((FLAGS) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), \
2035 isLarge = (sizeof(TYPE)>sizeof(void*)), \
2036 isPointer = false, \
2037 isDummy = (((FLAGS) & Q_DUMMY_TYPE) != 0) \
2039 static inline const char *name() { return #TYPE; } \
2042 template <typename T
>
2043 inline void qSwap(T
&value1
, T
&value2
)
2051 Specialize a shared type with:
2053 Q_DECLARE_SHARED(type);
2055 where 'type' is the name of the type to specialize. NOTE: shared
2056 types must declare a 'bool isDetached(void) const;' member for this
2059 #define Q_DECLARE_SHARED(TYPE) \
2060 template <> inline bool qIsDetached<TYPE>(TYPE &t) { return t.isDetached(); } \
2061 template <> inline void qSwap<TYPE>(TYPE &value1, TYPE &value2) \
2063 qSwap(value1.data_ptr(), value2.data_ptr()); \
2067 QTypeInfo primitive specializations
2069 Q_DECLARE_TYPEINFO(bool, Q_PRIMITIVE_TYPE
);
2070 Q_DECLARE_TYPEINFO(char, Q_PRIMITIVE_TYPE
);
2071 Q_DECLARE_TYPEINFO(signed char, Q_PRIMITIVE_TYPE
);
2072 Q_DECLARE_TYPEINFO(uchar
, Q_PRIMITIVE_TYPE
);
2073 Q_DECLARE_TYPEINFO(short, Q_PRIMITIVE_TYPE
);
2074 Q_DECLARE_TYPEINFO(ushort
, Q_PRIMITIVE_TYPE
);
2075 Q_DECLARE_TYPEINFO(int, Q_PRIMITIVE_TYPE
);
2076 Q_DECLARE_TYPEINFO(uint
, Q_PRIMITIVE_TYPE
);
2077 Q_DECLARE_TYPEINFO(long, Q_PRIMITIVE_TYPE
);
2078 Q_DECLARE_TYPEINFO(ulong
, Q_PRIMITIVE_TYPE
);
2079 Q_DECLARE_TYPEINFO(qint64
, Q_PRIMITIVE_TYPE
);
2080 Q_DECLARE_TYPEINFO(quint64
, Q_PRIMITIVE_TYPE
);
2081 Q_DECLARE_TYPEINFO(float, Q_PRIMITIVE_TYPE
);
2082 Q_DECLARE_TYPEINFO(double, Q_PRIMITIVE_TYPE
);
2084 Q_DECLARE_TYPEINFO(long double, Q_PRIMITIVE_TYPE
);
2088 These functions make it possible to use standard C++ functions with
2089 a similar name from Qt header files (especially template classes).
2091 Q_CORE_EXPORT
void *qMalloc(size_t size
);
2092 Q_CORE_EXPORT
void qFree(void *ptr
);
2093 Q_CORE_EXPORT
void *qRealloc(void *ptr
, size_t size
);
2094 Q_CORE_EXPORT
void *qMallocAligned(size_t size
, size_t alignment
);
2095 Q_CORE_EXPORT
void *qReallocAligned(void *ptr
, size_t size
, size_t oldsize
, size_t alignment
);
2096 Q_CORE_EXPORT
void qFreeAligned(void *ptr
);
2097 Q_CORE_EXPORT
void *qMemCopy(void *dest
, const void *src
, size_t n
);
2098 Q_CORE_EXPORT
void *qMemSet(void *dest
, int c
, size_t n
);
2102 Avoid some particularly useless warnings from some stupid compilers.
2103 To get ALL C++ compiler warnings, define QT_CC_WARNINGS or comment out
2104 the line "#define QT_NO_WARNINGS".
2106 #if !defined(QT_CC_WARNINGS)
2107 # define QT_NO_WARNINGS
2109 #if defined(QT_NO_WARNINGS)
2110 # if defined(Q_CC_MSVC)
2111 # pragma warning(disable: 4251) /* class 'A' needs to have dll interface for to be used by clients of class 'B'. */
2112 # pragma warning(disable: 4244) /* 'conversion' conversion from 'type1' to 'type2', possible loss of data */
2113 # pragma warning(disable: 4275) /* non - DLL-interface classkey 'identifier' used as base for DLL-interface classkey 'identifier' */
2114 # pragma warning(disable: 4514) /* unreferenced inline/local function has been removed */
2115 # pragma warning(disable: 4800) /* 'type' : forcing value to bool 'true' or 'false' (performance warning) */
2116 # pragma warning(disable: 4097) /* typedef-name 'identifier1' used as synonym for class-name 'identifier2' */
2117 # pragma warning(disable: 4706) /* assignment within conditional expression */
2118 # pragma warning(disable: 4786) /* truncating debug info after 255 characters */
2119 # pragma warning(disable: 4660) /* template-class specialization 'identifier' is already instantiated */
2120 # pragma warning(disable: 4355) /* 'this' : used in base member initializer list */
2121 # pragma warning(disable: 4231) /* nonstandard extension used : 'extern' before template explicit instantiation */
2122 # pragma warning(disable: 4710) /* function not inlined */
2123 # pragma warning(disable: 4530) /* C++ exception handler used, but unwind semantics are not enabled. Specify -GX */
2124 # if _MSC_VER < 1300
2125 # pragma warning(disable: 4284) /* return type for 'type1::operator ->' is 'type2 *' */
2126 /* (ie; not a UDT or reference to a UDT. Will produce errors if applied using infix notation) */
2128 # elif defined(Q_CC_BOR)
2129 # pragma option -w-inl
2130 # pragma option -w-aus
2139 class Q_CORE_EXPORT QFlag
2143 inline QFlag(int i
);
2144 inline operator int() const { return i
; }
2147 inline QFlag::QFlag(int ai
) : i(ai
) {}
2149 class Q_CORE_EXPORT QIncompatibleFlag
2153 inline explicit QIncompatibleFlag(int i
);
2154 inline operator int() const { return i
; }
2157 inline QIncompatibleFlag::QIncompatibleFlag(int ai
) : i(ai
) {}
2160 #ifndef Q_NO_TYPESAFE_FLAGS
2162 template<typename Enum
>
2165 typedef void **Zero
;
2168 typedef Enum enum_type
;
2169 inline QFlags(const QFlags
&f
) : i(f
.i
) {}
2170 inline QFlags(Enum f
) : i(f
) {}
2171 inline QFlags(Zero
= 0) : i(0) {}
2172 inline QFlags(QFlag f
) : i(f
) {}
2174 inline QFlags
&operator=(const QFlags
&f
) { i
= f
.i
; return *this; }
2175 inline QFlags
&operator&=(int mask
) { i
&= mask
; return *this; }
2176 inline QFlags
&operator&=(uint mask
) { i
&= mask
; return *this; }
2177 inline QFlags
&operator|=(QFlags f
) { i
|= f
.i
; return *this; }
2178 inline QFlags
&operator|=(Enum f
) { i
|= f
; return *this; }
2179 inline QFlags
&operator^=(QFlags f
) { i
^= f
.i
; return *this; }
2180 inline QFlags
&operator^=(Enum f
) { i
^= f
; return *this; }
2182 inline operator int() const { return i
; }
2184 inline QFlags
operator|(QFlags f
) const { QFlags g
; g
.i
= i
| f
.i
; return g
; }
2185 inline QFlags
operator|(Enum f
) const { QFlags g
; g
.i
= i
| f
; return g
; }
2186 inline QFlags
operator^(QFlags f
) const { QFlags g
; g
.i
= i
^ f
.i
; return g
; }
2187 inline QFlags
operator^(Enum f
) const { QFlags g
; g
.i
= i
^ f
; return g
; }
2188 inline QFlags
operator&(int mask
) const { QFlags g
; g
.i
= i
& mask
; return g
; }
2189 inline QFlags
operator&(uint mask
) const { QFlags g
; g
.i
= i
& mask
; return g
; }
2190 inline QFlags
operator&(Enum f
) const { QFlags g
; g
.i
= i
& f
; return g
; }
2191 inline QFlags
operator~() const { QFlags g
; g
.i
= ~i
; return g
; }
2193 inline bool operator!() const { return !i
; }
2195 inline bool testFlag(Enum f
) const { return (i
& f
) == f
&& (f
!= 0 || i
== int(f
) ); }
2198 #define Q_DECLARE_FLAGS(Flags, Enum)\
2199 typedef QFlags<Enum> Flags;
2201 #if defined Q_CC_MSVC && _MSC_VER < 1300
2202 # define Q_DECLARE_INCOMPATIBLE_FLAGS(Flags)
2204 # define Q_DECLARE_INCOMPATIBLE_FLAGS(Flags) \
2205 inline QIncompatibleFlag operator|(Flags::enum_type f1, int f2) \
2206 { return QIncompatibleFlag(int(f1) | f2); }
2209 #define Q_DECLARE_OPERATORS_FOR_FLAGS(Flags) \
2210 inline QFlags<Flags::enum_type> operator|(Flags::enum_type f1, Flags::enum_type f2) \
2211 { return QFlags<Flags::enum_type>(f1) | f2; } \
2212 inline QFlags<Flags::enum_type> operator|(Flags::enum_type f1, QFlags<Flags::enum_type> f2) \
2213 { return f2 | f1; } Q_DECLARE_INCOMPATIBLE_FLAGS(Flags)
2216 #else /* Q_NO_TYPESAFE_FLAGS */
2218 #define Q_DECLARE_FLAGS(Flags, Enum)\
2220 #define Q_DECLARE_OPERATORS_FOR_FLAGS(Flags)
2222 #endif /* Q_NO_TYPESAFE_FLAGS */
2224 #if defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && !defined(Q_CC_RVCT)
2225 /* make use of typeof-extension */
2226 template <typename T
>
2227 class QForeachContainer
{
2229 inline QForeachContainer(const T
& t
) : c(t
), brk(0), i(c
.begin()), e(c
.end()) { }
2232 typename
T::const_iterator i
, e
;
2235 #define Q_FOREACH(variable, container) \
2236 for (QForeachContainer<__typeof__(container)> _container_(container); \
2237 !_container_.brk && _container_.i != _container_.e; \
2238 __extension__ ({ ++_container_.brk; ++_container_.i; })) \
2239 for (variable = *_container_.i;; __extension__ ({--_container_.brk; break;}))
2243 struct QForeachContainerBase
{};
2245 template <typename T
>
2246 class QForeachContainer
: public QForeachContainerBase
{
2248 inline QForeachContainer(const T
& t
): c(t
), brk(0), i(c
.begin()), e(c
.end()){};
2251 mutable typename
T::const_iterator i
, e
;
2252 inline bool condition() const { return (!brk
++ && i
!= e
); }
2255 template <typename T
> inline T
*qForeachPointer(const T
&) { return 0; }
2257 template <typename T
> inline QForeachContainer
<T
> qForeachContainerNew(const T
& t
)
2258 { return QForeachContainer
<T
>(t
); }
2260 template <typename T
>
2261 inline const QForeachContainer
<T
> *qForeachContainer(const QForeachContainerBase
*base
, const T
*)
2262 { return static_cast<const QForeachContainer
<T
> *>(base
); }
2264 #if (defined(Q_CC_MSVC) && !defined(Q_CC_MSVC_NET) && !defined(Q_CC_INTEL)) || defined(Q_CC_MIPS)
2266 Proper for-scoping in VC++6 and MIPSpro CC
2268 # define Q_FOREACH(variable,container) \
2270 for (const QForeachContainerBase &_container_ = qForeachContainerNew(container); \
2271 qForeachContainer(&_container_, true ? 0 : qForeachPointer(container))->condition(); \
2272 ++qForeachContainer(&_container_, true ? 0 : qForeachPointer(container))->i) \
2273 for (variable = *qForeachContainer(&_container_, true ? 0 : qForeachPointer(container))->i; \
2274 qForeachContainer(&_container_, true ? 0 : qForeachPointer(container))->brk; \
2275 --qForeachContainer(&_container_, true ? 0 : qForeachPointer(container))->brk)
2277 #elif defined(Q_CC_DIAB)
2278 // VxWorks DIAB generates unresolvable symbols, if container is a function call
2279 # define Q_FOREACH(variable,container) \
2281 for (const QForeachContainerBase &_container_ = qForeachContainerNew(container); \
2282 qForeachContainer(&_container_, (__typeof__(container) *) 0)->condition(); \
2283 ++qForeachContainer(&_container_, (__typeof__(container) *) 0)->i) \
2284 for (variable = *qForeachContainer(&_container_, (__typeof__(container) *) 0)->i; \
2285 qForeachContainer(&_container_, (__typeof__(container) *) 0)->brk; \
2286 --qForeachContainer(&_container_, (__typeof__(container) *) 0)->brk)
2289 # define Q_FOREACH(variable, container) \
2290 for (const QForeachContainerBase &_container_ = qForeachContainerNew(container); \
2291 qForeachContainer(&_container_, true ? 0 : qForeachPointer(container))->condition(); \
2292 ++qForeachContainer(&_container_, true ? 0 : qForeachPointer(container))->i) \
2293 for (variable = *qForeachContainer(&_container_, true ? 0 : qForeachPointer(container))->i; \
2294 qForeachContainer(&_container_, true ? 0 : qForeachPointer(container))->brk; \
2295 --qForeachContainer(&_container_, true ? 0 : qForeachPointer(container))->brk)
2296 #endif // MSVC6 || MIPSpro
2300 #define Q_FOREVER for(;;)
2301 #ifndef QT_NO_KEYWORDS
2303 # define foreach Q_FOREACH
2306 # define forever Q_FOREVER
2311 /* tell gcc to use its built-in methods for some common functions */
2312 #if defined(QT_NO_DEBUG) && defined(Q_CC_GNU)
2313 # define qMemCopy __builtin_memcpy
2314 # define qMemSet __builtin_memset
2318 template <typename T
> static inline T
*qGetPtrHelper(T
*ptr
) { return ptr
; }
2319 template <typename Wrapper
> static inline typename
Wrapper::pointer
qGetPtrHelper(const Wrapper
&p
) { return p
.data(); }
2321 #define Q_DECLARE_PRIVATE(Class) \
2322 inline Class##Private* d_func() { return reinterpret_cast<Class##Private *>(qGetPtrHelper(d_ptr)); } \
2323 inline const Class##Private* d_func() const { return reinterpret_cast<const Class##Private *>(qGetPtrHelper(d_ptr)); } \
2324 friend class Class##Private;
2326 #define Q_DECLARE_PRIVATE_D(Dptr, Class) \
2327 inline Class##Private* d_func() { return reinterpret_cast<Class##Private *>(Dptr); } \
2328 inline const Class##Private* d_func() const { return reinterpret_cast<const Class##Private *>(Dptr); } \
2329 friend class Class##Private;
2331 #define Q_DECLARE_PUBLIC(Class) \
2332 inline Class* q_func() { return static_cast<Class *>(q_ptr); } \
2333 inline const Class* q_func() const { return static_cast<const Class *>(q_ptr); } \
2336 #define Q_D(Class) Class##Private * const d = d_func()
2337 #define Q_Q(Class) Class * const q = q_func()
2339 #define QT_TR_NOOP(x) (x)
2340 #define QT_TR_NOOP_UTF8(x) (x)
2341 #define QT_TRANSLATE_NOOP(scope, x) (x)
2342 #define QT_TRANSLATE_NOOP_UTF8(scope, x) (x)
2343 #define QT_TRANSLATE_NOOP3(scope, x, comment) {x, comment}
2344 #define QT_TRANSLATE_NOOP3_UTF8(scope, x, comment) {x, comment}
2346 #ifndef QT_NO_TRANSLATION // ### This should enclose the NOOPs above
2348 // Defined in qcoreapplication.cpp
2349 // The better name qTrId() is reserved for an upcoming function which would
2350 // return a much more powerful QStringFormatter instead of a QString.
2351 Q_CORE_EXPORT QString
qtTrId(const char *id
, int n
= -1);
2353 #define QT_TRID_NOOP(id) id
2355 #endif // QT_NO_TRANSLATION
2357 #define QDOC_PROPERTY(text)
2360 When RTTI is not available, define this macro to force any uses of
2361 dynamic_cast to cause a compile failure.
2364 #ifdef QT_NO_DYNAMIC_CAST
2365 # define dynamic_cast QT_PREPEND_NAMESPACE(qt_dynamic_cast_check)
2367 template<typename T
, typename X
>
2368 T
qt_dynamic_cast_check(X
, T
* = 0)
2369 { return T::dynamic_cast_will_always_fail_because_rtti_is_disabled
; }
2373 Some classes do not permit copies to be made of an object. These
2374 classes contains a private copy constructor and assignment
2375 operator to disable copying (the compiler gives an error message).
2377 #define Q_DISABLE_COPY(Class) \
2378 Class(const Class &); \
2379 Class &operator=(const Class &);
2382 Q_CORE_EXPORT QByteArray
qgetenv(const char *varName
);
2383 Q_CORE_EXPORT
bool qputenv(const char *varName
, const QByteArray
& value
);
2385 inline int qIntCast(double f
) { return int(f
); }
2386 inline int qIntCast(float f
) { return int(f
); }
2389 Reentrant versions of basic rand() functions for random number generation
2391 Q_CORE_EXPORT
void qsrand(uint seed
);
2392 Q_CORE_EXPORT
int qrand();
2395 Compat functions that were generated by configure
2398 #ifndef QT_PRODUCT_LICENSEE
2399 # define QT_PRODUCT_LICENSEE QLibraryInfo::licensee()
2401 #ifndef QT_PRODUCT_LICENSE
2402 # define QT_PRODUCT_LICENSE QLibraryInfo::licensedProducts()
2404 QT3_SUPPORT Q_CORE_EXPORT
const char *qInstallPath();
2405 QT3_SUPPORT Q_CORE_EXPORT
const char *qInstallPathDocs();
2406 QT3_SUPPORT Q_CORE_EXPORT
const char *qInstallPathHeaders();
2407 QT3_SUPPORT Q_CORE_EXPORT
const char *qInstallPathLibs();
2408 QT3_SUPPORT Q_CORE_EXPORT
const char *qInstallPathBins();
2409 QT3_SUPPORT Q_CORE_EXPORT
const char *qInstallPathPlugins();
2410 QT3_SUPPORT Q_CORE_EXPORT
const char *qInstallPathData();
2411 QT3_SUPPORT Q_CORE_EXPORT
const char *qInstallPathTranslations();
2412 QT3_SUPPORT Q_CORE_EXPORT
const char *qInstallPathSysconf();
2415 #if defined(Q_OS_SYMBIAN)
2417 #ifdef SYMBIAN_GRAPHICS_USE_GCE
2418 //RWsPointerCursor is fixed, so don't use low performance sprites
2419 #define Q_SYMBIAN_FIXED_POINTER_CURSORS
2420 #define Q_SYMBIAN_HAS_EXTENDED_BITMAP_TYPE
2421 //enabling new graphics resources
2422 #define QT_SYMBIAN_SUPPORTS_SGIMAGE
2423 #define QT_SYMBIAN_SUPPORTS_ADVANCED_POINTER
2425 #ifdef SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS
2426 #define Q_SYMBIAN_SEMITRANSPARENT_BG_SURFACE
2431 //Symbian does not support data imports from a DLL
2432 #define Q_NO_DATA_RELOCATION
2435 // forward declare std::exception
2437 namespace std
{ class exception
; }
2440 Q_CORE_EXPORT
void qt_symbian_throwIfError(int error
);
2441 Q_CORE_EXPORT
void qt_symbian_exception2LeaveL(const std::exception
& ex
);
2442 Q_CORE_EXPORT
int qt_symbian_exception2Error(const std::exception
& ex
);
2444 #define QT_TRAP_THROWING(_f) \
2447 TRAP(____error, _f); \
2448 qt_symbian_throwIfError(____error); \
2451 #define QT_TRYCATCH_ERROR(_err, _f) \
2456 } catch (const std::exception &____ex) { \
2457 _err = qt_symbian_exception2Error(____ex); \
2461 #define QT_TRYCATCH_LEAVING(_f) \
2464 QT_TRYCATCH_ERROR(____err, _f) \
2465 User::LeaveIfError(____err); \
2471 This gives us the possibility to check which modules the user can
2472 use. These are purely compile time checks and will generate no code.
2476 #define QT_MODULE_CORE 0x00001
2477 #define QT_MODULE_GUI 0x00002
2478 #define QT_MODULE_NETWORK 0x00004
2479 #define QT_MODULE_OPENGL 0x00008
2480 #define QT_MODULE_SQL 0x00010
2481 #define QT_MODULE_XML 0x00020
2482 #define QT_MODULE_QT3SUPPORTLIGHT 0x00040
2483 #define QT_MODULE_QT3SUPPORT 0x00080
2484 #define QT_MODULE_SVG 0x00100
2485 #define QT_MODULE_ACTIVEQT 0x00200
2486 #define QT_MODULE_GRAPHICSVIEW 0x00400
2487 #define QT_MODULE_SCRIPT 0x00800
2488 #define QT_MODULE_XMLPATTERNS 0x01000
2489 #define QT_MODULE_HELP 0x02000
2490 #define QT_MODULE_TEST 0x04000
2491 #define QT_MODULE_DBUS 0x08000
2492 #define QT_MODULE_SCRIPTTOOLS 0x10000
2493 #define QT_MODULE_OPENVG 0x20000
2494 #define QT_MODULE_MULTIMEDIA 0x40000
2495 #define QT_MODULE_DECLARATIVE 0x80000
2498 #define QT_EDITION_CONSOLE (QT_MODULE_CORE \
2499 | QT_MODULE_NETWORK \
2501 | QT_MODULE_SCRIPT \
2502 | QT_MODULE_MULTIMEDIA \
2504 | QT_MODULE_XMLPATTERNS \
2507 #define QT_EDITION_DESKTOPLIGHT (QT_MODULE_CORE \
2509 | QT_MODULE_QT3SUPPORTLIGHT \
2512 #define QT_EDITION_OPENSOURCE (QT_MODULE_CORE \
2514 | QT_MODULE_NETWORK \
2515 | QT_MODULE_OPENGL \
2516 | QT_MODULE_OPENVG \
2518 | QT_MODULE_MULTIMEDIA \
2520 | QT_MODULE_XMLPATTERNS \
2521 | QT_MODULE_SCRIPT \
2522 | QT_MODULE_SCRIPTTOOLS \
2523 | QT_MODULE_QT3SUPPORTLIGHT \
2524 | QT_MODULE_QT3SUPPORT \
2526 | QT_MODULE_DECLARATIVE \
2527 | QT_MODULE_GRAPHICSVIEW \
2531 | QT_MODULE_ACTIVEQT)
2532 #define QT_EDITION_DESKTOP (QT_EDITION_OPENSOURCE)
2533 #define QT_EDITION_UNIVERSAL QT_EDITION_DESKTOP
2534 #define QT_EDITION_ACADEMIC QT_EDITION_DESKTOP
2535 #define QT_EDITION_EDUCATIONAL QT_EDITION_DESKTOP
2536 #define QT_EDITION_EVALUATION QT_EDITION_DESKTOP
2538 /* Determine which modules can be used */
2540 # ifdef QT_BUILD_QMAKE
2541 # define QT_EDITION QT_EDITION_DESKTOP
2543 # error "Qt not configured correctly, please run configure"
2547 #define QT_LICENSED_MODULE(x) \
2548 enum QtValidLicenseFor##x##Module { Licensed##x = true };
2550 /* qdoc is really unhappy with the following block of preprocessor checks,
2551 making it difficult to document classes properly after this point. */
2553 #if (QT_EDITION & QT_MODULE_CORE)
2554 QT_LICENSED_MODULE(Core
)
2556 #if (QT_EDITION & QT_MODULE_GUI)
2557 QT_LICENSED_MODULE(Gui
)
2559 #if (QT_EDITION & QT_MODULE_NETWORK)
2560 QT_LICENSED_MODULE(Network
)
2562 #if (QT_EDITION & QT_MODULE_OPENGL)
2563 QT_LICENSED_MODULE(OpenGL
)
2565 #if (QT_EDITION & QT_MODULE_OPENVG)
2566 QT_LICENSED_MODULE(OpenVG
)
2568 #if (QT_EDITION & QT_MODULE_SQL)
2569 QT_LICENSED_MODULE(Sql
)
2571 #if (QT_EDITION & QT_MODULE_MULTIMEDIA)
2572 QT_LICENSED_MODULE(Multimedia
)
2574 #if (QT_EDITION & QT_MODULE_XML)
2575 QT_LICENSED_MODULE(Xml
)
2577 #if (QT_EDITION & QT_MODULE_XMLPATTERNS)
2578 QT_LICENSED_MODULE(XmlPatterns
)
2580 #if (QT_EDITION & QT_MODULE_HELP)
2581 QT_LICENSED_MODULE(Help
)
2583 #if (QT_EDITION & QT_MODULE_SCRIPT) || defined(QT_BUILD_QMAKE)
2584 QT_LICENSED_MODULE(Script
)
2586 #if (QT_EDITION & QT_MODULE_SCRIPTTOOLS)
2587 QT_LICENSED_MODULE(ScriptTools
)
2589 #if (QT_EDITION & QT_MODULE_QT3SUPPORTLIGHT)
2590 QT_LICENSED_MODULE(Qt3SupportLight
)
2592 #if (QT_EDITION & QT_MODULE_QT3SUPPORT)
2593 QT_LICENSED_MODULE(Qt3Support
)
2595 #if (QT_EDITION & QT_MODULE_SVG)
2596 QT_LICENSED_MODULE(Svg
)
2598 #if (QT_EDITION & QT_MODULE_DECLARATIVE)
2599 QT_LICENSED_MODULE(Declarative
)
2601 #if (QT_EDITION & QT_MODULE_ACTIVEQT)
2602 QT_LICENSED_MODULE(ActiveQt
)
2604 #if (QT_EDITION & QT_MODULE_TEST)
2605 QT_LICENSED_MODULE(Test
)
2607 #if (QT_EDITION & QT_MODULE_DBUS)
2608 QT_LICENSED_MODULE(DBus
)
2611 #define QT_MODULE(x) \
2612 typedef QtValidLicenseFor##x##Module Qt##x##Module;
2614 #ifdef QT_NO_CONCURRENT
2615 # define QT_NO_QFUTURE
2618 // MSVC 6.0 and MSVC .NET 2002, can`t handle the map(), etc templates,
2619 // but the QFuture class compiles.
2620 #if (defined(Q_CC_MSVC) && _MSC_VER <= 1300)
2621 # define QT_NO_CONCURRENT
2624 // gcc 3 version has problems with some of the
2625 // map/filter overloads.
2626 #if defined(Q_CC_GNU) && (__GNUC__ < 4)
2627 # define QT_NO_CONCURRENT_MAP
2628 # define QT_NO_CONCURRENT_FILTER
2632 // QNX doesn't have SYSV style shared memory. Multiprocess QWS apps,
2633 // shared fonts and QSystemSemaphore + QSharedMemory are not available
2634 # define QT_NO_QWS_MULTIPROCESS
2635 # define QT_NO_QWS_SHARE_FONTS
2636 # define QT_NO_SYSTEMSEMAPHORE
2637 # define QT_NO_SHAREDMEMORY
2638 // QNX currently doesn't support forking in a thread, so disable QProcess
2639 # define QT_NO_PROCESS
2645 #endif /* __cplusplus */
2647 #endif /* QGLOBAL_H */