- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Directories
- Examples

- File List
- File Members

# qglobal.h

Go to the documentation of this file.

    00001 /****************************************************************************
    00002 **
    00003 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
    00004 ** All rights reserved.
    00005 ** Contact: Nokia Corporation (qt-info@nokia.com)
    00006 **
    00007 ** This file is part of the QtCore module of the Qt Toolkit.
    00008 **
    00009 ** $QT_BEGIN_LICENSE:LGPL$
    00010 ** Commercial Usage
    00011 ** Licensees holding valid Qt Commercial licenses may use this file in
    00012 ** accordance with the Qt Commercial License Agreement provided with the
    00013 ** Software or, alternatively, in accordance with the terms contained in
    00014 ** a written agreement between you and Nokia.
    00015 **
    00016 ** GNU Lesser General Public License Usage
    00017 ** Alternatively, this file may be used under the terms of the GNU Lesser
    00018 ** General Public License version 2.1 as published by the Free Software
    00019 ** Foundation and appearing in the file LICENSE.LGPL included in the
    00020 ** packaging of this file.  Please review the following information to
    00021 ** ensure the GNU Lesser General Public License version 2.1 requirements
    00022 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    00023 **
    00024 ** In addition, as a special exception, Nokia gives you certain additional
    00025 ** rights.  These rights are described in the Nokia Qt LGPL Exception
    00026 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this module.
    00027 **
    00028 ** GNU General Public License Usage
    00029 ** Alternatively, this file may be used under the terms of the GNU
    00030 ** General Public License version 3.0 as published by the Free Software
    00031 ** Foundation and appearing in the file LICENSE.GPL included in the
    00032 ** packaging of this file.  Please review the following information to
    00033 ** ensure the GNU General Public License version 3.0 requirements will be
    00034 ** met: http://www.gnu.org/copyleft/gpl.html.
    00035 **
    00036 ** If you have questions regarding the use of this file, please contact
    00037 ** Nokia at qt-info@nokia.com.
    00038 ** $QT_END_LICENSE$
    00039 **
    00040 ****************************************************************************/
    00041
    00042 #ifndef QGLOBAL_H
    00043 #define QGLOBAL_H
    00044
    00045 #include <stddef.h>
    00046
    00047 #define QT_VERSION_STR "4.7.1"
    00048 /*
    00049    QT_VERSION is (major << 16) + (minor << 8) + patch.
    00050 */
    00051 #define QT_VERSION 0x040701
    00052 /*
    00053    can be used like #if (QT_VERSION >= QT_VERSION_CHECK(4, 4, 0))
    00054 */
    00055 #define QT_VERSION_CHECK(major, minor, patch) ((major<<16)|(minor<<8)|(patch))
    00056
    00057 #define QT_PACKAGEDATE_STR "2010-11-06"
    00058
    00059 #define QT_PACKAGE_TAG "1b3f43c997b00d6b0d435ed8be08596c913a0189"
    00060
    00061 #if !defined(QT_BUILD_MOC)
    00062 #include <QtCore/qconfig.h>
    00063 #endif
    00064
    00065 #ifdef __cplusplus
    00066
    00067 #ifndef QT_NAMESPACE /* user namespace */
    00068
    00069 # define QT_PREPEND_NAMESPACE(name) ::name
    00070 # define QT_USE_NAMESPACE
    00071 # define QT_BEGIN_NAMESPACE
    00072 # define QT_END_NAMESPACE
    00073 # define QT_BEGIN_INCLUDE_NAMESPACE
    00074 # define QT_END_INCLUDE_NAMESPACE
    00075 # define QT_BEGIN_MOC_NAMESPACE
    00076 # define QT_END_MOC_NAMESPACE
    00077 # define QT_FORWARD_DECLARE_CLASS(name) class name;
    00078 # define QT_FORWARD_DECLARE_STRUCT(name) struct name;
    00079 # define QT_MANGLE_NAMESPACE(name) name
    00080
    00081 #else /* user namespace */
    00082
    00083 # define QT_PREPEND_NAMESPACE(name) ::QT_NAMESPACE::name
    00084 # define QT_USE_NAMESPACE using namespace ::QT_NAMESPACE;
    00085 # define QT_BEGIN_NAMESPACE namespace QT_NAMESPACE {
    00086 # define QT_END_NAMESPACE }
    00087 # define QT_BEGIN_INCLUDE_NAMESPACE }
    00088 # define QT_END_INCLUDE_NAMESPACE namespace QT_NAMESPACE {
    00089 # define QT_BEGIN_MOC_NAMESPACE QT_USE_NAMESPACE
    00090 # define QT_END_MOC_NAMESPACE
    00091 # define QT_FORWARD_DECLARE_CLASS(name) \
    00092     QT_BEGIN_NAMESPACE class name; QT_END_NAMESPACE \
    00093     using QT_PREPEND_NAMESPACE(name);
    00094
    00095 # define QT_FORWARD_DECLARE_STRUCT(name) \
    00096     QT_BEGIN_NAMESPACE struct name; QT_END_NAMESPACE \
    00097     using QT_PREPEND_NAMESPACE(name);
    00098
    00099 # define QT_MANGLE_NAMESPACE0(x) x
    00100 # define QT_MANGLE_NAMESPACE1(a, b) a##_##b
    00101 # define QT_MANGLE_NAMESPACE2(a, b) QT_MANGLE_NAMESPACE1(a,b)
    00102 # define QT_MANGLE_NAMESPACE(name) QT_MANGLE_NAMESPACE2( \
    00103         QT_MANGLE_NAMESPACE0(name), QT_MANGLE_NAMESPACE0(QT_NAMESPACE))
    00104
    00105 namespace QT_NAMESPACE {}
    00106
    00107 # ifndef QT_BOOTSTRAPPED
    00108 # ifndef QT_NO_USING_NAMESPACE
    00109    /*
    00110     This expands to a "using QT_NAMESPACE" also in _header files_.
    00111     It is the only way the feature can be used without too much
    00112     pain, but if people _really_ do not want it they can add
    00113     DEFINES += QT_NO_USING_NAMESPACE to their .pro files.
    00114     */
    00115    QT_USE_NAMESPACE
    00116 # endif
    00117 # endif
    00118
    00119 #endif /* user namespace */
    00120
    00121 #else /* __cplusplus */
    00122
    00123 # define QT_BEGIN_NAMESPACE
    00124 # define QT_END_NAMESPACE
    00125 # define QT_USE_NAMESPACE
    00126 # define QT_BEGIN_INCLUDE_NAMESPACE
    00127 # define QT_END_INCLUDE_NAMESPACE
    00128
    00129 #endif /* __cplusplus */
    00130
    00131 #if defined(Q_OS_MAC) && !defined(Q_CC_INTEL)
    00132 #define QT_BEGIN_HEADER extern "C++" {
    00133 #define QT_END_HEADER }
    00134 #define QT_BEGIN_INCLUDE_HEADER }
    00135 #define QT_END_INCLUDE_HEADER extern "C++" {
    00136 #else
    00137 #define QT_BEGIN_HEADER
    00138 #define QT_END_HEADER
    00139 #define QT_BEGIN_INCLUDE_HEADER
    00140 #define QT_END_INCLUDE_HEADER extern "C++"
    00141 #endif
    00142
    00143 /*
    00144    The operating system, must be one of: (Q_OS_x)
    00145
    00146      DARWIN   - Darwin OS (synonym for Q_OS_MAC)
    00147      SYMBIAN  - Symbian
    00148      MSDOS    - MS-DOS and Windows
    00149      OS2      - OS/2
    00150      OS2EMX   - XFree86 on OS/2 (not PM)
    00151      WIN32    - Win32 (Windows 2000/XP/Vista/7 and Windows Server 2003/2008)
    00152      WINCE    - WinCE (Windows CE 5.0)
    00153      CYGWIN   - Cygwin
    00154      SOLARIS  - Sun Solaris
    00155      HPUX     - HP-UX
    00156      ULTRIX   - DEC Ultrix
    00157      LINUX    - Linux
    00158      FREEBSD  - FreeBSD
    00159      NETBSD   - NetBSD
    00160      OPENBSD  - OpenBSD
    00161      BSDI     - BSD/OS
    00162      IRIX     - SGI Irix
    00163      OSF      - HP Tru64 UNIX
    00164      SCO      - SCO OpenServer 5
    00165      UNIXWARE - UnixWare 7, Open UNIX 8
    00166      AIX      - AIX
    00167      HURD     - GNU Hurd
    00168      DGUX     - DG/UX
    00169      RELIANT  - Reliant UNIX
    00170      DYNIX    - DYNIX/ptx
    00171      QNX      - QNX
    00172      QNX6     - QNX RTP 6.1
    00173      LYNX     - LynxOS
    00174      BSD4     - Any BSD 4.4 system
    00175      UNIX     - Any UNIX BSD/SYSV system
    00176 */
    00177
    00178 #if defined(__APPLE__) && (defined(__GNUC__) || defined(__xlC__) || defined(__xlc__))
    00179 #  define Q_OS_DARWIN
    00180 #  define Q_OS_BSD4
    00181 #  ifdef __LP64__
    00182 #    define Q_OS_DARWIN64
    00183 #  else
    00184 #    define Q_OS_DARWIN32
    00185 #  endif
    00186 #elif defined(__SYMBIAN32__) || defined(SYMBIAN)
    00187 #  define Q_OS_SYMBIAN
    00188 #  define Q_NO_POSIX_SIGNALS
    00189 #  define QT_NO_GETIFADDRS
    00190 #elif defined(__CYGWIN__)
    00191 #  define Q_OS_CYGWIN
    00192 #elif defined(MSDOS) || defined(_MSDOS)
    00193 #  define Q_OS_MSDOS
    00194 #elif defined(__OS2__)
    00195 #  if defined(__EMX__)
    00196 #    define Q_OS_OS2EMX
    00197 #  else
    00198 #    define Q_OS_OS2
    00199 #  endif
    00200 #elif !defined(SAG_COM) && (defined(WIN64) || defined(_WIN64) || defined(__WIN64__))
    00201 #  define Q_OS_WIN32
    00202 #  define Q_OS_WIN64
    00203 #elif !defined(SAG_COM) && (defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__))
    00204 #  if defined(WINCE) || defined(_WIN32_WCE)
    00205 #    define Q_OS_WINCE
    00206 #  else
    00207 #    define Q_OS_WIN32
    00208 #  endif
    00209 #elif defined(__MWERKS__) && defined(__INTEL__)
    00210 #  define Q_OS_WIN32
    00211 #elif defined(__sun) || defined(sun)
    00212 #  define Q_OS_SOLARIS
    00213 #elif defined(hpux) || defined(__hpux)
    00214 #  define Q_OS_HPUX
    00215 #elif defined(__ultrix) || defined(ultrix)
    00216 #  define Q_OS_ULTRIX
    00217 #elif defined(sinix)
    00218 #  define Q_OS_RELIANT
    00219 #elif defined(__linux__) || defined(__linux)
    00220 #  define Q_OS_LINUX
    00221 #elif defined(__FreeBSD__) || defined(__DragonFly__)
    00222 #  define Q_OS_FREEBSD
    00223 #  define Q_OS_BSD4
    00224 #elif defined(__NetBSD__)
    00225 #  define Q_OS_NETBSD
    00226 #  define Q_OS_BSD4
    00227 #elif defined(__OpenBSD__)
    00228 #  define Q_OS_OPENBSD
    00229 #  define Q_OS_BSD4
    00230 #elif defined(__bsdi__)
    00231 #  define Q_OS_BSDI
    00232 #  define Q_OS_BSD4
    00233 #elif defined(__sgi)
    00234 #  define Q_OS_IRIX
    00235 #elif defined(__osf__)
    00236 #  define Q_OS_OSF
    00237 #elif defined(_AIX)
    00238 #  define Q_OS_AIX
    00239 #elif defined(__Lynx__)
    00240 #  define Q_OS_LYNX
    00241 #elif defined(__GNU__)
    00242 #  define Q_OS_HURD
    00243 #elif defined(__DGUX__)
    00244 #  define Q_OS_DGUX
    00245 #elif defined(__QNXNTO__)
    00246 #  define Q_OS_QNX
    00247 #elif defined(_SEQUENT_)
    00248 #  define Q_OS_DYNIX
    00249 #elif defined(_SCO_DS) /* SCO OpenServer 5 + GCC */
    00250 #  define Q_OS_SCO
    00251 #elif defined(__USLC__) /* all SCO platforms + UDK or OUDK */
    00252 #  define Q_OS_UNIXWARE
    00253 #elif defined(__svr4__) && defined(i386) /* Open UNIX 8 + GCC */
    00254 #  define Q_OS_UNIXWARE
    00255 #elif defined(__INTEGRITY)
    00256 #  define Q_OS_INTEGRITY
    00257 #elif defined(VXWORKS) /* there is no "real" VxWorks define - this has to be set in the mkspec! */
    00258 #  define Q_OS_VXWORKS
    00259 #elif defined(__MAKEDEPEND__)
    00260 #else
    00261 #  error "Qt has not been ported to this OS - talk to qt-bugs@trolltech.com"
    00262 #endif
    00263
    00264 #if defined(Q_OS_WIN32) || defined(Q_OS_WIN64) || defined(Q_OS_WINCE)
    00265 #  define Q_OS_WIN
    00266 #endif
    00267
    00268 #if defined(Q_OS_DARWIN)
    00269 #  define Q_OS_MAC /* Q_OS_MAC is mostly for compatibility, but also more clear */
    00270 #  define Q_OS_MACX /* Q_OS_MACX is only for compatibility.*/
    00271 #  if defined(Q_OS_DARWIN64)
    00272 #     define Q_OS_MAC64
    00273 #  elif defined(Q_OS_DARWIN32)
    00274 #     define Q_OS_MAC32
    00275 #  endif
    00276 #endif
    00277
    00278 #ifdef QT_AUTODETECT_COCOA
    00279 #  ifdef Q_OS_MAC64
    00280 #    define QT_MAC_USE_COCOA 1
    00281 #    define QT_BUILD_KEY QT_BUILD_KEY_COCOA
    00282 #  else
    00283 #    define QT_BUILD_KEY QT_BUILD_KEY_CARBON
    00284 #  endif
    00285 #endif
    00286
    00287 #if defined(Q_OS_MAC64) && !defined(QT_MAC_USE_COCOA) && !defined(QT_BUILD_QMAKE)
    00288 #error "You are building a 64-bit application, but using a 32-bit version of Qt. Check your build configuration."
    00289 #endif
    00290
    00291 #if defined(Q_OS_MSDOS) || defined(Q_OS_OS2) || defined(Q_OS_WIN)
    00292 #  undef Q_OS_UNIX
    00293 #elif !defined(Q_OS_UNIX)
    00294 #  define Q_OS_UNIX
    00295 #endif
    00296
    00297 #if defined(Q_OS_DARWIN) && !defined(QT_LARGEFILE_SUPPORT)
    00298 #  define QT_LARGEFILE_SUPPORT 64
    00299 #endif
    00300
    00301 #ifdef Q_OS_DARWIN
    00302 #  ifdef MAC_OS_X_VERSION_MIN_REQUIRED
    00303 #    undef MAC_OS_X_VERSION_MIN_REQUIRED
    00304 #  endif
    00305 #  define MAC_OS_X_VERSION_MIN_REQUIRED MAC_OS_X_VERSION_10_4
    00306 #  include <AvailabilityMacros.h>
    00307 #  if !defined(MAC_OS_X_VERSION_10_3)
    00308 #     define MAC_OS_X_VERSION_10_3 MAC_OS_X_VERSION_10_2 + 1
    00309 #  endif
    00310 #  if !defined(MAC_OS_X_VERSION_10_4)
    00311 #       define MAC_OS_X_VERSION_10_4 MAC_OS_X_VERSION_10_3 + 1
    00312 #  endif
    00313 #  if !defined(MAC_OS_X_VERSION_10_5)
    00314 #       define MAC_OS_X_VERSION_10_5 MAC_OS_X_VERSION_10_4 + 1
    00315 #  endif
    00316 #  if !defined(MAC_OS_X_VERSION_10_6)
    00317 #       define MAC_OS_X_VERSION_10_6 MAC_OS_X_VERSION_10_5 + 1
    00318 #  endif
    00319 #  if (MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_6)
    00320 #    warning "This version of Mac OS X is unsupported"
    00321 #  endif
    00322 #endif
    00323
    00324 #ifdef __LSB_VERSION__
    00325 #  if __LSB_VERSION__ < 40
    00326 #    error "This version of the Linux Standard Base is unsupported"
    00327 #  endif
    00328 #ifndef QT_LINUXBASE
    00329 #  define QT_LINUXBASE
    00330 #endif
    00331 #endif
    00332
    00333 /*
    00334    The compiler, must be one of: (Q_CC_x)
    00335
    00336      SYM      - Digital Mars C/C++ (used to be Symantec C++)
    00337      MWERKS   - Metrowerks CodeWarrior
    00338      MSVC     - Microsoft Visual C/C++, Intel C++ for Windows
    00339      BOR      - Borland/Turbo C++
    00340      WAT      - Watcom C++
    00341      GNU      - GNU C++
    00342      COMEAU   - Comeau C++
    00343      EDG      - Edison Design Group C++
    00344      OC       - CenterLine C++
    00345      SUN      - Forte Developer, or Sun Studio C++
    00346      MIPS     - MIPSpro C++
    00347      DEC      - DEC C++
    00348      HPACC    - HP aC++
    00349      USLC     - SCO OUDK and UDK
    00350      CDS      - Reliant C++
    00351      KAI      - KAI C++
    00352      INTEL    - Intel C++ for Linux, Intel C++ for Windows
    00353      HIGHC    - MetaWare High C/C++
    00354      PGI      - Portland Group C++
    00355      GHS      - Green Hills Optimizing C++ Compilers
    00356      GCCE     - GCCE (Symbian GCCE builds)
    00357      RVCT     - ARM Realview Compiler Suite
    00358      NOKIAX86 - Nokia x86 (Symbian WINSCW builds)
    00359
    00360
    00361    Should be sorted most to least authoritative.
    00362 */
    00363
    00364 #if defined(__ghs)
    00365 #  define Q_OUTOFLINE_TEMPLATE inline
    00366 #endif
    00367
    00368 /* Symantec C++ is now Digital Mars */
    00369 #if defined(__DMC__) || defined(__SC__)
    00370 #  define Q_CC_SYM
    00371 /* "explicit" semantics implemented in 8.1e but keyword recognized since 7.5 */
    00372 #  if defined(__SC__) && __SC__ < 0x750
    00373 #    define Q_NO_EXPLICIT_KEYWORD
    00374 #  endif
    00375 #  define Q_NO_USING_KEYWORD
    00376
    00377 #elif defined(__MWERKS__)
    00378 #  define Q_CC_MWERKS
    00379 #  if defined(__EMU_SYMBIAN_OS__)
    00380 #    define Q_CC_NOKIAX86
    00381 #  endif
    00382 /* "explicit" recognized since 4.0d1 */
    00383
    00384 #elif defined(_MSC_VER)
    00385 #  define Q_CC_MSVC
    00386 /* proper support of bool for _MSC_VER >= 1100 */
    00387 #  define Q_CANNOT_DELETE_CONSTANT
    00388 #  define Q_OUTOFLINE_TEMPLATE inline
    00389 #  define Q_NO_TEMPLATE_FRIENDS
    00390 #  define QT_NO_PARTIAL_TEMPLATE_SPECIALIZATION
    00391 #    define Q_ALIGNOF(type)   __alignof(type)
    00392 #    define Q_DECL_ALIGN(n)   __declspec(align(n))
    00393
    00394 /* Visual C++.Net issues for _MSC_VER >= 1300 */
    00395 #  if _MSC_VER >= 1300
    00396 #    define Q_CC_MSVC_NET
    00397 #    if _MSC_VER < 1310 || (defined(Q_OS_WIN64) && defined(_M_IA64))
    00398 #      define Q_TYPENAME
    00399 #    else
    00400 #      undef QT_NO_PARTIAL_TEMPLATE_SPECIALIZATION
    00401 #    endif
    00402 #  else
    00403 #    define Q_NO_USING_KEYWORD
    00404 #    define QT_NO_MEMBER_TEMPLATES
    00405 #  endif
    00406 #  if _MSC_VER < 1310
    00407 #     define QT_NO_QOBJECT_CHECK
    00408 #     define Q_TYPENAME
    00409 #     define QT_NO_TEMPLATE_TEMPLATE_PARAMETERS
    00410 #  endif
    00411 /* Intel C++ disguising as Visual C++: the `using' keyword avoids warnings */
    00412 #  if defined(__INTEL_COMPILER)
    00413 #    define Q_CC_INTEL
    00414 #  endif
    00415 /* MSVC does not support SSE/MMX on x64 */
    00416 #  if (defined(Q_CC_MSVC) && defined(_M_X64))
    00417 #    undef QT_HAVE_SSE
    00418 #    undef QT_HAVE_MMX
    00419 #    undef QT_HAVE_3DNOW
    00420 #  endif
    00421
    00422 #elif defined(__BORLANDC__) || defined(__TURBOC__)
    00423 #  define Q_CC_BOR
    00424 #  define Q_INLINE_TEMPLATE
    00425 #  if __BORLANDC__ < 0x502
    00426 #    define Q_NO_BOOL_TYPE
    00427 #    define Q_NO_EXPLICIT_KEYWORD
    00428 #  endif
    00429 #  define Q_NO_USING_KEYWORD
    00430
    00431 #elif defined(__WATCOMC__)
    00432 #  define Q_CC_WAT
    00433
    00434 /* Symbian GCCE */
    00435 #elif defined(__GCCE__)
    00436 #  define Q_CC_GCCE
    00437 #  define QT_VISIBILITY_AVAILABLE
    00438 #  if defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__)
    00439 #    define QT_HAVE_ARMV6
    00440 #  endif
    00441
    00442 /* ARM Realview Compiler Suite
    00443    RVCT compiler also defines __EDG__ and __GNUC__ (if --gnu flag is given),
    00444    so check for it before that */
    00445 #elif defined(__ARMCC__) || defined(__CC_ARM)
    00446 #  define Q_CC_RVCT
    00447 #  if __TARGET_ARCH_ARM >= 6
    00448 #    define QT_HAVE_ARMV6
    00449 #  endif
    00450 #elif defined(__GNUC__)
    00451 #  define Q_CC_GNU
    00452 #  define Q_C_CALLBACKS
    00453 #  if defined(__MINGW32__)
    00454 #    define Q_CC_MINGW
    00455 #  endif
    00456 #  if defined(__INTEL_COMPILER)
    00457 /* Intel C++ also masquerades as GCC 3.2.0 */
    00458 #    define Q_CC_INTEL
    00459 #    define Q_NO_TEMPLATE_FRIENDS
    00460 #  endif
    00461 #  ifdef __APPLE__
    00462 #    define Q_NO_DEPRECATED_CONSTRUCTORS
    00463 #  endif
    00464 #  if __GNUC__ == 2 && __GNUC_MINOR__ <= 7
    00465 #    define Q_FULL_TEMPLATE_INSTANTIATION
    00466 #  endif
    00467 /* GCC 2.95 knows "using" but does not support it correctly */
    00468 #  if __GNUC__ == 2 && __GNUC_MINOR__ <= 95
    00469 #    define Q_NO_USING_KEYWORD
    00470 #    define QT_NO_STL_WCHAR
    00471 #  endif
    00472 #  if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
    00473 #    define Q_ALIGNOF(type)   __alignof__(type)
    00474 #    define Q_TYPEOF(expr)    __typeof__(expr)
    00475 #    define Q_DECL_ALIGN(n)   __attribute__((__aligned__(n)))
    00476 #  endif
    00477 /* GCC 3.1 and GCC 3.2 wrongly define _SB_CTYPE_MACROS on HP-UX */
    00478 #  if defined(Q_OS_HPUX) && __GNUC__ == 3 && __GNUC_MINOR__ >= 1
    00479 #    define Q_WRONG_SB_CTYPE_MACROS
    00480 #  endif
    00481 /* GCC <= 3.3 cannot handle template friends */
    00482 #  if __GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ <= 3)
    00483 #    define Q_NO_TEMPLATE_FRIENDS
    00484 #  endif
    00485 /* Apple's GCC 3.1 chokes on our streaming qDebug() */
    00486 #  if defined(Q_OS_DARWIN) && __GNUC__ == 3 && (__GNUC_MINOR__ >= 1 && __GNUC_MINOR__ < 3)
    00487 #    define Q_BROKEN_DEBUG_STREAM
    00488 #  endif
    00489 #  if (defined(Q_CC_GNU) || defined(Q_CC_INTEL)) && !defined(QT_MOC_CPP)
    00490 #    define Q_PACKED __attribute__ ((__packed__))
    00491 #    define Q_NO_PACKED_REFERENCE
    00492 #    ifndef __ARM_EABI__
    00493 #      define QT_NO_ARM_EABI
    00494 #    endif
    00495 #  endif
    00496
    00497 /* IBM compiler versions are a bit messy. There are actually two products:
    00498    the C product, and the C++ product. The C++ compiler is always packaged
    00499    with the latest version of the C compiler. Version numbers do not always
    00500    match. This little table (I'm not sure it's accurate) should be helpful:
    00501
    00502    C++ product                C product
    00503
    00504    C Set 3.1                  C Compiler 3.0
    00505    ...                        ...
    00506    C++ Compiler 3.6.6         C Compiler 4.3
    00507    ...                        ...
    00508    Visual Age C++ 4.0         ...
    00509    ...                        ...
    00510    Visual Age C++ 5.0         C Compiler 5.0
    00511    ...                        ...
    00512    Visual Age C++ 6.0         C Compiler 6.0
    00513
    00514    Now:
    00515    __xlC__    is the version of the C compiler in hexadecimal notation
    00516               is only an approximation of the C++ compiler version
    00517    __IBMCPP__ is the version of the C++ compiler in decimal notation
    00518               but it is not defined on older compilers like C Set 3.1 */
    00519 #elif defined(__xlC__)
    00520 #  define Q_CC_XLC
    00521 #  define Q_FULL_TEMPLATE_INSTANTIATION
    00522 #  if __xlC__ < 0x400
    00523 #    define Q_NO_BOOL_TYPE
    00524 #    define Q_NO_EXPLICIT_KEYWORD
    00525 #    define Q_NO_USING_KEYWORD
    00526 #    define Q_TYPENAME
    00527 #    define Q_OUTOFLINE_TEMPLATE inline
    00528 #    define Q_BROKEN_TEMPLATE_SPECIALIZATION
    00529 #    define Q_CANNOT_DELETE_CONSTANT
    00530 #  elif __xlC__ >= 0x0600
    00531 #    define Q_ALIGNOF(type)     __alignof__(type)
    00532 #    define Q_TYPEOF(expr)      __typeof__(expr)
    00533 #    define Q_DECL_ALIGN(n)     __attribute__((__aligned__(n)))
    00534 #    define Q_PACKED            __attribute__((__packed__))
    00535 #  endif
    00536
    00537 /* Older versions of DEC C++ do not define __EDG__ or __EDG - observed
    00538    on DEC C++ V5.5-004. New versions do define  __EDG__ - observed on
    00539    Compaq C++ V6.3-002.
    00540    This compiler is different enough from other EDG compilers to handle
    00541    it separately anyway. */
    00542 #elif defined(__DECCXX) || defined(__DECC)
    00543 #  define Q_CC_DEC
    00544 /* Compaq C++ V6 compilers are EDG-based but I'm not sure about older
    00545    DEC C++ V5 compilers. */
    00546 #  if defined(__EDG__)
    00547 #    define Q_CC_EDG
    00548 #  endif
    00549 /* Compaq have disabled EDG's _BOOL macro and use _BOOL_EXISTS instead
    00550    - observed on Compaq C++ V6.3-002.
    00551    In any case versions prior to Compaq C++ V6.0-005 do not have bool. */
    00552 #  if !defined(_BOOL_EXISTS)
    00553 #    define Q_NO_BOOL_TYPE
    00554 #  endif
    00555 /* Spurious (?) error messages observed on Compaq C++ V6.5-014. */
    00556 #  define Q_NO_USING_KEYWORD
    00557 /* Apply to all versions prior to Compaq C++ V6.0-000 - observed on
    00558    DEC C++ V5.5-004. */
    00559 #  if __DECCXX_VER < 60060000
    00560 #    define Q_TYPENAME
    00561 #    define Q_BROKEN_TEMPLATE_SPECIALIZATION
    00562 #    define Q_CANNOT_DELETE_CONSTANT
    00563 #  endif
    00564 /* avoid undefined symbol problems with out-of-line template members */
    00565 #  define Q_OUTOFLINE_TEMPLATE inline
    00566
    00567 /* The Portland Group C++ compiler is based on EDG and does define __EDG__
    00568    but the C compiler does not */
    00569 #elif defined(__PGI)
    00570 #  define Q_CC_PGI
    00571 #  if defined(__EDG__)
    00572 #    define Q_CC_EDG
    00573 #  endif
    00574
    00575 /* Compilers with EDG front end are similar. To detect them we test:
    00576    __EDG documented by SGI, observed on MIPSpro 7.3.1.1 and KAI C++ 4.0b
    00577    __EDG__ documented in EDG online docs, observed on Compaq C++ V6.3-002
    00578    and PGI C++ 5.2-4 */
    00579 #elif !defined(Q_OS_HPUX) && (defined(__EDG) || defined(__EDG__))
    00580 #  define Q_CC_EDG
    00581 /* From the EDG documentation (does not seem to apply to Compaq C++):
    00582    _BOOL
    00583         Defined in C++ mode when bool is a keyword. The name of this
    00584         predefined macro is specified by a configuration flag. _BOOL
    00585         is the default.
    00586    __BOOL_DEFINED
    00587         Defined in Microsoft C++ mode when bool is a keyword. */
    00588 #  if !defined(_BOOL) && !defined(__BOOL_DEFINED)
    00589 #    define Q_NO_BOOL_TYPE
    00590 #  endif
    00591
    00592 /* The Comeau compiler is based on EDG and does define __EDG__ */
    00593 #  if defined(__COMO__)
    00594 #    define Q_CC_COMEAU
    00595 #    define Q_C_CALLBACKS
    00596
    00597 /* The `using' keyword was introduced to avoid KAI C++ warnings
    00598    but it's now causing KAI C++ errors instead. The standard is
    00599    unclear about the use of this keyword, and in practice every
    00600    compiler is using its own set of rules. Forget it. */
    00601 #  elif defined(__KCC)
    00602 #    define Q_CC_KAI
    00603 #    define Q_NO_USING_KEYWORD
    00604
    00605 /* Using the `using' keyword avoids Intel C++ for Linux warnings */
    00606 #  elif defined(__INTEL_COMPILER)
    00607 #    define Q_CC_INTEL
    00608
    00609 /* Uses CFront, make sure to read the manual how to tweak templates. */
    00610 #  elif defined(__ghs)
    00611 #    define Q_CC_GHS
    00612
    00613 #  elif defined(__DCC__)
    00614 #    define Q_CC_DIAB
    00615 #    undef Q_NO_BOOL_TYPE
    00616 #    if !defined(__bool)
    00617 #      define Q_NO_BOOL_TYPE
    00618 #    endif
    00619
    00620 /* The UnixWare 7 UDK compiler is based on EDG and does define __EDG__ */
    00621 #  elif defined(__USLC__) && defined(__SCO_VERSION__)
    00622 #    define Q_CC_USLC
    00623 /* The latest UDK 7.1.1b does not need this, but previous versions do */
    00624 #    if !defined(__SCO_VERSION__) || (__SCO_VERSION__ < 302200010)
    00625 #      define Q_OUTOFLINE_TEMPLATE inline
    00626 #    endif
    00627 #    define Q_NO_USING_KEYWORD /* ### check "using" status */
    00628
    00629 /* Never tested! */
    00630 #  elif defined(CENTERLINE_CLPP) || defined(OBJECTCENTER)
    00631 #    define Q_CC_OC
    00632 #    define Q_NO_USING_KEYWORD
    00633
    00634 /* CDS++ defines __EDG__ although this is not documented in the Reliant
    00635    documentation. It also follows conventions like _BOOL and this documented */
    00636 #  elif defined(sinix)
    00637 #    define Q_CC_CDS
    00638 #    define Q_NO_USING_KEYWORD
    00639
    00640 /* The MIPSpro compiler defines __EDG */
    00641 #  elif defined(__sgi)
    00642 #    define Q_CC_MIPS
    00643 #    define Q_NO_USING_KEYWORD /* ### check "using" status */
    00644 #    define Q_NO_TEMPLATE_FRIENDS
    00645 #    if defined(_COMPILER_VERSION) && (_COMPILER_VERSION >= 740)
    00646 #      define Q_OUTOFLINE_TEMPLATE inline
    00647 #      pragma set woff 3624,3625,3649 /* turn off some harmless warnings */
    00648 #    endif
    00649 #  endif
    00650
    00651 /* VxWorks' DIAB toolchain has an additional EDG type C++ compiler
    00652    (see __DCC__ above). This one is for C mode files (__EDG is not defined) */
    00653 #elif defined(_DIAB_TOOL)
    00654 #  define Q_CC_DIAB
    00655
    00656 /* Never tested! */
    00657 #elif defined(__HIGHC__)
    00658 #  define Q_CC_HIGHC
    00659
    00660 #elif defined(__SUNPRO_CC) || defined(__SUNPRO_C)
    00661 #  define Q_CC_SUN
    00662 /* 5.0 compiler or better
    00663     'bool' is enabled by default but can be disabled using -features=nobool
    00664     in which case _BOOL is not defined
    00665         this is the default in 4.2 compatibility mode triggered by -compat=4 */
    00666 #  if __SUNPRO_CC >= 0x500
    00667 #    define QT_NO_TEMPLATE_TEMPLATE_PARAMETERS
    00668    /* see http://developers.sun.com/sunstudio/support/Ccompare.html */
    00669 #    if __SUNPRO_CC >= 0x590
    00670 #      define Q_ALIGNOF(type)   __alignof__(type)
    00671 #      define Q_TYPEOF(expr)    __typeof__(expr)
    00672 #      define Q_DECL_ALIGN(n)   __attribute__((__aligned__(n)))
    00673 #    endif
    00674 #    if __SUNPRO_CC >= 0x550
    00675 #      define Q_DECL_EXPORT     __global
    00676 #    endif
    00677 #    if __SUNPRO_CC < 0x5a0
    00678 #      define Q_NO_TEMPLATE_FRIENDS
    00679 #    endif
    00680 #    if !defined(_BOOL)
    00681 #      define Q_NO_BOOL_TYPE
    00682 #    endif
    00683 #    if defined(__SUNPRO_CC_COMPAT) && (__SUNPRO_CC_COMPAT <= 4)
    00684 #      define Q_NO_USING_KEYWORD
    00685 #    endif
    00686 #    define Q_C_CALLBACKS
    00687 /* 4.2 compiler or older */
    00688 #  else
    00689 #    define Q_NO_BOOL_TYPE
    00690 #    define Q_NO_EXPLICIT_KEYWORD
    00691 #    define Q_NO_USING_KEYWORD
    00692 #  endif
    00693
    00694 /* CDS++ does not seem to define __EDG__ or __EDG according to Reliant
    00695    documentation but nevertheless uses EDG conventions like _BOOL */
    00696 #elif defined(sinix)
    00697 #  define Q_CC_EDG
    00698 #  define Q_CC_CDS
    00699 #  if !defined(_BOOL)
    00700 #    define Q_NO_BOOL_TYPE
    00701 #  endif
    00702 #  define Q_BROKEN_TEMPLATE_SPECIALIZATION
    00703
    00704 #elif defined(Q_OS_HPUX)
    00705 /* __HP_aCC was not defined in first aCC releases */
    00706 #  if defined(__HP_aCC) || __cplusplus >= 199707L
    00707 #    define Q_NO_TEMPLATE_FRIENDS
    00708 #    define Q_CC_HPACC
    00709 #    if __HP_aCC-0 < 060000
    00710 #      define QT_NO_TEMPLATE_TEMPLATE_PARAMETERS
    00711 #      define Q_DECL_EXPORT     __declspec(dllexport)
    00712 #      define Q_DECL_IMPORT     __declspec(dllimport)
    00713 #    endif
    00714 #    if __HP_aCC-0 >= 061200
    00715 #      define Q_DECL_ALIGNED(n) __attribute__((aligned(n)))
    00716 #    endif
    00717 #    if __HP_aCC-0 >= 062000
    00718 #      define Q_DECL_EXPORT     __attribute__((visibility("default")))
    00719 #      define Q_DECL_IMPORT     Q_DECL_EXPORT
    00720 #    endif
    00721 #  else
    00722 #    define Q_CC_HP
    00723 #    define Q_NO_BOOL_TYPE
    00724 #    define Q_FULL_TEMPLATE_INSTANTIATION
    00725 #    define Q_BROKEN_TEMPLATE_SPECIALIZATION
    00726 #    define Q_NO_EXPLICIT_KEYWORD
    00727 #  endif
    00728 #  define Q_NO_USING_KEYWORD /* ### check "using" status */
    00729
    00730 #elif defined(__WINSCW__) && !defined(Q_CC_NOKIAX86)
    00731 #  define Q_CC_NOKIAX86
    00732
    00733
    00734 #else
    00735 #  error "Qt has not been tested with this compiler - talk to qt-bugs@trolltech.com"
    00736 #endif
    00737
    00738 #ifndef Q_PACKED
    00739 #  define Q_PACKED
    00740 #  undef Q_NO_PACKED_REFERENCE
    00741 #endif
    00742
    00743 #ifndef Q_CONSTRUCTOR_FUNCTION
    00744 # define Q_CONSTRUCTOR_FUNCTION0(AFUNC) \
    00745    static const int AFUNC ## __init_variable__ = AFUNC();
    00746 # define Q_CONSTRUCTOR_FUNCTION(AFUNC) Q_CONSTRUCTOR_FUNCTION0(AFUNC)
    00747 #endif
    00748
    00749 #ifndef Q_DESTRUCTOR_FUNCTION
    00750 # define Q_DESTRUCTOR_FUNCTION0(AFUNC) \
    00751     class AFUNC ## __dest_class__ { \
    00752     public: \
    00753        inline AFUNC ## __dest_class__() { } \
    00754        inline ~ AFUNC ## __dest_class__() { AFUNC(); } \
    00755     } AFUNC ## __dest_instance__;
    00756 # define Q_DESTRUCTOR_FUNCTION(AFUNC) Q_DESTRUCTOR_FUNCTION0(AFUNC)
    00757 #endif
    00758
    00759 #ifndef Q_REQUIRED_RESULT
    00760 #  if defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1))
    00761 #    define Q_REQUIRED_RESULT __attribute__ ((warn_unused_result))
    00762 #  else
    00763 #    define Q_REQUIRED_RESULT
    00764 #  endif
    00765 #endif
    00766
    00767 #ifndef Q_COMPILER_MANGLES_RETURN_TYPE
    00768 #  if defined(Q_CC_MSVC)
    00769 #    define Q_COMPILER_MANGLES_RETURN_TYPE
    00770 #  endif
    00771 #endif
    00772
    00773 /*
    00774    The window system, must be one of: (Q_WS_x)
    00775
    00776      MACX     - Mac OS X
    00777      MAC9     - Mac OS 9
    00778      QWS      - Qt for Embedded Linux
    00779      WIN32    - Windows
    00780      X11      - X Window System
    00781      S60      - Symbian S60
    00782      PM       - unsupported
    00783      WIN16    - unsupported
    00784 */
    00785
    00786 #if defined(Q_OS_MSDOS)
    00787 #  define Q_WS_WIN16
    00788 #  error "Qt requires Win32 and does not work with Windows 3.x"
    00789 #elif defined(_WIN32_X11_)
    00790 #  define Q_WS_X11
    00791 #elif defined(Q_OS_WIN32)
    00792 #  define Q_WS_WIN32
    00793 #  if defined(Q_OS_WIN64)
    00794 #    define Q_WS_WIN64
    00795 #  endif
    00796 #elif defined(Q_OS_WINCE)
    00797 #  define Q_WS_WIN32
    00798 #  define Q_WS_WINCE
    00799 #  if defined(Q_OS_WINCE_WM)
    00800 #    define Q_WS_WINCE_WM
    00801 #  endif
    00802 #elif defined(Q_OS_OS2)
    00803 #  define Q_WS_PM
    00804 #  error "Qt does not work with OS/2 Presentation Manager or Workplace Shell"
    00805 #elif defined(Q_OS_UNIX)
    00806 #  if defined(Q_OS_MAC) && !defined(__USE_WS_X11__) && !defined(Q_WS_QWS)
    00807 #    define Q_WS_MAC
    00808 #    define Q_WS_MACX
    00809 #    if defined(Q_OS_MAC64)
    00810 #      define Q_WS_MAC64
    00811 #    elif defined(Q_OS_MAC32)
    00812 #      define Q_WS_MAC32
    00813 #    endif
    00814 #  elif defined(Q_OS_SYMBIAN)
    00815 #    if !defined(QT_NO_S60)
    00816 #      define Q_WS_S60
    00817 #    endif
    00818 #  elif !defined(Q_WS_QWS)
    00819 #    define Q_WS_X11
    00820 #  endif
    00821 #endif
    00822
    00823 #if defined(Q_WS_WIN16) || defined(Q_WS_WIN32) || defined(Q_WS_WINCE)
    00824 #  define Q_WS_WIN
    00825 #endif
    00826
    00827 QT_BEGIN_HEADER
    00828 QT_BEGIN_NAMESPACE
    00829
    00830 /*
    00831    Size-dependent types (architechture-dependent byte order)
    00832
    00833    Make sure to update QMetaType when changing these typedefs
    00834 */
    00835
    00836 typedef signed char qint8;         /* 8 bit signed */
    00837 typedef unsigned char quint8;      /* 8 bit unsigned */
    00838 typedef short qint16;              /* 16 bit signed */
    00839 typedef unsigned short quint16;    /* 16 bit unsigned */
    00840 typedef int qint32;                /* 32 bit signed */
    00841 typedef unsigned int quint32;      /* 32 bit unsigned */
    00842 #if defined(Q_OS_WIN) && !defined(Q_CC_GNU) && !defined(Q_CC_MWERKS)
    00843 #  define Q_INT64_C(c) c ## i64    /* signed 64 bit constant */
    00844 #  define Q_UINT64_C(c) c ## ui64   /* unsigned 64 bit constant */
    00845 typedef __int64 qint64;            /* 64 bit signed */
    00846 typedef unsigned __int64 quint64;  /* 64 bit unsigned */
    00847 #else
    00848 #  define Q_INT64_C(c) static_cast<long long>(c ## LL)     /* signed 64 bit constant */
    00849 #  define Q_UINT64_C(c) static_cast<unsigned long long>(c ## ULL) /* unsigned 64 bit constant */
    00850 typedef long long qint64;           /* 64 bit signed */
    00851 typedef unsigned long long quint64; /* 64 bit unsigned */
    00852 #endif
    00853
    00854 typedef qint64 qlonglong;
    00855 typedef quint64 qulonglong;
    00856
    00857 #ifndef QT_POINTER_SIZE
    00858 #  if defined(Q_OS_WIN64)
    00859 #   define QT_POINTER_SIZE 8
    00860 #  elif defined(Q_OS_WIN32) || defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN)
    00861 #   define QT_POINTER_SIZE 4
    00862 #  endif
    00863 #endif
    00864
    00865 #define Q_INIT_RESOURCE_EXTERN(name) \
    00866     extern int QT_MANGLE_NAMESPACE(qInitResources_ ## name) ();
    00867
    00868 #define Q_INIT_RESOURCE(name) \
    00869     do { extern int QT_MANGLE_NAMESPACE(qInitResources_ ## name) ();       \
    00870         QT_MANGLE_NAMESPACE(qInitResources_ ## name) (); } while (0)
    00871 #define Q_CLEANUP_RESOURCE(name) \
    00872     do { extern int QT_MANGLE_NAMESPACE(qCleanupResources_ ## name) ();    \
    00873         QT_MANGLE_NAMESPACE(qCleanupResources_ ## name) (); } while (0)
    00874
    00875 #if defined(__cplusplus)
    00876
    00877 /*
    00878   quintptr and qptrdiff is guaranteed to be the same size as a pointer, i.e.
    00879
    00880       sizeof(void *) == sizeof(quintptr)
    00881       && sizeof(void *) == sizeof(qptrdiff)
    00882 */
    00883 template <int> struct QIntegerForSize;
    00884 template <>    struct QIntegerForSize<1> { typedef quint8  Unsigned; typedef qint8  Signed; };
    00885 template <>    struct QIntegerForSize<2> { typedef quint16 Unsigned; typedef qint16 Signed; };
    00886 template <>    struct QIntegerForSize<4> { typedef quint32 Unsigned; typedef qint32 Signed; };
    00887 template <>    struct QIntegerForSize<8> { typedef quint64 Unsigned; typedef qint64 Signed; };
    00888 template <class T> struct QIntegerForSizeof: QIntegerForSize<sizeof(T)> { };
    00889 typedef QIntegerForSizeof<void*>::Unsigned quintptr;
    00890 typedef QIntegerForSizeof<void*>::Signed qptrdiff;
    00891
    00892 /*
    00893    Useful type definitions for Qt
    00894 */
    00895
    00896 QT_BEGIN_INCLUDE_NAMESPACE
    00897 typedef unsigned char uchar;
    00898 typedef unsigned short ushort;
    00899 typedef unsigned int uint;
    00900 typedef unsigned long ulong;
    00901 QT_END_INCLUDE_NAMESPACE
    00902
    00903 #if defined(Q_NO_BOOL_TYPE)
    00904 #error "Compiler doesn't support the bool type"
    00905 #endif
    00906
    00907 /*
    00908    Constant bool values
    00909 */
    00910
    00911 #ifndef QT_LINUXBASE /* the LSB defines TRUE and FALSE for us */
    00912 /* Symbian OS defines TRUE = 1 and FALSE = 0,
    00913 redefine to built-in booleans to make autotests work properly */
    00914 #ifdef Q_OS_SYMBIAN
    00915     #include <e32def.h> /* Symbian OS defines */
    00916
    00917     #undef TRUE
    00918     #undef FALSE
    00919 #endif
    00920 #  ifndef TRUE
    00921 #   define TRUE true
    00922 #   define FALSE false
    00923 #  endif
    00924 #endif
    00925
    00926 /*
    00927    Proper for-scoping in VC++6 and MIPSpro CC
    00928 */
    00929 #ifndef QT_NO_KEYWORDS
    00930 #  if (defined(Q_CC_MSVC) && !defined(Q_CC_MSVC_NET) && !defined(Q_CC_INTEL)) || defined(Q_CC_MIPS) || (defined(Q_CC_HPACC) && defined(__ia64))
    00931 #    define for if(0){}else for
    00932 #  endif
    00933 #endif
    00934
    00935 /*
    00936    Workaround for static const members on MSVC++.
    00937 */
    00938
    00939 #if defined(Q_CC_MSVC)
    00940 #  define QT_STATIC_CONST static
    00941 #  define QT_STATIC_CONST_IMPL
    00942 #else
    00943 #  define QT_STATIC_CONST static const
    00944 #  define QT_STATIC_CONST_IMPL const
    00945 #endif
    00946
    00947 /*
    00948    Warnings and errors when using deprecated methods
    00949 */
    00950 #if defined(Q_MOC_RUN)
    00951 #  define Q_DECL_DEPRECATED Q_DECL_DEPRECATED
    00952 #elif (defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && (__GNUC__ - 0 > 3 || (__GNUC__ - 0 == 3 && __GNUC_MINOR__ - 0 >= 2))) || defined(Q_CC_RVCT)
    00953 #  define Q_DECL_DEPRECATED __attribute__ ((__deprecated__))
    00954 #elif defined(Q_CC_MSVC) && (_MSC_VER >= 1300)
    00955 #  define Q_DECL_DEPRECATED __declspec(deprecated)
    00956 #  if defined (Q_CC_INTEL)
    00957 #    define Q_DECL_VARIABLE_DEPRECATED
    00958 #  else
    00959 #  endif
    00960 #else
    00961 #  define Q_DECL_DEPRECATED
    00962 #endif
    00963 #ifndef Q_DECL_VARIABLE_DEPRECATED
    00964 #  define Q_DECL_VARIABLE_DEPRECATED Q_DECL_DEPRECATED
    00965 #endif
    00966 #ifndef Q_DECL_CONSTRUCTOR_DEPRECATED
    00967 #  if defined(Q_MOC_RUN)
    00968 #    define Q_DECL_CONSTRUCTOR_DEPRECATED Q_DECL_CONSTRUCTOR_DEPRECATED
    00969 #  elif defined(Q_NO_DEPRECATED_CONSTRUCTORS)
    00970 #    define Q_DECL_CONSTRUCTOR_DEPRECATED
    00971 #  else
    00972 #    define Q_DECL_CONSTRUCTOR_DEPRECATED Q_DECL_DEPRECATED
    00973 #  endif
    00974 #endif
    00975
    00976 #if defined(QT_NO_DEPRECATED)
    00977 /* disable Qt3 support as well */
    00978 #  undef QT3_SUPPORT_WARNINGS
    00979 #  undef QT3_SUPPORT
    00980 #  undef QT_DEPRECATED
    00981 #  undef QT_DEPRECATED_VARIABLE
    00982 #  undef QT_DEPRECATED_CONSTRUCTOR
    00983 #elif defined(QT_DEPRECATED_WARNINGS)
    00984 #  ifdef QT3_SUPPORT
    00985 /* enable Qt3 support warnings as well */
    00986 #    undef QT3_SUPPORT_WARNINGS
    00987 #    define QT3_SUPPORT_WARNINGS
    00988 #  endif
    00989 #  undef QT_DEPRECATED
    00990 #  define QT_DEPRECATED Q_DECL_DEPRECATED
    00991 #  undef QT_DEPRECATED_VARIABLE
    00992 #  define QT_DEPRECATED_VARIABLE Q_DECL_VARIABLE_DEPRECATED
    00993 #  undef QT_DEPRECATED_CONSTRUCTOR
    00994 #  define QT_DEPRECATED_CONSTRUCTOR explicit Q_DECL_CONSTRUCTOR_DEPRECATED
    00995 #else
    00996 #  undef QT_DEPRECATED
    00997 #  define QT_DEPRECATED
    00998 #  undef QT_DEPRECATED_VARIABLE
    00999 #  define QT_DEPRECATED_VARIABLE
    01000 #  undef QT_DEPRECATED_CONSTRUCTOR
    01001 #  define QT_DEPRECATED_CONSTRUCTOR
    01002 #endif
    01003
    01004 #if defined(QT3_SUPPORT_WARNINGS)
    01005 #  if !defined(QT_COMPAT_WARNINGS) /* also enable compat */
    01006 #    define QT_COMPAT_WARNINGS
    01007 #  endif
    01008 #  undef QT3_SUPPORT
    01009 #  define QT3_SUPPORT Q_DECL_DEPRECATED
    01010 #  undef QT3_SUPPORT_VARIABLE
    01011 #  define QT3_SUPPORT_VARIABLE Q_DECL_VARIABLE_DEPRECATED
    01012 #  undef QT3_SUPPORT_CONSTRUCTOR
    01013 #  define QT3_SUPPORT_CONSTRUCTOR explicit Q_DECL_CONSTRUCTOR_DEPRECATED
    01014 #elif defined(QT3_SUPPORT) /* define back to nothing */
    01015 #  if !defined(QT_COMPAT) /* also enable qt3 support */
    01016 #    define QT_COMPAT
    01017 #  endif
    01018 #  undef QT3_SUPPORT
    01019 #  define QT3_SUPPORT
    01020 #  undef QT3_SUPPORT_VARIABLE
    01021 #  define QT3_SUPPORT_VARIABLE
    01022 #  undef QT3_SUPPORT_CONSTRUCTOR
    01023 #  define QT3_SUPPORT_CONSTRUCTOR explicit
    01024 #endif
    01025
    01026 /* moc compats (signals/slots) */
    01027 #ifndef QT_MOC_COMPAT
    01028 #  if defined(QT3_SUPPORT)
    01029 #    define QT_MOC_COMPAT QT3_SUPPORT
    01030 #  else
    01031 #    define QT_MOC_COMPAT
    01032 #  endif
    01033 #else
    01034 #  undef QT_MOC_COMPAT
    01035 #  define QT_MOC_COMPAT
    01036 #endif
    01037
    01038 #ifdef QT_ASCII_CAST_WARNINGS
    01039 #  define QT_ASCII_CAST_WARN Q_DECL_DEPRECATED
    01040 #  if defined(Q_CC_GNU) && __GNUC__ < 4
    01041      /* gcc < 4 doesn't like Q_DECL_DEPRECATED in front of constructors */
    01042 #    define QT_ASCII_CAST_WARN_CONSTRUCTOR
    01043 #  else
    01044 #    define QT_ASCII_CAST_WARN_CONSTRUCTOR Q_DECL_CONSTRUCTOR_DEPRECATED
    01045 #  endif
    01046 #else
    01047 #  define QT_ASCII_CAST_WARN
    01048 #  define QT_ASCII_CAST_WARN_CONSTRUCTOR
    01049 #endif
    01050
    01051 #if defined(__i386__) || defined(_WIN32) || defined(_WIN32_WCE)
    01052 #  if defined(Q_CC_GNU)
    01053 #if !defined(Q_CC_INTEL) && ((100*(__GNUC__ - 0) + 10*(__GNUC_MINOR__ - 0) + __GNUC_PATCHLEVEL__) >= 332)
    01054 #    define QT_FASTCALL __attribute__((regparm(3)))
    01055 #else
    01056 #    define QT_FASTCALL
    01057 #endif
    01058 #  elif defined(Q_CC_MSVC) && (_MSC_VER > 1300 || defined(Q_CC_INTEL))
    01059 #    define QT_FASTCALL __fastcall
    01060 #  else
    01061 #     define QT_FASTCALL
    01062 #  endif
    01063 #else
    01064 #  define QT_FASTCALL
    01065 #endif
    01066
    01067 //defines the type for the WNDPROC on windows
    01068 //the alignment needs to be forced for sse2 to not crash with mingw
    01069 #if defined(Q_WS_WIN)
    01070 #  if defined(Q_CC_MINGW)
    01071 #    define QT_ENSURE_STACK_ALIGNED_FOR_SSE __attribute__ ((force_align_arg_pointer))
    01072 #  else
    01073 #    define QT_ENSURE_STACK_ALIGNED_FOR_SSE
    01074 #  endif
    01075 #  define QT_WIN_CALLBACK CALLBACK QT_ENSURE_STACK_ALIGNED_FOR_SSE
    01076 #endif
    01077
    01078 typedef int QNoImplicitBoolCast;
    01079
    01080 #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)
    01081 #define QT_NO_FPU
    01082 #endif
    01083
    01084 // This logic must match the one in qmetatype.h
    01085 #if defined(QT_COORD_TYPE)
    01086 typedef QT_COORD_TYPE qreal;
    01087 #elif defined(QT_NO_FPU) || defined(QT_ARCH_ARM) || defined(QT_ARCH_WINDOWSCE) || defined(QT_ARCH_SYMBIAN)
    01088 typedef float qreal;
    01089 #else
    01090 typedef double qreal;
    01091 #endif
    01092
    01093 /*
    01094    Utility macros and inline functions
    01095 */
    01096
    01097 template <typename T>
    01098 inline T qAbs(const T &t) { return t >= 0 ? t : -t; }
    01099
    01100 inline int qRound(qreal d)
    01101 { return d >= 0.0 ? int(d + 0.5) : int(d - int(d-1) + 0.5) + int(d-1); }
    01102
    01103 #if defined(QT_NO_FPU) || defined(QT_ARCH_ARM) || defined(QT_ARCH_WINDOWSCE) || defined(QT_ARCH_SYMBIAN)
    01104 inline qint64 qRound64(double d)
    01105 { return d >= 0.0 ? qint64(d + 0.5) : qint64(d - qreal(qint64(d-1)) + 0.5) + qint64(d-1); }
    01106 #else
    01107 inline qint64 qRound64(qreal d)
    01108 { return d >= 0.0 ? qint64(d + 0.5) : qint64(d - qreal(qint64(d-1)) + 0.5) + qint64(d-1); }
    01109 #endif
    01110
    01111 template <typename T>
    01112 inline const T &qMin(const T &a, const T &b) { if (a < b) return a; return b; }
    01113 template <typename T>
    01114 inline const T &qMax(const T &a, const T &b) { if (a < b) return b; return a; }
    01115 template <typename T>
    01116 inline const T &qBound(const T &min, const T &val, const T &max)
    01117 { return qMax(min, qMin(max, val)); }
    01118
    01119 #ifdef QT3_SUPPORT
    01120 typedef qint8 Q_INT8;
    01121 typedef quint8 Q_UINT8;
    01122 typedef qint16 Q_INT16;
    01123 typedef quint16 Q_UINT16;
    01124 typedef qint32 Q_INT32;
    01125 typedef quint32 Q_UINT32;
    01126 typedef qint64 Q_INT64;
    01127 typedef quint64 Q_UINT64;
    01128
    01129 typedef qint64 Q_LLONG;
    01130 typedef quint64 Q_ULLONG;
    01131 #if defined(Q_OS_WIN64)
    01132 typedef __int64 Q_LONG;             /* word up to 64 bit signed */
    01133 typedef unsigned __int64 Q_ULONG;   /* word up to 64 bit unsigned */
    01134 #else
    01135 typedef long Q_LONG;                /* word up to 64 bit signed */
    01136 typedef unsigned long Q_ULONG;      /* word up to 64 bit unsigned */
    01137 #endif
    01138
    01139 #  define QABS(a) qAbs(a)
    01140 #  define QMAX(a, b) qMax((a), (b))
    01141 #  define QMIN(a, b) qMin((a), (b))
    01142 #endif
    01143
    01144 /*
    01145    Data stream functions are provided by many classes (defined in qdatastream.h)
    01146 */
    01147
    01148 class QDataStream;
    01149
    01150 #ifndef QT_BUILD_KEY
    01151 #define QT_BUILD_KEY "unspecified"
    01152 #endif
    01153
    01154 #if defined(Q_WS_MAC)
    01155 #  ifndef QMAC_QMENUBAR_NO_EVENT
    01156 #    define QMAC_QMENUBAR_NO_EVENT
    01157 #  endif
    01158 #endif
    01159
    01160 #if !defined(Q_WS_QWS) && !defined(QT_NO_COP)
    01161 #  define QT_NO_COP
    01162 #endif
    01163
    01164 #if defined(Q_OS_VXWORKS)
    01165 #  define QT_NO_CRASHHANDLER     // no popen
    01166 #  define QT_NO_PROCESS          // no exec*, no fork
    01167 #  define QT_NO_LPR
    01168 #  define QT_NO_SHAREDMEMORY     // only POSIX, no SysV and in the end...
    01169 #  define QT_NO_SYSTEMSEMAPHORE  // not needed at all in a flat address space
    01170 #  define QT_NO_QWS_MULTIPROCESS // no processes
    01171 #endif
    01172
    01173 # include <QtCore/qfeatures.h>
    01174
    01175 #define QT_SUPPORTS(FEATURE) (!defined(QT_NO_##FEATURE))
    01176
    01177 #ifndef Q_DECL_EXPORT
    01178 #  if defined(Q_OS_WIN) || defined(Q_CC_NOKIAX86) || defined(Q_CC_RVCT)
    01179 #    define Q_DECL_EXPORT __declspec(dllexport)
    01180 #  elif defined(QT_VISIBILITY_AVAILABLE)
    01181 #    define Q_DECL_EXPORT __attribute__((visibility("default")))
    01182 #  endif
    01183 #  ifndef Q_DECL_EXPORT
    01184 #    define Q_DECL_EXPORT
    01185 #  endif
    01186 #endif
    01187 #ifndef Q_DECL_IMPORT
    01188 #  if defined(Q_OS_WIN) || defined(Q_CC_NOKIAX86) || defined(Q_CC_RVCT)
    01189 #    define Q_DECL_IMPORT __declspec(dllimport)
    01190 #  else
    01191 #    define Q_DECL_IMPORT
    01192 #  endif
    01193 #endif
    01194
    01195 /*
    01196    Create Qt DLL if QT_DLL is defined (Windows and Symbian only)
    01197 */
    01198
    01199 #if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
    01200 #  if defined(QT_NODLL)
    01201 #    undef QT_MAKEDLL
    01202 #    undef QT_DLL
    01203 #  elif defined(QT_MAKEDLL)        /* create a Qt DLL library */
    01204 #    if defined(QT_DLL)
    01205 #      undef QT_DLL
    01206 #    endif
    01207 #    if defined(QT_BUILD_CORE_LIB)
    01208 #      define Q_CORE_EXPORT Q_DECL_EXPORT
    01209 #    else
    01210 #      define Q_CORE_EXPORT Q_DECL_IMPORT
    01211 #    endif
    01212 #    if defined(QT_BUILD_GUI_LIB)
    01213 #      define Q_GUI_EXPORT Q_DECL_EXPORT
    01214 #    else
    01215 #      define Q_GUI_EXPORT Q_DECL_IMPORT
    01216 #    endif
    01217 #    if defined(QT_BUILD_SQL_LIB)
    01218 #      define Q_SQL_EXPORT Q_DECL_EXPORT
    01219 #    else
    01220 #      define Q_SQL_EXPORT Q_DECL_IMPORT
    01221 #    endif
    01222 #    if defined(QT_BUILD_NETWORK_LIB)
    01223 #      define Q_NETWORK_EXPORT Q_DECL_EXPORT
    01224 #    else
    01225 #      define Q_NETWORK_EXPORT Q_DECL_IMPORT
    01226 #    endif
    01227 #    if defined(QT_BUILD_SVG_LIB)
    01228 #      define Q_SVG_EXPORT Q_DECL_EXPORT
    01229 #    else
    01230 #      define Q_SVG_EXPORT Q_DECL_IMPORT
    01231 #    endif
    01232 #    if defined(QT_BUILD_DECLARATIVE_LIB)
    01233 #      define Q_DECLARATIVE_EXPORT Q_DECL_EXPORT
    01234 #    else
    01235 #      define Q_DECLARATIVE_EXPORT Q_DECL_IMPORT
    01236 #    endif
    01237 #    if defined(QT_BUILD_OPENGL_LIB)
    01238 #      define Q_OPENGL_EXPORT Q_DECL_EXPORT
    01239 #    else
    01240 #      define Q_OPENGL_EXPORT Q_DECL_IMPORT
    01241 #    endif
    01242 #    if defined(QT_BUILD_MULTIMEDIA_LIB)
    01243 #      define Q_MULTIMEDIA_EXPORT Q_DECL_EXPORT
    01244 #    else
    01245 #      define Q_MULTIMEDIA_EXPORT Q_DECL_IMPORT
    01246 #    endif
    01247 #    if defined(QT_BUILD_OPENVG_LIB)
    01248 #      define Q_OPENVG_EXPORT Q_DECL_EXPORT
    01249 #    else
    01250 #      define Q_OPENVG_EXPORT Q_DECL_IMPORT
    01251 #    endif
    01252 #    if defined(QT_BUILD_XML_LIB)
    01253 #      define Q_XML_EXPORT Q_DECL_EXPORT
    01254 #    else
    01255 #      define Q_XML_EXPORT Q_DECL_IMPORT
    01256 #    endif
    01257 #    if defined(QT_BUILD_XMLPATTERNS_LIB)
    01258 #      define Q_XMLPATTERNS_EXPORT Q_DECL_EXPORT
    01259 #    else
    01260 #      define Q_XMLPATTERNS_EXPORT Q_DECL_IMPORT
    01261 #    endif
    01262 #    if defined(QT_BUILD_SCRIPT_LIB)
    01263 #      define Q_SCRIPT_EXPORT Q_DECL_EXPORT
    01264 #    else
    01265 #      define Q_SCRIPT_EXPORT Q_DECL_IMPORT
    01266 #    endif
    01267 #    if defined(QT_BUILD_SCRIPTTOOLS_LIB)
    01268 #      define Q_SCRIPTTOOLS_EXPORT Q_DECL_EXPORT
    01269 #    else
    01270 #      define Q_SCRIPTTOOLS_EXPORT Q_DECL_IMPORT
    01271 #    endif
    01272 #    if defined(QT_BUILD_CANVAS_LIB)
    01273 #      define Q_CANVAS_EXPORT Q_DECL_EXPORT
    01274 #    else
    01275 #      define Q_CANVAS_EXPORT Q_DECL_IMPORT
    01276 #    endif
    01277 #    if defined(QT_BUILD_COMPAT_LIB)
    01278 #      define Q_COMPAT_EXPORT Q_DECL_EXPORT
    01279 #    else
    01280 #      define Q_COMPAT_EXPORT Q_DECL_IMPORT
    01281 #    endif
    01282 #    if defined(QT_BUILD_DBUS_LIB)
    01283 #      define Q_DBUS_EXPORT Q_DECL_EXPORT
    01284 #    else
    01285 #      define Q_DBUS_EXPORT Q_DECL_IMPORT
    01286 #    endif
    01287 #    define Q_TEMPLATEDLL
    01288 #  elif defined(QT_DLL) /* use a Qt DLL library */
    01289 #    define Q_CORE_EXPORT Q_DECL_IMPORT
    01290 #    define Q_GUI_EXPORT Q_DECL_IMPORT
    01291 #    define Q_SQL_EXPORT Q_DECL_IMPORT
    01292 #    define Q_NETWORK_EXPORT Q_DECL_IMPORT
    01293 #    define Q_SVG_EXPORT Q_DECL_IMPORT
    01294 #    define Q_DECLARATIVE_EXPORT Q_DECL_IMPORT
    01295 #    define Q_CANVAS_EXPORT Q_DECL_IMPORT
    01296 #    define Q_OPENGL_EXPORT Q_DECL_IMPORT
    01297 #    define Q_MULTIMEDIA_EXPORT Q_DECL_IMPORT
    01298 #    define Q_OPENVG_EXPORT Q_DECL_IMPORT
    01299 #    define Q_XML_EXPORT Q_DECL_IMPORT
    01300 #    define Q_XMLPATTERNS_EXPORT Q_DECL_IMPORT
    01301 #    define Q_SCRIPT_EXPORT Q_DECL_IMPORT
    01302 #    define Q_SCRIPTTOOLS_EXPORT Q_DECL_IMPORT
    01303 #    define Q_COMPAT_EXPORT Q_DECL_IMPORT
    01304 #    define Q_DBUS_EXPORT Q_DECL_IMPORT
    01305 #    define Q_TEMPLATEDLL
    01306 #  endif
    01307 #  define Q_NO_DECLARED_NOT_DEFINED
    01308 #else
    01309 #  if defined(Q_OS_LINUX) && defined(Q_CC_BOR)
    01310 #    define Q_TEMPLATEDLL
    01311 #    define Q_NO_DECLARED_NOT_DEFINED
    01312 #  endif
    01313 #  undef QT_MAKEDLL /* ignore these for other platforms */
    01314 #  undef QT_DLL
    01315 #endif
    01316
    01317 #if !defined(Q_CORE_EXPORT)
    01318 #  if defined(QT_SHARED)
    01319 #    define Q_CORE_EXPORT Q_DECL_EXPORT
    01320 #    define Q_GUI_EXPORT Q_DECL_EXPORT
    01321 #    define Q_SQL_EXPORT Q_DECL_EXPORT
    01322 #    define Q_NETWORK_EXPORT Q_DECL_EXPORT
    01323 #    define Q_SVG_EXPORT Q_DECL_EXPORT
    01324 #    define Q_DECLARATIVE_EXPORT Q_DECL_EXPORT
    01325 #    define Q_OPENGL_EXPORT Q_DECL_EXPORT
    01326 #    define Q_MULTIMEDIA_EXPORT Q_DECL_EXPORT
    01327 #    define Q_OPENVG_EXPORT Q_DECL_EXPORT
    01328 #    define Q_XML_EXPORT Q_DECL_EXPORT
    01329 #    define Q_XMLPATTERNS_EXPORT Q_DECL_EXPORT
    01330 #    define Q_SCRIPT_EXPORT Q_DECL_EXPORT
    01331 #    define Q_SCRIPTTOOLS_EXPORT Q_DECL_EXPORT
    01332 #    define Q_COMPAT_EXPORT Q_DECL_EXPORT
    01333 #    define Q_DBUS_EXPORT Q_DECL_EXPORT
    01334 #  else
    01335 #    define Q_CORE_EXPORT
    01336 #    define Q_GUI_EXPORT
    01337 #    define Q_SQL_EXPORT
    01338 #    define Q_NETWORK_EXPORT
    01339 #    define Q_SVG_EXPORT
    01340 #    define Q_DECLARATIVE_EXPORT
    01341 #    define Q_OPENGL_EXPORT
    01342 #    define Q_MULTIMEDIA_EXPORT
    01343 #    define Q_XML_EXPORT
    01344 #    define Q_XMLPATTERNS_EXPORT
    01345 #    define Q_SCRIPT_EXPORT
    01346 #    define Q_SCRIPTTOOLS_EXPORT
    01347 #    define Q_COMPAT_EXPORT
    01348 #    define Q_DBUS_EXPORT
    01349 #  endif
    01350 #endif
    01351
    01352 // Functions marked as Q_GUI_EXPORT_INLINE were exported and inlined by mistake.
    01353 // Compilers like MinGW complain that the import attribute is ignored.
    01354 #if defined(Q_CC_MINGW)
    01355 #    if defined(QT_BUILD_CORE_LIB)
    01356 #      define Q_CORE_EXPORT_INLINE Q_CORE_EXPORT inline
    01357 #    else
    01358 #      define Q_CORE_EXPORT_INLINE inline
    01359 #    endif
    01360 #    if defined(QT_BUILD_GUI_LIB)
    01361 #      define Q_GUI_EXPORT_INLINE Q_GUI_EXPORT inline
    01362 #    else
    01363 #      define Q_GUI_EXPORT_INLINE inline
    01364 #    endif
    01365 #elif defined(Q_CC_RVCT)
    01366 // we force RVCT not to export inlines by passing --visibility_inlines_hidden
    01367 // so we need to just inline it, rather than exporting and inlining
    01368 // note: this affects the contents of the DEF files (ie. these functions do not appear)
    01369 #    define Q_CORE_EXPORT_INLINE inline
    01370 #    define Q_GUI_EXPORT_INLINE inline
    01371 #else
    01372 #    define Q_CORE_EXPORT_INLINE Q_CORE_EXPORT inline
    01373 #    define Q_GUI_EXPORT_INLINE Q_GUI_EXPORT inline
    01374 #endif
    01375
    01376 /*
    01377    No, this is not an evil backdoor. QT_BUILD_INTERNAL just exports more symbols
    01378    for Qt's internal unit tests. If you want slower loading times and more
    01379    symbols that can vanish from version to version, feel free to define QT_BUILD_INTERNAL.
    01380 */
    01381 #if defined(QT_BUILD_INTERNAL) && (defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)) && defined(QT_MAKEDLL)
    01382 #    define Q_AUTOTEST_EXPORT Q_DECL_EXPORT
    01383 #elif defined(QT_BUILD_INTERNAL) && (defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)) && defined(QT_DLL)
    01384 #    define Q_AUTOTEST_EXPORT Q_DECL_IMPORT
    01385 #elif defined(QT_BUILD_INTERNAL) && !(defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)) && defined(QT_SHARED)
    01386 #    define Q_AUTOTEST_EXPORT Q_DECL_EXPORT
    01387 #else
    01388 #    define Q_AUTOTEST_EXPORT
    01389 #endif
    01390
    01391 inline void qt_noop() {}
    01392
    01393 /* These wrap try/catch so we can switch off exceptions later.
    01394
    01395    Beware - do not use more than one QT_CATCH per QT_TRY, and do not use
    01396    the exception instance in the catch block.
    01397    If you can't live with those constraints, don't use these macros.
    01398    Use the QT_NO_EXCEPTIONS macro to protect your code instead.
    01399 */
    01400
    01401 #ifdef QT_BOOTSTRAPPED
    01402 #  define QT_NO_EXCEPTIONS
    01403 #endif
    01404 #if !defined(QT_NO_EXCEPTIONS) && defined(Q_CC_GNU) && !defined (__EXCEPTIONS) && !defined(Q_MOC_RUN)
    01405 #  define QT_NO_EXCEPTIONS
    01406 #endif
    01407
    01408 #ifdef QT_NO_EXCEPTIONS
    01409 #  define QT_TRY if (true)
    01410 #  define QT_CATCH(A) else
    01411 #  define QT_THROW(A) qt_noop()
    01412 #  define QT_RETHROW qt_noop()
    01413 #else
    01414 #  define QT_TRY try
    01415 #  define QT_CATCH(A) catch (A)
    01416 #  define QT_THROW(A) throw A
    01417 #  define QT_RETHROW throw
    01418 #endif
    01419
    01420 /*
    01421    System information
    01422 */
    01423
    01424 class QString;
    01425 class Q_CORE_EXPORT QSysInfo {
    01426 public:
    01427     enum Sizes {
    01428         WordSize = (sizeof(void *)<<3)
    01429     };
    01430
    01431 #if defined(QT_BUILD_QMAKE)
    01432     enum Endian {
    01433         BigEndian,
    01434         LittleEndian
    01435     };
    01436     /* needed to bootstrap qmake */
    01437     static const int ByteOrder;
    01438 #elif defined(Q_BYTE_ORDER)
    01439     enum Endian {
    01440         BigEndian,
    01441         LittleEndian
    01442
    01443 #  ifdef qdoc
    01444         , ByteOrder = <platform-dependent>
    01445 #  elif Q_BYTE_ORDER == Q_BIG_ENDIAN
    01446         , ByteOrder = BigEndian
    01447 #  elif Q_BYTE_ORDER == Q_LITTLE_ENDIAN
    01448         , ByteOrder = LittleEndian
    01449 #  else
    01450 #    error "Undefined byte order"
    01451 #  endif
    01452     };
    01453 #else
    01454 #  error "Qt not configured correctly, please run configure"
    01455 #endif
    01456 #if defined(Q_WS_WIN) || defined(Q_OS_CYGWIN)
    01457     enum WinVersion {
    01458         WV_32s      = 0x0001,
    01459         WV_95       = 0x0002,
    01460         WV_98       = 0x0003,
    01461         WV_Me       = 0x0004,
    01462         WV_DOS_based= 0x000f,
    01463
    01464         /* codenames */
    01465         WV_NT       = 0x0010,
    01466         WV_2000     = 0x0020,
    01467         WV_XP       = 0x0030,
    01468         WV_2003     = 0x0040,
    01469         WV_VISTA    = 0x0080,
    01470         WV_WINDOWS7 = 0x0090,
    01471         WV_NT_based = 0x00f0,
    01472
    01473         /* version numbers */
    01474         WV_4_0      = WV_NT,
    01475         WV_5_0      = WV_2000,
    01476         WV_5_1      = WV_XP,
    01477         WV_5_2      = WV_2003,
    01478         WV_6_0      = WV_VISTA,
    01479         WV_6_1      = WV_WINDOWS7,
    01480
    01481         WV_CE       = 0x0100,
    01482         WV_CENET    = 0x0200,
    01483         WV_CE_5     = 0x0300,
    01484         WV_CE_6     = 0x0400,
    01485         WV_CE_based = 0x0f00
    01486     };
    01487     static const WinVersion WindowsVersion;
    01488     static WinVersion windowsVersion();
    01489
    01490 #endif
    01491 #ifdef Q_OS_MAC
    01492     enum MacVersion {
    01493         MV_Unknown = 0x0000,
    01494
    01495         /* version */
    01496         MV_9 = 0x0001,
    01497         MV_10_0 = 0x0002,
    01498         MV_10_1 = 0x0003,
    01499         MV_10_2 = 0x0004,
    01500         MV_10_3 = 0x0005,
    01501         MV_10_4 = 0x0006,
    01502         MV_10_5 = 0x0007,
    01503         MV_10_6 = 0x0008,
    01504
    01505         /* codenames */
    01506         MV_CHEETAH = MV_10_0,
    01507         MV_PUMA = MV_10_1,
    01508         MV_JAGUAR = MV_10_2,
    01509         MV_PANTHER = MV_10_3,
    01510         MV_TIGER = MV_10_4,
    01511         MV_LEOPARD = MV_10_5,
    01512         MV_SNOWLEOPARD = MV_10_6
    01513     };
    01514     static const MacVersion MacintoshVersion;
    01515 #endif
    01516 #ifdef Q_OS_SYMBIAN
    01517     enum SymbianVersion {
    01518         SV_Unknown = 1000000, // Assume unknown is something newer than what is supported
    01519         //These are the Symbian Ltd versions 9.2-9.4
    01520         SV_9_2 = 10,
    01521         SV_9_3 = 20,
    01522         SV_9_4 = 30,
    01523         //Following values are the symbian foundation versions, i.e. Symbian^1 == SV_SF_1
    01524         SV_SF_1 = SV_9_4,
    01525         SV_SF_2 = 40,
    01526         SV_SF_3 = 50,
    01527         SV_SF_4 = 60
    01528     };
    01529     static SymbianVersion symbianVersion();
    01530     enum S60Version {
    01531         SV_S60_None = 0,
    01532         SV_S60_Unknown = SV_Unknown,
    01533         SV_S60_3_1 = SV_9_2,
    01534         SV_S60_3_2 = SV_9_3,
    01535         SV_S60_5_0 = SV_9_4,
    01536         //versions beyond 5.0 are to be confirmed - it is better to use symbian version
    01537         SV_S60_5_1 = SV_SF_2,
    01538         SV_S60_5_2 = SV_SF_3
    01539     };
    01540     static S60Version s60Version();
    01541 #endif
    01542 };
    01543
    01544 Q_CORE_EXPORT const char *qVersion();
    01545 Q_CORE_EXPORT bool qSharedBuild();
    01546
    01547 #if defined(Q_OS_MAC)
    01548 inline int qMacVersion() { return QSysInfo::MacintoshVersion; }
    01549 #endif
    01550
    01551 #ifdef QT3_SUPPORT
    01552 inline QT3_SUPPORT bool qSysInfo(int *wordSize, bool *bigEndian)
    01553 {
    01554     *wordSize = QSysInfo::WordSize;
    01555     *bigEndian = (QSysInfo::ByteOrder == QSysInfo::BigEndian);
    01556     return true;
    01557 }
    01558 #endif
    01559
    01560 #if defined(Q_WS_WIN) || defined(Q_OS_CYGWIN)
    01561 #if defined(QT3_SUPPORT)
    01562 inline QT3_SUPPORT bool qt_winUnicode() { return true; }
    01563 inline QT3_SUPPORT int qWinVersion() { return QSysInfo::WindowsVersion; }
    01564 #endif
    01565
    01566 // ### Qt 5: remove Win9x support macros QT_WA and QT_WA_INLINE.
    01567 #define QT_WA(unicode, ansi) unicode
    01568 #define QT_WA_INLINE(unicode, ansi) (unicode)
    01569
    01570 #endif /* Q_WS_WIN */
    01571
    01572 #ifndef Q_OUTOFLINE_TEMPLATE
    01573 #  define Q_OUTOFLINE_TEMPLATE
    01574 #endif
    01575 #ifndef Q_INLINE_TEMPLATE
    01576 #  define Q_INLINE_TEMPLATE inline
    01577 #endif
    01578
    01579 #ifndef Q_TYPENAME
    01580 #  define Q_TYPENAME typename
    01581 #endif
    01582
    01583 /*
    01584    Avoid "unused parameter" warnings
    01585 */
    01586
    01587 #if defined(Q_CC_INTEL) && !defined(Q_OS_WIN) || defined(Q_CC_RVCT)
    01588 template <typename T>
    01589 inline void qUnused(T &x) { (void)x; }
    01590 #  define Q_UNUSED(x) qUnused(x);
    01591 #else
    01592 #  define Q_UNUSED(x) (void)x;
    01593 #endif
    01594
    01595 /*
    01596    Debugging and error handling
    01597 */
    01598
    01599 /*
    01600    On Symbian we do not know beforehand whether we are compiling in
    01601    release or debug mode, so check the Symbian build define here,
    01602    and set the QT_NO_DEBUG define appropriately.
    01603 */
    01604 #if defined(Q_OS_SYMBIAN) && defined(NDEBUG) && !defined(QT_NO_DEBUG)
    01605 #  define QT_NO_DEBUG
    01606 #endif
    01607
    01608 #if !defined(QT_NO_DEBUG) && !defined(QT_DEBUG)
    01609 #  define QT_DEBUG
    01610 #endif
    01611
    01612 #ifndef qPrintable
    01613 #  define qPrintable(string) (string).toLocal8Bit().constData()
    01614 #endif
    01615
    01616 Q_CORE_EXPORT void qDebug(const char *, ...) /* print debug message */
    01617 #if defined(Q_CC_GNU) && !defined(__INSURE__)
    01618     __attribute__ ((format (printf, 1, 2)))
    01619 #endif
    01620 ;
    01621
    01622 Q_CORE_EXPORT void qWarning(const char *, ...) /* print warning message */
    01623 #if defined(Q_CC_GNU) && !defined(__INSURE__)
    01624     __attribute__ ((format (printf, 1, 2)))
    01625 #endif
    01626 ;
    01627
    01628 class QString;
    01629 Q_CORE_EXPORT QString qt_error_string(int errorCode = -1);
    01630 Q_CORE_EXPORT void qCritical(const char *, ...) /* print critical message */
    01631 #if defined(Q_CC_GNU) && !defined(__INSURE__)
    01632     __attribute__ ((format (printf, 1, 2)))
    01633 #endif
    01634 ;
    01635 Q_CORE_EXPORT void qFatal(const char *, ...) /* print fatal message and exit */
    01636 #if defined(Q_CC_GNU) && !defined(__INSURE__)
    01637     __attribute__ ((format (printf, 1, 2)))
    01638 #endif
    01639 ;
    01640
    01641 #ifdef QT3_SUPPORT
    01642 Q_CORE_EXPORT QT3_SUPPORT void qSystemWarning(const char *msg, int code = -1);
    01643 #endif /* QT3_SUPPORT */
    01644 Q_CORE_EXPORT void qErrnoWarning(int code, const char *msg, ...);
    01645 Q_CORE_EXPORT void qErrnoWarning(const char *msg, ...);
    01646
    01647 #if (defined(QT_NO_DEBUG_OUTPUT) || defined(QT_NO_TEXTSTREAM)) && !defined(QT_NO_DEBUG_STREAM)
    01648 #define QT_NO_DEBUG_STREAM
    01649 #endif
    01650
    01651 /*
    01652   Forward declarations only.
    01653
    01654   In order to use the qDebug() stream, you must #include<QDebug>
    01655 */
    01656 class QDebug;
    01657 class QNoDebug;
    01658 #ifndef QT_NO_DEBUG_STREAM
    01659 Q_CORE_EXPORT_INLINE QDebug qDebug();
    01660 Q_CORE_EXPORT_INLINE QDebug qWarning();
    01661 Q_CORE_EXPORT_INLINE QDebug qCritical();
    01662 #else
    01663 inline QNoDebug qDebug();
    01664 #endif
    01665
    01666 #define QT_NO_QDEBUG_MACRO while (false) qDebug
    01667 #ifdef QT_NO_DEBUG_OUTPUT
    01668 #  define qDebug QT_NO_QDEBUG_MACRO
    01669 #endif
    01670 #define QT_NO_QWARNING_MACRO while (false) qWarning
    01671 #ifdef QT_NO_WARNING_OUTPUT
    01672 #  define qWarning QT_NO_QWARNING_MACRO
    01673 #endif
    01674
    01675
    01676 Q_CORE_EXPORT void qt_assert(const char *assertion, const char *file, int line);
    01677
    01678 #if !defined(Q_ASSERT)
    01679 #  ifndef QT_NO_DEBUG
    01680 #    define Q_ASSERT(cond) ((!(cond)) ? qt_assert(#cond,__FILE__,__LINE__) : qt_noop())
    01681 #  else
    01682 #    define Q_ASSERT(cond) qt_noop()
    01683 #  endif
    01684 #endif
    01685
    01686 #if defined(QT_NO_DEBUG) && !defined(QT_PAINT_DEBUG)
    01687 #define QT_NO_PAINT_DEBUG
    01688 #endif
    01689
    01690 Q_CORE_EXPORT void qt_assert_x(const char *where, const char *what, const char *file, int line);
    01691
    01692 #if !defined(Q_ASSERT_X)
    01693 #  ifndef QT_NO_DEBUG
    01694 #    define Q_ASSERT_X(cond, where, what) ((!(cond)) ? qt_assert_x(where, what,__FILE__,__LINE__) : qt_noop())
    01695 #  else
    01696 #    define Q_ASSERT_X(cond, where, what) qt_noop()
    01697 #  endif
    01698 #endif
    01699
    01700 Q_CORE_EXPORT void qt_check_pointer(const char *, int);
    01701 Q_CORE_EXPORT void qBadAlloc();
    01702
    01703 #ifdef QT_NO_EXCEPTIONS
    01704 #  if defined(QT_NO_DEBUG)
    01705 #    define Q_CHECK_PTR(p) qt_noop();
    01706 #  else
    01707 #    define Q_CHECK_PTR(p) do {if(!(p))qt_check_pointer(__FILE__,__LINE__);} while (0)
    01708 #  endif
    01709 #else
    01710 #  define Q_CHECK_PTR(p) do { if (!(p)) qBadAlloc(); } while (0)
    01711 #endif
    01712
    01713 template <typename T>
    01714 inline T *q_check_ptr(T *p) { Q_CHECK_PTR(p); return p; }
    01715
    01716 #if (defined(Q_CC_GNU) && !defined(Q_OS_SOLARIS)) || defined(Q_CC_HPACC) || defined(Q_CC_DIAB)
    01717 #  define Q_FUNC_INFO __PRETTY_FUNCTION__
    01718 #elif defined(_MSC_VER)
    01719     /* MSVC 2002 doesn't have __FUNCSIG__ nor can it handle QT_STRINGIFY. */
    01720 #  if _MSC_VER <= 1300
    01721 #      define Q_FUNC_INFO __FILE__ "(line number unavailable)"
    01722 #  else
    01723 #      define Q_FUNC_INFO __FUNCSIG__
    01724 #  endif
    01725 #else
    01726 #   if defined(Q_OS_SOLARIS) || defined(Q_CC_XLC) || defined(Q_OS_SYMBIAN)
    01727 #      define Q_FUNC_INFO __FILE__ "(line number unavailable)"
    01728 #   else
    01729         /* These two macros makes it possible to turn the builtin line expander into a
    01730          * string literal. */
    01731 #       define QT_STRINGIFY2(x) #x
    01732 #       define QT_STRINGIFY(x) QT_STRINGIFY2(x)
    01733 #       define Q_FUNC_INFO __FILE__ ":" QT_STRINGIFY(__LINE__)
    01734 #   endif
    01735     /* The MIPSpro and RVCT compilers postpones macro expansion,
    01736        and therefore macros must be in scope when being used. */
    01737 #   if !defined(Q_CC_MIPS) && !defined(Q_CC_RVCT) && !defined(Q_CC_NOKIAX86)
    01738 #       undef QT_STRINGIFY2
    01739 #       undef QT_STRINGIFY
    01740 #   endif
    01741 #endif
    01742
    01743 enum QtMsgType { QtDebugMsg, QtWarningMsg, QtCriticalMsg, QtFatalMsg, QtSystemMsg = QtCriticalMsg };
    01744
    01745 Q_CORE_EXPORT void qt_message_output(QtMsgType, const char *buf);
    01746
    01747 typedef void (*QtMsgHandler)(QtMsgType, const char *);
    01748 Q_CORE_EXPORT QtMsgHandler qInstallMsgHandler(QtMsgHandler);
    01749
    01750 #ifdef QT3_SUPPORT
    01751 inline QT3_SUPPORT void qSuppressObsoleteWarnings(bool = true) {}
    01752 inline QT3_SUPPORT void qObsolete(const char *, const char * = 0, const char * = 0) {}
    01753 #endif
    01754
    01755 #if defined(QT_NO_THREAD)
    01756
    01757 template <typename T>
    01758 class QGlobalStatic
    01759 {
    01760 public:
    01761     T *pointer;
    01762     inline QGlobalStatic(T *p) : pointer(p) { }
    01763     inline ~QGlobalStatic() { pointer = 0; }
    01764 };
    01765
    01766 #define Q_GLOBAL_STATIC(TYPE, NAME)                              \
    01767     static TYPE *NAME()                                          \
    01768     {                                                            \
    01769         static TYPE this_##NAME;                                 \
    01770         static QGlobalStatic<TYPE > global_##NAME(&this_##NAME); \
    01771         return global_##NAME.pointer;                            \
    01772     }
    01773
    01774 #define Q_GLOBAL_STATIC_WITH_ARGS(TYPE, NAME, ARGS)              \
    01775     static TYPE *NAME()                                          \
    01776     {                                                            \
    01777         static TYPE this_##NAME ARGS;                            \
    01778         static QGlobalStatic<TYPE > global_##NAME(&this_##NAME); \
    01779         return global_##NAME.pointer;                            \
    01780     }
    01781
    01782 #define Q_GLOBAL_STATIC_WITH_INITIALIZER(TYPE, NAME, INITIALIZER) \
    01783     static TYPE *NAME()                                           \
    01784     {                                                             \
    01785         static TYPE this_##NAME;                                  \
    01786         static QGlobalStatic<TYPE > global_##NAME(0);             \
    01787         if (!global_##NAME.pointer) {                             \
    01788             TYPE *x = global_##NAME.pointer = &this_##NAME;       \
    01789             INITIALIZER;                                          \
    01790         }                                                         \
    01791         return global_##NAME.pointer;                             \
    01792     }
    01793
    01794 #else
    01795
    01796 // forward declaration, since qatomic.h needs qglobal.h
    01797 template <typename T> class QBasicAtomicPointer;
    01798
    01799 // POD for Q_GLOBAL_STATIC
    01800 template <typename T>
    01801 class QGlobalStatic
    01802 {
    01803 public:
    01804     QBasicAtomicPointer<T> pointer;
    01805     bool destroyed;
    01806 };
    01807
    01808 // Created as a function-local static to delete a QGlobalStatic<T>
    01809 template <typename T>
    01810 class QGlobalStaticDeleter
    01811 {
    01812 public:
    01813     QGlobalStatic<T> &globalStatic;
    01814     QGlobalStaticDeleter(QGlobalStatic<T> &_globalStatic)
    01815         : globalStatic(_globalStatic)
    01816     { }
    01817
    01818     inline ~QGlobalStaticDeleter()
    01819     {
    01820         delete globalStatic.pointer;
    01821         globalStatic.pointer = 0;
    01822         globalStatic.destroyed = true;
    01823     }
    01824 };
    01825
    01826 #define Q_GLOBAL_STATIC_INIT(TYPE, NAME)                              \
    01827     static QGlobalStatic<TYPE > this_##NAME = { Q_BASIC_ATOMIC_INITIALIZER(0), false }
    01828
    01829 #define Q_GLOBAL_STATIC(TYPE, NAME)                                     \
    01830     Q_GLOBAL_STATIC_INIT(TYPE, NAME);                                   \
    01831     static TYPE *NAME()                                                 \
    01832     {                                                                   \
    01833         if (!this_##NAME.pointer && !this_##NAME.destroyed) {           \
    01834             TYPE *x = new TYPE;                                         \
    01835             if (!this_##NAME.pointer.testAndSetOrdered(0, x))           \
    01836                 delete x;                                               \
    01837             else                                                        \
    01838                 static QGlobalStaticDeleter<TYPE > cleanup(this_##NAME); \
    01839         }                                                               \
    01840         return this_##NAME.pointer;                                     \
    01841     }
    01842
    01843 #define Q_GLOBAL_STATIC_WITH_ARGS(TYPE, NAME, ARGS)                     \
    01844     Q_GLOBAL_STATIC_INIT(TYPE, NAME);                                   \
    01845     static TYPE *NAME()                                                 \
    01846     {                                                                   \
    01847         if (!this_##NAME.pointer && !this_##NAME.destroyed) {           \
    01848             TYPE *x = new TYPE ARGS;                                    \
    01849             if (!this_##NAME.pointer.testAndSetOrdered(0, x))           \
    01850                 delete x;                                               \
    01851             else                                                        \
    01852                 static QGlobalStaticDeleter<TYPE > cleanup(this_##NAME); \
    01853         }                                                               \
    01854         return this_##NAME.pointer;                                     \
    01855     }
    01856
    01857 #define Q_GLOBAL_STATIC_WITH_INITIALIZER(TYPE, NAME, INITIALIZER)       \
    01858     Q_GLOBAL_STATIC_INIT(TYPE, NAME);                                   \
    01859     static TYPE *NAME()                                                 \
    01860     {                                                                   \
    01861         if (!this_##NAME.pointer && !this_##NAME.destroyed) {           \
    01862             QScopedPointer<TYPE > x(new TYPE);                          \
    01863             INITIALIZER;                                                \
    01864             if (this_##NAME.pointer.testAndSetOrdered(0, x.data())) {   \
    01865                 static QGlobalStaticDeleter<TYPE > cleanup(this_##NAME); \
    01866                 x.take();                                               \
    01867             }                                                           \
    01868         }                                                               \
    01869         return this_##NAME.pointer;                                     \
    01870     }
    01871
    01872 #endif
    01873
    01874 class QBool
    01875 {
    01876     bool b;
    01877
    01878 public:
    01879     inline explicit QBool(bool B) : b(B) {}
    01880     inline operator const void *() const
    01881     { return b ? static_cast<const void *>(this) : static_cast<const void *>(0); }
    01882 };
    01883
    01884 inline bool operator==(QBool b1, bool b2) { return !b1 == !b2; }
    01885 inline bool operator==(bool b1, QBool b2) { return !b1 == !b2; }
    01886 inline bool operator==(QBool b1, QBool b2) { return !b1 == !b2; }
    01887 inline bool operator!=(QBool b1, bool b2) { return !b1 != !b2; }
    01888 inline bool operator!=(bool b1, QBool b2) { return !b1 != !b2; }
    01889 inline bool operator!=(QBool b1, QBool b2) { return !b1 != !b2; }
    01890
    01891 static inline bool qFuzzyCompare(double p1, double p2)
    01892 {
    01893     return (qAbs(p1 - p2) <= 0.000000000001 * qMin(qAbs(p1), qAbs(p2)));
    01894 }
    01895
    01896 static inline bool qFuzzyCompare(float p1, float p2)
    01897 {
    01898     return (qAbs(p1 - p2) <= 0.00001f * qMin(qAbs(p1), qAbs(p2)));
    01899 }
    01900
    01904 static inline bool qFuzzyIsNull(double d)
    01905 {
    01906     return qAbs(d) <= 0.000000000001;
    01907 }
    01908
    01912 static inline bool qFuzzyIsNull(float f)
    01913 {
    01914     return qAbs(f) <= 0.00001f;
    01915 }
    01916
    01917 /*
    01918    This function tests a double for a null value. It doesn't
    01919    check whether the actual value is 0 or close to 0, but whether
    01920    it is binary 0.
    01921 */
    01922 static inline bool qIsNull(double d)
    01923 {
    01924     union U {
    01925         double d;
    01926         quint64 u;
    01927     };
    01928     U val;
    01929     val.d = d;
    01930     return val.u == quint64(0);
    01931 }
    01932
    01933 /*
    01934    This function tests a float for a null value. It doesn't
    01935    check whether the actual value is 0 or close to 0, but whether
    01936    it is binary 0.
    01937 */
    01938 static inline bool qIsNull(float f)
    01939 {
    01940     union U {
    01941         float f;
    01942         quint32 u;
    01943     };
    01944     U val;
    01945     val.f = f;
    01946     return val.u == 0u;
    01947 }
    01948
    01949 /*
    01950    Compilers which follow outdated template instantiation rules
    01951    require a class to have a comparison operator to exist when
    01952    a QList of this type is instantiated. It's not actually
    01953    used in the list, though. Hence the dummy implementation.
    01954    Just in case other code relies on it we better trigger a warning
    01955    mandating a real implementation.
    01956 */
    01957
    01958 #ifdef Q_FULL_TEMPLATE_INSTANTIATION
    01959 #  define Q_DUMMY_COMPARISON_OPERATOR(C) \
    01960     bool operator==(const C&) const { \
    01961         qWarning(#C"::operator==(const "#C"&) was called"); \
    01962         return false; \
    01963     }
    01964 #else
    01965 #  define Q_DUMMY_COMPARISON_OPERATOR(C)
    01966 #endif
    01967
    01968
    01969 /*
    01970    QTypeInfo     - type trait functionality
    01971    qIsDetached   - data sharing functionality
    01972 */
    01973
    01974 #ifndef QT_NO_PARTIAL_TEMPLATE_SPECIALIZATION
    01975
    01976 /*
    01977   The catch-all template.
    01978 */
    01979
    01980 template <typename T> inline bool qIsDetached(T &) { return true; }
    01981
    01982 template <typename T>
    01983 class QTypeInfo
    01984 {
    01985 public:
    01986     enum {
    01987         isPointer = false,
    01988         isComplex = true,
    01989         isStatic = true,
    01990         isLarge = (sizeof(T)>sizeof(void*)),
    01991         isDummy = false
    01992     };
    01993 };
    01994
    01995 template <typename T>
    01996 class QTypeInfo<T*>
    01997 {
    01998 public:
    01999     enum {
    02000         isPointer = true,
    02001         isComplex = false,
    02002         isStatic = false,
    02003         isLarge = false,
    02004         isDummy = false
    02005     };
    02006 };
    02007
    02008 #else
    02009
    02010 template <typename T> char QTypeInfoHelper(T*(*)());
    02011 void* QTypeInfoHelper(...);
    02012
    02013 template <typename T> inline bool qIsDetached(T &) { return true; }
    02014
    02015 template <typename T>
    02016 class QTypeInfo
    02017 {
    02018 public:
    02019     enum {
    02020         isPointer = (1 == sizeof(QTypeInfoHelper((T(*)())0))),
    02021         isComplex = !isPointer,
    02022         isStatic = !isPointer,
    02023         isLarge = (sizeof(T)>sizeof(void*)),
    02024         isDummy = false
    02025     };
    02026 };
    02027
    02028 #endif /* QT_NO_PARTIAL_TEMPLATE_SPECIALIZATION */
    02029
    02030 /*
    02031    Specialize a specific type with:
    02032
    02033      Q_DECLARE_TYPEINFO(type, flags);
    02034
    02035    where 'type' is the name of the type to specialize and 'flags' is
    02036    logically-OR'ed combination of the flags below.
    02037 */
    02038 enum { /* TYPEINFO flags */
    02039     Q_COMPLEX_TYPE = 0,
    02040     Q_PRIMITIVE_TYPE = 0x1,
    02041     Q_STATIC_TYPE = 0,
    02042     Q_MOVABLE_TYPE = 0x2,
    02043     Q_DUMMY_TYPE = 0x4
    02044 };
    02045
    02046 #define Q_DECLARE_TYPEINFO(TYPE, FLAGS) \
    02047 template <> \
    02048 class QTypeInfo<TYPE > \
    02049 { \
    02050 public: \
    02051     enum { \
    02052         isComplex = (((FLAGS) & Q_PRIMITIVE_TYPE) == 0), \
    02053         isStatic = (((FLAGS) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), \
    02054         isLarge = (sizeof(TYPE)>sizeof(void*)), \
    02055         isPointer = false, \
    02056         isDummy = (((FLAGS) & Q_DUMMY_TYPE) != 0) \
    02057     }; \
    02058     static inline const char *name() { return #TYPE; } \
    02059 }
    02060
    02061 template <typename T>
    02062 inline void qSwap(T &value1, T &value2)
    02063 {
    02064     const T t = value1;
    02065     value1 = value2;
    02066     value2 = t;
    02067 }
    02068
    02069 /*
    02070    Specialize a shared type with:
    02071
    02072      Q_DECLARE_SHARED(type);
    02073
    02074    where 'type' is the name of the type to specialize.  NOTE: shared
    02075    types must declare a 'bool isDetached(void) const;' member for this
    02076    to work.
    02077 */
    02078 #define Q_DECLARE_SHARED(TYPE)                                          \
    02079 template <> inline bool qIsDetached<TYPE>(TYPE &t) { return t.isDetached(); } \
    02080 template <> inline void qSwap<TYPE>(TYPE &value1, TYPE &value2) \
    02081 { \
    02082     qSwap(value1.data_ptr(), value2.data_ptr()); \
    02083 }
    02084
    02085 /*
    02086    QTypeInfo primitive specializations
    02087 */
    02088 Q_DECLARE_TYPEINFO(bool, Q_PRIMITIVE_TYPE);
    02089 Q_DECLARE_TYPEINFO(char, Q_PRIMITIVE_TYPE);
    02090 Q_DECLARE_TYPEINFO(signed char, Q_PRIMITIVE_TYPE);
    02091 Q_DECLARE_TYPEINFO(uchar, Q_PRIMITIVE_TYPE);
    02092 Q_DECLARE_TYPEINFO(short, Q_PRIMITIVE_TYPE);
    02093 Q_DECLARE_TYPEINFO(ushort, Q_PRIMITIVE_TYPE);
    02094 Q_DECLARE_TYPEINFO(int, Q_PRIMITIVE_TYPE);
    02095 Q_DECLARE_TYPEINFO(uint, Q_PRIMITIVE_TYPE);
    02096 Q_DECLARE_TYPEINFO(long, Q_PRIMITIVE_TYPE);
    02097 Q_DECLARE_TYPEINFO(ulong, Q_PRIMITIVE_TYPE);
    02098 Q_DECLARE_TYPEINFO(qint64, Q_PRIMITIVE_TYPE);
    02099 Q_DECLARE_TYPEINFO(quint64, Q_PRIMITIVE_TYPE);
    02100 Q_DECLARE_TYPEINFO(float, Q_PRIMITIVE_TYPE);
    02101 Q_DECLARE_TYPEINFO(double, Q_PRIMITIVE_TYPE);
    02102 #ifndef Q_OS_DARWIN
    02103 Q_DECLARE_TYPEINFO(long double, Q_PRIMITIVE_TYPE);
    02104 #endif
    02105
    02106 /*
    02107    These functions make it possible to use standard C++ functions with
    02108    a similar name from Qt header files (especially template classes).
    02109 */
    02110 Q_CORE_EXPORT void *qMalloc(size_t size);
    02111 Q_CORE_EXPORT void qFree(void *ptr);
    02112 Q_CORE_EXPORT void *qRealloc(void *ptr, size_t size);
    02113 Q_CORE_EXPORT void *qMallocAligned(size_t size, size_t alignment);
    02114 Q_CORE_EXPORT void *qReallocAligned(void *ptr, size_t size, size_t oldsize, size_t alignment);
    02115 Q_CORE_EXPORT void qFreeAligned(void *ptr);
    02116 Q_CORE_EXPORT void *qMemCopy(void *dest, const void *src, size_t n);
    02117 Q_CORE_EXPORT void *qMemSet(void *dest, int c, size_t n);
    02118
    02119
    02120 /*
    02121    Avoid some particularly useless warnings from some stupid compilers.
    02122    To get ALL C++ compiler warnings, define QT_CC_WARNINGS or comment out
    02123    the line "#define QT_NO_WARNINGS".
    02124 */
    02125 #if !defined(QT_CC_WARNINGS)
    02126 #  define QT_NO_WARNINGS
    02127 #endif
    02128 #if defined(QT_NO_WARNINGS)
    02129 #  if defined(Q_CC_MSVC)
    02130 #    pragma warning(disable: 4251) /* class 'A' needs to have dll interface for to be used by clients of class 'B'. */
    02131 #    pragma warning(disable: 4244) /* 'conversion' conversion from 'type1' to 'type2', possible loss of data */
    02132 #    pragma warning(disable: 4275) /* non - DLL-interface classkey 'identifier' used as base for DLL-interface classkey 'identifier' */
    02133 #    pragma warning(disable: 4514) /* unreferenced inline/local function has been removed */
    02134 #    pragma warning(disable: 4800) /* 'type' : forcing value to bool 'true' or 'false' (performance warning) */
    02135 #    pragma warning(disable: 4097) /* typedef-name 'identifier1' used as synonym for class-name 'identifier2' */
    02136 #    pragma warning(disable: 4706) /* assignment within conditional expression */
    02137 #    pragma warning(disable: 4786) /* truncating debug info after 255 characters */
    02138 #    pragma warning(disable: 4660) /* template-class specialization 'identifier' is already instantiated */
    02139 #    pragma warning(disable: 4355) /* 'this' : used in base member initializer list */
    02140 #    pragma warning(disable: 4231) /* nonstandard extension used : 'extern' before template explicit instantiation */
    02141 #    pragma warning(disable: 4710) /* function not inlined */
    02142 #    pragma warning(disable: 4530) /* C++ exception handler used, but unwind semantics are not enabled. Specify -GX */
    02143 #    if _MSC_VER < 1300
    02144 #      pragma warning(disable: 4284) /* return type for 'type1::operator ->' is 'type2 *' */
    02145                                      /* (ie; not a UDT or reference to a UDT.  Will produce errors if applied using infix notation) */
    02146 #    endif
    02147 #  elif defined(Q_CC_BOR)
    02148 #    pragma option -w-inl
    02149 #    pragma option -w-aus
    02150 #    pragma warn -inl
    02151 #    pragma warn -pia
    02152 #    pragma warn -ccc
    02153 #    pragma warn -rch
    02154 #    pragma warn -sig
    02155 #  endif
    02156 #endif
    02157
    02158 class Q_CORE_EXPORT QFlag
    02159 {
    02160     int i;
    02161 public:
    02162     inline QFlag(int i);
    02163     inline operator int() const { return i; }
    02164 };
    02165
    02166 inline QFlag::QFlag(int ai) : i(ai) {}
    02167
    02168 class Q_CORE_EXPORT QIncompatibleFlag
    02169 {
    02170     int i;
    02171 public:
    02172     inline explicit QIncompatibleFlag(int i);
    02173     inline operator int() const { return i; }
    02174 };
    02175
    02176 inline QIncompatibleFlag::QIncompatibleFlag(int ai) : i(ai) {}
    02177
    02178
    02179 #ifndef Q_NO_TYPESAFE_FLAGS
    02180
    02181 template<typename Enum>
    02182 class QFlags
    02183 {
    02184     typedef void **Zero;
    02185     int i;
    02186 public:
    02187     typedef Enum enum_type;
    02188     inline QFlags(const QFlags &f) : i(f.i) {}
    02189     inline QFlags(Enum f) : i(f) {}
    02190     inline QFlags(Zero = 0) : i(0) {}
    02191     inline QFlags(QFlag f) : i(f) {}
    02192
    02193     inline QFlags &operator=(const QFlags &f) { i = f.i; return *this; }
    02194     inline QFlags &operator&=(int mask) { i &= mask; return *this; }
    02195     inline QFlags &operator&=(uint mask) { i &= mask; return *this; }
    02196     inline QFlags &operator|=(QFlags f) { i |= f.i; return *this; }
    02197     inline QFlags &operator|=(Enum f) { i |= f; return *this; }
    02198     inline QFlags &operator^=(QFlags f) { i ^= f.i; return *this; }
    02199     inline QFlags &operator^=(Enum f) { i ^= f; return *this; }
    02200
    02201     inline operator int() const { return i; }
    02202
    02203     inline QFlags operator|(QFlags f) const { QFlags g; g.i = i | f.i; return g; }
    02204     inline QFlags operator|(Enum f) const { QFlags g; g.i = i | f; return g; }
    02205     inline QFlags operator^(QFlags f) const { QFlags g; g.i = i ^ f.i; return g; }
    02206     inline QFlags operator^(Enum f) const { QFlags g; g.i = i ^ f; return g; }
    02207     inline QFlags operator&(int mask) const { QFlags g; g.i = i & mask; return g; }
    02208     inline QFlags operator&(uint mask) const { QFlags g; g.i = i & mask; return g; }
    02209     inline QFlags operator&(Enum f) const { QFlags g; g.i = i & f; return g; }
    02210     inline QFlags operator~() const { QFlags g; g.i = ~i; return g; }
    02211
    02212     inline bool operator!() const { return !i; }
    02213
    02214     inline bool testFlag(Enum f) const { return (i & f) == f && (f != 0 || i == int(f) ); }
    02215 };
    02216
    02217 #define Q_DECLARE_FLAGS(Flags, Enum)\
    02218 typedef QFlags<Enum> Flags;
    02219
    02220 #if defined Q_CC_MSVC && _MSC_VER < 1300
    02221 # define Q_DECLARE_INCOMPATIBLE_FLAGS(Flags)
    02222 #else
    02223 # define Q_DECLARE_INCOMPATIBLE_FLAGS(Flags) \
    02224 inline QIncompatibleFlag operator|(Flags::enum_type f1, int f2) \
    02225 { return QIncompatibleFlag(int(f1) | f2); }
    02226 #endif
    02227
    02228 #define Q_DECLARE_OPERATORS_FOR_FLAGS(Flags) \
    02229 inline QFlags<Flags::enum_type> operator|(Flags::enum_type f1, Flags::enum_type f2) \
    02230 { return QFlags<Flags::enum_type>(f1) | f2; } \
    02231 inline QFlags<Flags::enum_type> operator|(Flags::enum_type f1, QFlags<Flags::enum_type> f2) \
    02232 { return f2 | f1; } Q_DECLARE_INCOMPATIBLE_FLAGS(Flags)
    02233
    02234
    02235 #else /* Q_NO_TYPESAFE_FLAGS */
    02236
    02237 #define Q_DECLARE_FLAGS(Flags, Enum)\
    02238 typedef uint Flags;
    02239 #define Q_DECLARE_OPERATORS_FOR_FLAGS(Flags)
    02240
    02241 #endif /* Q_NO_TYPESAFE_FLAGS */
    02242
    02243 #if defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && !defined(Q_CC_RVCT)
    02244 /* make use of typeof-extension */
    02245 template <typename T>
    02246 class QForeachContainer {
    02247 public:
    02248     inline QForeachContainer(const T& t) : c(t), brk(0), i(c.begin()), e(c.end()) { }
    02249     const T c;
    02250     int brk;
    02251     typename T::const_iterator i, e;
    02252 };
    02253
    02254 #define Q_FOREACH(variable, container)                                \
    02255 for (QForeachContainer<__typeof__(container)> _container_(container); \
    02256      !_container_.brk && _container_.i != _container_.e;              \
    02257      __extension__  ({ ++_container_.brk; ++_container_.i; }))                       \
    02258     for (variable = *_container_.i;; __extension__ ({--_container_.brk; break;}))
    02259
    02260 #else
    02261
    02262 struct QForeachContainerBase {};
    02263
    02264 template <typename T>
    02265 class QForeachContainer : public QForeachContainerBase {
    02266 public:
    02267     inline QForeachContainer(const T& t): c(t), brk(0), i(c.begin()), e(c.end()){};
    02268     const T c;
    02269     mutable int brk;
    02270     mutable typename T::const_iterator i, e;
    02271     inline bool condition() const { return (!brk++ && i != e); }
    02272 };
    02273
    02274 template <typename T> inline T *qForeachPointer(const T &) { return 0; }
    02275
    02276 template <typename T> inline QForeachContainer<T> qForeachContainerNew(const T& t)
    02277 { return QForeachContainer<T>(t); }
    02278
    02279 template <typename T>
    02280 inline const QForeachContainer<T> *qForeachContainer(const QForeachContainerBase *base, const T *)
    02281 { return static_cast<const QForeachContainer<T> *>(base); }
    02282
    02283 #if (defined(Q_CC_MSVC) && !defined(Q_CC_MSVC_NET) && !defined(Q_CC_INTEL)) || defined(Q_CC_MIPS)
    02284 /*
    02285    Proper for-scoping in VC++6 and MIPSpro CC
    02286 */
    02287 #  define Q_FOREACH(variable,container)                                                             \
    02288     if(0){}else                                                                                     \
    02289     for (const QForeachContainerBase &_container_ = qForeachContainerNew(container);                \
    02290          qForeachContainer(&_container_, true ? 0 : qForeachPointer(container))->condition();       \
    02291          ++qForeachContainer(&_container_, true ? 0 : qForeachPointer(container))->i)               \
    02292         for (variable = *qForeachContainer(&_container_, true ? 0 : qForeachPointer(container))->i; \
    02293              qForeachContainer(&_container_, true ? 0 : qForeachPointer(container))->brk;           \
    02294              --qForeachContainer(&_container_, true ? 0 : qForeachPointer(container))->brk)
    02295
    02296 #elif defined(Q_CC_DIAB)
    02297 // VxWorks DIAB generates unresolvable symbols, if container is a function call
    02298 #  define Q_FOREACH(variable,container)                                                             \
    02299     if(0){}else                                                                                     \
    02300     for (const QForeachContainerBase &_container_ = qForeachContainerNew(container);                \
    02301          qForeachContainer(&_container_, (__typeof__(container) *) 0)->condition();       \
    02302          ++qForeachContainer(&_container_, (__typeof__(container) *) 0)->i)               \
    02303         for (variable = *qForeachContainer(&_container_, (__typeof__(container) *) 0)->i; \
    02304              qForeachContainer(&_container_, (__typeof__(container) *) 0)->brk;           \
    02305              --qForeachContainer(&_container_, (__typeof__(container) *) 0)->brk)
    02306
    02307 #else
    02308 #  define Q_FOREACH(variable, container) \
    02309     for (const QForeachContainerBase &_container_ = qForeachContainerNew(container); \
    02310          qForeachContainer(&_container_, true ? 0 : qForeachPointer(container))->condition();       \
    02311          ++qForeachContainer(&_container_, true ? 0 : qForeachPointer(container))->i)               \
    02312         for (variable = *qForeachContainer(&_container_, true ? 0 : qForeachPointer(container))->i; \
    02313              qForeachContainer(&_container_, true ? 0 : qForeachPointer(container))->brk;           \
    02314              --qForeachContainer(&_container_, true ? 0 : qForeachPointer(container))->brk)
    02315 #endif // MSVC6 || MIPSpro
    02316
    02317 #endif
    02318
    02319 #define Q_FOREVER for(;;)
    02320 #ifndef QT_NO_KEYWORDS
    02321 #  ifndef foreach
    02322 #    define foreach Q_FOREACH
    02323 #  endif
    02324 #  ifndef forever
    02325 #    define forever Q_FOREVER
    02326 #  endif
    02327 #endif
    02328
    02329 #if 0
    02330 /* tell gcc to use its built-in methods for some common functions */
    02331 #if defined(QT_NO_DEBUG) && defined(Q_CC_GNU)
    02332 #  define qMemCopy __builtin_memcpy
    02333 #  define qMemSet __builtin_memset
    02334 #endif
    02335 #endif
    02336
    02337 template <typename T> static inline T *qGetPtrHelper(T *ptr) { return ptr; }
    02338 template <typename Wrapper> static inline typename Wrapper::pointer qGetPtrHelper(const Wrapper &p) { return p.data(); }
    02339
    02340 #define Q_DECLARE_PRIVATE(Class) \
    02341     inline Class##Private* d_func() { return reinterpret_cast<Class##Private *>(qGetPtrHelper(d_ptr)); } \
    02342     inline const Class##Private* d_func() const { return reinterpret_cast<const Class##Private *>(qGetPtrHelper(d_ptr)); } \
    02343     friend class Class##Private;
    02344
    02345 #define Q_DECLARE_PRIVATE_D(Dptr, Class) \
    02346     inline Class##Private* d_func() { return reinterpret_cast<Class##Private *>(Dptr); } \
    02347     inline const Class##Private* d_func() const { return reinterpret_cast<const Class##Private *>(Dptr); } \
    02348     friend class Class##Private;
    02349
    02350 #define Q_DECLARE_PUBLIC(Class)                                    \
    02351     inline Class* q_func() { return static_cast<Class *>(q_ptr); } \
    02352     inline const Class* q_func() const { return static_cast<const Class *>(q_ptr); } \
    02353     friend class Class;
    02354
    02355 #define Q_D(Class) Class##Private * const d = d_func()
    02356 #define Q_Q(Class) Class * const q = q_func()
    02357
    02358 #define QT_TR_NOOP(x) (x)
    02359 #define QT_TR_NOOP_UTF8(x) (x)
    02360 #define QT_TRANSLATE_NOOP(scope, x) (x)
    02361 #define QT_TRANSLATE_NOOP_UTF8(scope, x) (x)
    02362 #define QT_TRANSLATE_NOOP3(scope, x, comment) {x, comment}
    02363 #define QT_TRANSLATE_NOOP3_UTF8(scope, x, comment) {x, comment}
    02364
    02365 #ifndef QT_NO_TRANSLATION // ### This should enclose the NOOPs above
    02366
    02367 // Defined in qcoreapplication.cpp
    02368 // The better name qTrId() is reserved for an upcoming function which would
    02369 // return a much more powerful QStringFormatter instead of a QString.
    02370 Q_CORE_EXPORT QString qtTrId(const char *id, int n = -1);
    02371
    02372 #define QT_TRID_NOOP(id) id
    02373
    02374 #endif // QT_NO_TRANSLATION
    02375
    02376 #define QDOC_PROPERTY(text)
    02377
    02378 /*
    02379    When RTTI is not available, define this macro to force any uses of
    02380    dynamic_cast to cause a compile failure.
    02381 */
    02382
    02383 #ifdef QT_NO_DYNAMIC_CAST
    02384 #  define dynamic_cast QT_PREPEND_NAMESPACE(qt_dynamic_cast_check)
    02385
    02386   template<typename T, typename X>
    02387   T qt_dynamic_cast_check(X, T* = 0)
    02388   { return T::dynamic_cast_will_always_fail_because_rtti_is_disabled; }
    02389 #endif
    02390
    02391 /*
    02392    Some classes do not permit copies to be made of an object. These
    02393    classes contains a private copy constructor and assignment
    02394    operator to disable copying (the compiler gives an error message).
    02395 */
    02396 #define Q_DISABLE_COPY(Class) \
    02397     Class(const Class &); \
    02398     Class &operator=(const Class &);
    02399
    02400 class QByteArray;
    02401 Q_CORE_EXPORT QByteArray qgetenv(const char *varName);
    02402 Q_CORE_EXPORT bool qputenv(const char *varName, const QByteArray& value);
    02403
    02404 inline int qIntCast(double f) { return int(f); }
    02405 inline int qIntCast(float f) { return int(f); }
    02406
    02407 /*
    02408   Reentrant versions of basic rand() functions for random number generation
    02409 */
    02410 Q_CORE_EXPORT void qsrand(uint seed);
    02411 Q_CORE_EXPORT int qrand();
    02412
    02413 /*
    02414    Compat functions that were generated by configure
    02415 */
    02416 #ifdef QT3_SUPPORT
    02417 #ifndef QT_PRODUCT_LICENSEE
    02418 #  define QT_PRODUCT_LICENSEE QLibraryInfo::licensee()
    02419 #endif
    02420 #ifndef QT_PRODUCT_LICENSE
    02421 #  define QT_PRODUCT_LICENSE QLibraryInfo::licensedProducts()
    02422 #endif
    02423 QT3_SUPPORT Q_CORE_EXPORT const char *qInstallPath();
    02424 QT3_SUPPORT Q_CORE_EXPORT const char *qInstallPathDocs();
    02425 QT3_SUPPORT Q_CORE_EXPORT const char *qInstallPathHeaders();
    02426 QT3_SUPPORT Q_CORE_EXPORT const char *qInstallPathLibs();
    02427 QT3_SUPPORT Q_CORE_EXPORT const char *qInstallPathBins();
    02428 QT3_SUPPORT Q_CORE_EXPORT const char *qInstallPathPlugins();
    02429 QT3_SUPPORT Q_CORE_EXPORT const char *qInstallPathData();
    02430 QT3_SUPPORT Q_CORE_EXPORT const char *qInstallPathTranslations();
    02431 QT3_SUPPORT Q_CORE_EXPORT const char *qInstallPathSysconf();
    02432 #endif
    02433
    02434 #if defined(Q_OS_SYMBIAN)
    02435
    02436 #ifdef SYMBIAN_BUILD_GCE
    02437 #define Q_SYMBIAN_SUPPORTS_SURFACES
    02438 //RWsPointerCursor is fixed, so don't use low performance sprites
    02439 #define Q_SYMBIAN_FIXED_POINTER_CURSORS
    02440 #define Q_SYMBIAN_HAS_EXTENDED_BITMAP_TYPE
    02441 #define Q_SYMBIAN_WINDOW_SIZE_CACHE
    02442 #define QT_SYMBIAN_SUPPORTS_ADVANCED_POINTER
    02443
    02444 //enabling new graphics resources
    02445 #ifdef SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
    02446 #  define QT_SYMBIAN_SUPPORTS_SGIMAGE
    02447 #endif
    02448
    02449 #ifdef SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS
    02450 #  define Q_SYMBIAN_SEMITRANSPARENT_BG_SURFACE
    02451 #endif
    02452 #endif
    02453
    02454
    02455 //Symbian does not support data imports from a DLL
    02456 #define Q_NO_DATA_RELOCATION
    02457
    02458 QT_END_NAMESPACE
    02459 // forward declare std::exception
    02460 #ifdef __cplusplus
    02461 namespace std { class exception; }
    02462 #endif
    02463 QT_BEGIN_NAMESPACE
    02464 Q_CORE_EXPORT void qt_symbian_throwIfError(int error);
    02465 Q_CORE_EXPORT void qt_symbian_exception2LeaveL(const std::exception& ex);
    02466 Q_CORE_EXPORT int qt_symbian_exception2Error(const std::exception& ex);
    02467
    02468 #define QT_TRAP_THROWING(_f)                        \
    02469     {                                               \
    02470         TInt ____error;                             \
    02471         TRAP(____error, _f);                        \
    02472         qt_symbian_throwIfError(____error);                 \
    02473      }
    02474
    02475 #define QT_TRYCATCH_ERROR(_err, _f)                         \
    02476     {                                                       \
    02477         _err = KErrNone;                                    \
    02478         try {                                               \
    02479             _f;                                             \
    02480         } catch (const std::exception &____ex) {            \
    02481             _err = qt_symbian_exception2Error(____ex);       \
    02482         }                                                   \
    02483     }
    02484
    02485 #define QT_TRYCATCH_LEAVING(_f)                         \
    02486     {                                                   \
    02487     TInt ____err;                                       \
    02488     QT_TRYCATCH_ERROR(____err, _f)                      \
    02489     User::LeaveIfError(____err);                        \
    02490     }
    02491 #endif
    02492
    02493
    02494 /*
    02495    This gives us the possibility to check which modules the user can
    02496    use. These are purely compile time checks and will generate no code.
    02497 */
    02498
    02499 /* Qt modules */
    02500 #define QT_MODULE_CORE                 0x00001
    02501 #define QT_MODULE_GUI                  0x00002
    02502 #define QT_MODULE_NETWORK              0x00004
    02503 #define QT_MODULE_OPENGL               0x00008
    02504 #define QT_MODULE_SQL                  0x00010
    02505 #define QT_MODULE_XML                  0x00020
    02506 #define QT_MODULE_QT3SUPPORTLIGHT      0x00040
    02507 #define QT_MODULE_QT3SUPPORT           0x00080
    02508 #define QT_MODULE_SVG                  0x00100
    02509 #define QT_MODULE_ACTIVEQT             0x00200
    02510 #define QT_MODULE_GRAPHICSVIEW         0x00400
    02511 #define QT_MODULE_SCRIPT               0x00800
    02512 #define QT_MODULE_XMLPATTERNS          0x01000
    02513 #define QT_MODULE_HELP                 0x02000
    02514 #define QT_MODULE_TEST                 0x04000
    02515 #define QT_MODULE_DBUS                 0x08000
    02516 #define QT_MODULE_SCRIPTTOOLS          0x10000
    02517 #define QT_MODULE_OPENVG               0x20000
    02518 #define QT_MODULE_MULTIMEDIA           0x40000
    02519 #define QT_MODULE_DECLARATIVE          0x80000
    02520
    02521 /* Qt editions */
    02522 #define QT_EDITION_CONSOLE      (QT_MODULE_CORE \
    02523                                  | QT_MODULE_NETWORK \
    02524                                  | QT_MODULE_SQL \
    02525                                  | QT_MODULE_SCRIPT \
    02526                                  | QT_MODULE_MULTIMEDIA \
    02527                                  | QT_MODULE_XML \
    02528                                  | QT_MODULE_XMLPATTERNS \
    02529                                  | QT_MODULE_TEST \
    02530                                  | QT_MODULE_DBUS)
    02531 #define QT_EDITION_DESKTOPLIGHT (QT_MODULE_CORE \
    02532                                  | QT_MODULE_GUI \
    02533                                  | QT_MODULE_QT3SUPPORTLIGHT \
    02534                                  | QT_MODULE_TEST \
    02535                                  | QT_MODULE_DBUS)
    02536 #define QT_EDITION_OPENSOURCE   (QT_MODULE_CORE \
    02537                                  | QT_MODULE_GUI \
    02538                                  | QT_MODULE_NETWORK \
    02539                                  | QT_MODULE_OPENGL \
    02540                                  | QT_MODULE_OPENVG \
    02541                                  | QT_MODULE_SQL \
    02542                                  | QT_MODULE_MULTIMEDIA \
    02543                                  | QT_MODULE_XML \
    02544                                  | QT_MODULE_XMLPATTERNS \
    02545                                  | QT_MODULE_SCRIPT \
    02546                                  | QT_MODULE_SCRIPTTOOLS \
    02547                                  | QT_MODULE_QT3SUPPORTLIGHT \
    02548                                  | QT_MODULE_QT3SUPPORT \
    02549                                  | QT_MODULE_SVG \
    02550                                  | QT_MODULE_DECLARATIVE \
    02551                                  | QT_MODULE_GRAPHICSVIEW \
    02552                                  | QT_MODULE_HELP \
    02553                                  | QT_MODULE_TEST \
    02554                                  | QT_MODULE_DBUS \
    02555                                  | QT_MODULE_ACTIVEQT)
    02556 #define QT_EDITION_DESKTOP      (QT_EDITION_OPENSOURCE)
    02557 #define QT_EDITION_UNIVERSAL    QT_EDITION_DESKTOP
    02558 #define QT_EDITION_ACADEMIC     QT_EDITION_DESKTOP
    02559 #define QT_EDITION_EDUCATIONAL  QT_EDITION_DESKTOP
    02560 #define QT_EDITION_EVALUATION   QT_EDITION_DESKTOP
    02561
    02562 /* Determine which modules can be used */
    02563 #ifndef QT_EDITION
    02564 #  ifdef QT_BUILD_QMAKE
    02565 #    define QT_EDITION QT_EDITION_DESKTOP
    02566 #  else
    02567 #    error "Qt not configured correctly, please run configure"
    02568 #  endif
    02569 #endif
    02570
    02571 #define QT_LICENSED_MODULE(x) \
    02572     enum QtValidLicenseFor##x##Module { Licensed##x = true };
    02573
    02574 /* qdoc is really unhappy with the following block of preprocessor checks,
    02575    making it difficult to document classes properly after this point. */
    02576
    02577 #if (QT_EDITION & QT_MODULE_CORE)
    02578 QT_LICENSED_MODULE(Core)
    02579 #endif
    02580 #if (QT_EDITION & QT_MODULE_GUI)
    02581 QT_LICENSED_MODULE(Gui)
    02582 #endif
    02583 #if (QT_EDITION & QT_MODULE_NETWORK)
    02584 QT_LICENSED_MODULE(Network)
    02585 #endif
    02586 #if (QT_EDITION & QT_MODULE_OPENGL)
    02587 QT_LICENSED_MODULE(OpenGL)
    02588 #endif
    02589 #if (QT_EDITION & QT_MODULE_OPENVG)
    02590 QT_LICENSED_MODULE(OpenVG)
    02591 #endif
    02592 #if (QT_EDITION & QT_MODULE_SQL)
    02593 QT_LICENSED_MODULE(Sql)
    02594 #endif
    02595 #if (QT_EDITION & QT_MODULE_MULTIMEDIA)
    02596 QT_LICENSED_MODULE(Multimedia)
    02597 #endif
    02598 #if (QT_EDITION & QT_MODULE_XML)
    02599 QT_LICENSED_MODULE(Xml)
    02600 #endif
    02601 #if (QT_EDITION & QT_MODULE_XMLPATTERNS)
    02602 QT_LICENSED_MODULE(XmlPatterns)
    02603 #endif
    02604 #if (QT_EDITION & QT_MODULE_HELP)
    02605 QT_LICENSED_MODULE(Help)
    02606 #endif
    02607 #if (QT_EDITION & QT_MODULE_SCRIPT) || defined(QT_BUILD_QMAKE)
    02608 QT_LICENSED_MODULE(Script)
    02609 #endif
    02610 #if (QT_EDITION & QT_MODULE_SCRIPTTOOLS)
    02611 QT_LICENSED_MODULE(ScriptTools)
    02612 #endif
    02613 #if (QT_EDITION & QT_MODULE_QT3SUPPORTLIGHT)
    02614 QT_LICENSED_MODULE(Qt3SupportLight)
    02615 #endif
    02616 #if (QT_EDITION & QT_MODULE_QT3SUPPORT)
    02617 QT_LICENSED_MODULE(Qt3Support)
    02618 #endif
    02619 #if (QT_EDITION & QT_MODULE_SVG)
    02620 QT_LICENSED_MODULE(Svg)
    02621 #endif
    02622 #if (QT_EDITION & QT_MODULE_DECLARATIVE)
    02623 QT_LICENSED_MODULE(Declarative)
    02624 #endif
    02625 #if (QT_EDITION & QT_MODULE_ACTIVEQT)
    02626 QT_LICENSED_MODULE(ActiveQt)
    02627 #endif
    02628 #if (QT_EDITION & QT_MODULE_TEST)
    02629 QT_LICENSED_MODULE(Test)
    02630 #endif
    02631 #if (QT_EDITION & QT_MODULE_DBUS)
    02632 QT_LICENSED_MODULE(DBus)
    02633 #endif
    02634
    02635 #define QT_MODULE(x) \
    02636     typedef QtValidLicenseFor##x##Module Qt##x##Module;
    02637
    02638 #ifdef QT_NO_CONCURRENT
    02639 #  define QT_NO_QFUTURE
    02640 #endif
    02641
    02642 // MSVC 6.0 and MSVC .NET 2002,  can`t handle the map(), etc templates,
    02643 // but the QFuture class compiles.
    02644 #if (defined(Q_CC_MSVC) && _MSC_VER <= 1300)
    02645 #  define QT_NO_CONCURRENT
    02646 #endif
    02647
    02648 // gcc 3 version has problems with some of the
    02649 // map/filter overloads.
    02650 #if defined(Q_CC_GNU) && (__GNUC__ < 4)
    02651 #  define QT_NO_CONCURRENT_MAP
    02652 #  define QT_NO_CONCURRENT_FILTER
    02653 #endif
    02654
    02655 #ifdef Q_OS_QNX
    02656 // QNX doesn't have SYSV style shared memory. Multiprocess QWS apps,
    02657 // shared fonts and QSystemSemaphore + QSharedMemory are not available
    02658 #  define QT_NO_QWS_MULTIPROCESS
    02659 #  define QT_NO_QWS_SHARE_FONTS
    02660 #  define QT_NO_SYSTEMSEMAPHORE
    02661 #  define QT_NO_SHAREDMEMORY
    02662 // QNX currently doesn't support forking in a thread, so disable QProcess
    02663 #  define QT_NO_PROCESS
    02664 #endif
    02665
    02666 QT_END_NAMESPACE
    02667 QT_END_HEADER
    02668
    02669 #endif /* __cplusplus */
    02670
    02671 #endif /* QGLOBAL_H */