summaryrefslogtreecommitdiffstats
path: root/src/corelib/global/qglobal.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix build with clang-clYuhang Zhao2022-03-311-1/+1
| | | | | | | qtbase\src\corelib\global\qglobal.cpp(3510,21): error: call to member function 'endsWith' is ambiguous Change-Id: I2b20077584a33ca5f40efdf397b5913afd6e7fae Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Short live Q_CONSTINIT!Marc Mutz2022-03-261-1/+28
| | | | | | | | | | | | | | | | | | It expands to the first available of - constinit (C++20) - [[clang::require_constant_initialization]] (Clang) - __constinit (GCC >= 10) Use it around the code (on and near static QBasicAtomic; this patch makes no attempt to find all statics in qtbase). [ChangeLog][QtCore][QtGlobal] Added macro Q_CONSTINIT. Fixes: QTBUG-100484 Change-Id: I11e0363a7acb3464476859d12ec7f94319d82be7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* QtCore: Replace remaining uses of QLatin1String with QLatin1StringViewSona Kurazyan2022-03-261-3/+3
| | | | | | | Task-number: QTBUG-98434 Change-Id: Ib7c5fc0aaca6ef33b93c7486e99502c555bf20bc Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* QtCore: replace QLatin1String/QLatin1Char with _L1/u'' where applicableSona Kurazyan2022-03-251-16/+17
| | | | | | | | | | | As a drive-by, did also minor refactorings/improvements. Task-number: QTBUG-98434 Change-Id: I81964176ae2f07ea63674c96f47f9c6aa046854f Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
* Fix has_signaling_NaN usage for INTEGRITYTatiana Borisova2022-03-161-2/+1
| | | | | | | | | | - The newest GHS compiler versions set the value of has_signaling_NaN to False. Add compilation and autotest fix for GHS-compiler 2021/2022 releases. Task-number: QTBUG-99123 Pick-to: 6.2 6.3 Change-Id: I45e5da6759a15c60c17f896e565002cbba8524ed Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Doc: Fix typosRobert Löhning2022-03-161-2/+2
| | | | | | | Pick to: 6.3 Change-Id: Iaea3c0e567ddd6a72db0b2ba1731c416cf85ef47 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Doc: Use \inmodule for all classes and headersTopi Reinio2022-01-171-0/+1
| | | | | | | | | | | | | | | QDoc made some assumptions about the module a class/header belongs to, based on the source file path. This feature is rather error-prone and unnecessarily complex and will be removed from QDoc. Define modules explicitly to avoid documentation warnings when this removal happens. Pick-to: 6.2 6.3 Change-Id: I7947d197db5ac36c12e816caa19bb2f74eda8849 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* Extract Header qforeach.h from qglobal.hMarc Mutz2021-12-301-4/+4
| | | | | | Task-number: QTBUG-99313 Change-Id: Ie89314ca7022e88c1fea957880c5aa4a41640744 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Doc: QSysInfo::productType: remove the "will be" note about Qt 6Thiago Macieira2021-12-231-4/+3
| | | | | | | Fixes: QTBUG-99413 Pick-to: 6.2 6.3 Change-Id: Ib42b3adc93bf4d43bd55fffd16c360797871011b Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Fix tst_qfloat16 runtime failure for INTEGRITYTatiana Borisova2021-12-061-1/+1
| | | | | | | | | | - GHS compiler is not fully compliant with iec559. Therefore we need to update is_iec559 checking for GHS case. Pick-to: 6.2 Change-Id: Ia094509d26bf5f0109f2937547a056267019cffb Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io>
* Add missing QT_TRID_N_NOOP definitionLucie Gérard2021-11-181-0/+20
| | | | | | | | | | | | | Amends c74bd2b93, properly following up on qttools/bc47b5190. [ChangeLog][QtCore] Added missing QT_TRID_N_NOOP() macro. Lupdate actually recognizes it since Qt 5.12. Fixes: QTBUG-98277 Fixes: QTBUG-3945 Change-Id: I0ea15ceb49b2ead5c8bb40d2a55a0ae8577e8850 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Do not include qloggingcategory.h in public headersKai Köhne2021-11-161-2/+3
| | | | | | | | | | | | | | | Reduce overhead for including qguiapplication.h by splitting up qnativeinterface.h into a public and a private part. [ChangeLog][Potentially Source-Incompatible Changes] The qguiapplication.h header no longer implicitly includes qloggingcategory.h. If your code depends on the transitive include, explicitly include <QLoggingCategory> where needed. Pick-to: 6.2 Task-number: QTBUG-97601 Change-Id: Ic02327a1c3092e21730160af5c59a9d58dc1239c Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Update windows version detectionMårten Nordheim2021-10-241-1/+11
| | | | | | | | Since the API still doesn't return 11. Pick-to: 6.2 5.15 Change-Id: Ifd4f7f845915702fcbb0f857487358ae8e806273 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* corelib: Fix typos in documentationJonas Kvinge2021-10-121-2/+2
| | | | | | Pick-to: 5.15 6.2 Change-Id: I64d63af708bc6ddaabd12450eb3089e5077f849e Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Add private qAbort helper functionTor Arne Vestbø2021-09-221-0/+29
| | | | | | | Used from qt_message_fatal(), but is useful in other situations too. Change-Id: I3c0e438536d40271061c76d954c7878abfe37b8e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Improve version-related docs in qglobal.cppEdward Welbourne2021-09-211-21/+23
| | | | | | | | | | Give a more pragmatic illustration for QT_DEPRECATED_BEFORE. Make various minor tweaks to wording, use slightly less antique versions in examples. Make usage of "runtime" standard in qglobal.cpp, at least, since "run-time" seems to be less used generally. Change-Id: I1db4950d0d0e97903b1586d98ecba75576493b1c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix assorted misindented end-comment markers in qglobal.cppEdward Welbourne2021-09-201-14/+14
| | | | | | Change-Id: I240e7d32c4aa004f2bd7dd8cafd39b7c7d64e014 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* Encourage use of QT_VERSION_CHECK()Edward Welbourne2021-09-201-11/+21
| | | | | | | | | | | | Document that QT_VERSION should normally be compared against it, rather than raw hex, and mildly update the example versions used in docs. (Left the snippets testing old version, since the code in which the #if-ery is used might actually make sense for those versions.) Improve related documentation in the process. Change-Id: Id3e97f41bfb0f81a117cf7b3a3ccd5f244e2a99a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove conditioning on Android embeddedEdward Welbourne2021-09-171-3/+3
| | | | | | | | It is no longer handled separately from Android. This effectively reverts commit 6d50f746fe05a7008b63818e77784dd0c99270a1 Change-Id: Ic2d75b8c5a09895810913311ab2fe3355d4d2983 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Use QByteArrayView::toInt() instead of duplicating its implementationEdward Welbourne2021-08-311-31/+2
| | | | | | | | | | The code in qEnvironmentVariableIntValue() to parse the text as an int can now delegate it to QByteArrayView, so that keeping in sync with QByteArray::toInt(), as a comment requested, is now automatic. Change-Id: I09a6b7245ecd02f39a850a4ce187f86709282e8c Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Convert various callers of strtou?ll() to call strntou?ll()Edward Welbourne2021-08-301-2/+4
| | | | | | | | Where size is known or can readily be determined. Change-Id: I442e7ebb3757fdbf7d021a15e19aeba533b590a5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Doc: Fix documentation issues for Qt CoreTopi Reinio2021-08-241-1/+1
| | | | | | | | | | | | | | * Tag deprecated Q(Multi)Map operators in the header to correctly match them with documentation \fn commands. * Add documentation for QByteArrayView comparison operators. * Add a dummy typedef 'jfieldID' for generating docs correctly on non-Android platforms * Fix other minor issues Pick-to: 6.2 Task-number: QTBUG-95860 Change-Id: I141d2f75d6aa10557aa374201f09ad74b4cd6e81 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* QSysInfo: Delete pre-windows 10 codeMårten Nordheim2021-07-281-28/+4
| | | | | | | It's not supported. Change-Id: Id8c6ca7e7ad152620c76b5479ca495e9f64cc354 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Doc: QtCore: Fix more documentation warningsTopi Reinio2021-06-071-1/+1
| | | | | | | | | | | | | | * Omit 'Bluetooth' enum value in QPermission::PermisionType (sic) as that seems to be unimplemented. * Comment out \sa links to internal/undocumented functions. * Fix incomplete template parameters in \fn commands for QProperty methods. Task-number: QTBUG-93995 Change-Id: Ic8e63fca22c9c72325c76f90f537b221f56ebace Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Doc: Use \deprecated instead of \obsoletePaul Wicking2021-05-261-3/+3
| | | | | | Task-number: QTBUG-93990 Change-Id: I4e512354a49dde6678ca89cabc56bc76ba666bb3 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Farewell Q_DISABLE_MOVEGiuseppe D'Angelo2021-05-261-14/+3
| | | | | | | | | | | | | | | | | | | | In hindsight, this macro is an API mistake, as it should NEVER be used alone, but always in combination with Q_DISABLE_COPY. But in that case, there's a better macro: Q_DISABLE_COPY_MOVE; hence this API is either bad, or completely redundant. A GitHub search reveals that luckily there's a handful of usages in the wild (of which 0 in Qt/dev and KDE). Hence, I'm going for the kill, and removing it entirely. [ChangeLog][Source-Incompatible Changes][QtGlobal] The Q_DISABLE_MOVE macro has been removed. Code that was using it can be ported to Q_DISABLE_COPY_MOVE instead. Change-Id: I7e346f7e2288f3f5a45315f4f6bfaeb2661f1de5 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Long live qToUnderlyingGiuseppe D'Angelo2021-05-181-0/+9
| | | | | | | | | | | "Cherry-pick" of C++2b's std::to_underlying. [ChangeLog][QtCore][QtGlobal] The qToUnderlying function has been added, to convert an value of enumeration type to its underlying value. Change-Id: Ia46bd8e4496e55174171ac2f0799eacbcca02cf9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* qglobal.cpp: build under QT_NO_EXCEPTIONSGiuseppe D'Angelo2021-05-181-3/+9
| | | | | | | | | | | | | | | | | The boostrap library is built with exceptions disabled, and its sources include qglobal.cpp. Therefore, the file must work when built w/o exceptions. Amend/partially revert 282b724808ea4524ed09b9f0183055fdffc3c38a with the necessary fixes. Driveby, cleanup an unnecessary QT_THROW (just throw, if we do have exceptions). Change-Id: I370c295c21edd3d81a9fa670e60909b29d1c68aa Pick-to: 6.1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Make qTerminate available when QT_NO_EXCEPTIONS flag is setAlexey Edelev2021-05-161-10/+2
| | | | | | | | | | | | It seems that QtCore could only be compiled with exceptions enabled. Therefore it doesn't make sense to keep conditonal code under QT_NO_EXCEPTIONS in qglobal.cpp. qTerminate may be called whether exceptions are enabled or not. Pick-to: 6.1 Fixes: QTBUG-93739 Change-Id: Ie49c10f27cfa75360f018e8638603e6a1791450e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QFlags: add test(Any)Flag(s)Giuseppe D'Angelo2021-05-151-0/+38
| | | | | | | | | | | | | | | QFlags was lacking a named function for testing whether a QFlags object contains _any_ of the bits set by a given enumerator/other QFlags. Drive-by, add testFlags taking a QFlags, not just an object of the enumeration; and simplify the implementation of testFlags to more closely follow what its documentation says it does. [ChangeLog][QtCore][QFlags] The testFlags, testAnyFlag and testAnyFlags functions have been added. Change-Id: Ie8688c8b0dd393d34d32bc7786cdcee3eba24d1c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Rejig native interface plumbingTor Arne Vestbø2021-05-121-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The initial approach for providing public access to native interfaces via T::nativeInteface<I>() was based on the template not being defined, and then having explicit instantiations of the supported types in a source file, so that the accessors were exported and available to the user. This worked fine for "simple" types such as QOpenGLContext and QOffscreenSurface, but presented a problem in the context of classes with subclasses, such as Q{Core,Gui}Application. To ensure that a native interface for QCoreApplication was accessible both from QCoreApplication and its subclasses, while at the same time preventing a native interface for QGuiApplication to be accessible for QCoreApplication, the nativeInterface() template function had to be declared in each subclass. Which in turn meant specializing each native interface once for each subclass it was available in. This quickly became tedious to manage, and the requirements for exposing a new native interface wasn't very clear with all these template specializations and explicit instantiations spread around. To improve on this situation, while also squashing a few other birds at the same time, we change the approach to use type erasure. The definition of T::nativeInteface<I>() is now inline, passing on the requested interface to a per type (T, not I) helper function, with the interface type flattened to a std::type_info. The type_info requested by the user is then compared to the available types in a single per-type (T) "switch statement", which is a lot easier to follow for someone trying to trace the logic of how a native interface is resolved. We can safely rely on type_info being stable between the user application and the Qt library as a result of exporting the type info for each native interface, by explicitly ensuring they have a key function. This is the same mechanism that ensures we can safely dynamic_cast these interfaces, even across library boundaries. The use of a free standing templated helper function instead of a member function in the type T, is to avoid shadowing issues, and to not pollute the class namespace of T with the helper function. Since we are already changing the plumbing for how a user resolves a native interface for a type T, we take the opportunity to add a few extra safeguards to the machinery. First, we add a static assert in the T::nativeInteface<I>() definition, that ensures that only compatible interfaces, as declared by the interface themselves, are allowed. This ensures a compile time error when an incompatible interface is requested, which improves on the link time errors we had prior to this patch, and also offsets the one downside of type erasure, namely that errors are only caught at runtime. Secondly, each interface meant for public consumption through T::nativeInteface<I>() is declared with a revision, which is checked when requesting the interface. This allows us to bump the revision when we make breaking changes to the interface that would have otherwise been binary incompatible. Since the user will never see this interface due to the revision check, they will not end up calling methods that have been removed or renamed. One advantage of moving to a type-erased approach for the plumbing is that we're not longer exposing the native interface types as part of the T::nativeInteface symbols. This means that if we ever want to rename a native interface, the only exported symbol that the user code relies on is the type info. Renaming is then possible by just exporting the type info for the old interface, but leaving it empty. Since no class in Qt implements the old native interface, the user will just get a nullptr back, similarly to bumping the revision of an interface. Change-Id: Ie50d8fb536aafe2836370caacb22afbcfaf1712a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* QFlags::testFlag: clarify the behavior in the docsGiuseppe D'Angelo2021-05-111-0/+8
| | | | | | | | | | | | | The name made me fall in a trap: I thought that testFlag returned true if *any* of the bits in the argument were set in the QFlags object. In reality, it returns true if *all* the bits are set, and an argument equivalent to 0 is treated specially. Clarify this in the documentation. Change-Id: I9e8088c48038b4e6ba5830fdb7e473c6d7884b29 Pick-to: 5.15 6.0 6.1 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QFlags: add operator== and !=Giuseppe D'Angelo2021-05-111-0/+24
| | | | | | | | | | | | | It's a value type, and we don't need detours through implicit conversions (which are a real disgrace, as they make nonsense like `flags != 3.14` well-formed). [ChangeLog][QtCore][QFlags] Added overloads of operator== and operator!= between QFlags objects, and between a QFlags object and an object of the flag's enumeration. Change-Id: I36701dea8fcd4cc64941e78af58fa7d38a15a8c7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QFlags: add operator& / &= overloads taking a QFlags objectGiuseppe D'Angelo2021-05-111-0/+14
| | | | | | | | | | | | | It makes no sense to offer the "type-unsafe" operators taking a plain int, and not offer the ones taking a QFlags object. Using these operators has actually always worked by going through a conversion to int, but we're going to limit that possibility in the future. [ChangeLog][QtCore][QFlags] The operator& and operator&= now accept a QFlags object. Change-Id: Iee0845640014d35b646787e8bdb77854f180a9ef Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QFlags: add qHash overloadGiuseppe D'Angelo2021-05-111-0/+9
| | | | | | | | | Stop going through the implicit int conversion. [ChangeLog][QtCore][QFlags] QFlags now has a qHash() overload. Change-Id: Id380ed252695f24af2e8c239b650dcb6f44e2893 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QFlags: add (named) explicit conversion from/to intGiuseppe D'Angelo2021-05-111-0/+18
| | | | | | | | | | | | | There are some use cases where one may want to convert a QFlags object from/to an integer deliberately; for instance, to store it in a bitfield, saving some space. So far this worked by means of a implicit conversions; instead, also add named conversions for this. [ChangeLog][QtCore][QFlags] Added the fromInt() and toInt() functions for explicit conversions from/to a plain integer. Change-Id: I705559bf75b28c30b4446bb6d0753aedfc808eed Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* PRIx macros: add missing \relates to the docsGiuseppe D'Angelo2021-05-101-0/+4
| | | | | | | Otherwise they won't appear. Change-Id: I19d93aef9acb9d7afced8acbc76813a30b572953 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* PRI* datatypes: fix typos in documentationGiuseppe D'Angelo2021-04-251-2/+2
| | | | | | | A c&p mistake manage to slip through in 5fabad9a61, amend it. Change-Id: I706a6643d0745f336afca7bda0d8b0359354a0d6 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Long live PRI*QdatatypesGiuseppe D'Angelo2021-04-251-0/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Qt defines some integral datatypes (qsizetype, qintptr, quintptr, qptrdiff) not in terms of the corresponding language datatypes (resp. make_signed_t<size_t>, intptr_t, uintptr_t, ptrdiff_t) but as "integer types with the same bit size of the corresponding language type" (and of course the corret correct signedness for the target type). This makes the Qt datatypes not printable via printf-like formatted output, incl. qDebug, qWarning, QString::asprintf and so on; that's because there isn't a format modifier that would universally work with the Qt definitions. For instance, on a 32 bit platform, ptrdiff_t may be a typedef for long, while qptrdiff is a typedef for _int_ instead. Both long and int would indeed be 32 bits, but they still are different types, and this means that the ptrdiff_t-specific 't' length modifier would be wrong for qptrdiff: qptrdiff p; printf("%td", p); // WARNING: -Wformat: wanted long, got int Similarly, not using 't' breaks on 64 bits, and so on and so forth. There isn't a way out, short of inserting casts on every print statement. So, let's adopt the same solution C/C++ use for their own integer typedefs: the PRIx macros. This allows one to always use the correct formatting specifier without the need of a cast. I'm not adding the macros for the qintXX datatypes, as they already exist in the Standard Library. [ChangeLog][QtCore][QtGlobal] A series of PRIxQTDATATYPE macros have been added. They 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. Change-Id: I473226a661868aed9514d793c8e6e4d391ab5055 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Fixed type integers: streamline the definitionsGiuseppe D'Angelo2021-04-241-5/+4
| | | | | | | | | | | | | | | | | | | | | | On all the platforms we support, we require these sizes in bits: * char: 8 * short: 16 * int: 32 * long long: 64 We can get rid of the MSVC-specific type aliases (MSVC guarantees __intXX to be aliases anyhow, not extended integer types) and just use the builtin types. Also, we require C++11 and C99, so "LL" and "ULL" are the correct standard suffixes for (unsigned) long long. Remove the non-standard suffixes from the Q_(U)INT64_C macros. Change-Id: If007cd88d74064a163b5e910ca1983acd1dd1d10 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QtGlobal: check the Qt fixed size integersGiuseppe D'Angelo2021-04-231-0/+6
| | | | | | | | | | "Just in case", together with all the others platform checks we have in qglobal.cpp, check that we're not accidentally breaking our type aliases for fixed size integers. Change-Id: Iaa9438741b3a7e89f3c458763c7d222ef2abe961 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Use Core library for qmake instead of the Bootstrap libraryAlexey Edelev2021-02-251-12/+1
| | | | | | | | | | | | | | | | | | | Move the qmake-specific logic of the QLibraryInfo class to qmake internals. 'qconfig.cpp.in' now stores information about the library info entries to keep them consistent between qmake and the Core library. qmake requires specific features enabled in the Core library, so building qmake will be skipped if the features are not enabled. All flags directly related to the qmake have been removed from Core lib. Remove all bootstrap related sections from qmake CMakeLists.txt Task-number: QTBUG-89369 Change-Id: I26de157d3bfd4a5526699296e9d46e1c180b89ae Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Make QJniObject and QJniEnvironment public APIAssam Boudjelthia2021-01-271-3/+3
| | | | | | | | | | | | | | | | | | | | As part of Qt 6 restructring for the extras modules, this change exposes the Jni APIs which are very important for Android platform. This patch adds the APIs QJniObject, QJniEnvironment, QJniExceptionCleaner based from private QtCore and QtAndroidExtras. The Jni interface is cross-platform which justifies the name, but currently, this API is used mainly for Android, and the naming comes generic without Android keyword to avoid any future limitation on supporting other platforms. [ChangeLog][QtCore] Add new QJniObject, QJniEnvironment and QJniExceptionCleaner APIs. Task-number: QTBUG-89482 Fixes: QTBUG-89633 Change-Id: I4382dd53a225375759b9d042f6035a4a9810572b Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
* Mark qBadAlloc as [[noreturn]]Giuseppe D'Angelo2021-01-191-0/+4
| | | | | | | | | | | | So that static analyzers don't get confused by its semantics. In builds with exceptions disabled, it's not actually called by client code (e.g. Q_CHECK_PTR will just terminate in that case), but we still need to make it not return -- add another path that callss std::terminate(), otherwise we'd have a noreturn function returning. Change-Id: Ia8c4ce3e9d971f1757e9c273051cb3dedf23c61f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Assert that wchar_t's size matches one of the unicode character typesEdward Welbourne2021-01-081-0/+2
| | | | | | | This is assumed in various places, so best checked explicitly. Change-Id: I475dcf5cbb60c0272dec560acd2893cff73872ce Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Add test for qRoundDavid Skoland2020-12-021-0/+8
| | | | | | | | | Add test for qRound that covers some edge cases for rounding. Note that as of right now, this test fails and the docs have been updated to warn that it should not be depended on for strict correctness. Change-Id: I1a61bca47abd77855fe7c13ded44e913cc7e8722 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Extend container overview documentation, mention Q_DECLARE_TYPEINFOAndreas Buhr2020-11-301-3/+10
| | | | | | | | | | | | The container overview documentation did not mention Q_DECLARE_TYPEINFO and the related optimizations. This patch adds a short paragraph about it. Task-number: QTBUG-86584 Pick-to: 6.0 Change-Id: I5b0b8ce92a47da5f0398cc413fbf3e07b0921e59 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* Re-fix the definition of primitive typesGiuseppe D'Angelo2020-11-241-1/+1
| | | | | | | | | | | The conditions are AND, not OR. Technically we don't rely on not having constructors any more, but we may reserve the right in the future to have uninitialized resizes. Change-Id: Icfae61079a544f7ac8e90a32ad605c12cfa8b4aa Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit bcd38a96149f5397375b57e948c05c7a8f172194) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Centralize the wchar_t == char16_t check on WindowsGiuseppe D'Angelo2020-11-181-0/+3
| | | | | | | | Don't push it onto every TU that includes QChar (... approx. everything that uses Qt). Change-Id: I4a07ce9e38a347b45315db93b0c5b90c20bacdbc Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Don't initialize POD types with memset(0)Lars Knoll2020-11-171-4/+2
| | | | | | | | | This is dangerous as at least pointers to member objects/data are not always zero initialized. Change-Id: I1250e101ab73cd816694315fc9130f4d486b9feb Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>