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

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



< QFlags >

Type-safe way of combining enum values


Qt’s implementation of foreach and forever loops


Typedef for a pointer-to-function type

< QGlobalStatic >

Thread-safe initialization of global static objects


Helpers for resolving member function overloads

< QSysInfo >

A helper class to get system information


Helpers to get type information


Q_ASSERT and other runtime checks


Qt class helper macros


Compiler-specific macro definitions


Deprecation helper macros


Helpers for working with environment variables


Helpers for exception handling


Qt logging helpers


Memory allocation helpers


Helpers for comparing values


Various numeric functions


Helper preprocessor macros


Architecture-specific macro definitions


Helpers for initializing and cleaning resources


Implementation of qSwap()


Platform-specific macro definitions


Qt translation helpers


Qt type traits


Qt fundamental type declarations


QT_VERSION_CHECK and related checks


QT_VERSION_STR and qVersion()

Use std::move instead.

It expands to “std::move”.

qMove takes an rvalue reference to its parameter x, and converts it to an xvalue.