QtBase  v6.3.1
qglobal.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2020 The Qt Company Ltd.
4 ** Copyright (C) 2019 Intel Corporation.
5 ** Contact: https://www.qt.io/licensing/
6 **
7 ** This file is part of the QtCore module of the Qt Toolkit.
8 **
9 ** $QT_BEGIN_LICENSE:LGPL$
10 ** Commercial License Usage
11 ** Licensees holding valid commercial Qt licenses may use this file in
12 ** accordance with the commercial license agreement provided with the
13 ** Software or, alternatively, in accordance with the terms contained in
14 ** a written agreement between you and The Qt Company. For licensing terms
15 ** and conditions see https://www.qt.io/terms-conditions. For further
16 ** information use the contact form at https://www.qt.io/contact-us.
17 **
18 ** GNU Lesser General Public License Usage
19 ** Alternatively, this file may be used under the terms of the GNU Lesser
20 ** General Public License version 3 as published by the Free Software
21 ** Foundation and appearing in the file LICENSE.LGPL3 included in the
22 ** packaging of this file. Please review the following information to
23 ** ensure the GNU Lesser General Public License version 3 requirements
24 ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
25 **
26 ** GNU General Public License Usage
27 ** Alternatively, this file may be used under the terms of the GNU
28 ** General Public License version 2.0 or (at your option) the GNU General
29 ** Public license version 3 or any later version approved by the KDE Free
30 ** Qt Foundation. The licenses are as published by the Free Software
31 ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
32 ** included in the packaging of this file. Please review the following
33 ** information to ensure the GNU General Public License requirements will
34 ** be met: https://www.gnu.org/licenses/gpl-2.0.html and
35 ** https://www.gnu.org/licenses/gpl-3.0.html.
36 **
37 ** $QT_END_LICENSE$
38 **
39 ****************************************************************************/
40 
41 #ifndef QGLOBAL_H
42 #define QGLOBAL_H
43 
44 #ifdef __cplusplus
45 # include <type_traits>
46 # include <cstddef>
47 # include <utility>
48 # include <cstdint>
49 #endif
50 #ifndef __ASSEMBLER__
51 # include <assert.h>
52 # include <stddef.h>
53 #endif
54 
55 /*
56  QT_VERSION is (major << 16) | (minor << 8) | patch.
57 */
58 #define QT_VERSION QT_VERSION_CHECK(QT_VERSION_MAJOR, QT_VERSION_MINOR, QT_VERSION_PATCH)
59 /*
60  can be used like #if (QT_VERSION >= QT_VERSION_CHECK(6, 4, 0))
61 */
62 #define QT_VERSION_CHECK(major, minor, patch) ((major<<16)|(minor<<8)|(patch))
63 
64 #ifdef QT_BOOTSTRAPPED
65 #include <QtCore/qconfig-bootstrapped.h>
66 #else
67 #include <QtCore/qconfig.h>
68 #include <QtCore/qtcore-config.h>
69 #endif
70 
71 /*
72  The Qt modules' export macros.
73  The options are:
74  - defined(QT_STATIC): Qt was built or is being built in static mode
75  - defined(QT_SHARED): Qt was built or is being built in shared/dynamic mode
76  If neither was defined, then QT_SHARED is implied. If Qt was compiled in static
77  mode, QT_STATIC is defined in qconfig.h. In shared mode, QT_STATIC is implied
78  for the bootstrapped tools.
79 */
80 
81 #ifdef QT_BOOTSTRAPPED
82 # ifdef QT_SHARED
83 # error "QT_SHARED and QT_BOOTSTRAPPED together don't make sense. Please fix the build"
84 # elif !defined(QT_STATIC)
85 # define QT_STATIC
86 # endif
87 #endif
88 
89 #if defined(QT_SHARED) || !defined(QT_STATIC)
90 # ifdef QT_STATIC
91 # error "Both QT_SHARED and QT_STATIC defined, please make up your mind"
92 # endif
93 # ifndef QT_SHARED
94 # define QT_SHARED
95 # endif
96 #endif
97 
98 #include <QtCore/qtcoreexports.h>
99 
100 /*
101  The QT_CONFIG macro implements a safe compile time check for features of Qt.
102  Features can be in three states:
103  0 or undefined: This will lead to a compile error when testing for it
104  -1: The feature is not available
105  1: The feature is available
106 */
107 #define QT_CONFIG(feature) (1/QT_FEATURE_##feature == 1)
108 #define QT_REQUIRE_CONFIG(feature) Q_STATIC_ASSERT_X(QT_FEATURE_##feature == 1, "Required feature " #feature " for file " __FILE__ " not available.")
109 
110 /*
111  helper macros to make some simple code work active in Qt 6 or Qt 7 only,
112  like:
113  struct QT6_ONLY(Q_CORE_EXPORT) QTrivialClass
114  {
115  void QT7_ONLY(Q_CORE_EXPORT) void operate();
116  }
117 */
118 #if QT_VERSION_MAJOR == 7
119 # define QT7_ONLY(...) __VA_ARGS__
120 # define QT6_ONLY(...)
121 #elif QT_VERSION_MAJOR == 6
122 # define QT7_ONLY(...)
123 # define QT6_ONLY(...) __VA_ARGS__
124 #else
125 # error Qt major version not 6 or 7
126 #endif
127 
128 /* These two macros makes it possible to turn the builtin line expander into a
129  * string literal. */
130 #define QT_STRINGIFY2(x) #x
131 #define QT_STRINGIFY(x) QT_STRINGIFY2(x)
132 
133 #include <QtCore/qsystemdetection.h>
134 #include <QtCore/qprocessordetection.h>
135 #include <QtCore/qcompilerdetection.h>
136 
137 // This could go to the very beginning of this file, but we're using compiler
138 // detection, so it's here.
139 #if defined(__cplusplus) && (__cplusplus < 201703L)
140 # ifdef Q_CC_MSVC
141 # error "Qt requires a C++17 compiler, and a suitable value for __cplusplus. On MSVC, you must pass the /Zc:__cplusplus option to the compiler."
142 # else
143 # error "Qt requires a C++17 compiler"
144 # endif
145 #endif // __cplusplus
146 
147 #if defined(__cplusplus) && defined(Q_CC_MSVC) && !defined(Q_CC_CLANG)
148 # if Q_CC_MSVC < 1927
149  // Check below only works with 16.7 or newer
150 # error "Qt requires at least Visual Studio 2019 version 16.7 (VC++ version 14.27). Please upgrade."
151 # endif
152 
153 // On MSVC we require /permissive- set by user code. Check that we are
154 // under its rules -- for instance, check that std::nullptr_t->bool is
155 // not an implicit conversion, as per
156 // https://docs.microsoft.com/en-us/cpp/overview/cpp-conformance-improvements?view=msvc-160#nullptr_t-is-only-convertible-to-bool-as-a-direct-initialization
157 static_assert(!std::is_convertible_v<std::nullptr_t, bool>,
158  "On MSVC you must pass the /permissive- option to the compiler.");
159 #endif
160 
161 #if defined (__ELF__)
162 # define Q_OF_ELF
163 #endif
164 #if defined (__MACH__) && defined (__APPLE__)
165 # define Q_OF_MACH_O
166 #endif
167 
168 /*
169  Avoid "unused parameter" warnings
170 */
171 #define Q_UNUSED(x) (void)x;
172 
173 #if defined(__cplusplus)
174 // Don't use these in C++ mode, use static_assert directly.
175 // These are here only to keep old code compiling.
176 # define Q_STATIC_ASSERT(Condition) static_assert(bool(Condition), #Condition)
177 # define Q_STATIC_ASSERT_X(Condition, Message) static_assert(bool(Condition), Message)
178 #elif defined(Q_COMPILER_STATIC_ASSERT)
179 // C11 mode - using the _S version in case <assert.h> doesn't do the right thing
180 # define Q_STATIC_ASSERT(Condition) _Static_assert(!!(Condition), #Condition)
181 # define Q_STATIC_ASSERT_X(Condition, Message) _Static_assert(!!(Condition), Message)
182 #else
183 // C89 & C99 version
184 # define Q_STATIC_ASSERT_PRIVATE_JOIN(A, B) Q_STATIC_ASSERT_PRIVATE_JOIN_IMPL(A, B)
185 # define Q_STATIC_ASSERT_PRIVATE_JOIN_IMPL(A, B) A ## B
186 # ifdef __COUNTER__
187 # define Q_STATIC_ASSERT(Condition) \
188  typedef char Q_STATIC_ASSERT_PRIVATE_JOIN(q_static_assert_result, __COUNTER__) [(Condition) ? 1 : -1];
189 # else
190 # define Q_STATIC_ASSERT(Condition) \
191  typedef char Q_STATIC_ASSERT_PRIVATE_JOIN(q_static_assert_result, __LINE__) [(Condition) ? 1 : -1];
192 # endif /* __COUNTER__ */
193 # define Q_STATIC_ASSERT_X(Condition, Message) Q_STATIC_ASSERT(Condition)
194 #endif
195 
196 #ifdef __cplusplus
197 
198 #if !defined(QT_NAMESPACE) || defined(Q_MOC_RUN) /* user namespace */
199 
200 # define QT_PREPEND_NAMESPACE(name) ::name
201 # define QT_USE_NAMESPACE
202 # define QT_BEGIN_NAMESPACE
203 # define QT_END_NAMESPACE
204 # define QT_BEGIN_INCLUDE_NAMESPACE
205 # define QT_END_INCLUDE_NAMESPACE
206 #ifndef QT_BEGIN_MOC_NAMESPACE
207 # define QT_BEGIN_MOC_NAMESPACE
208 #endif
209 #ifndef QT_END_MOC_NAMESPACE
210 # define QT_END_MOC_NAMESPACE
211 #endif
212 # define QT_FORWARD_DECLARE_CLASS(name) class name;
213 # define QT_FORWARD_DECLARE_STRUCT(name) struct name;
214 # define QT_MANGLE_NAMESPACE(name) name
215 
216 #else /* user namespace */
217 
218 # define QT_PREPEND_NAMESPACE(name) ::QT_NAMESPACE::name
219 # define QT_USE_NAMESPACE using namespace ::QT_NAMESPACE;
220 # define QT_BEGIN_NAMESPACE namespace QT_NAMESPACE {
221 # define QT_END_NAMESPACE }
222 # define QT_BEGIN_INCLUDE_NAMESPACE }
223 # define QT_END_INCLUDE_NAMESPACE namespace QT_NAMESPACE {
224 #ifndef QT_BEGIN_MOC_NAMESPACE
225 # define QT_BEGIN_MOC_NAMESPACE QT_USE_NAMESPACE
226 #endif
227 #ifndef QT_END_MOC_NAMESPACE
228 # define QT_END_MOC_NAMESPACE
229 #endif
230 # define QT_FORWARD_DECLARE_CLASS(name) \
231  QT_BEGIN_NAMESPACE class name; QT_END_NAMESPACE \
232  using QT_PREPEND_NAMESPACE(name);
233 
234 # define QT_FORWARD_DECLARE_STRUCT(name) \
235  QT_BEGIN_NAMESPACE struct name; QT_END_NAMESPACE \
236  using QT_PREPEND_NAMESPACE(name);
237 
238 # define QT_MANGLE_NAMESPACE0(x) x
239 # define QT_MANGLE_NAMESPACE1(a, b) a##_##b
240 # define QT_MANGLE_NAMESPACE2(a, b) QT_MANGLE_NAMESPACE1(a,b)
241 # define QT_MANGLE_NAMESPACE(name) QT_MANGLE_NAMESPACE2( \
242  QT_MANGLE_NAMESPACE0(name), QT_MANGLE_NAMESPACE0(QT_NAMESPACE))
243 
244 namespace QT_NAMESPACE {}
245 
246 # ifndef QT_BOOTSTRAPPED
247 # ifndef QT_NO_USING_NAMESPACE
248  /*
249  This expands to a "using QT_NAMESPACE" also in _header files_.
250  It is the only way the feature can be used without too much
251  pain, but if people _really_ do not want it they can add
252  DEFINES += QT_NO_USING_NAMESPACE to their .pro files.
253  */
255 # endif
256 # endif
257 
258 #endif /* user namespace */
259 
260 #else /* __cplusplus */
261 
262 # define QT_BEGIN_NAMESPACE
263 # define QT_END_NAMESPACE
264 # define QT_USE_NAMESPACE
265 # define QT_BEGIN_INCLUDE_NAMESPACE
266 # define QT_END_INCLUDE_NAMESPACE
267 
268 #endif /* __cplusplus */
269 
270 #if defined(Q_OS_DARWIN) && !defined(QT_LARGEFILE_SUPPORT)
271 # define QT_LARGEFILE_SUPPORT 64
272 #endif
273 
274 #ifndef __ASSEMBLER__
276 
277 /*
278  Size-dependent types (architechture-dependent byte order)
279 
280  Make sure to update QMetaType when changing these typedefs
281 */
282 
283 typedef signed char qint8; /* 8 bit signed */
284 typedef unsigned char quint8; /* 8 bit unsigned */
285 typedef short qint16; /* 16 bit signed */
286 typedef unsigned short quint16; /* 16 bit unsigned */
287 typedef int qint32; /* 32 bit signed */
288 typedef unsigned int quint32; /* 32 bit unsigned */
289 // Unlike LL / ULL in C++, for historical reasons, we force the
290 // result to be of the requested type.
291 #ifdef __cplusplus
292 # define Q_INT64_C(c) static_cast<long long>(c ## LL) /* signed 64 bit constant */
293 # define Q_UINT64_C(c) static_cast<unsigned long long>(c ## ULL) /* unsigned 64 bit constant */
294 #else
295 # define Q_INT64_C(c) ((long long)(c ## LL)) /* signed 64 bit constant */
296 # define Q_UINT64_C(c) ((unsigned long long)(c ## ULL)) /* unsigned 64 bit constant */
297 #endif
298 typedef long long qint64; /* 64 bit signed */
299 typedef unsigned long long quint64; /* 64 bit unsigned */
300 
303 
304 #ifndef __cplusplus
305 // In C++ mode, we define below using QIntegerForSize template
306 Q_STATIC_ASSERT_X(sizeof(ptrdiff_t) == sizeof(size_t), "Weird ptrdiff_t and size_t definitions");
307 typedef ptrdiff_t qptrdiff;
308 typedef ptrdiff_t qsizetype;
309 typedef ptrdiff_t qintptr;
310 typedef size_t quintptr;
311 
312 #define PRIdQPTRDIFF "td"
313 #define PRIiQPTRDIFF "ti"
314 
315 #define PRIdQSIZETYPE "td"
316 #define PRIiQSIZETYPE "ti"
317 
318 #define PRIdQINTPTR "td"
319 #define PRIiQINTPTR "ti"
320 
321 #define PRIuQUINTPTR "zu"
322 #define PRIoQUINTPTR "zo"
323 #define PRIxQUINTPTR "zx"
324 #define PRIXQUINTPTR "zX"
325 #endif
326 
327 /*
328  Useful type definitions for Qt
329 */
330 
332 typedef unsigned char uchar;
333 typedef unsigned short ushort;
334 typedef unsigned int uint;
335 typedef unsigned long ulong;
337 
338 #if defined(QT_COORD_TYPE)
339 typedef QT_COORD_TYPE qreal;
340 #else
341 typedef double qreal;
342 #endif
343 
344 #if defined(QT_NO_DEPRECATED)
345 # undef QT_DEPRECATED
346 # undef QT_DEPRECATED_X
347 # undef QT_DEPRECATED_VARIABLE
348 # undef QT_DEPRECATED_CONSTRUCTOR
349 #elif !defined(QT_NO_DEPRECATED_WARNINGS)
350 # undef QT_DEPRECATED
351 # define QT_DEPRECATED Q_DECL_DEPRECATED
352 # undef QT_DEPRECATED_X
353 # define QT_DEPRECATED_X(text) Q_DECL_DEPRECATED_X(text)
354 # undef QT_DEPRECATED_VARIABLE
355 # define QT_DEPRECATED_VARIABLE Q_DECL_VARIABLE_DEPRECATED
356 # undef QT_DEPRECATED_CONSTRUCTOR
357 # define QT_DEPRECATED_CONSTRUCTOR Q_DECL_CONSTRUCTOR_DEPRECATED explicit
358 #else
359 # undef QT_DEPRECATED
360 # define QT_DEPRECATED
361 # undef QT_DEPRECATED_X
362 # define QT_DEPRECATED_X(text)
363 # undef QT_DEPRECATED_VARIABLE
364 # define QT_DEPRECATED_VARIABLE
365 # undef QT_DEPRECATED_CONSTRUCTOR
366 # define QT_DEPRECATED_CONSTRUCTOR
367 # undef Q_DECL_ENUMERATOR_DEPRECATED
368 # define Q_DECL_ENUMERATOR_DEPRECATED
369 #endif
370 
371 #ifndef QT_DEPRECATED_WARNINGS_SINCE
372 # ifdef QT_DISABLE_DEPRECATED_BEFORE
373 # define QT_DEPRECATED_WARNINGS_SINCE QT_DISABLE_DEPRECATED_BEFORE
374 # else
375 # define QT_DEPRECATED_WARNINGS_SINCE QT_VERSION
376 # endif
377 #endif
378 
379 #ifndef QT_DISABLE_DEPRECATED_BEFORE
380 #define QT_DISABLE_DEPRECATED_BEFORE QT_VERSION_CHECK(5, 0, 0)
381 #endif
382 
383 /*
384  QT_DEPRECATED_SINCE(major, minor) evaluates as true if the Qt version is greater than
385  the deprecation point specified.
386 
387  Use it to specify from which version of Qt a function or class has been deprecated
388 
389  Example:
390  #if QT_DEPRECATED_SINCE(5,1)
391  QT_DEPRECATED void deprecatedFunction(); //function deprecated since Qt 5.1
392  #endif
393 
394 */
395 #ifdef QT_DEPRECATED
396 #define QT_DEPRECATED_SINCE(major, minor) (QT_VERSION_CHECK(major, minor, 0) > QT_DISABLE_DEPRECATED_BEFORE)
397 #else
398 #define QT_DEPRECATED_SINCE(major, minor) 0
399 #endif
400 
401 /*
402  QT_DEPRECATED_VERSION(major, minor) and QT_DEPRECATED_VERSION_X(major, minor, text)
403  outputs a deprecation warning if QT_DEPRECATED_WARNINGS_SINCE is equal or greater
404  than the version specified as major, minor. This makes it possible to deprecate a
405  function without annoying a user who needs to stick at a specified minimum version
406  and therefore can't use the new function.
407 */
408 #if QT_DEPRECATED_WARNINGS_SINCE >= QT_VERSION_CHECK(5, 12, 0)
409 # define QT_DEPRECATED_VERSION_X_5_12(text) QT_DEPRECATED_X(text)
410 # define QT_DEPRECATED_VERSION_5_12 QT_DEPRECATED
411 #else
412 # define QT_DEPRECATED_VERSION_X_5_12(text)
413 # define QT_DEPRECATED_VERSION_5_12
414 #endif
415 
416 #if QT_DEPRECATED_WARNINGS_SINCE >= QT_VERSION_CHECK(5, 13, 0)
417 # define QT_DEPRECATED_VERSION_X_5_13(text) QT_DEPRECATED_X(text)
418 # define QT_DEPRECATED_VERSION_5_13 QT_DEPRECATED
419 #else
420 # define QT_DEPRECATED_VERSION_X_5_13(text)
421 # define QT_DEPRECATED_VERSION_5_13
422 #endif
423 
424 #if QT_DEPRECATED_WARNINGS_SINCE >= QT_VERSION_CHECK(5, 14, 0)
425 # define QT_DEPRECATED_VERSION_X_5_14(text) QT_DEPRECATED_X(text)
426 # define QT_DEPRECATED_VERSION_5_14 QT_DEPRECATED
427 #else
428 # define QT_DEPRECATED_VERSION_X_5_14(text)
429 # define QT_DEPRECATED_VERSION_5_14
430 #endif
431 
432 #if QT_DEPRECATED_WARNINGS_SINCE >= QT_VERSION_CHECK(5, 15, 0)
433 # define QT_DEPRECATED_VERSION_X_5_15(text) QT_DEPRECATED_X(text)
434 # define QT_DEPRECATED_VERSION_5_15 QT_DEPRECATED
435 #else
436 # define QT_DEPRECATED_VERSION_X_5_15(text)
437 # define QT_DEPRECATED_VERSION_5_15
438 #endif
439 
440 #if QT_DEPRECATED_WARNINGS_SINCE >= QT_VERSION_CHECK(6, 0, 0)
441 # define QT_DEPRECATED_VERSION_X_6_0(text) QT_DEPRECATED_X(text)
442 # define QT_DEPRECATED_VERSION_6_0 QT_DEPRECATED
443 #else
444 # define QT_DEPRECATED_VERSION_X_6_0(text)
445 # define QT_DEPRECATED_VERSION_6_0
446 #endif
447 
448 #if QT_DEPRECATED_WARNINGS_SINCE >= QT_VERSION_CHECK(6, 1, 0)
449 # define QT_DEPRECATED_VERSION_X_6_1(text) QT_DEPRECATED_X(text)
450 # define QT_DEPRECATED_VERSION_6_1 QT_DEPRECATED
451 #else
452 # define QT_DEPRECATED_VERSION_X_6_1(text)
453 # define QT_DEPRECATED_VERSION_6_1
454 #endif
455 
456 #if QT_DEPRECATED_WARNINGS_SINCE >= QT_VERSION_CHECK(6, 2, 0)
457 # define QT_DEPRECATED_VERSION_X_6_2(text) QT_DEPRECATED_X(text)
458 # define QT_DEPRECATED_VERSION_6_2 QT_DEPRECATED
459 #else
460 # define QT_DEPRECATED_VERSION_X_6_2(text)
461 # define QT_DEPRECATED_VERSION_6_2
462 #endif
463 
464 #if QT_DEPRECATED_WARNINGS_SINCE >= QT_VERSION_CHECK(6, 3, 0)
465 # define QT_DEPRECATED_VERSION_X_6_3(text) QT_DEPRECATED_X(text)
466 # define QT_DEPRECATED_VERSION_6_3 QT_DEPRECATED
467 #else
468 # define QT_DEPRECATED_VERSION_X_6_3(text)
469 # define QT_DEPRECATED_VERSION_6_3
470 #endif
471 
472 #if QT_DEPRECATED_WARNINGS_SINCE >= QT_VERSION_CHECK(6, 4, 0)
473 # define QT_DEPRECATED_VERSION_X_6_4(text) QT_DEPRECATED_X(text)
474 # define QT_DEPRECATED_VERSION_6_4 QT_DEPRECATED
475 #else
476 # define QT_DEPRECATED_VERSION_X_6_4(text)
477 # define QT_DEPRECATED_VERSION_6_4
478 #endif
479 
480 #if QT_DEPRECATED_WARNINGS_SINCE >= QT_VERSION_CHECK(6, 5, 0)
481 # define QT_DEPRECATED_VERSION_X_6_5(text) QT_DEPRECATED_X(text)
482 # define QT_DEPRECATED_VERSION_6_5 QT_DEPRECATED
483 #else
484 # define QT_DEPRECATED_VERSION_X_6_5(text)
485 # define QT_DEPRECATED_VERSION_6_5
486 #endif
487 
488 #if QT_DEPRECATED_WARNINGS_SINCE >= QT_VERSION_CHECK(6, 6, 0)
489 # define QT_DEPRECATED_VERSION_X_6_6(text) QT_DEPRECATED_X(text)
490 # define QT_DEPRECATED_VERSION_6_6 QT_DEPRECATED
491 #else
492 # define QT_DEPRECATED_VERSION_X_6_6(text)
493 # define QT_DEPRECATED_VERSION_6_6
494 #endif
495 
496 #define QT_DEPRECATED_VERSION_X_5(minor, text) QT_DEPRECATED_VERSION_X_5_##minor(text)
497 #define QT_DEPRECATED_VERSION_X(major, minor, text) QT_DEPRECATED_VERSION_X_##major##_##minor(text)
498 
499 #define QT_DEPRECATED_VERSION_5(minor) QT_DEPRECATED_VERSION_5_##minor
500 #define QT_DEPRECATED_VERSION(major, minor) QT_DEPRECATED_VERSION_##major##_##minor
501 
502 #ifdef __cplusplus
503 // A tag to help mark stuff deprecated (cf. QStringViewLiteral)
504 namespace QtPrivate {
505 enum class Deprecated_t {};
506 constexpr inline Deprecated_t Deprecated = {};
507 }
508 #endif
509 
510 /*
511  Some classes do not permit copies to be made of an object. These
512  classes contains a private copy constructor and assignment
513  operator to disable copying (the compiler gives an error message).
514 */
515 #define Q_DISABLE_COPY(Class) \
516  Class(const Class &) = delete;\
517  Class &operator=(const Class &) = delete;
518 
519 #define Q_DISABLE_COPY_MOVE(Class) \
520  Q_DISABLE_COPY(Class) \
521  Class(Class &&) = delete; \
522  Class &operator=(Class &&) = delete;
523 
524 /*
525  Implementing a move assignment operator using an established
526  technique (move-and-swap, pure swap) is just boilerplate.
527  Here's a couple of *private* macros for convenience.
528 
529  To know which one to use:
530 
531  * if you don't have a move constructor (*) => use pure swap;
532  * if you have a move constructor, then
533  * if your class holds just memory (no file handles, no user-defined
534  datatypes, etc.) => use pure swap;
535  * use move and swap.
536 
537  The preference should always go for the move-and-swap one, as it
538  will deterministically destroy the data previously held in *this,
539  and not "dump" it in the moved-from object (which may then be alive
540  for longer).
541 
542  The requirement for either macro is the presence of a member swap(),
543  which any value class that defines its own special member functions
544  should have anyhow.
545 
546  (*) Many value classes in Qt do not have move constructors; mostly,
547  the implicitly shared classes using QSharedDataPointer and friends.
548  The reason is mostly historical: those classes require either an
549  out-of-line move constructor, which we could not provide before we
550  made C++11 mandatory (and that we don't like anyhow), or
551  an out-of-line dtor for the Q(E)DSP<Private> member (cf. QPixmap).
552 
553  If you can however add a move constructor to a class lacking it,
554  consider doing so, then reevaluate which macro to choose.
555 */
556 #define QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_MOVE_AND_SWAP(Class) \
557  Class &operator=(Class &&other) noexcept { \
558  Class moved(std::move(other)); \
559  swap(moved); \
560  return *this; \
561  }
562 
563 #define QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP(Class) \
564  Class &operator=(Class &&other) noexcept { \
565  swap(other); \
566  return *this; \
567  }
568 
569 /*
570  No, this is not an evil backdoor. QT_BUILD_INTERNAL just exports more symbols
571  for Qt's internal unit tests. If you want slower loading times and more
572  symbols that can vanish from version to version, feel free to define QT_BUILD_INTERNAL.
573 */
574 #if defined(QT_BUILD_INTERNAL) && defined(QT_BUILDING_QT) && defined(QT_SHARED)
575 # define Q_AUTOTEST_EXPORT Q_DECL_EXPORT
576 #elif defined(QT_BUILD_INTERNAL) && defined(QT_SHARED)
577 # define Q_AUTOTEST_EXPORT Q_DECL_IMPORT
578 #else
579 # define Q_AUTOTEST_EXPORT
580 #endif
581 
582 #define Q_INIT_RESOURCE(name) \
583  do { extern int QT_MANGLE_NAMESPACE(qInitResources_ ## name) (); \
584  QT_MANGLE_NAMESPACE(qInitResources_ ## name) (); } while (false)
585 #define Q_CLEANUP_RESOURCE(name) \
586  do { extern int QT_MANGLE_NAMESPACE(qCleanupResources_ ## name) (); \
587  QT_MANGLE_NAMESPACE(qCleanupResources_ ## name) (); } while (false)
588 
589 /*
590  * If we're compiling C++ code:
591  * - and this is a non-namespace build, declare qVersion as extern "C"
592  * - and this is a namespace build, declare it as a regular function
593  * (we're already inside QT_BEGIN_NAMESPACE / QT_END_NAMESPACE)
594  * If we're compiling C code, simply declare the function. If Qt was compiled
595  * in a namespace, qVersion isn't callable anyway.
596  */
597 #if !defined(QT_NAMESPACE) && defined(__cplusplus) && !defined(Q_QDOC)
598 extern "C"
599 #endif
600 Q_CORE_EXPORT Q_DECL_CONST_FUNCTION const char *qVersion(void) Q_DECL_NOEXCEPT;
601 
602 #if defined(__cplusplus)
603 
604 #ifndef Q_CONSTRUCTOR_FUNCTION
605 # define Q_CONSTRUCTOR_FUNCTION0(AFUNC) \
606  namespace { \
607  static const struct AFUNC ## _ctor_class_ { \
608  inline AFUNC ## _ctor_class_() { AFUNC(); } \
609  } AFUNC ## _ctor_instance_; \
610  }
611 
612 # define Q_CONSTRUCTOR_FUNCTION(AFUNC) Q_CONSTRUCTOR_FUNCTION0(AFUNC)
613 #endif
614 
615 #ifndef Q_DESTRUCTOR_FUNCTION
616 # define Q_DESTRUCTOR_FUNCTION0(AFUNC) \
617  namespace { \
618  static const struct AFUNC ## _dtor_class_ { \
619  inline AFUNC ## _dtor_class_() { } \
620  inline ~ AFUNC ## _dtor_class_() { AFUNC(); } \
621  } AFUNC ## _dtor_instance_; \
622  }
623 # define Q_DESTRUCTOR_FUNCTION(AFUNC) Q_DESTRUCTOR_FUNCTION0(AFUNC)
624 #endif
625 
626 /*
627  quintptr and qptrdiff is guaranteed to be the same size as a pointer, i.e.
628 
629  sizeof(void *) == sizeof(quintptr)
630  && sizeof(void *) == sizeof(qptrdiff)
631 
632  size_t and qsizetype are not guaranteed to be the same size as a pointer, but
633  they usually are. We actually check for that in qglobal.cpp.
634 */
635 template <int> struct QIntegerForSize;
636 template <> struct QIntegerForSize<1> { typedef quint8 Unsigned; typedef qint8 Signed; };
637 template <> struct QIntegerForSize<2> { typedef quint16 Unsigned; typedef qint16 Signed; };
638 template <> struct QIntegerForSize<4> { typedef quint32 Unsigned; typedef qint32 Signed; };
639 template <> struct QIntegerForSize<8> { typedef quint64 Unsigned; typedef qint64 Signed; };
640 #if defined(Q_CC_GNU) && defined(__SIZEOF_INT128__)
641 template <> struct QIntegerForSize<16> { __extension__ typedef unsigned __int128 Unsigned; __extension__ typedef __int128 Signed; };
642 #endif
643 template <class T> struct QIntegerForSizeof: QIntegerForSize<sizeof(T)> { };
644 typedef QIntegerForSize<Q_PROCESSOR_WORDSIZE>::Signed qregisterint;
645 typedef QIntegerForSize<Q_PROCESSOR_WORDSIZE>::Unsigned qregisteruint;
646 typedef QIntegerForSizeof<void *>::Unsigned quintptr;
647 typedef QIntegerForSizeof<void *>::Signed qptrdiff;
648 typedef qptrdiff qintptr;
649 using qsizetype = QIntegerForSizeof<std::size_t>::Signed;
650 
651 // These custom definitions are necessary as we're not defining our
652 // datatypes in terms of the language ones, but in terms of integer
653 // types that have the sime size. For instance, on a 32-bit platform,
654 // qptrdiff is int, while ptrdiff_t may be aliased to long; therefore
655 // using %td to print a qptrdiff would be wrong (and raise -Wformat
656 // warnings), although both int and long have same bit size on that
657 // platform.
658 //
659 // We know that sizeof(size_t) == sizeof(void *) == sizeof(qptrdiff).
660 #if SIZE_MAX == 4294967295ULL
661 #define PRIuQUINTPTR "u"
662 #define PRIoQUINTPTR "o"
663 #define PRIxQUINTPTR "x"
664 #define PRIXQUINTPTR "X"
665 
666 #define PRIdQPTRDIFF "d"
667 #define PRIiQPTRDIFF "i"
668 
669 #define PRIdQINTPTR "d"
670 #define PRIiQINTPTR "i"
671 
672 #define PRIdQSIZETYPE "d"
673 #define PRIiQSIZETYPE "i"
674 #elif SIZE_MAX == 18446744073709551615ULL
675 #define PRIuQUINTPTR "llu"
676 #define PRIoQUINTPTR "llo"
677 #define PRIxQUINTPTR "llx"
678 #define PRIXQUINTPTR "llX"
679 
680 #define PRIdQPTRDIFF "lld"
681 #define PRIiQPTRDIFF "lli"
682 
683 #define PRIdQINTPTR "lld"
684 #define PRIiQINTPTR "lli"
685 
686 #define PRIdQSIZETYPE "lld"
687 #define PRIiQSIZETYPE "lli"
688 #else
689 #error Unsupported platform (unknown value for SIZE_MAX)
690 #endif
691 
692 /* moc compats (signals/slots) */
693 #ifndef QT_MOC_COMPAT
694 # define QT_MOC_COMPAT
695 #else
696 # undef QT_MOC_COMPAT
697 # define QT_MOC_COMPAT
698 #endif
699 
700 #ifdef QT_ASCII_CAST_WARNINGS
701 # define QT_ASCII_CAST_WARN Q_DECL_DEPRECATED_X("Use fromUtf8, QStringLiteral, or QLatin1String")
702 #else
703 # define QT_ASCII_CAST_WARN
704 #endif
705 
706 #ifdef Q_PROCESSOR_X86_32
707 # if defined(Q_CC_GNU)
708 # define QT_FASTCALL __attribute__((regparm(3)))
709 # elif defined(Q_CC_MSVC)
710 # define QT_FASTCALL __fastcall
711 # else
712 # define QT_FASTCALL
713 # endif
714 #else
715 # define QT_FASTCALL
716 #endif
717 
718 // enable gcc warnings for printf-style functions
719 #if defined(Q_CC_GNU) && !defined(__INSURE__)
720 # if defined(Q_CC_MINGW) && !defined(Q_CC_CLANG)
721 # define Q_ATTRIBUTE_FORMAT_PRINTF(A, B) \
722  __attribute__((format(gnu_printf, (A), (B))))
723 # else
724 # define Q_ATTRIBUTE_FORMAT_PRINTF(A, B) \
725  __attribute__((format(printf, (A), (B))))
726 # endif
727 #else
728 # define Q_ATTRIBUTE_FORMAT_PRINTF(A, B)
729 #endif
730 
731 #ifdef Q_CC_MSVC
732 # define Q_NEVER_INLINE __declspec(noinline)
733 # define Q_ALWAYS_INLINE __forceinline
734 #elif defined(Q_CC_GNU)
735 # define Q_NEVER_INLINE __attribute__((noinline))
736 # define Q_ALWAYS_INLINE inline __attribute__((always_inline))
737 #else
738 # define Q_NEVER_INLINE
739 # define Q_ALWAYS_INLINE inline
740 #endif
741 
742 //defines the type for the WNDPROC on windows
743 //the alignment needs to be forced for sse2 to not crash with mingw
744 #if defined(Q_OS_WIN)
745 # if defined(Q_CC_MINGW) && defined(Q_PROCESSOR_X86_32)
746 # define QT_ENSURE_STACK_ALIGNED_FOR_SSE __attribute__ ((force_align_arg_pointer))
747 # else
748 # define QT_ENSURE_STACK_ALIGNED_FOR_SSE
749 # endif
750 # define QT_WIN_CALLBACK CALLBACK QT_ENSURE_STACK_ALIGNED_FOR_SSE
751 #endif
752 
753 /*
754  Utility macros and inline functions
755 */
756 
757 template <typename T>
758 constexpr inline T qAbs(const T &t) { return t >= 0 ? t : -t; }
759 
760 // gcc < 10 doesn't have __has_builtin
761 #if defined(Q_PROCESSOR_ARM_64) && (__has_builtin(__builtin_round) || defined(Q_CC_GNU)) && !defined(Q_CC_CLANG)
762 // ARM64 has a single instruction that can do C++ rounding with conversion to integer.
763 // Note current clang versions have non-constexpr __builtin_round, ### allow clang this path when they fix it.
764 constexpr inline int qRound(double d)
765 { return int(__builtin_round(d)); }
766 constexpr inline int qRound(float f)
767 { return int(__builtin_roundf(f)); }
768 constexpr inline qint64 qRound64(double d)
769 { return qint64(__builtin_round(d)); }
770 constexpr inline qint64 qRound64(float f)
771 { return qint64(__builtin_roundf(f)); }
772 #elif defined(__SSE2__) && (__has_builtin(__builtin_copysign) || defined(Q_CC_GNU))
773 // SSE has binary operations directly on floating point making copysign fast
774 constexpr inline int qRound(double d)
775 { return int(d + __builtin_copysign(0.5, d)); }
776 constexpr inline int qRound(float f)
777 { return int(f + __builtin_copysignf(0.5f, f)); }
778 constexpr inline qint64 qRound64(double d)
779 { return qint64(d + __builtin_copysign(0.5, d)); }
780 constexpr inline qint64 qRound64(float f)
781 { return qint64(f + __builtin_copysignf(0.5f, f)); }
782 #else
783 constexpr inline int qRound(double d)
784 { return d >= 0.0 ? int(d + 0.5) : int(d - 0.5); }
785 constexpr inline int qRound(float d)
786 { return d >= 0.0f ? int(d + 0.5f) : int(d - 0.5f); }
787 
788 constexpr inline qint64 qRound64(double d)
789 { return d >= 0.0 ? qint64(d + 0.5) : qint64(d - 0.5); }
790 constexpr inline qint64 qRound64(float d)
791 { return d >= 0.0f ? qint64(d + 0.5f) : qint64(d - 0.5f); }
792 #endif
793 
794 #ifndef Q_FORWARD_DECLARE_OBJC_CLASS
795 # ifdef __OBJC__
796 # define Q_FORWARD_DECLARE_OBJC_CLASS(classname) @class classname
797 # else
798 # define Q_FORWARD_DECLARE_OBJC_CLASS(classname) class classname
799 # endif
800 #endif
801 #ifndef Q_FORWARD_DECLARE_CF_TYPE
802 # define Q_FORWARD_DECLARE_CF_TYPE(type) typedef const struct __ ## type * type ## Ref
803 #endif
804 #ifndef Q_FORWARD_DECLARE_MUTABLE_CF_TYPE
805 # define Q_FORWARD_DECLARE_MUTABLE_CF_TYPE(type) typedef struct __ ## type * type ## Ref
806 #endif
807 #ifndef Q_FORWARD_DECLARE_CG_TYPE
808 #define Q_FORWARD_DECLARE_CG_TYPE(type) typedef const struct type *type ## Ref;
809 #endif
810 #ifndef Q_FORWARD_DECLARE_MUTABLE_CG_TYPE
811 #define Q_FORWARD_DECLARE_MUTABLE_CG_TYPE(type) typedef struct type *type ## Ref;
812 #endif
813 
814 #ifdef Q_OS_DARWIN
815 # define QT_DARWIN_PLATFORM_SDK_EQUAL_OR_ABOVE(macos, ios, tvos, watchos) \
816  ((defined(__MAC_OS_X_VERSION_MAX_ALLOWED) && macos != __MAC_NA && __MAC_OS_X_VERSION_MAX_ALLOWED >= macos) || \
817  (defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && ios != __IPHONE_NA && __IPHONE_OS_VERSION_MAX_ALLOWED >= ios) || \
818  (defined(__TV_OS_VERSION_MAX_ALLOWED) && tvos != __TVOS_NA && __TV_OS_VERSION_MAX_ALLOWED >= tvos) || \
819  (defined(__WATCH_OS_VERSION_MAX_ALLOWED) && watchos != __WATCHOS_NA && __WATCH_OS_VERSION_MAX_ALLOWED >= watchos))
820 
821 # define QT_DARWIN_DEPLOYMENT_TARGET_BELOW(macos, ios, tvos, watchos) \
822  ((defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && macos != __MAC_NA && __MAC_OS_X_VERSION_MIN_REQUIRED < macos) || \
823  (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && ios != __IPHONE_NA && __IPHONE_OS_VERSION_MIN_REQUIRED < ios) || \
824  (defined(__TV_OS_VERSION_MIN_REQUIRED) && tvos != __TVOS_NA && __TV_OS_VERSION_MIN_REQUIRED < tvos) || \
825  (defined(__WATCH_OS_VERSION_MIN_REQUIRED) && watchos != __WATCHOS_NA && __WATCH_OS_VERSION_MIN_REQUIRED < watchos))
826 
827 # define QT_MACOS_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(macos, ios) \
828  QT_DARWIN_PLATFORM_SDK_EQUAL_OR_ABOVE(macos, ios, __TVOS_NA, __WATCHOS_NA)
829 # define QT_MACOS_PLATFORM_SDK_EQUAL_OR_ABOVE(macos) \
830  QT_DARWIN_PLATFORM_SDK_EQUAL_OR_ABOVE(macos, __IPHONE_NA, __TVOS_NA, __WATCHOS_NA)
831 # define QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(ios) \
832  QT_DARWIN_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_NA, ios, __TVOS_NA, __WATCHOS_NA)
833 # define QT_TVOS_PLATFORM_SDK_EQUAL_OR_ABOVE(tvos) \
834  QT_DARWIN_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_NA, __IPHONE_NA, tvos, __WATCHOS_NA)
835 # define QT_WATCHOS_PLATFORM_SDK_EQUAL_OR_ABOVE(watchos) \
836  QT_DARWIN_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_NA, __IPHONE_NA, __TVOS_NA, watchos)
837 
838 # define QT_MACOS_IOS_DEPLOYMENT_TARGET_BELOW(macos, ios) \
839  QT_DARWIN_DEPLOYMENT_TARGET_BELOW(macos, ios, __TVOS_NA, __WATCHOS_NA)
840 # define QT_MACOS_DEPLOYMENT_TARGET_BELOW(macos) \
841  QT_DARWIN_DEPLOYMENT_TARGET_BELOW(macos, __IPHONE_NA, __TVOS_NA, __WATCHOS_NA)
842 # define QT_IOS_DEPLOYMENT_TARGET_BELOW(ios) \
843  QT_DARWIN_DEPLOYMENT_TARGET_BELOW(__MAC_NA, ios, __TVOS_NA, __WATCHOS_NA)
844 # define QT_TVOS_DEPLOYMENT_TARGET_BELOW(tvos) \
845  QT_DARWIN_DEPLOYMENT_TARGET_BELOW(__MAC_NA, __IPHONE_NA, tvos, __WATCHOS_NA)
846 # define QT_WATCHOS_DEPLOYMENT_TARGET_BELOW(watchos) \
847  QT_DARWIN_DEPLOYMENT_TARGET_BELOW(__MAC_NA, __IPHONE_NA, __TVOS_NA, watchos)
848 
849 // Compatibility synonyms, do not use
850 # define QT_MAC_PLATFORM_SDK_EQUAL_OR_ABOVE(osx, ios) QT_MACOS_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(osx, ios)
851 # define QT_MAC_DEPLOYMENT_TARGET_BELOW(osx, ios) QT_MACOS_IOS_DEPLOYMENT_TARGET_BELOW(osx, ios)
852 # define QT_OSX_PLATFORM_SDK_EQUAL_OR_ABOVE(osx) QT_MACOS_PLATFORM_SDK_EQUAL_OR_ABOVE(osx)
853 # define QT_OSX_DEPLOYMENT_TARGET_BELOW(osx) QT_MACOS_DEPLOYMENT_TARGET_BELOW(osx)
854 
855 // Implemented in qcore_mac_objc.mm
856 class Q_CORE_EXPORT QMacAutoReleasePool
857 {
858 public:
859  QMacAutoReleasePool();
860  ~QMacAutoReleasePool();
861 private:
862  Q_DISABLE_COPY(QMacAutoReleasePool)
863  void *pool;
864 };
865 
866 #else
867 
868 #define QT_DARWIN_PLATFORM_SDK_EQUAL_OR_ABOVE(macos, ios, tvos, watchos) (0)
869 #define QT_MACOS_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(macos, ios) (0)
870 #define QT_MACOS_PLATFORM_SDK_EQUAL_OR_ABOVE(macos) (0)
871 #define QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(ios) (0)
872 #define QT_TVOS_PLATFORM_SDK_EQUAL_OR_ABOVE(tvos) (0)
873 #define QT_WATCHOS_PLATFORM_SDK_EQUAL_OR_ABOVE(watchos) (0)
874 
875 #define QT_MAC_PLATFORM_SDK_EQUAL_OR_ABOVE(osx, ios) (0)
876 #define QT_OSX_PLATFORM_SDK_EQUAL_OR_ABOVE(osx) (0)
877 
878 #endif // Q_OS_DARWIN
879 
880 /*
881  Data stream functions are provided by many classes (defined in qdatastream.h)
882 */
883 
884 class QDataStream;
885 
886 inline void qt_noop(void) {}
887 
888 /* These wrap try/catch so we can switch off exceptions later.
889 
890  Beware - do not use more than one QT_CATCH per QT_TRY, and do not use
891  the exception instance in the catch block.
892  If you can't live with those constraints, don't use these macros.
893  Use the QT_NO_EXCEPTIONS macro to protect your code instead.
894 */
895 
896 #if !defined(QT_NO_EXCEPTIONS)
897 # if !defined(Q_MOC_RUN)
898 # if (defined(Q_CC_CLANG) && !defined(Q_CC_INTEL) && !__has_feature(cxx_exceptions)) || \
899  (defined(Q_CC_GNU) && !defined(__EXCEPTIONS))
900 # define QT_NO_EXCEPTIONS
901 # endif
902 # elif defined(QT_BOOTSTRAPPED)
903 # define QT_NO_EXCEPTIONS
904 # endif
905 #endif
906 
907 Q_NORETURN Q_DECL_COLD_FUNCTION Q_CORE_EXPORT void qTerminate() noexcept;
908 #ifdef QT_NO_EXCEPTIONS
909 # define QT_TRY if (true)
910 # define QT_CATCH(A) else
911 # define QT_THROW(A) qt_noop()
912 # define QT_RETHROW qt_noop()
913 # define QT_TERMINATE_ON_EXCEPTION(expr) do { expr; } while (false)
914 #else
915 # define QT_TRY try
916 # define QT_CATCH(A) catch (A)
917 # define QT_THROW(A) throw A
918 # define QT_RETHROW throw
919 # ifdef Q_COMPILER_NOEXCEPT
920 # define QT_TERMINATE_ON_EXCEPTION(expr) do { expr; } while (false)
921 # else
922 # define QT_TERMINATE_ON_EXCEPTION(expr) do { try { expr; } catch (...) { qTerminate(); } } while (false)
923 # endif
924 #endif
925 
926 Q_CORE_EXPORT Q_DECL_CONST_FUNCTION bool qSharedBuild() noexcept;
927 
928 #ifndef Q_OUTOFLINE_TEMPLATE
929 # define Q_OUTOFLINE_TEMPLATE
930 #endif
931 #ifndef Q_INLINE_TEMPLATE
932 # define Q_INLINE_TEMPLATE inline
933 #endif
934 
935 /*
936  Debugging and error handling
937 */
938 
939 #if !defined(QT_NO_DEBUG) && !defined(QT_DEBUG)
940 # define QT_DEBUG
941 #endif
942 
943 // QtPrivate::asString defined in qstring.h
944 #ifndef qPrintable
945 # define qPrintable(string) QtPrivate::asString(string).toLocal8Bit().constData()
946 #endif
947 
948 #ifndef qUtf8Printable
949 # define qUtf8Printable(string) QtPrivate::asString(string).toUtf8().constData()
950 #endif
951 
952 /*
953  Wrap QString::utf16() with enough casts to allow passing it
954  to QString::asprintf("%ls") without warnings.
955 */
956 #ifndef qUtf16Printable
957 # define qUtf16Printable(string) \
958  static_cast<const wchar_t*>(static_cast<const void*>(QString(string).utf16()))
959 #endif
960 
961 class QString;
963 Q_CORE_EXPORT QString qt_error_string(int errorCode = -1);
964 
965 #ifndef Q_CC_MSVC
967 #endif
969 Q_CORE_EXPORT void qt_assert(const char *assertion, const char *file, int line) noexcept;
970 
971 #if !defined(Q_ASSERT)
972 # if defined(QT_NO_DEBUG) && !defined(QT_FORCE_ASSERTS)
973 # define Q_ASSERT(cond) static_cast<void>(false && (cond))
974 # else
975 # define Q_ASSERT(cond) ((cond) ? static_cast<void>(0) : qt_assert(#cond, __FILE__, __LINE__))
976 # endif
977 #endif
978 
979 #ifndef Q_CC_MSVC
981 #endif
983 Q_CORE_EXPORT void qt_assert_x(const char *where, const char *what, const char *file, int line) noexcept;
984 
985 #if !defined(Q_ASSERT_X)
986 # if defined(QT_NO_DEBUG) && !defined(QT_FORCE_ASSERTS)
987 # define Q_ASSERT_X(cond, where, what) static_cast<void>(false && (cond))
988 # else
989 # define Q_ASSERT_X(cond, where, what) ((cond) ? static_cast<void>(0) : qt_assert_x(where, what, __FILE__, __LINE__))
990 # endif
991 #endif
992 
993 Q_NORETURN Q_CORE_EXPORT void qt_check_pointer(const char *, int) noexcept;
995 Q_CORE_EXPORT void qBadAlloc();
996 
997 #ifdef QT_NO_EXCEPTIONS
998 # if defined(QT_NO_DEBUG) && !defined(QT_FORCE_ASSERTS)
999 # define Q_CHECK_PTR(p) qt_noop()
1000 # else
1001 # define Q_CHECK_PTR(p) do {if (!(p)) qt_check_pointer(__FILE__,__LINE__);} while (false)
1002 # endif
1003 #else
1004 # define Q_CHECK_PTR(p) do { if (!(p)) qBadAlloc(); } while (false)
1005 #endif
1006 
1007 template <typename T>
1008 inline T *q_check_ptr(T *p) { Q_CHECK_PTR(p); return p; }
1009 
1010 typedef void (*QFunctionPointer)();
1011 
1012 #if !defined(Q_UNIMPLEMENTED)
1013 # define Q_UNIMPLEMENTED() qWarning("Unimplemented code.")
1014 #endif
1015 
1016 namespace QTypeTraits {
1017 
1018 namespace detail {
1019 template<typename T, typename U,
1020  typename = std::enable_if_t<std::is_arithmetic_v<T> && std::is_arithmetic_v<U> &&
1021  std::is_floating_point_v<T> == std::is_floating_point_v<U> &&
1022  std::is_signed_v<T> == std::is_signed_v<U> &&
1023  !std::is_same_v<T, bool> && !std::is_same_v<U, bool> &&
1024  !std::is_same_v<T, char> && !std::is_same_v<U, char>>>
1025 struct Promoted
1026 {
1027  using type = decltype(T() + U());
1028 };
1029 }
1030 
1031 template <typename T, typename U>
1032 using Promoted = typename detail::Promoted<T, U>::type;
1033 
1034 }
1035 
1036 template <typename T>
1037 constexpr inline const T &qMin(const T &a, const T &b) { return (a < b) ? a : b; }
1038 template <typename T>
1039 constexpr inline const T &qMax(const T &a, const T &b) { return (a < b) ? b : a; }
1040 template <typename T>
1041 constexpr inline const T &qBound(const T &min, const T &val, const T &max)
1042 {
1043  Q_ASSERT(!(max < min));
1044  return qMax(min, qMin(max, val));
1045 }
1046 template <typename T, typename U>
1047 constexpr inline QTypeTraits::Promoted<T, U> qMin(const T &a, const U &b)
1048 {
1049  using P = QTypeTraits::Promoted<T, U>;
1050  P _a = a;
1051  P _b = b;
1052  return (_a < _b) ? _a : _b;
1053 }
1054 template <typename T, typename U>
1055 constexpr inline QTypeTraits::Promoted<T, U> qMax(const T &a, const U &b)
1056 {
1057  using P = QTypeTraits::Promoted<T, U>;
1058  P _a = a;
1059  P _b = b;
1060  return (_a < _b) ? _b : _a;
1061 }
1062 template <typename T, typename U>
1063 constexpr inline QTypeTraits::Promoted<T, U> qBound(const T &min, const U &val, const T &max)
1064 {
1065  Q_ASSERT(!(max < min));
1066  return qMax(min, qMin(max, val));
1067 }
1068 template <typename T, typename U>
1069 constexpr inline QTypeTraits::Promoted<T, U> qBound(const T &min, const T &val, const U &max)
1070 {
1071  using P = QTypeTraits::Promoted<T, U>;
1072  Q_ASSERT(!(P(max) < P(min)));
1073  return qMax(min, qMin(max, val));
1074 }
1075 template <typename T, typename U>
1076 constexpr inline QTypeTraits::Promoted<T, U> qBound(const U &min, const T &val, const T &max)
1077 {
1078  using P = QTypeTraits::Promoted<T, U>;
1079  Q_ASSERT(!(P(max) < P(min)));
1080  return qMax(min, qMin(max, val));
1081 }
1082 
1083 [[nodiscard]] constexpr bool qFuzzyCompare(double p1, double p2)
1084 {
1085  return (qAbs(p1 - p2) * 1000000000000. <= qMin(qAbs(p1), qAbs(p2)));
1086 }
1087 
1088 [[nodiscard]] constexpr bool qFuzzyCompare(float p1, float p2)
1089 {
1090  return (qAbs(p1 - p2) * 100000.f <= qMin(qAbs(p1), qAbs(p2)));
1091 }
1092 
1093 [[nodiscard]] constexpr bool qFuzzyIsNull(double d)
1094 {
1095  return qAbs(d) <= 0.000000000001;
1096 }
1097 
1098 [[nodiscard]] constexpr bool qFuzzyIsNull(float f)
1099 {
1100  return qAbs(f) <= 0.00001f;
1101 }
1102 
1105 
1106 [[nodiscard]] constexpr bool qIsNull(double d) noexcept
1107 {
1108  return d == 0.0;
1109 }
1110 
1111 [[nodiscard]] constexpr bool qIsNull(float f) noexcept
1112 {
1113  return f == 0.0f;
1114 }
1115 
1117 
1118 /*
1119  Compilers which follow outdated template instantiation rules
1120  require a class to have a comparison operator to exist when
1121  a QList of this type is instantiated. It's not actually
1122  used in the list, though. Hence the dummy implementation.
1123  Just in case other code relies on it we better trigger a warning
1124  mandating a real implementation.
1125 */
1126 
1127 #ifdef Q_FULL_TEMPLATE_INSTANTIATION
1128 # define Q_DUMMY_COMPARISON_OPERATOR(C) \
1129  bool operator==(const C&) const { \
1130  qWarning(#C"::operator==(const "#C"&) was called"); \
1131  return false; \
1132  }
1133 #else
1134 
1135 # define Q_DUMMY_COMPARISON_OPERATOR(C)
1136 #endif
1137 
1139 // warning: noexcept-expression evaluates to 'false' because of a call to 'void swap(..., ...)'
1140 QT_WARNING_DISABLE_GCC("-Wnoexcept")
1141 
1142 namespace QtPrivate
1143 {
1144 namespace SwapExceptionTester { // insulate users from the "using std::swap" below
1145  using std::swap; // import std::swap
1146  template <typename T>
1147  void checkSwap(T &t)
1148  noexcept(noexcept(swap(t, t)));
1149  // declared, but not implemented (only to be used in unevaluated contexts (noexcept operator))
1150 }
1151 } // namespace QtPrivate
1152 
1153 // Documented in ../tools/qalgorithm.qdoc
1154 template <typename T>
1155 constexpr void qSwap(T &value1, T &value2)
1156  noexcept(noexcept(QtPrivate::SwapExceptionTester::checkSwap(value1)))
1157 {
1158  using std::swap;
1159  swap(value1, value2);
1160 }
1161 
1162 // pure compile-time micro-optimization for our own headers, so not documented:
1163 template <typename T>
1164 constexpr inline void qt_ptr_swap(T* &lhs, T* &rhs) noexcept
1165 {
1166  T *tmp = lhs;
1167  lhs = rhs;
1168  rhs = tmp;
1169 }
1170 
1172 
1173 Q_CORE_EXPORT void *qMallocAligned(size_t size, size_t alignment) Q_ALLOC_SIZE(1);
1174 Q_CORE_EXPORT void *qReallocAligned(void *ptr, size_t size, size_t oldsize, size_t alignment) Q_ALLOC_SIZE(2);
1175 Q_CORE_EXPORT void qFreeAligned(void *ptr);
1176 
1177 
1178 /*
1179  Avoid some particularly useless warnings from some stupid compilers.
1180  To get ALL C++ compiler warnings, define QT_CC_WARNINGS or comment out
1181  the line "#define QT_NO_WARNINGS".
1182 */
1183 #if !defined(QT_CC_WARNINGS)
1184 # define QT_NO_WARNINGS
1185 #endif
1186 #if defined(QT_NO_WARNINGS)
1187 # if defined(Q_CC_MSVC)
1188 QT_WARNING_DISABLE_MSVC(4251) /* class 'type' needs to have dll-interface to be used by clients of class 'type2' */
1189 QT_WARNING_DISABLE_MSVC(4244) /* conversion from 'type1' to 'type2', possible loss of data */
1190 QT_WARNING_DISABLE_MSVC(4275) /* non - DLL-interface classkey 'identifier' used as base for DLL-interface classkey 'identifier' */
1191 QT_WARNING_DISABLE_MSVC(4514) /* unreferenced inline function has been removed */
1192 QT_WARNING_DISABLE_MSVC(4800) /* 'type' : forcing value to bool 'true' or 'false' (performance warning) */
1193 QT_WARNING_DISABLE_MSVC(4097) /* typedef-name 'identifier1' used as synonym for class-name 'identifier2' */
1194 QT_WARNING_DISABLE_MSVC(4706) /* assignment within conditional expression */
1195 QT_WARNING_DISABLE_MSVC(4355) /* 'this' : used in base member initializer list */
1196 QT_WARNING_DISABLE_MSVC(4710) /* function not inlined */
1197 QT_WARNING_DISABLE_MSVC(4530) /* C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc */
1198 # elif defined(Q_CC_BOR)
1199 # pragma option -w-inl
1200 # pragma option -w-aus
1201 # pragma warn -inl
1202 # pragma warn -pia
1203 # pragma warn -ccc
1204 # pragma warn -rch
1205 # pragma warn -sig
1206 # endif
1207 #endif
1208 
1209 // this adds const to non-const objects (like std::as_const)
1210 template <typename T>
1211 constexpr typename std::add_const<T>::type &qAsConst(T &t) noexcept { return t; }
1212 // prevent rvalue arguments:
1213 template <typename T>
1214 void qAsConst(const T &&) = delete;
1215 
1216 // like std::exchange
1217 template <typename T, typename U = T>
1218 constexpr T qExchange(T &t, U &&newValue)
1219 noexcept(std::conjunction_v<std::is_nothrow_move_constructible<T>, std::is_nothrow_assignable<T &, U>>)
1220 {
1221  T old = std::move(t);
1222  t = std::forward<U>(newValue);
1223  return old;
1224 }
1225 
1226 // like std::to_underlying
1227 template <typename Enum>
1228 constexpr std::underlying_type_t<Enum> qToUnderlying(Enum e) noexcept
1229 {
1230  return static_cast<std::underlying_type_t<Enum>>(e);
1231 }
1232 
1233 #ifdef __cpp_conditional_explicit
1234 #define Q_IMPLICIT explicit(false)
1235 #else
1236 #define Q_IMPLICIT
1237 #endif
1238 
1239 #ifndef QT_NO_FOREACH
1240 
1241 namespace QtPrivate {
1242 
1243 template <typename T>
1244 class QForeachContainer {
1245  Q_DISABLE_COPY(QForeachContainer)
1246 public:
1247  QForeachContainer(const T &t) : c(t), i(qAsConst(c).begin()), e(qAsConst(c).end()) {}
1248  QForeachContainer(T &&t) : c(std::move(t)), i(qAsConst(c).begin()), e(qAsConst(c).end()) {}
1249 
1250  QForeachContainer(QForeachContainer &&other)
1251  : c(std::move(other.c)),
1252  i(qAsConst(c).begin()),
1253  e(qAsConst(c).end()),
1254  control(std::move(other.control))
1255  {
1256  }
1257 
1258  QForeachContainer &operator=(QForeachContainer &&other)
1259  {
1260  c = std::move(other.c);
1261  i = qAsConst(c).begin();
1262  e = qAsConst(c).end();
1263  control = std::move(other.control);
1264  return *this;
1265  }
1266 
1267  T c;
1268  typename T::const_iterator i, e;
1269  int control = 1;
1270 };
1271 
1272 // Containers that have a detach function are considered shared, and are OK in a foreach loop
1273 template <typename T, typename = decltype(std::declval<T>().detach())>
1274 inline void warnIfContainerIsNotShared(int) {}
1275 
1276 #if QT_DEPRECATED_SINCE(6, 0)
1277 // Other containers will copy themselves if used in foreach, this use is deprecated
1278 template <typename T>
1279 QT_DEPRECATED_VERSION_X_6_0("Do not use foreach/Q_FOREACH with containers which are not implicitly shared. "
1280  "Prefer using a range-based for loop with these containers: `for (const auto &it : container)`, "
1281  "keeping in mind that range-based for doesn't copy the container as Q_FOREACH does")
1282 inline void warnIfContainerIsNotShared(...) {}
1283 #endif
1284 
1285 template<typename T>
1286 QForeachContainer<typename std::decay<T>::type> qMakeForeachContainer(T &&t)
1287 {
1289  return QForeachContainer<typename std::decay<T>::type>(std::forward<T>(t));
1290 }
1291 
1292 }
1293 
1294 // Use C++17 if statement with initializer. User's code ends up in a else so
1295 // scoping of different ifs is not broken
1296 #define Q_FOREACH_IMPL(variable, name, container) \
1297  for (auto name = QtPrivate::qMakeForeachContainer(container); name.i != name.e; ++name.i) \
1298  if (variable = *name.i; false) {} else
1299 
1300 #define Q_FOREACH_JOIN(A, B) Q_FOREACH_JOIN_IMPL(A, B)
1301 #define Q_FOREACH_JOIN_IMPL(A, B) A ## B
1302 
1303 #define Q_FOREACH(variable, container) \
1304  Q_FOREACH_IMPL(variable, Q_FOREACH_JOIN(_container_, __LINE__), container)
1305 #endif // QT_NO_FOREACH
1306 
1307 #define Q_FOREVER for(;;)
1308 #ifndef QT_NO_KEYWORDS
1309 # ifndef QT_NO_FOREACH
1310 # ifndef foreach
1311 # define foreach Q_FOREACH
1312 # endif
1313 # endif // QT_NO_FOREACH
1314 # ifndef forever
1315 # define forever Q_FOREVER
1316 # endif
1317 #endif
1318 
1319 template <typename T> inline T *qGetPtrHelper(T *ptr) noexcept { return ptr; }
1320 template <typename Ptr> inline auto qGetPtrHelper(Ptr &ptr) noexcept -> decltype(ptr.get())
1321 { static_assert(noexcept(ptr.get()), "Smart d pointers for Q_DECLARE_PRIVATE must have noexcept get()"); return ptr.get(); }
1322 
1323 // The body must be a statement:
1324 #define Q_CAST_IGNORE_ALIGN(body) QT_WARNING_PUSH QT_WARNING_DISABLE_GCC("-Wcast-align") body QT_WARNING_POP
1325 #define Q_DECLARE_PRIVATE(Class) \
1326  inline Class##Private* d_func() noexcept \
1327  { Q_CAST_IGNORE_ALIGN(return reinterpret_cast<Class##Private *>(qGetPtrHelper(d_ptr));) } \
1328  inline const Class##Private* d_func() const noexcept \
1329  { Q_CAST_IGNORE_ALIGN(return reinterpret_cast<const Class##Private *>(qGetPtrHelper(d_ptr));) } \
1330  friend class Class##Private;
1331 
1332 #define Q_DECLARE_PRIVATE_D(Dptr, Class) \
1333  inline Class##Private* d_func() noexcept \
1334  { Q_CAST_IGNORE_ALIGN(return reinterpret_cast<Class##Private *>(qGetPtrHelper(Dptr));) } \
1335  inline const Class##Private* d_func() const noexcept \
1336  { Q_CAST_IGNORE_ALIGN(return reinterpret_cast<const Class##Private *>(qGetPtrHelper(Dptr));) } \
1337  friend class Class##Private;
1338 
1339 #define Q_DECLARE_PUBLIC(Class) \
1340  inline Class* q_func() noexcept { return static_cast<Class *>(q_ptr); } \
1341  inline const Class* q_func() const noexcept { return static_cast<const Class *>(q_ptr); } \
1342  friend class Class;
1343 
1344 #define Q_D(Class) Class##Private * const d = d_func()
1345 #define Q_Q(Class) Class * const q = q_func()
1346 
1347 #define QT_TR_NOOP(x) x
1348 #define QT_TR_NOOP_UTF8(x) x
1349 #define QT_TRANSLATE_NOOP(scope, x) x
1350 #define QT_TRANSLATE_NOOP_UTF8(scope, x) x
1351 #define QT_TRANSLATE_NOOP3(scope, x, comment) {x, comment}
1352 #define QT_TRANSLATE_NOOP3_UTF8(scope, x, comment) {x, comment}
1353 
1354 #ifndef QT_NO_TRANSLATION
1355 
1356 #define QT_TR_N_NOOP(x) x
1357 #define QT_TRANSLATE_N_NOOP(scope, x) x
1358 #define QT_TRANSLATE_N_NOOP3(scope, x, comment) {x, comment}
1359 
1360 // Defined in qcoreapplication.cpp
1361 // The better name qTrId() is reserved for an upcoming function which would
1362 // return a much more powerful QStringFormatter instead of a QString.
1363 Q_CORE_EXPORT QString qtTrId(const char *id, int n = -1);
1364 
1365 #define QT_TRID_NOOP(id) id
1366 #define QT_TRID_N_NOOP(id) id
1367 
1368 #endif // QT_NO_TRANSLATION
1369 
1370 
1371 #ifdef Q_QDOC
1372 // Just for documentation generation
1373 template<typename T>
1374 auto qOverload(T functionPointer);
1375 template<typename T>
1376 auto qConstOverload(T memberFunctionPointer);
1377 template<typename T>
1378 auto qNonConstOverload(T memberFunctionPointer);
1379 #else
1380 template <typename... Args>
1381 struct QNonConstOverload
1382 {
1383  template <typename R, typename T>
1384  constexpr auto operator()(R (T::*ptr)(Args...)) const noexcept -> decltype(ptr)
1385  { return ptr; }
1386 
1387  template <typename R, typename T>
1388  static constexpr auto of(R (T::*ptr)(Args...)) noexcept -> decltype(ptr)
1389  { return ptr; }
1390 };
1391 
1392 template <typename... Args>
1393 struct QConstOverload
1394 {
1395  template <typename R, typename T>
1396  constexpr auto operator()(R (T::*ptr)(Args...) const) const noexcept -> decltype(ptr)
1397  { return ptr; }
1398 
1399  template <typename R, typename T>
1400  static constexpr auto of(R (T::*ptr)(Args...) const) noexcept -> decltype(ptr)
1401  { return ptr; }
1402 };
1403 
1404 template <typename... Args>
1405 struct QOverload : QConstOverload<Args...>, QNonConstOverload<Args...>
1406 {
1407  using QConstOverload<Args...>::of;
1408  using QConstOverload<Args...>::operator();
1409  using QNonConstOverload<Args...>::of;
1410  using QNonConstOverload<Args...>::operator();
1411 
1412  template <typename R>
1413  constexpr auto operator()(R (*ptr)(Args...)) const noexcept -> decltype(ptr)
1414  { return ptr; }
1415 
1416  template <typename R>
1417  static constexpr auto of(R (*ptr)(Args...)) noexcept -> decltype(ptr)
1418  { return ptr; }
1419 };
1420 
1421 template <typename... Args> constexpr inline QOverload<Args...> qOverload = {};
1422 template <typename... Args> constexpr inline QConstOverload<Args...> qConstOverload = {};
1423 template <typename... Args> constexpr inline QNonConstOverload<Args...> qNonConstOverload = {};
1424 #endif
1425 
1426 
1427 class QByteArray;
1428 Q_CORE_EXPORT QByteArray qgetenv(const char *varName);
1429 // need it as two functions because QString is only forward-declared here
1430 Q_CORE_EXPORT QString qEnvironmentVariable(const char *varName);
1431 Q_CORE_EXPORT QString qEnvironmentVariable(const char *varName, const QString &defaultValue);
1432 Q_CORE_EXPORT bool qputenv(const char *varName, const QByteArray& value);
1433 Q_CORE_EXPORT bool qunsetenv(const char *varName);
1434 
1435 Q_CORE_EXPORT bool qEnvironmentVariableIsEmpty(const char *varName) noexcept;
1436 Q_CORE_EXPORT bool qEnvironmentVariableIsSet(const char *varName) noexcept;
1437 Q_CORE_EXPORT int qEnvironmentVariableIntValue(const char *varName, bool *ok=nullptr) noexcept;
1438 
1439 inline int qIntCast(double f) { return int(f); }
1440 inline int qIntCast(float f) { return int(f); }
1441 
1442 #define QT_MODULE(x)
1443 
1444 #if !defined(QT_BOOTSTRAPPED) && defined(QT_REDUCE_RELOCATIONS) && defined(__ELF__) && \
1445  (!defined(__PIC__) || (defined(__PIE__) && defined(Q_CC_GNU) && Q_CC_GNU >= 500))
1446 # error "You must build your code with position independent code if Qt was built with -reduce-relocations. "\
1447  "Compile your code with -fPIC (and not with -fPIE)."
1448 #endif
1449 
1450 #define QT_VA_ARGS_CHOOSE(_1, _2, _3, _4, _5, _6, _7, _8, _9, N, ...) N
1451 #define QT_VA_ARGS_EXPAND(...) __VA_ARGS__ // Needed for MSVC
1452 #define QT_VA_ARGS_COUNT(...) QT_VA_ARGS_EXPAND(QT_VA_ARGS_CHOOSE(__VA_ARGS__, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0))
1453 #define QT_OVERLOADED_MACRO_EXPAND(MACRO, ARGC) MACRO##_##ARGC
1454 #define QT_OVERLOADED_MACRO_IMP(MACRO, ARGC) QT_OVERLOADED_MACRO_EXPAND(MACRO, ARGC)
1455 #define QT_OVERLOADED_MACRO(MACRO, ...) QT_VA_ARGS_EXPAND(QT_OVERLOADED_MACRO_IMP(MACRO, QT_VA_ARGS_COUNT(__VA_ARGS__))(__VA_ARGS__))
1456 
1457 // This macro can be used to calculate member offsets for types with a non standard layout.
1458 // It uses the fact that offsetof() is allowed to support those types since C++17 as an optional
1459 // feature. All our compilers do support this, but some issue a warning, so we wrap the offsetof()
1460 // call in a macro that disables the compiler warning.
1461 #define Q_OFFSETOF(Class, member) \
1462  []() -> size_t { \
1463  QT_WARNING_PUSH QT_WARNING_DISABLE_INVALID_OFFSETOF \
1464  return offsetof(Class, member); \
1465  QT_WARNING_POP \
1466  }()
1467 
1469 
1470 // We need to keep QTypeInfo, QSysInfo, QFlags, qDebug & family in qglobal.h for compatibility with Qt 4.
1471 // Be careful when changing the order of these files.
1472 #include <QtCore/qtypeinfo.h>
1473 #include <QtCore/qsysinfo.h>
1474 #include <QtCore/qlogging.h>
1475 
1476 #include <QtCore/qflags.h>
1477 
1478 #include <QtCore/qatomic.h>
1479 #include <QtCore/qglobalstatic.h>
1480 #include <QtCore/qnumeric.h>
1481 #include <QtCore/qversiontagging.h>
1482 
1483 #endif /* __cplusplus */
1484 #endif /* !__ASSEMBLER__ */
1485 
1486 #endif /* QGLOBAL_H */
small capitals from c petite p scientific i
[1]
Definition: afcover.h:80
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:85
The QDataStream class provides serialization of binary data to a QIODevice.
Definition: qdatastream.h:66
bool qFuzzyCompare(const QMatrix4x4 &m1, const QMatrix4x4 &m2)
Definition: qmatrix4x4.cpp:774
The QString class provides a Unicode character string.
Definition: qstring.h:388
#define T(x)
Definition: main.cpp:42
QPixmap p2
QPixmap p1
[0]
qSwap(pi, e)
double e
uint alignment
constexpr T & operator()(T &v) const
Definition: hb-algs.hh:2
auto it unsigned count const
Definition: hb-iter.hh:848
#define inline
Definition: md4c.c:45
typename C::const_iterator const_iterator
Definition: qfloat16.h:381
void swap(SimpleVector< T > &v1, SimpleVector< T > &v2)
Definition: simplevector.h:331
void
Definition: png.h:1080
#define Q_NORETURN
#define Q_DECL_NOEXCEPT
#define Q_DECL_CONST_FUNCTION
#define QT_WARNING_POP
#define QT_WARNING_DISABLE_MSVC(number)
#define QT_WARNING_DISABLE_FLOAT_COMPARE
#define Q_DECL_COLD_FUNCTION
#define QT_WARNING_DISABLE_GCC(text)
#define QT_WARNING_PUSH
#define Q_ALLOC_SIZE(x)
QString qtTrId(const char *id, int n)
EGLOutputLayerEXT EGLint EGLAttrib value
bool qFuzzyIsNull(qfloat16 f) noexcept
Definition: qfloat16.h:249
bool qIsNull(qfloat16 f) noexcept
Definition: qfloat16.h:254
qint64 qRound64(qfloat16 d) noexcept
Definition: qfloat16.h:230
int qRound(qfloat16 d) noexcept
Definition: qfloat16.h:227
int qIntCast(qfloat16 f) noexcept
Definition: qfloat16.h:259
void qt_assert_x(const char *where, const char *what, const char *file, int line) noexcept
Definition: qglobal.cpp:3310
QString qEnvironmentVariable(const char *varName, const QString &defaultValue)
Definition: qglobal.cpp:3493
bool qSharedBuild() noexcept
Definition: qglobal.cpp:1376
Q_NORETURN void qTerminate() noexcept
Definition: qglobal.cpp:3294
void qt_assert(const char *assertion, const char *file, int line) noexcept
Definition: qglobal.cpp:3302
void qBadAlloc()
Definition: qglobal.cpp:3280
#define Q_STATIC_ASSERT_X(Condition, Message)
Definition: qglobal.h:193
unsigned int quint32
Definition: qglobal.h:288
#define QT_BEGIN_INCLUDE_NAMESPACE
Definition: qglobal.h:265
short qint16
Definition: qglobal.h:285
QT_BEGIN_INCLUDE_NAMESPACE typedef unsigned char uchar
Definition: qglobal.h:332
unsigned short quint16
Definition: qglobal.h:286
size_t quintptr
Definition: qglobal.h:310
int qint32
Definition: qglobal.h:287
unsigned long ulong
Definition: qglobal.h:335
ptrdiff_t qptrdiff
Definition: qglobal.h:307
QT_END_INCLUDE_NAMESPACE typedef double qreal
Definition: qglobal.h:341
quint64 qulonglong
Definition: qglobal.h:302
unsigned long long quint64
Definition: qglobal.h:299
#define QT_END_INCLUDE_NAMESPACE
Definition: qglobal.h:266
ptrdiff_t qsizetype
Definition: qglobal.h:308
unsigned int uint
Definition: qglobal.h:334
#define QT_DEPRECATED_VERSION_X_6_0(text)
Definition: qglobal.h:444
long long qint64
Definition: qglobal.h:298
#define Q_DISABLE_COPY(Class)
Definition: qglobal.h:515
Q_CORE_EXPORT Q_DECL_CONST_FUNCTION const char * qVersion(void) Q_DECL_NOEXCEPT
unsigned short ushort
Definition: qglobal.h:333
QT_BEGIN_NAMESPACE typedef signed char qint8
Definition: qglobal.h:283
unsigned char quint8
Definition: qglobal.h:284
qint64 qlonglong
Definition: qglobal.h:301
ptrdiff_t qintptr
Definition: qglobal.h:309
QT_BEGIN_NAMESPACE void * qMallocAligned(size_t size, size_t alignment)
Definition: qmalloc.cpp:52
void * qReallocAligned(void *oldptr, size_t newsize, size_t oldsize, size_t alignment)
Definition: qmalloc.cpp:57
void qFreeAligned(void *ptr)
Definition: qmalloc.cpp:106
GLenum type
Definition: qopengl.h:270
GLboolean GLboolean GLboolean b
GLboolean GLboolean GLboolean GLboolean a
[7]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLuint GLuint end
GLfloat GLfloat f
GLfloat n
const GLubyte * c
Definition: qopenglext.h:12701
GLuint GLfloat * val
Definition: qopenglext.h:1513
GLdouble GLdouble t
[9]
Definition: qopenglext.h:243
GLfloat GLfloat p
[1]
Definition: qopenglext.h:12698
#define Q_ASSERT(cond)
Definition: qrandom.cpp:84
QtPrivate::QRegularExpressionMatchIteratorRangeBasedForIterator begin(const QRegularExpressionMatchIterator &iterator)
QPointF qAbs(const QPointF &p)
Definition: qscroller.cpp:119
QString qt_error_string(int code)
QThreadPool pool
Q_CHECK_PTR(a=new int[80])
QFile file
[0]
QSharedPointer< T > other(t)
[5]
this swap(other)
Definition: main.cpp:58
Definition: main.cpp:38
Enum
#define rhs
#define P
#define __extension__
Definition: valgrind_p.h:6205