- Qt 6.7
- Qt Core
- <QtGlobal> - Global Qt Declarations
- Qt 6.7.3 Reference Documentation

# <QtGlobal> - Global Qt Declarations

The <QtGlobal> header file includes an assortment of other headers. More...

Header: | #include <QtGlobal>

## Detailed Description

Up to Qt 6.5, most Qt header files included <QtGlobal>. Before Qt 6.5, <QtGlobal> defined an assortment of global declarations. Most of these have moved, at Qt 6.5, to separate headers, so that source code can include only what it needs, rather than the whole assortment. For now, <QtGlobal> includes those other headers (see next section), but future releases of Qt may remove some of these headers from <QtGlobal> or condition their inclusion on a version check. Likewise, in future releases, some Qt headers that currently include <QtGlobal> may stop doing so. The hope is that this will improve compilation times by avoiding global declarations when they are not used.

#### List of Headers Extracted from <QtGlobal>

Header | Summary
--- | ---
<QFlags> | Type-safe way of combining enum values
<QForeach> | Qt's implementation of foreach and forever loops
<QFunctionPointer> | Typedef for a pointer-to-function type
<QGlobalStatic> | Thread-safe initialization of global static objects
<QOverload> | Helpers for resolving member function overloads
<QSysInfo> | A helper class to get system information
<QTypeInfo> | Helpers to get type information
<QtAssert> | Q_ASSERT and other runtime checks
<QtClassHelperMacros> | Qt class helper macros
<QtCompilerDetection> | Compiler-specific macro definitions
<QtDeprecationMarkers> | Deprecation helper macros
<QtEnvironmentVariables> | Helpers for working with environment variables
<QtExceptionHandling> | Helpers for exception handling
<QtLogging> | Qt logging helpers
<QtMalloc> | Memory allocation helpers
<QtMinMax> | Helpers for comparing values
<QtNumeric> | Various numeric functions
<QtPreprocessorSupport> | Helper preprocessor macros
<QtProcessorDetection> | Architecture-specific macro definitions
<QtResource> | Helpers for initializing and cleaning resources
<QtSwap> | Implementation of qSwap()
<QtSystemDetection> | Platform-specific macro definitions
<QtTranslation> | Qt translation helpers
<QtTypeTraits> | Qt type traits
<QtTypes> | Qt fundamental type declarations
<QtVersionChecks> | QT_VERSION_CHECK and related checks
<QtVersion> | QT_VERSION_STR and qVersion()