<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>

HeaderSummary
<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()

© 2024 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.