summaryrefslogtreecommitdiffstats
path: root/src/corelib/global
Commit message (Collapse)AuthorAgeFilesLines
* Q{*String,ByteArray}View::length(): use qsizetype, not intGiuseppe D'Angelo2021-04-151-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Looks like these ones have been forgotten in the Qt 5 -> 6 upgrade to qsizetype. Change them to return qsizetype as well, and fix the docs. Being entirely inline, non-exported classes, we should be able to get away with it without affecting binary compatibility. Moreover, there's no reason for keeping them deprecated. Requires some minor adjustments, just like the ones done for size()'s changes. [ChangeLog][QtCore][QStringView] The length() function now returns `qsizetype`, not `int`, for consistency with the other string and container classes in Qt. Following this change, it has been un-deprecated. [ChangeLog][QtCore][QAnyStringView] The length() function now returns `qsizetype`, not `int`, for consistency with the other string and container classes in Qt. Following this change, it has been un-deprecated. [ChangeLog][QtCore][QUtf8StringView] The length() function now returns `qsizetype`, not `int`, for consistency with the other string and container classes in Qt. Following this change, it has been un-deprecated. [ChangeLog][QtCore][QByteArrayView] The length() function now returns `qsizetype`, not `int`, for consistency with the other string and container classes in Qt. Following this change, it has been un-deprecated. Fixes: QTBUG-92496 Change-Id: Ie0f4939d1083884e95d4725f891b6c6764532cb8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Document new InputMethodQuery enum valueVolker Hilsheimer2021-04-131-0/+1
| | | | | | | | | This amends c80f262258b7846bf199887bcfdbb6dcfda6ad6f. Change-Id: Iec8a8f5ce50fdf0ba371a287f243186b2435e594 Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Piotr Mikolajczyk <piotr.mikolajczyk@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Add "QT_DEPRECATED_VERSION_XXX" macrosJiDe Zhang2021-04-121-0/+32
| | | | | | | | | Since 6.3 to 6.6, for which version add "QT_DEPRECATED_VERSION_X_6_" and "QT_DEPRECATED_VERSION_6_" macro. Change-Id: I10c77b1ed436ce3442960f5594f86a3a3be181f2 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Allow qrandom_p.h to be included by more than one .cpp in QtCoreThiago Macieira2021-04-072-3/+5
| | | | | | | | | | I thought we could use C++17 inline variables, but those can't be used across DLL boundaries: qrandom_p.h:75:48: error: definition of 'QBasicAtomicInteger<unsigned int> qt_randomdevice_control' is marked 'dllimport' Change-Id: Id2983978ad544ff79911fffd1671f857587ef2fb Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* CMake: Fix building multi-arch universal macOS QtAlexandru Croitor2021-04-011-7/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use the same approach we use for iOS, which is to set multiple CMAKE_OSX_ARCHITECTURES values and let the clang front end deal with lipo-ing the final libraries. For now, Qt can be configured to build universal macOS libraries by passing 2 architectures to CMake, either via: -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" or -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" Currently we recommend specifying the intel x86_64 arch as the first one, to get an intel slice configuration that is comparable to a non-universal intel build. Specifying the arm64 slice first could pessimize optimizations and reduce the feature set for the intel slice due to the limitation that we run configure tests only once. The first specified architecture is the one used to do all the configure tests. It 'mostly' defines the common feature set of both architecture slices, with the excepion of some special handling for sse2 and neon instructions. In the future we might want to run at least the Qt architecture config test for all specified architectures, so that we can extract all the supported sub-arches and instruction sets in a reliable way. For now, we use the same sse2 hack as for iOS simulator_and_device builds, otherwise QtGui fails to link due to missing qt_memfill32_sse2 and other symbols. The hack is somewhat augmented to ensure that reconfiguration still succeeds (same issue happened with iOS). Previously the sse2 feature condition was broken due to force setting the feature to be ON. Now the condition also checks for a special QT_FORCE_FEATURE_sse2 variable which we set internally. Note that we shouldn't build for arm64e, because the binaries get killed when running on AS with the following message: kernel: exec_mach_imgact: not running binary built against preview arm64e ABI. Aslo, by default, we disable the arm64 slice for qt sql plugins, mostly because the CI provisioned sql libraries that we depend on only contain x86_64 slices, and trying to build the sql plugins for both slices will fail with linker errors. This behavior can be disabled for all targets marked by qt_internal_force_macos_intel_arch, by setting the QT_FORCE_MACOS_ALL_ARCHES CMake option to ON. To disble it per-target one can set QT_FORCE_MACOS_ALL_ARCHES_${target} to ON. Task-number: QTBUG-85447 Change-Id: Iccb5dfcc1a21a8a8292bd3817df0ea46c3445f75 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Android: Add select and copy capability to read-only text widgetsPiotr Mikolajczyk2021-03-301-0/+1
| | | | | | | | | | | | | | | | In case of a read-only text editing widget it was imposibble to copy text from it. In QtWidgets you could not even see the selection handless. Text selection in QtWidgets module was filtered depending on readOnly property of the widget. Additionally, in InputMethod the read-only state was translated into disabled. Patch also makes the edit menu to be aware of the read-only status of the control - the menu items are different for rw and ro controls. Task-number: QTBUG-91417 Change-Id: Ic7b27f78678eeaa87a38607af787f254db1383b8 Reviewed-by: Rami Potinkara <rami.potinkara@qt.io> Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
* Use official names for Android versionsVolker Hilsheimer2021-03-292-8/+8
| | | | | | | | | | | Google ditched the dessert names as of Android "Q". "Q" and "R" were development names, the released versions are called Android 10 and Android 11, respectively. Pick-to: 6.1 Task-number: QTBUG-90211 Change-Id: I36225067cc802ebd3ebd1289d509759ae1b2d83d Reviewed-by: BogDan Vatra <bogdan@kdab.com>
* Merge integration refs/builds/qtci/dev/1616675134Qt CI Bot2021-03-251-1/+1
|\
| * CMake: Fix qconfig.cpp embedded prefix in the CIAlexandru Croitor2021-03-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the CI on a windows we configure Qt with the following prefix -DCMAKE_INSTALL_PREFIX:PATH=\Users\qt\work\install Note the lack of the drive letter. This is intentional, so that we can abuse CMake's DESTDIR installation mechanism to install into a custom path. This causes trouble for static Qt builds in the CI. Specifically when there is no qt.conf file next to qmake, qmake -query will report a QT_INSTALL_PREFIX:/Users/qt/work/install and ultimately qmake will fail to locate the module .pri files in such a path, showing errors like: Project ERROR: Unknown module(s) in QT: core gui? If a qt.conf is placed next to qmake (even an empty one), a differenct code path is used in qmake to resolve the prefix, which returns a path with a drive letter. In a shared build, because the 'relocatable' feature is enabled by default, a different code path is used and thus the prefix is also successfully resolved. So the problem is specific to static Windows Qt builds that have no qt.conf file next to qmake. This is the exact scenario that we encounter when running static Qt tests (tst_qmake in particular). To circumvent the issue, prepend a drive letter to the prefix hardcoded into qconfig.cpp. Do that with get_filename_component(REALPATH) which apparently resolves to a fully qualified path. Pick-to: 6.1 Task-number: QTBUG-87580 Change-Id: I17c885f29bfdee45bec1d6aac7c3b26723e761a3 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* | QTypeInfo: Handle T::value_type being equal to TFabian Kosmale2021-03-251-4/+13
|/ | | | | | | | | | | | | | | | | Fix operator checks for containers whose value_type equals themselves. It does not make sense to recurse on value_type in that case. Thanks to std::disjunction having short-circuiting semantics, we can avoid that issue by checking first whether T is T::value_type. As a drive-by, check for value_type typedef before checking for begin/end in is_container. This works around an issue in gcc <= 8.1, which fails to correctly SFINAE the case where begin and end are private methods. Pick-to: 6.0 6.1 Fixes: QTBUG-89456 Change-Id: I27305a7cfe050f13a279c07f00bc229c01daa25b Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Revert "qtypeinfo: make variable templates inline"Fabian Kosmale2021-03-231-19/+14
| | | | | | | | | | This reverts commit 6de9acf7793a299322923b3ac02142a5e5998842. Reason for revert: This might cause ICEs in clang Task-number: QTBUG-91782 Change-Id: I987d2242b04a22208b54ecbc386a1f6cfc625c1d Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Enforce __cplusplus >= 201703L on MSVCGiuseppe D'Angelo2021-03-221-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Client code on MSVC *must* pass /Zc:__cplusplus when using Qt. Otherwise, this makes Qt code that relies on feature-testing macros a mess. For instance, in QTBUG-91117, we trip on this code: // C++ version guard is necessary: you may have the header, // but including it in pre-C++20 will cause an hard error #if __has_include(<bit>) && __cplusplus > 201703L #include <bit> #endif #if defined(__cpp_lib_bitops) // use some <bit> functionality #endif The #define __cpp_lib_bitops should've come from the preceding include directive, but there's another possibility: that it comes from <version> (or some other similar header) included transitively, when compiling in C++20 mode, and *without* a bumped __cplusplus. Yes, that's an actual possibility on MSVC. Then, since we did not include <bit> ourselves due to the __cplusplus version check, using the functionality will cause a compile error. We're not going to fix *every* post C++-17 feature detection macro because of MSVC and feature-test shenanigans. It's time to require compilers to tell us the truth about what they support. Fixes: QTBUG-91117 Change-Id: I9d74f9d8b74b5ac35dce3528e7a2006746a00676 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* qcontainerfwd.h: Do not include variant and tupleFabian Kosmale2021-03-211-0/+1
| | | | | | | | | utility is enough to get std::pair; qtypeinfo.h needs to include tuple now though. Change-Id: I9feb625f9feb148b3f3133747ab5405c2eca049d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Clenaup Q_COMPILER_THREADSAFE_STATICSFabian Kosmale2021-03-212-55/+5
| | | | | | Change-Id: I1cf0646d4e6c9b30a7ef6538d81f92faf2e511e1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Unify QLibraryInfo settingsAlexey Edelev2021-03-172-36/+122
| | | | | | | | | | | Exporting QLibraryInfo internals allows to reuse settings in qmake/qtpath without having to keep its own instance. Also there is no need to check setting groups in QLibraryInfo except the 'Paths' group, since this logic belongs to qmake/qtpaths only. Change-Id: If762defba025ad7f7489f8a86ef5768a8628bd2f Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* QRandomGenerator: remove dead code previously used by qrand()Thiago Macieira2021-03-141-22/+0
| | | | | | | | | | Commit 9ee554ac1d1af97e7ad5b4bf78e2779f7d1c405f removed qrand() and qsrand(), so commit 81896304dc1fb65da3302deb54ab4cfe060625ff removed the functions accessing QRandEngine, but forgot to remove the actual engine. Pick-to: 6.1 Change-Id: I26b8286f61534f88b649fffd166c41aecf55d2b1 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Remove now unneeded QT_BOOTSTRAPPED check from qlibraryinfo.cppJoerg Bornemann2021-03-111-2/+0
| | | | | | | | | | Since qmake links against QtCore, we don't need to check for the bootstrapping case in qlibraryinfo.cpp anymore. Change-Id: I644b1e71db727773b3e32ac650481df134acf033 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Remove all qmake-related data from q[make]config.cppJoerg Bornemann2021-03-112-80/+34
| | | | | | | | | | | | Now that we're not actually using qmakeconfig.cpp anymore, we can remove it together with all qmake-related information that was written into qconfig.cpp. This also moves the qtConfEntries array back to qlibraryinfo.cpp. Change-Id: I5e57d8c55613332cc3e57b11df4398d46aed259b Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Read QLibraryInfo paths directly from QLibraryInfo and not from qmakeconfig.cppJoerg Bornemann2021-03-112-12/+21
| | | | | | Change-Id: I1db1c871ec6b4e572bd36df6aff7a5be8a4a706c Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Do not write Sysroot and SysrootifyPrefix into qmakeconfig.cppJoerg Bornemann2021-03-111-2/+2
| | | | | | | | Those have fixed values. Change-Id: I7f1ba8036f43413d3c805f4b419ae79e037343fb Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Remove the platformsSection constant from qconfig.cpp.inJoerg Bornemann2021-03-112-4/+2
| | | | | | | | | This is not configurable and doesn't have to be in the generated q[make]config.cpp files. Change-Id: If294d735800a3b5c6b3e269abdd86df401cf4864 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* string 16<->8 bits conversion: SIMD on arm32Nick Shaforostoff2021-03-081-0/+16
| | | | | | | | this adds emulation for 2 NEON commands that armv7 lacks this increases conversion speed by around 50% in my simple tests Change-Id: I4f52d353184e9a8d88089de60e17bd5670637c0c Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* qtypeinfo: make variable templates inlineFabian Kosmale2021-03-051-14/+19
| | | | | | | | | | And refactor the TMP to use std::conjunction and use variable template specialization instead of template class specialization for the base cases. Change-Id: Iea6a03f13ea3443a0fa7365af21c496670c1e07f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix build of Core module without regularexpression featureAlexey Edelev2021-03-042-3/+3
| | | | | | | | | | | | | | | | | | qregularexpression.h requires FEATURE_regularexpression to be enabled. Add a condition to the 'qt_pch.h' header to fix the build when PCH are enabled and FEATURE_regularexpression is disabled. It seems that the filter implementation of QSortFilterProxyModel has QRegularExpression as its base. It's necessary to make sortfilterproxymodel dependent on the regularexpression feature. Fix the precompiler condition for the extractSections function in the QString implementation. Use the same precompiler condition for the QString::section and extractSections functions, since QString::section depends on extractSections. Change-Id: I5b775e0842a0aa1a8d47f8dded376bdfcf63b5bf Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Fix QT_HOST_LIBEXECS for cross-builds on WindowsJoerg Bornemann2021-03-041-0/+4
| | | | | | | | | | Like for LibraryExecutables, we must default to "bin" on Windows for HostLibraryExecutables in our generated qconfig.cpp. Pick-to: 6.1 Fixes: QTBUG-91496 Change-Id: Ib5a4b3b3fd6192bd953e615058b482e67ad19462 Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* Add the 6.2 deprecation macrosGiuseppe D'Angelo2021-03-021-0/+8
| | | | | | | | | ... which makes me wonder, why isn't this stuff bumped automatically when a minor version branch is created? Change-Id: Ia43f898163a4baa0896a09bd13d65cf534fe1df5 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Simplify prefix-related functionality of qmakeAlexey Edelev2021-03-011-2/+0
| | | | | | | | | | | | | Since the QT_CONFIGURE_HOSTBINDIR_TO_HOSTPREFIX_PATH and QT_CONFIGURE_HOSTBINDIR_TO_EXTPREFIX_PATH definitions keep the same value in modern CMake build, no need to have special handling in cases where these values are used in qmake. Also it will be useful to specify the relative path to the prefix directory from the directories different of 'bin' when use QMakeLibraryInfo. Task-number: QTBUG-75870 Change-Id: I5a777001eb334dcf05e22853a514d4257352d59b Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Remove unused definitionsAlexey Edelev2021-03-011-4/+0
| | | | | | | | | | | | QT_CONFIGURE_CROSSBUILD is always '0', so it's not necessary to keep conditional compilation in QMakeLibraryInfo. Also the QT_CONFIGURE_SYSROOTIFY_PREFIX definition is never used in the project. Task-number: QTBUG-75870 Change-Id: I1fe42dce40fddc6a72254736883f93aa4727f6b3 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Use Core library for qmake instead of the Bootstrap libraryAlexey Edelev2021-02-256-312/+85
| | | | | | | | | | | | | | | | | | | 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>
* qmake: Introduce QT_HOST_LIBEXECS propertyJoerg Bornemann2021-02-182-1/+9
| | | | | | | | | This will be used to access host tools that are installed in ${prefix}/libexec instead of ${prefix}/bin. Pick-to: 6.1 Change-Id: I36c4b5736330f8229d267a117c65d55cd5e12758 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Prepare TextDate to use UTC-offset rather than GMT-offset zone suffixesEdward Welbourne2021-02-151-4/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are GMT-offset zones whose convention for the sign of the offset is the reverse of what we are (still) using, which is the usual convention for UTC-offset zone: for example, the Olson Database's Etc/GMT+3 has offset -3 hours in the UTC-based system we use, so we give it suffix GMT-0300. The UTC-based suffix is also what we use as the abbreviation for OffsetFromUTC() in toString(). For now this only adds support for parsing a planned future form: the old form using GMT is retained, to give client code some chance to prepare for a backwards-compatible transition. Although the GMT prefix is matched case-insensitively, only match UTC if fully upper-case; there is no meaningful precedent for case-insensitive usage here. [ChangeLog][QtCore][QDateTime] The Qt::TextDate format now recognizes UTC-based offset suffixes in addition to suffixes based on the deprecated alias GMT. This prepares for toString() to use such UTC-based suffixes for time-zones (fromString() cannot parse the present abbreviation suffix). A future release of Qt shall use UTC-based suffixes in place of the present GMT-based suffixes (which conflict with GMT-based IANA zone names) for Qt::LocalTime and Qt::OffsetFromUTC time-specs. Client code is encouraged to use and recognize UTC-based zone suffixes in preparation for that transition, unless compatibility with versions before 6.2 is required. Change-Id: I5a42a488f1232a30f4b427b7954759283423b9b3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Doc: Fix warning on undocumented enum valueNico Vertriest2021-02-151-0/+1
| | | | | Change-Id: Ia917b86a24bdb621b1040f1e1a9fe4946a1e57ae Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Fix tst_QDateTime::systemTimeZoneChange() for 32-bit systemsEdward Welbourne2021-02-121-3/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The test verified that a LocalTime's time since Epoch changes when the system time-zone changes. This works when the QDateTime object is in short form and recomputes its offset from UTC every time it is needed, but fails with a pimpled QDateTime, as this caches its offset from UTC when it is created, saving the recomputation which - in the far more usual case where the system time-zone does not change in the lifetime of a QDateTime object - would normally produce the same result. Changed the test to use a newly-created QDateTime constructed with the same parameters, which doesn't have the cached out-of-date knowledge of its zone offset. Removed the XFAIL. Made the test data-driven and added test-cases: one so close to the Epoch that it should be short even on 32-bit systems, one so far that it's pimpled even on 64-bit systems (used in reproducing the issue in order to debug it). This then revealed that Android 5 doesn't seem to support the POSIX zone IDs used by this test, so it now verifies that LocalTime has the expected offset from UTC after zone changes, QSKIP()ping if not. Documented that the behavior of LocalTime is undefined after a change to the system time-zone. Cleaned up the existing doc of Qt::TimeSpec in the process. Fixes: QTBUG-89889 Pick-to: 6.1 6.0 5.15 Change-Id: I1058f47a1ff3ee1c326f3579ac80bd8bab242e28 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QLibraryInfo: Rename Qml2ImportsPath to QmlImportsPathUlf Hermann2021-02-082-2/+3
| | | | | | | | | | The "2" is meaningless. We retain the old name as alias for source compatibility, but we don't document it anymore. Task-number: QTBUG-85064 Change-Id: Id10d58f6d39a0faaec042304b374ae6b23469362 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Fix compilation with 32-bit clangRobert Loehning2021-02-011-2/+5
| | | | | | | | Currently fails with: undefined reference to `__mulodi4' Change-Id: Iefa321d6fd7cb989dd4a00166ed65e5b7f3ba33f Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove usage of the definitions that are never definedAlexey Edelev2021-02-011-9/+3
| | | | | | | | The QT_BUILD_QMAKE_BOOTSTRAP and QT_BUILD_QMAKE_LIBRARY definitions are never defined in the project since migrating to CMake build. Change-Id: I7108c92387005a2fde6ebdb2d74843e3efc6413e Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Make QJniObject and QJniEnvironment public APIAssam Boudjelthia2021-01-273-11/+8
| | | | | | | | | | | | | | | | | | | | 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>
* Add qHypot() to qmath.h, exposing and extending std::hypot()Edward Welbourne2021-01-271-1/+58
| | | | | | | | | | | | | | | | | | | | We have plenty of places where we add some squares and take a square root; this may be done more accurately and faster by hypot(). Introduce QHypotHelper to handle hypot with more than 3 parameters, and with 3 when the C++17 version is missing (which it never should be). Include an overload taking arbitrarily many valus and ensure that we can use qHypot() with qfloat16. Illustrate with some example uses, add some tests. [ChangeLog][QtCore][QMath] Header <QMath> now provides qHypot(), an implementation of std::hypot() taking arbitrarily many numeric values, including support for qfloat16, while avoiding the overflow and underflow problems that arise when naively taking the square root of a sum of squares. Change-Id: Ia4e3913fe83fc27d17d8e7f1a52f03ad445c1fed Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Q_GLOBAL_STATIC - deal with static code analysersTimur Pocheptsov2021-01-271-0/+4
| | | | | | | | | | | | At least some of them don't like the fact we have classes with non-trivial destructors but trivial move/copy constructors - disable them explicitly, hopefully those analysers are smart enough to stop complaining. Change-Id: I285711a2d21bff89661af928ba326ecd5b69823f Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Fix build with GCC 11: include <limits>Thiago Macieira2021-01-192-2/+5
| | | | | | | Fixes: QTBUG-90395 Pick-to: 6.0 Change-Id: Iecc74d2000eb40dfbe7bfffd165b5dd3708b7a40 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Mark qBadAlloc as [[noreturn]]Giuseppe D'Angelo2021-01-192-1/+5
| | | | | | | | | | | | 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>
* Update QOperatingSystemVersion version names for AndroidAssam Boudjelthia2021-01-192-0/+40
| | | | | Change-Id: I88c7713cd75f84d11b303e0dad2093c7d5568bc4 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* Fix XCB launch key mappingAllan Sandfeld Jensen2021-01-152-19/+20
| | | | | | | | | | | | | They have been reported wrong since Qt 4, and not fixed for behavior compatibility, fixing it for Qt 6. [ChangeLog][X11] XF86LaunchXX keys have been remapped, so the Qt names and X11 names match, instead of being 2 off. Pick-to: 6.0 Fixes: QTBUG-25261 Change-Id: Ie3a8676439ae3e93a78218c9e7f4443565e84356 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* Extend qIsInf() and friends to handle integral types sensiblyEdward Welbourne2021-01-151-1/+14
| | | | | | | | | [ChangeLog][QtCore] qIsInf(), qIsNaN() and qIsFinite() now, like std::isinf() and friends, accept integral types (returning false, false and true, respectively) as well as floating-point ones. Change-Id: I1e2b7f033f0e8166c0b21e31a62b3e6d37b9344a Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* If available, use a version-specific qt<major-version>.confRalf Habacker2021-01-141-1/+4
| | | | | | | | | | | To enable the current Qt version to use a qt.conf that is independent from the previous version, a file named 'qt<major-version>.conf' is searched for first. If this file does not exist, a file with the name 'qt.conf' is searched for. Task-number: QTBUG-88635 Change-Id: If75b63f72a7bdbdf1de7729ea4ecb00810b58d12 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* 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>
* Remove the qmake project filesJoerg Bornemann2021-01-071-132/+0
| | | | | | | | | | | | | | | | Remove the qmake project files for most of Qt. Leave the qmake project files for examples, because we still test those in the CI to ensure qmake does not regress. Also leave the qmake project files for utils and other minor parts that lack CMake project files. Task-number: QTBUG-88742 Change-Id: I6cdf059e6204816f617f9624f3ea9822703f73cc Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Add version() to QOperatingSystemVersionLars Schmertmann2020-12-282-4/+19
| | | | | Change-Id: I6c7f0616d52b0d118ffd8c031f3f51212b8ed821 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* macos: Document that Drawer is obsoleteMorten Johan Sørvig2020-12-211-0/+2
| | | | | | | | | | This feature is not much used on modern macOS, and Qt 5 has never supported it. Pick-to: 5.15 6.0 Change-Id: I9de195aaf7df954b63f0f816e93c91e870ef5852 Reviewed-by: Andy Shaw <andy.shaw@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Use QDeadlineTimer in qlogging.cppThiago Macieira2020-12-091-3/+2
| | | | | | | No change, just shorter code. Change-Id: I25d85d86649448d5b2b3fffd1450f95b0ec66927 Reviewed-by: Lars Knoll <lars.knoll@qt.io>