| archdetect.cpp |
|
3667 |
- |
| minimum-linux_p.h |
Minimum Linux kernel version:
We require the following features in Qt (unconditional, no fallback):
Feature Added in version Macro
- inotify_init1 before 2.6.12-rc12
- futex(2) before 2.6.12-rc12
- FUTEX_WAKE_OP 2.6.14 FUTEX_OP
- linkat(2) 2.6.17 O_TMPFILE && QT_CONFIG(linkat)
- FUTEX_PRIVATE_FLAG 2.6.22
- O_CLOEXEC 2.6.23
- eventfd 2.6.23
- FUTEX_WAIT_BITSET 2.6.25
- pipe2 & dup3 2.6.27
- accept4 2.6.28
- renameat2 3.16 QT_CONFIG(renameat2)
- getrandom 3.17 QT_CONFIG(getentropy)
- statx 4.11 STATX_BASIC_STATS
|
2364 |
- |
| patches |
|
|
- |
| q17memory.h |
|
1573 |
- |
| q20algorithm.h |
|
5461 |
- |
| q20atomic.h |
Q20ATOMIC_H |
1342 |
- |
| q20bit.h |
non-constexpr |
12239 |
- |
| q20chrono.h |
Q20CHRONO_H |
2144 |
- |
| q20functional.h |
Q20FUNCTIONAL_H |
1293 |
- |
| q20iterator.h |
Q20ITERATOR_H |
1678 |
- |
| q20map.h |
erasing |
2316 |
- |
| q20memory.h |
Q20MEMORY_H |
4019 |
- |
| q20type_traits.h |
>= 1925, but we require 1927 in qglobal.h |
3171 |
- |
| q20utility.h |
Q20UTILITY_H |
3876 |
- |
| q20vector.h |
Q20VECTOR_H |
2840 |
- |
| q23functional.h |
Q23FUNCTIONAL_H |
1502 |
- |
| q23type_traits.h |
Q23TYPE_TRAITS_H |
1368 |
- |
| q23utility.cpp |
end |
713 |
- |
| q23utility.h |
else |
1992 |
- |
| q26numeric.h |
else |
2171 |
- |
| qalloc.cpp |
|
1144 |
- |
| qalloc.h |
\internal
\return the size that would be allocated for the given request.
Computes the actual allocation size for \a allocSize and \a alignment,
as determined by the active allocator, without performing the allocation.
In practice, it only returns nonzero when using jemalloc.
|
4666 |
- |
| qassert.cpp |
!
\headerfile <QtAssert>
\inmodule QtCore
\ingroup funclists
\brief Macros for condition checks during development and debugging.
|
8246 |
- |
| qassert.h |
for now... |
5307 |
- |
| qcheckedint_impl.h |
|
9173 |
- |
| qcompare.cpp |
end |
61833 |
- |
| qcompare.h |
else |
40754 |
- |
| qcompare_impl.h |
|
1057 |
- |
| qcomparehelpers.h |
end |
69316 |
- |
| qcompilerdetection.h |
The compiler, must be one of: (Q_CC_x)
COVERITY - Coverity cov-scan
SYM - Digital Mars C/C++ (used to be Symantec C++)
MSVC - Microsoft Visual C/C++, Intel C++ for Windows
BOR - Borland/Turbo C++
WAT - Watcom C++
GNU - GNU C++
COMEAU - Comeau C++
EDG - Edison Design Group C++
OC - CenterLine C++
SUN - Forte Developer, or Sun Studio C++
MIPS - MIPSpro C++
DEC - DEC C++
HPACC - HP aC++
USLC - SCO OUDK and UDK
CDS - Reliant C++
KAI - KAI C++
INTEL - Intel C++ for Linux, Intel C++ for Windows
HIGHC - MetaWare High C/C++
PGI - Portland Group C++
GHS - Green Hills Optimizing C++ Compilers
RVCT - ARM Realview Compiler Suite
CLANG - C++ front-end for the LLVM compiler
Should be sorted most to least authoritative.
|
56885 |
- |
| qcompilerdetection.qdoc |
|
14668 |
- |
| qconfig-bootstrapped.h |
|
2813 |
- |
| qconfig.cpp.in |
|
896 |
- |
| qconstructormacros.h |
|
1086 |
- |
| qcontainerinfo.h |
|
8896 |
- |
| qdarwinhelpers.h |
Utility macros and inline functions
|
1140 |
- |
| qdarwinhelpers.qdoc |
|
1255 |
- |
| qendian.cpp |
!
\headerfile <QtEndian>
\inmodule QtCore
\title Endian Conversion Functions
\ingroup funclists
\brief The <QtEndian> header provides functions to convert between
little and big endian representations of numbers.
|
27014 |
- |
| qendian.h |
ENDIAN FUNCTIONS
|
13543 |
- |
| qendian_p.h |
|
6544 |
- |
| qexceptionhandling.h |
These wrap try/catch so we can switch off exceptions later.
Beware - do not use more than one QT_CATCH per QT_TRY, and do not use
the exception instance in the catch block.
If you can't live with those constraints, don't use these macros.
Use the QT_NO_EXCEPTIONS macro to protect your code instead.
|
1212 |
- |
| qexpected_p.h |
|
96231 |
- |
| qflags.h |
|
13528 |
- |
| qflags.qdoc |
|
13628 |
- |
| qfloat16.cpp |
!
\class qfloat16
\keyword 16-bit Floating Point Support
\ingroup funclists
\inmodule QtCore
\inheaderfile QFloat16
\brief Provides 16-bit floating point support.
\compares partial
\compareswith partial float double {long double} qint8 quint8 qint16 quint16 \
qint32 quint32 long {unsigned long} qint64 quint64
\endcompareswith
\compareswith partial qint128 quint128
Comparison with 128-bit integral types is only supported if Qt provides
these types.
\endcompareswith
The \c qfloat16 class provides support for half-precision (16-bit) floating
point data. It is fully compliant with IEEE 754 as a storage type. This
implies that any arithmetic operation on a \c qfloat16 instance results in
the value first being converted to a \c float. This conversion to and from
\c float is performed by hardware when possible, but on processors that do
not natively support half-precision, the conversion is performed through a
sequence of lookup table operations.
\c qfloat16 should be treated as if it were a POD (plain old data) type.
Consequently, none of the supported operations need any elaboration beyond
stating that it supports all arithmetic operators incident to floating point
types.
\note On x86 and x86-64 that to get hardware accelerated conversions you must
compile with F16C or AVX2 enabled, or use qFloatToFloat16() and qFloatFromFloat16()
which will detect F16C at runtime.
\since 5.9
|
14008 |
- |
| qfloat16.h |
|
25078 |
- |
| qfloat16tables.cpp |
This file was generated by util/qfloat16-tables/gen_qfloat16_tables.cpp |
39785 |
- |
| qforeach.h |
QFOREACH_H |
2736 |
- |
| qforeach.qdoc |
|
2091 |
- |
| qfunctionpointer.h |
|
486 |
- |
| qfunctionpointer.qdoc |
|
444 |
- |
| qgettid_p.h |
|
1502 |
- |
| qglobal.cpp |
!
\headerfile <QtGlobal>
\inmodule QtCore
\title Global Qt Declarations
\ingroup funclists
\brief 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.
\section1 List of Headers Extracted from <QtGlobal>
\table
\header \li Header \li Summary
\row \li <QFlags> \li Type-safe way of combining enum values
\row \li \l <QForeach> \li Qt's implementation of foreach and forever loops
\row \li \l <QFunctionPointer> \li Typedef for a pointer-to-function type
\row \li \l <QApplicationStatic> \li For Q_APPLICATION_STATIC
\row \li <QGlobalStatic> \li Thread-safe initialization of global static objects
\row \li \l <QOverload> \li Helpers for resolving member function overloads
\row \li <QSysInfo> \li A helper class to get system information
\row \li \l <QTypeInfo> \li Helpers to get type information
\row \li \l <QtAssert> \li Q_ASSERT and other runtime checks
\row \li \l <QtClassHelperMacros> \li Qt class helper macros
\row \li \l <QtCompilerDetection> \li Compiler-specific macro definitions
\row \li \l <QtDeprecationMarkers> \li Deprecation helper macros
\row \li \l <QtEnvironmentVariables> \li Helpers for working with environment variables
\row \li <QtExceptionHandling> \li Helpers for exception handling
\row \li \l <QtLogging> \li Qt logging helpers
\row \li <QtMalloc> \li Memory allocation helpers
\row \li \l <QtMinMax> \li Helpers for comparing values
\row \li \l <QtNumeric> \li Various numeric functions
\row \li \l <QtPreprocessorSupport> \li Helper preprocessor macros
\row \li \l <QtProcessorDetection> \li Architecture-specific macro definitions
\row \li \l <QtResource> \li Helpers for initializing and cleaning resources
\row \li \l <QtSwap> \li Implementation of qSwap()
\row \li \l <QtSystemDetection> \li Platform-specific macro definitions
\row \li \l <QtTranslation> \li Qt translation helpers
\row \li \l <QtTypeTraits> \li Qt type traits
\row \li \l <QtTypes> \li Qt fundamental type declarations
\row \li \l <QtVersionChecks> \li QT_VERSION_CHECK and related checks
\row \li \l <QtVersion> \li QT_VERSION_STR and qVersion()
\endtable
|
13941 |
- |
| qglobal.h |
!__ASSEMBLER__ |
1917 |
- |
| qglobal_p.h |
|
5221 |
- |
| qglobalstatic.h |
|
4143 |
- |
| qglobalstatic.qdoc |
|
21343 |
- |
| qhooks.cpp |
|
1506 |
- |
| qhooks_p.h |
|
1062 |
- |
| qlibraryinfo.cpp |
|
39773 |
- |
| qlibraryinfo.h |
|
1875 |
- |
| qlibraryinfo_p.h |
|
1708 |
- |
| qlogging.cpp |
!
\headerfile <QtLogging>
\inmodule QtCore
\title Qt Logging Types
\brief The <QtLogging> header file defines Qt logging types, functions
and macros.
The <QtLogging> header file contains several types, functions and
macros for logging.
The QtMsgType enum identifies the various messages that can be generated
and sent to a Qt message handler; QtMessageHandler is a type definition for
a pointer to a function with the signature
\c {void myMessageHandler(QtMsgType, const QMessageLogContext &, const char *)}.
qInstallMessageHandler() function can be used to install the given
QtMessageHandler. QMessageLogContext class contains the line, file, and
function the message was logged at. This information is created by the
QMessageLogger class.
<QtLogging> also contains functions that generate messages from the
given string argument: qDebug(), qInfo(), qWarning(), qCritical(),
and qFatal(). These functions call the message handler
with the given message.
Example:
\snippet code/src_corelib_global_qglobal.cpp 4
\sa QLoggingCategory
|
91324 |
- |
| qlogging.h |
Forward declarations only.
In order to use the qDebug() stream, you must #include<QDebug>
|
7534 |
- |
| qlogging_p.h |
|
2256 |
- |
| qmalloc.cpp |
Define the container allocation functions in a separate file, so that our
users can easily override them.
|
2562 |
- |
| qmalloc.h |
|
739 |
- |
| qminmax.h |
|
1958 |
- |
| qminmax.qdoc |
|
998 |
- |
| qnamespace.h |
|
62854 |
- |
| qnamespace.qdoc |
|
151806 |
- |
| qnativeinterface.h |
|
5844 |
- |
| qnativeinterface_p.h |
|
3562 |
- |
| qnumeric.cpp |
!
\headerfile <QtNumeric>
\inmodule QtCore
\title Qt Numeric Functions
\brief The <QtNumeric> header file provides common numeric functions.
The <QtNumeric> header file contains various numeric functions
for comparing and adjusting a numeric value.
|
14224 |
- |
| qnumeric.h |
|
24053 |
- |
| qnumeric_p.h |
|
16981 |
- |
| qoperatingsystemversion.cpp |
!
\class QOperatingSystemVersion
\inmodule QtCore
\since 5.9
\brief The QOperatingSystemVersion class provides information about the
operating system version.
Unlike other version functions in QSysInfo, QOperatingSystemVersion provides
access to the full version number that \a developers typically use to vary
behavior or determine whether to enable APIs or features based on the
operating system version (as opposed to the kernel version number or
marketing version).
Presently, Android, Apple Platforms (iOS, macOS, tvOS, watchOS, and visionOS),
OpenHarmony (HarmonyOS), and Windows are supported.
The \a majorVersion(), \a minorVersion(), and \a microVersion() functions
return the parts of the operating system version number based on:
\table
\header
\li Platforms
\li Value
\row
\li Android
\li result of parsing
\l{https://developer.android.com/reference/android/os/Build.VERSION.html#RELEASE}{android.os.Build.VERSION.RELEASE}
using QVersionNumber, with a fallback to
\l{https://developer.android.com/reference/android/os/Build.VERSION.html#SDK_INT}{android.os.Build.VERSION.SDK_INT}
to determine the major and minor version component if the former
fails
\row
\li Apple Platforms
\li majorVersion, minorVersion, and patchVersion from
\l{https://developer.apple.com/reference/foundation/nsprocessinfo/1410906-operatingsystemversion?language=objc}{NSProcessInfo.operatingSystemVersion}
\row
\li Windows
\li dwMajorVersion, dwMinorVersion, and dwBuildNumber from
\l{https://docs.microsoft.com/en-us/windows/win32/devnotes/rtlgetversion}
{RtlGetVersion} -
note that this function ALWAYS return the version number of the
underlying operating system, as opposed to the shim underneath
GetVersionEx that hides the real version number if the
application is not manifested for that version of the OS
\endtable
Because QOperatingSystemVersion stores both a version number and an OS type, the OS type
can be taken into account when performing comparisons. For example, on a macOS system running
macOS Sierra (v10.12), the following expression will return \c false even though the
major version number component of the object on the left hand side of the expression (10) is
greater than that of the object on the right (9):
\snippet code/src_corelib_global_qoperatingsystemversion.cpp 0
This allows expressions for multiple operating systems to be joined with a logical OR operator
and still work as expected. For example:
\snippet code/src_corelib_global_qoperatingsystemversion.cpp 1
A more naive comparison algorithm might incorrectly return true on all versions of macOS,
including Mac OS 9. This behavior is achieved by overloading the comparison operators to return
\c false whenever the OS types of the QOperatingSystemVersion instances being compared do not
match. Be aware that due to this it can be the case \c x >= y and \c x < y are BOTH \c false
for the same instances of \c x and \c y.
|
26820 |
- |
| qoperatingsystemversion.h |
|
14903 |
- |
| qoperatingsystemversion_darwin.mm |
|
2432 |
- |
| qoperatingsystemversion_p.h |
|
766 |
- |
| qoperatingsystemversion_win.cpp |
|
3388 |
- |
| qoperatingsystemversion_win_p.h |
|
701 |
- |
| qoverload.h |
QOVERLOAD_H |
2167 |
- |
| qoverload.qdoc |
|
1563 |
- |
| qprocessordetection.h |
This file uses preprocessor #defines to set various Q_PROCESSOR_* #defines
based on the following patterns:
Q_PROCESSOR_{FAMILY}
Q_PROCESSOR_{FAMILY}_{VARIANT}
Q_PROCESSOR_{FAMILY}_{REVISION}
The first is always defined. Defines for the various revisions/variants are
optional and usually dependent on how the compiler was invoked. Variants
that are a superset of another should have a define for the superset.
In addition to the processor family, variants, and revisions, we also set
Q_BYTE_ORDER appropriately for the target processor. For bi-endian
processors, we try to auto-detect the byte order using the __BIG_ENDIAN__,
__LITTLE_ENDIAN__, or __BYTE_ORDER__ preprocessor macros.
Note: when adding support for new processors, be sure to update
config.tests/arch/arch.cpp to ensure that configure can detect the target
and host architectures.
|
12852 |
- |
| qprocessordetection.qdoc |
|
12886 |
- |
| qrandom.cpp |
|
48574 |
- |
| qrandom.h |
|
9143 |
- |
| qrandom_p.h |
|
1108 |
- |
| qsimd.cpp |
arch dependent hints at CPU capabilities |
20836 |
- |
| qsimd.h |
qconfig.h defines the QT_COMPILER_SUPPORTS_XXX macros.
They mean the compiler supports the necessary flags and the headers
for the x86 and ARM intrinsics.
Supported instruction set extensions are:
Flag | Arch
neon | ARM
sve | ARM
mips_dsp | mips
mips_dspr2 | mips
sse2 | x86
sse4_1 | x86
sse4_2 | x86
avx | x86
avx2 | x86
lsx | loongarch
lasx | loongarch
Code can use the following constructs to determine compiler support & status:
- #if QT_COMPILER_USES(XXX) (e.g: #if QT_COMPILER_USES(neon) or QT_COMPILER_USES(sse4_1)
If this test passes, then the compiler is already generating code using the
given instruction set. The intrinsics for those instructions are
#included and can be used without restriction or runtime check.
Code that requires runtime detection and different code paths at runtime is
currently not supported here, have a look at qsimd_p.h for support.
|
5101 |
- |
| qsimd_p.h |
Code can use the following constructs to determine compiler support & status:
- #ifdef __XXX__ (e.g: #ifdef __AVX__ or #ifdef __ARM_NEON__)
If this test passes, then the compiler is already generating code for that
given sub-architecture. The intrinsics for that sub-architecture are
#included and can be used without restriction or runtime check.
- #if QT_COMPILER_SUPPORTS(XXX)
If this test passes, then the compiler is able to generate code for that
given sub-architecture in another translation unit, given the right set of
flags. Use of the intrinsics is not guaranteed. This is useful with
runtime detection (see below).
- #if QT_COMPILER_SUPPORTS_HERE(XXX)
If this test passes, then the compiler is able to generate code for that
given sub-architecture in this translation unit, even if it is not doing
that now (it might be). Individual functions may be tagged with
QT_FUNCTION_TARGET(XXX) to cause the compiler to generate code for that
sub-arch. Only inside such functions is the use of the intrisics
guaranteed to work. This is useful with runtime detection (see below).
The distinction between QT_COMPILER_SUPPORTS and QT_COMPILER_SUPPORTS_HERE is
historical: GCC 4.8 needed the distinction.
Runtime detection of a CPU sub-architecture can be done with the
qCpuHasFeature(XXX) function. There are two strategies for generating
optimized code like that:
1) place the optimized code in a different translation unit (C or assembly
sources) and pass the correct flags to the compiler to enable support. Those
sources must not include qglobal.h, which means they cannot include this
file either. The dispatcher function would look like this:
void foo()
{
#if QT_COMPILER_SUPPORTS(XXX)
if (qCpuHasFeature(XXX)) {
foo_optimized_xxx();
return;
}
#endif
foo_plain();
}
2) place the optimized code in a function tagged with QT_FUNCTION_TARGET and
surrounded by #if QT_COMPILER_SUPPORTS_HERE(XXX). That code can freely use
other Qt code. The dispatcher function would look like this:
void foo()
{
#if QT_COMPILER_SUPPORTS_HERE(XXX)
if (qCpuHasFeature(XXX)) {
foo_optimized_xxx();
return;
}
#endif
foo_plain();
}
|
17080 |
- |
| qsimd_x86.cpp |
|
7337 |
- |
| qsimd_x86_p.h |
|
28285 |
- |
| qstdlibdetection.h |
If <version> exists, qtconfiginclude.h will have included it. |
2037 |
- |
| qswap.h |
|
831 |
- |
| qswap.qdoc |
|
1650 |
- |
| qsysinfo.cpp |
!
\class QSysInfo
\inmodule QtCore
\brief The QSysInfo class provides information about the system.
\list
\li \l WordSize specifies the size of a pointer for the platform
on which the application is compiled.
\li \l ByteOrder specifies whether the platform is big-endian or
little-endian.
\endlist
Some constants are defined only on certain platforms. You can use
the preprocessor symbols Q_OS_WIN and Q_OS_MACOS to test that
the application is compiled under Windows or \macos.
\sa QLibraryInfo
|
38133 |
- |
| qsysinfo.h |
System information
|
1354 |
- |
| qsystemdetection.h |
The operating system, must be one of: (Q_OS_x)
DARWIN - Any Darwin system (macOS, iOS, watchOS, tvOS)
MACOS - macOS
IOS - iOS
WATCHOS - watchOS
TVOS - tvOS
VISIONOS - visionOS
WIN32 - Win32 (Windows 2000/XP/Vista/7 and Windows Server 2003/2008)
CYGWIN - Cygwin
SOLARIS - Sun Solaris
HPUX - HP-UX
LINUX - Linux [has variants]
FREEBSD - FreeBSD [has variants]
NETBSD - NetBSD
OPENBSD - OpenBSD
INTERIX - Interix
AIX - AIX
HURD - GNU Hurd
QNX - QNX [has variants]
QNX6 - QNX RTP 6.1
LYNX - LynxOS
BSD4 - Any BSD 4.4 system
UNIX - Any UNIX BSD/SYSV system
ANDROID - Android platform
HAIKU - Haiku
WEBOS - LG WebOS
WASM - WebAssembly
The following operating systems have variants:
LINUX - both Q_OS_LINUX and Q_OS_ANDROID are defined when building for Android
- only Q_OS_LINUX is defined if building for other Linux systems
MACOS - both Q_OS_BSD4 and Q_OS_IOS are defined when building for iOS
- both Q_OS_BSD4 and Q_OS_MACOS are defined when building for macOS
FREEBSD - Q_OS_FREEBSD is defined only when building for FreeBSD with a BSD userland
- Q_OS_FREEBSD_KERNEL is always defined on FreeBSD, even if the userland is from GNU
|
11984 |
- |
| qsystemdetection.qdoc |
|
3625 |
- |
| qt_attribution.json |
|
814 |
- |
| qt_pch.h |
This is a precompiled header file for use in Xcode / Mac GCC /
GCC >= 3.4 / VC to greatly speed the building of Qt. It may also be
of use to people developing their own project, but it is probably
better to define your own header. Use of this header is currently
UNSUPPORTED.
|
1432 |
- |
| qt_windows.h |
|
2354 |
- |
| qtclasshelper_p.h |
Helper for setters overloaded on lvalue/rvalue. If the setter is doing a
lot of work around the actual assignment, a common pattern is to create a
private helper method
void doSetFoo(const Foo &lvalue, Foo *rvalue);
and implement the two setters inline by calling that function:
void setFoo(const Foo &f) { doSetFoo(f, nullptr); }
void setFoo(Foo &&f) { doSetFoo(f, &f); }
Then, in doSetFoo(), when assigning the argument to the member, use this
function:
q_choose_assign(m_foo, lvalue, rvalue);
or, when appending to a container,
q_choose_append(m_container, lvalue, rvalue);
For all other purposes, you can use
q_choose_copy_move(lvalue, rvalue);
though note that this always produces an rvalue (the copy, if any, is done
inside the function).
The functions mandate (in the C++ sense) that all arguments are the same
type, so they deduce each argument separately and then static_assert that
they're the same. If we need std::exchange()-like mixed types later, it's
easy to relax. For now, avoid being overly general.
|
2848 |
- |
| qtclasshelpermacros.h |
Some classes do not permit copies to be made of an object. These
classes contains a private copy constructor and assignment
operator to disable copying (the compiler gives an error message).
|
8219 |
- |
| qtclasshelpermacros.qdoc |
|
3462 |
- |
| qtconfiginclude.h |
remove this check once Integrity, QNX have caught up |
838 |
- |
| qtconfigmacros.h |
The Qt modules' export macros.
The options are:
- defined(QT_STATIC): Qt was built or is being built in static mode
- defined(QT_SHARED): Qt was built or is being built in shared/dynamic mode
If neither was defined, then QT_SHARED is implied. If Qt was compiled in static
mode, QT_STATIC is defined in qconfig.h. In shared mode, QT_STATIC is implied
for the bootstrapped tools.
|
7614 |
- |
| qtcoreglobal.h |
|
457 |
- |
| qtcoreglobal_p.h |
|
676 |
- |
| qtdeprecationdefinitions.h.in |
|
1335 |
- |
| qtdeprecationmarkers.h |
undef, so as to cause compile-errors when they're used outside #if QT_DEPRECATED_SINCE blocks |
15438 |
- |
| qtdeprecationmarkers.qdoc |
|
3171 |
- |
| qtenvironmentvariables.cpp |
!
\headerfile <QtEnvironmentVariables>
\inmodule QtCore
\ingroup funclists
\brief Helper functions for working with environment variables.
The functions in this header are used to manipulate the environment
variables.
\section2 Thread-safety
The Qt environment manipulation functions are thread-safe, but this requires
that the C library equivalent functions like \c {getenv} and \c {putenv}
are not directly called.
This is also relevant for the third-party libraries that are loaded by the
application. If such a library uses unsafe functions to manipulate the
environment from a secondary thread, it is recommended to do all the
environment setup in the main thread before loading the library and/or
creating secondary threads.
|
15485 |
- |
| qtenvironmentvariables.h |
QTENVIRONMENTVARIABLES_H |
1514 |
- |
| qtenvironmentvariables_p.h |
|
1170 |
- |
| qtnoop.h |
|
422 |
- |
| qtpreprocessorsupport.h |
These two macros makes it possible to turn the builtin line expander into a
string literal. |
1247 |
- |
| qtpreprocessorsupport.qdoc |
|
766 |
- |
| qtrace_p.h |
The Qt tracepoints API consists of only five macros:
- Q_TRACE(tracepoint, args...)
Fires 'tracepoint' if it is enabled.
- Q_TRACE_EXIT(tracepoint, args...)
Fires 'tracepoint' if it is enabled when the current scope exists.
- Q_TRACE_SCOPE(tracepoint, args...)
Wrapper around Q_TRACE/_EXIT to trace entry and exit. First it traces
`${tracepoint}_entry` and then `${tracepoint}_exit` on scope exit.
- Q_UNCONDITIONAL_TRACE(tracepoint, args...)
Fires 'tracepoint' unconditionally: no check is performed to query
whether 'tracepoint' is enabled.
- Q_TRACE_ENABLED(tracepoint)
Returns 'true' if 'tracepoint' is enabled; false otherwise.
When using LTTNG, Q_TRACE, Q_UNCONDITIONAL_TRACE and Q_TRACE_ENABLED map
ultimately to tracepoint(), do_tracepoint() and tracepoint_enabled(),
respectively, described on the lttng-ust manpage (man 3 lttng-ust).
On ETW, Q_TRACE() and Q_UNCONDITIONAL_TRACE() are equivalent, ultimately
amounting to a call to TraceLoggingWrite(), whereas Q_TRACE_ENABLED()
wraps around TraceLoggingProviderEnabled().
On HiTrace, Q_TRACE() and Q_UNCONDITIONAL_TRACE() are equivalent, each
amounting to an OH_HiTrace_StartTraceEx() and OH_HiTrace_FinishTraceEx()
pair, whereas Q_TRACE_ENABLED() reports whether a capture is running.
A tracepoint provider is defined in a separate file, that follows the
following format:
tracepoint_name(arg_type arg_name, ...)
For instance:
qcoreapplication_ctor(int argc, const char * const argv)
qcoreapplication_foo(int argc, const char[10] argv)
qcoreapplication_baz(const char[len] some_string, unsigned int len)
qcoreapplication_qstring(const QString &foo)
qcoreapplication_qrect(const QRect &rect)
The provider file is then parsed by src/tools/tracegen, which can be
switched to output either ETW, LTTNG, HiTrace or CTF tracepoint definitions.
The provider name is deduced to be basename(provider_file).
To use the above (inside qtcore), you need to include
<providername_tracepoints_p.h>. After that, the following call becomes
possible:
Q_TRACE(qcoreapplication_qrect, myRect);
Currently, all C++ primitive non-pointer types are supported for
arguments. Additionally, char * is supported, and is assumed to
be a NULL-terminated string. Finally, the following subset of Qt types also
currently supported:
- QString
- QByteArray
- QUrl
- QRect
- QRectF
- QSize
- QSizeF
Dynamic arrays are supported using the syntax illustrated by
qcoreapplication_baz above.
One can also add prefix for the generated providername_tracepoints_p.h file
by specifying it inside brackets '{ }' in the tracepoints file. One can
for example add forward declaration for a type:
{
QT_BEGIN_NAMESPACE
class QEvent;
QT_END_NAMESPACE
}
Metadata
Metadata is used to add textual information for different types such
as enums and flags. How this data is handled depends on the used backend.
For ETW, the values are converted to text, for CTF and LTTNG they are used to add
CTF enumerations, which are converted to text after tracing.
Enumererations are specified using ENUM:
ENUM {
Enum0 = 0,
Enum1 = 1,
Enum2,
RANGE(RangeEnum, 3 ... 10),
} Name;
Name must match to one of the enumerations used in the tracepoints. Range of values
can be provided using RANGE(name, first ... last). All values must be unique.
Flags are specified using FLAGS:
FLAGS {
Default = 0,
Flag0 = 1,
Flag1 = 2,
Flag2 = 4,
} Name;
Name must match to one of the flags used in the tracepoints. Each value must be
power of two and unique.
|
8752 |
- |
| qtresource.h |
|
741 |
- |
| qtresource.qdoc |
|
2066 |
- |
| qtsymbolmacros.h |
|
2055 |
- |
| qttranslation.h |
QTTRANSLATION_H |
1120 |
- |
| qttranslation.qdoc |
|
6297 |
- |
| qttypetraits.h |
The templates below aim to find out whether one can safely instantiate an operator==() or
operator<() for a type.
This is tricky for containers, as most containers have unconstrained comparison operators, even though they
rely on the corresponding operators for its content.
This is especially true for all of the STL template classes that have a comparison operator defined, and
leads to the situation, that the compiler would try to instantiate the operator, and fail if any
of its template arguments does not have the operator implemented.
The code tries to cover the relevant cases for Qt and the STL, by checking (recusrsively) the value_type
of a container (if it exists), and checking the template arguments of pair, tuple and variant.
|
12950 |
- |
| qttypetraits.qdoc |
|
5025 |
- |
| qtversion.h |
If we're compiling C++ code:
- and this is a non-namespace build, declare qVersion as extern "C"
- and this is a namespace build, declare it as a regular function
(we're already inside QT_BEGIN_NAMESPACE / QT_END_NAMESPACE)
If we're compiling C code, simply declare the function. If Qt was compiled
in a namespace, qVersion isn't callable anyway.
|
1106 |
- |
| qtversionchecks.cpp |
!
\headerfile <QtVersionChecks>
\inmodule QtCore
\ingroup funclists
\brief Macros for performing Qt version checks.
|
1966 |
- |
| qtversionchecks.h |
QT_VERSION is (major << 16) | (minor << 8) | patch.
|
3289 |
- |
| qtypeinfo.h |
QTypeInfo - type trait functionality
|
7601 |
- |
| qtypeinfo.qdoc |
|
2108 |
- |
| qtypes.cpp |
!
\headerfile <QtTypes>
\inmodule QtCore
\title Qt Type Declarations
\brief The <QtTypes> header file includes Qt fundamental type declarations.
The header file declares several type definitions that guarantee a
specified bit-size on all platforms supported by Qt for various
basic types, for example \l qint8 which is a signed char
guaranteed to be 8-bit on all platforms supported by Qt. The
header file also declares the \l qlonglong type definition for
\c {long long int}.
Several convenience type definitions are declared: \l qreal for \c
double or \c float, \l uchar for \c {unsigned char}, \l uint for
\c {unsigned int}, \l ulong for \c {unsigned long} and \l ushort
for \c {unsigned short}.
The header also provides series of macros that make it possible to print
some Qt type aliases (qsizetype, qintptr, etc.) via a formatted output
facility such as printf() or qDebug() without raising formatting warnings
and without the need of a type cast.
|
15827 |
- |
| qtypes.h |
Useful type definitions for Qt
|
10674 |
- |
| qversiontagging.cpp |
|
3605 |
- |
| qversiontagging.h |
Explanation
This file causes all libraries, plugins, and applications that #include this
file to automatically pull in a symbol found in QtCore that encodes the
current Qt version number at the time of compilation. The relocation is
designed so that it's impossible for the dynamic linker to perform lazy
binding. Instead, it must resolve at load time or fail. That way, attempting
to load such a library or plugin while an older QtCore is loaded will fail.
Similarly, if an older QtCore is found when launching an application, the
application will fail to launch.
It's also possible to inspect which version is required by decoding the
.qtversion section. The second pointer-sized variable is the required
version, for example, for Qt 6.4.1:
Hex dump of section [18] '.qtversion', 16 bytes at offset 0x1ee48:
0x00000000 b0ffffff ffffffff 01040600 00000000 ................
^^^^^^^^ ^^^^^^^^
There will only be one copy of the section in the output library or application.
This functionality can be disabled by defining QT_NO_VERSION_TAGGING. It's
disabled if Qt was built statically.
Windows notes:
On Windows, the address of a __declspec(dllimport) variable is not a
constant expression, unlike Unix systems. So we instead use the address of
the import variable, which is created by prefixing the external name with
"__imp_". Using that variable causes an import of the corresponding symbol
from QtCore DLL.
With MinGW (GCC and Clang), we use a C++17 inline variable, so the compiler
and linker automatically merge the variables. The "used" __attribute__
tells the compiler to always emit that variable, whether it's used or not.
MSVC has no equivalent to that attribute, so instead we create an extern
const variable and tell the linker to merge them all via
__declspec(selectany).
Unix notes:
On Unix, we use the same C++17 inline variable solution as MinGW, but we
don't need the "__imp_" trick.
Additionally, on ELF systems like Linux and FreeBSD, the symbol in question
is simply "qt_version_tag" in both QtCore and in this ELF module, but it
has an ELF version attached to it (see qversiontagging.cpp and
QtFlagHandlingHelpers.cmake). That way, the error message from the dynamic
linker will say it can't find version "Qt_6.x".
|
5773 |
- |
| qvolatile_p.h |
|
1319 |
- |
| qxpfunctional.h |
|
6207 |
- |
| qxptype_traits.h |
|
4933 |
- |