summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* CMake: Generate better Xcode iOS projectsAlexandru Croitor2021-04-195-0/+195
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add an iOS specific plist file like we do for macOS. If the user hasn't specified a bundle identifier or a development team id, do what qmake does and query the Xcode preferences file to pre-populate those if possible. This allows running cmake -GXcode ./foo on a Qt example project and building it with xcodebuild on the command line without having to go through the IDE to set a development team id or modifying the example project to add a product bundle identifier. Note that the change assumes that the development team id has been previously set / configured via Xcode. If no such id is found, then the value will not be set and the user will still have to specify it either in the project file or via the Xcode UI after the project has been generated. Amends 3a2fa3fec5a43d30f1a93a8e89e2973f23ee4ef3 Pick-to: 6.1 Change-Id: Iaab4e57de72c9877fb9035d28f9a879b2c91a33c Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* CMake: Introduce zlib find script to work around hardcoded iOS SDKAlexandru Croitor2021-04-1910-11/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Xcode allows building a project targeting either the device or simulator sysroot in one single build dir, but for the sysroot switching to work there should be no linker or compiler flags referencing absolute paths of a specific sysroot. During CMake configuration of a project targeting iOS, all found system libraries will be within one single sysroot, either the device one or the simulator one, whichever one was passed to CMAKE_OSX_SYSROOT. CMake will then generate the Xcode project and pass those absolute paths, which makes sysroot switching within Xcode not work. To avoid that, the CMake documentation recommends passing linker and framework flags of the form '-lfoo' and '-framework bar' instead of absolute paths. Xcode then takes care of setting the correct framework search path. Zlib is one of the libraries found in the iOS sysroot and thus passed as absolute path. To avoid that, create a new FindWrapZLIB find script. The target it creates will pass the absolute path to the library on non Apple platforms and an -lz linker flag on Apple platforms (macOS and iOS). To avoid issues with target global promotion when system PNG package is found, ensure that a found ZLIB::ZLIB target is promoted to global manually in src/gui/configure.cmake. Pick-to: 6.1 Change-Id: I8bd8649be4f680a331ad51925f27cb9d13ac5e5f Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* Fix qtbase cmake autotestJuha Vuolle2021-04-191-5/+2
| | | | | | | | | | The testcase relied on having optional packages, and that the last package in that list was found. Otherwise the version numbers of the found modules were not set. Change-Id: I76743fd029d6eed2f4b347280591e6fdaed19053 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Avoid divide-by-zero in the gradients exampleShawn Rutledge2021-04-191-0/+2
| | | | | | | | | | | After 7a738daa97436478a21b5dd31ba2312b2cb2df41 we require QLineF::setLength() to take a finite length, and this code was probably always risky when HoverPoints has two points that are both 0,0. It's probably a transient condition anyway. Fixes: QTBUG-92908 Change-Id: If81122d2f78761026b0d656ceffe173132751317 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Add documentation for the QtLiterals namespaceVolker Hilsheimer2021-04-191-0/+33
| | | | | | | Pick-to: 6.1 Change-Id: I7932de5f91590acd30c8d4c87f760fd47b1fe0b0 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Add ScreenGadget utilityMorten Johan Sørvig2021-04-193-0/+266
| | | | | | | | | | | | ScreenGadget visualizes virtual desktop screen layout, in device independent and native pixels. This can be used to debug the (sometimes surprising) device independent screen geometry resulting from Qt applying a scale factor. Change-Id: I5b18e0fc9a54ba3e14d648794429b2eeadd25748 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Update DprGadadgetMorten Johan Sørvig2021-04-192-34/+128
| | | | | | | | | | Display active environment variables. Reorder the labels with device independent values to the left and native values to the right. Display the Qt scale factor. Change-Id: If95c252b06eff5abd91a25847777246effe94be2 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Unicodetools: compileGiuseppe D'Angelo2021-04-191-0/+2
| | | | | | | | | | | | Add an #include for a header that was only accidentally included transitively. Pick-to: 5.15 6.0 6.1 Task-number: QTBUG-92822 Change-Id: Ie29bb0e065f2db712e9cf9539b15124ff0ced349 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Andreas Buhr <andreas.buhr@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Port QSequentialAnimationGroup to new property systemAndreas Buhr2021-04-194-8/+62
| | | | | | | | | | | | There is only one property in QSequentialAnimationGroup, currentAnimation. This patch ports this property to the new property system Task-number: QTBUG-85520 Change-Id: Id528d30f551e88a6165bbb6a3c09d44e89257de5 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Port of QDBusServiceWatcher::watchMode to new property systemAndreas Buhr2021-04-193-6/+63
| | | | | | | | | | | Port watchMode in QDBusServiceWatcher to the new property system. This is the easiest part. Task-number: QTBUG-85520 Change-Id: I588212af205e77765862b8fecdbdcbf871717142 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Assert that engine isn't nullptr before dereferencingVolker Hilsheimer2021-04-191-0/+1
| | | | | | | | | | | The engine pointer is guaranteed to be initialized in line 1838, so we can assert that the correct value is passed into the function to fix static analyzer warning 1d9b8ce922ee0891fb0d477dc17fdb8d. Change-Id: I773bbaa579afec0d7a79d4393ee66fd26ba9629b Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Jonas Karlsson <jonas.karlsson@qt.io> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Assert that engine isn't nullptr before dereferencingVolker Hilsheimer2021-04-191-6/+8
| | | | | | | | | | | | | | | | | | | | Various checks for "engine" in the previous code suggested that engine might be nullptr by the time we want to populate the out-parameters. This must not be the case, and QFontDatabase::load asserts already that a valid engine is loaded and returned. Fix static analyzer warning 7f68daa282c72e8cc172c681eb02f559 by asserting it here as well. As a drive-by, change the tested out-parameter to the last one in the list of optional parameters. Pick-to: 6.1 Change-Id: I3d9ff0f5f7c4740014301c073480d14fef54e2fb Reviewed-by: Jonas Karlsson <jonas.karlsson@qt.io> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Re-layout QProgressDialog when setting the cancel buttonQiang Li2021-04-192-0/+26
| | | | | | | | | | | | | | Setting a cancel button on QProgressDialog more than once caused the layout to be invalid. The layout was only applied when the dialog resizes or the style changes, but not when a new cancel button is set. The solution is to update the layout() before showing the dialog when adopting new child widgets. Fixes: QTBUG-19983 Pick-to: 6.0 6.1 Change-Id: Id8fb1ac56e94a9bd97d4559a2e8d4835856fd7d0 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Fix top-level build repository targetsJoerg Bornemann2021-04-191-9/+10
| | | | | | | | | | | | The directory-level targets missed the first level of sub-targets. E.g. `qtbase_qmake` did not have a dependency to `qmake`. Fix qt_build_internals_get_repo_targets to first grab all targets of the subdirectory and then recurse. Pick-to: 6.1 6.0 Change-Id: I3604000caec22fac9a4cc5f5aaf651d550d16793 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Merge integration refs/builds/qtci/dev/1618660601Qt CI Bot2021-04-171-0/+6
|\
| * CMake: Warn when using CMake 3.20.1 due to crashes in AUTOMOCAlexandru Croitor2021-04-171-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | With CMake 3.20.1 AUTOMOC can crash or hang on Windows when used with a Qt installation that supports moc depfiles due to missing multi-threaded locking. Warn and advise to use a different CMake version instead. Change-Id: I78d2269c48dfc2541bebcd6ab23aaa5595012149 Pick-to: 6.1 6.0 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* | Inline test cases in tst_qlistAndrei Golubev2021-04-171-598/+157
|/ | | | | | | | | | | | QList tests have mostly a scheme of: void opInt() { op<int>(); } void opMovable() { op<Movable>(); } void opCustom() { op<Custom>(); } As a drive by, move the leak checking into a separate struct/macro Change-Id: I7cdda3a6c2aa324968aa26594da9f9eafbd49a0a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Port examples away from deprecated QTouchEvent APIsVolker Hilsheimer2021-04-175-35/+35
| | | | | | | Use the QEventPoints API instead. Change-Id: I7310fd34df110cad508f6188a41ad452a3cf848d Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* QHash: allow an empty QT_HASH_SEED env variable to resetThiago Macieira2021-04-161-1/+1
| | | | | | | | | | | | | | | | | | It's much easier to un-do a QT_HASH_SEED=0 by simply setting it to empty in a command-line, as in: QT_HASH_SEED= ./appname [ChangeLog][Important Behavior Changes] Previously, if the QT_HASH_SEED environment variable was set but empty, Qt would interpret that as if it had been set to 0, thus disabling the hash salting functionality. Since this makes setting and unsetting this variable difficult in scripts, it has been changed: if the variable is set but empty, it is interpreted now as if it had not been set and the hash salting functionality is enabled. Change-Id: Id2983978ad544ff79911fffd1671f5473978a6bc Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QHash: remove the ability to set a non-zero global seedThiago Macieira2021-04-161-6/+5
| | | | | | | | | We've been warning since commit 4ba740b3bac6e1824c18614f579d106eee930d42 (2017-03-31, Qt 5.9.0). Change-Id: Id2983978ad544ff79911fffd1671f505fee6f282 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Merge integration refs/builds/qtci/dev/1618599897Qt CI Bot2021-04-1611-6941/+7823
|\
| * QPropertyBinding: Add sticky modeFabian Kosmale2021-04-163-0/+36
| | | | | | | | | | | | | | | | | | | | | | A sticky QPropertyBinding is a binding that does not get removed when a write occurs. This is used in the QML engine to implement support for the QQmlPropertyData::DontRemoveBinding flag. Task-number: QTBUG-91689 Change-Id: Ib575b49abe634215318ccc7ba46212cc21eb4dad Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
| * Unicode: fix the extended grapheme cluster algorithmGiuseppe D'Angelo2021-04-168-6941/+7787
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | UAX #29 in Unicode 11 changed the EGC algorithm to its current form. Although Qt has upgraded the Unicode tables all the way up to Unicode 13, the algorithm has never been adapted; in other words, it has been working by chance for years. Luckily, MOST of the cases were dealt with correctly, but emoji handling actually manages to break it. This commit: * Adds parsing of emoji-data.txt into the unicode table generator. That is necessary to extract the Extended_Pictographic property, which is used by the EGC algorithm. * Regenerates the tables. * Removes some obsoleted grapheme cluster break properties, and adds the ones added in the meanwhile. * Rewrites the EGC algorithm according to Unicode 13. This is done by simplifying a lot the lookup table. Some rules (GB11, GB12, GB13) can't be done by the table alone so some hand-rolled code is necessary in that case. * Thanks to these fixes, the complete upstream GraphemeBreakTest now passes. Remove the "edited" version that ignored some rows (because they were failing). Change-Id: Iaa07cb2e6d0ab9deac28397f46d9af189d2edf8b Pick-to: 6.1 6.0 5.15 Fixes: QTBUG-92822 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* | Merge integration refs/builds/qtci/dev/1618592683Qt CI Bot2021-04-163-4/+4
|\ \ | |/ |/|
| * tst_qcborstreamwriter: don't pass char8_t strings to QByteArrayGiuseppe D'Angelo2021-04-161-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | There isn't a QByteArray constructor taking a char8_t*. (I am not sure if there should be one; QByteArray is not going to anything special about that information anyways.) Change such strings to be "ordinary" narrow string literals. There should be no problems at doing so, as by default we build in UTF-8 mode under all compilers. Pick-to: 6.1 6.0 Change-Id: Ia200ec6e3b0453bad033d5d8ff34c013bb27abd1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * Make the documented API visible to qdocVolker Hilsheimer2021-04-161-1/+1
| | | | | | | | | | | | Pick-to: 6.1 Change-Id: Ic511af71cd0cc202f86fd39f5a4e0707bcf9fe36 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
| * Fix call to QMessageBox::informationVolker Hilsheimer2021-04-161-1/+1
| | | | | | | | | | | | | | | | | | The call assumes two arguments for QString::arg, but only one was passed. The error string became a buttontext argument, which is clearly wrong. Task-number: QTBUG-92483 Change-Id: I1fab5be88331f636185693b721f0d9688c0d9ff3 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* | Merge integration refs/builds/qtci/dev/1618585460Qt CI Bot2021-04-1623-316/+644
|\ \ | |/ |/|
| * Add support for grouped property changesLars Knoll2021-04-165-48/+372
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add Qt::begin/endPropertyUpdateGroup() methods. These methods will group a set of property updates together and delay bindings evaluations or change notifications until the end of the update group. In cases where many properties get updated, this can avoid duplicated recalculations and change notifications. Change-Id: Ia78ae1d46abc6b7e5da5023442e081cb5c5ae67b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Andreas Buhr <andreas.buhr@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * Don't emit change notifications more often than requiredLars Knoll2021-04-163-12/+99
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a property value changes, first update all dependent bindings to their new value. Only once that is done send out all the notifications and changed signals. This way, if a property depends on multiple other properties, which all get changed, there will only be one notification; and (potentially invalid) intermediate values will not be observed. Fixes: QTBUG-89844 Change-Id: I086077934aee6dc940705f08a87bf8448708881f Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Andreas Buhr <andreas.buhr@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
| * Address thread safety issues in QProperty classesFabian Kosmale2021-04-163-6/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While we do not support cross-thread bindings, reading of properties from a different thread when no bindings are involved must continue to work. However the check whether bindings are involved used the QBindingStatus in the QObjectPrivate. That one contains the wrong value when the QObject is accessed from a different thread than the one it has affinity with. This patch reads from the thread_local directly instead to sidetstep the issue. Change-Id: I8ce2092f35e210566934e2439beb5d48fd8cf226 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
| * Remove lazy binding evaluationLars Knoll2021-04-167-249/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Too much of the existing code in Qt requires eager evaluation without large scale modifications. Combined with the fact that supporting both eager and lazy evaluation has a high maintenance burden, keeping lazy evaluation, at least in its current state, is not worth it. This does not diminish other benefits of the new property system, which include - a C++ API to setup and modify bindings and - faster execution compared to QML's existing bindings and the ability to use them without having a QML engine. We do no longer benefit from doing less work thanks to laziness. A later commit will introduce grouping support to recapture some of this benefit. [ChangeLog][Import Behavior Change][QProperty] QProperty uses always eager evaluation now when a dependency in a binding changes. Change-Id: I34694fd5c7bcb1d31a0052d2e3da8b68d016671b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Andreas Buhr <andreas.buhr@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
| * Add documentation links for some JNI entitiesAssam Boudjelthia2021-04-163-4/+16
| | | | | | | | | | | | | | | | | | | | Add doc page link for: * AttachCurrentThread call. * Interface Function Table which describes JNIEnv. Pick-to: 6.1 6.1.0 Change-Id: I12b41429c40838e5133e58132930aede287e2e71 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
| * Fix build of jpeg plugin against recent jpeg-turbo on MinGWJoerg Bornemann2021-04-161-7/+0
| | | | | | | | | | | | | | | | | | | | | | | | Remove the MinGW-related hack that was introduced in ec31953007126a6e0f9f3ca16b64bdfdcdf3d7b6. It doesn't seem to be needed anymore with recent MinGW versions and prevents using a system jpeglib that disagrees in its jboolean declaration with our bundled jpeglib. Fixes: QTBUG-88093 Change-Id: Ic6eb03b4b395fe3e8dcedf52489e8642289fc98e Reviewed-by: Kai Koehne <kai.koehne@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
| * Port example away from deprecated QVariant APIVolker Hilsheimer2021-04-162-2/+2
| | | | | | | | | | Change-Id: I284610f216409b593d307b8076c8f638722929e6 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
| * QMultiHash: Fix docFabian Kosmale2021-04-161-3/+2
| | | | | | | | | | | | | | | | In Qt 6, QMultiHash does not iherit QHash Pick-to: 6.1 6.0 Change-Id: Iaad8768d681a9aad2bb1f80fd87904f0dd9683d4 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
| * Check whether CMake was built with zstd supportJoerg Bornemann2021-04-163-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CMake 3.18 introduced the file(ARCHIVE_CREATE) API that we use with COMPRESSION Zstd for compressing corelib's mimedatabase. It's possible to build CMake without proper zstd support, and we have encountered such builds in the wild where the file(ARCHIVE_CREATE) call crashes. Add a configure test to determine whether CMake properly supports the Zstd compression method. Fixes: QTBUG-89108 Change-Id: I37e389c878845162b6f18457984d4f73a265b604 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
| * QList::(const_)iterator: protect element_type on GCC < 11Giuseppe D'Angelo2021-04-161-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GCC 10 in C++20 mode will still try to use std::indirectly_readable_traits on QList iterators, and since it does not have the fixes for LWG 3346 / 3541, it will fail to build: /usr/include/c++/10/bits/iterator_concepts.h: In substitution of ‘template<class _Tp> using __iter_value_t = typename std::__detail::__iter_traits_impl<_Tp, std::indirectly_readable_traits<_Iter> >::type::value_type [with _Tp = QList<std::pair<int, int> >::const_iterator]’: /usr/include/c++/10/bits/iterator_concepts.h:248:11: required by substitution of ‘template<class _Tp> using iter_value_t = std::__detail::__iter_value_t<typename std::remove_cv<typename std::remove_reference<_Tp>::type>::type> [with _Tp = QList<std::pair<int, int> >::const_iterator]’ /usr/include/c++/10/bits/iterator_concepts.h:468:11: required from ‘class std::reverse_iterator<QList<std::pair<int, int> >::const_iterator>’ ../src/corelib/itemmodels/qsortfilterproxymodel.cpp:669:43: required from here /usr/include/c++/10/bits/iterator_concepts.h:243:13: error: ambiguous template instantiation for ‘struct std::indirectly_readable_traits<QList<std::pair<int, int> >::const_iterator>’ 243 | using __iter_value_t = typename | ^~~~~~~~~~~~~~ /usr/include/c++/10/bits/iterator_concepts.h:231:12: note: candidates are: ‘template<class _Tp> requires requires{typename _Tp::value_type;} struct std::indirectly_readable_traits<_Iter> [with _Tp = QList<std::pair<int, int> >::const_iterator]’ 231 | struct indirectly_readable_traits<_Tp> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/10/bits/iterator_concepts.h:236:12: note: ‘template<class _Tp> requires requires{typename _Tp::element_type;} struct std::indirectly_readable_traits<_Iter> [with _Tp = QList<std::pair<int, int> >::const_iterator]’ 236 | struct indirectly_readable_traits<_Tp> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ So hide element_type as well. The CI didn't catch this because the CI doesn't build in C++20 mode. Amends 595b4e1a9b4. Change-Id: I5c8e47d693ca584571cd89f856d08ba249dd05ab Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
| * QString: add missing char8_t* constructor / fromUtf8 overloadsGiuseppe D'Angelo2021-04-162-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently we support: QString s = QString::fromUtf(u8"foo", 3); But we don't support QString s = QString::fromUtf8(u8"foo"); QString s(u8"foo"); There's no reason not to have these two functions. Guess what, we've actually got code _in Qt_ that tries to build a QString out of a char8_t; that code stops compiling under C++20 (which is supported, but not CI-tested at the moment, it seems). Re-add the missing constructor and fromUtf8 overloads. [ChangeLog][QtCore][QString] Added a constructor and a fromUtf8() overload taking a `const char8_t *` argument. Task-number: QTQAINFRA-4117 Task-number: QTQAINFRA-4242 Change-Id: I1f0ae658b3490b9e092941cabcc7fb8fc4c51aa3 Pick-to: 6.1.0 6.1 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| * util/unicode: enable asserts unconditionallyGiuseppe D'Angelo2021-04-161-0/+1
| | | | | | | | | | | | | | | | If one "accidentally" uses a release build of the unicode tool, the asserts within it won't fire. Enable them in all cases. Change-Id: I9d63641dc6d6d2e5805b61b36f8c28e624b25e12 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| * Fix handling of surrogates in QBidiAlgorithmEdward Welbourne2021-04-161-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Prior code was naively assuming the character after a high surrogate would necessarily be a low surrogate, which is buggy. Fixes oss-fuzz issue 29718. Pick-to: 6.0 6.1 5.15 Change-Id: I10f023c4b5024a0d76fea0a3672001063591ec6d Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Robert Löhning <robert.loehning@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * Switch metatypes generation on by default for Qt modulesUlf Hermann2021-04-162-9/+20
| | | | | | | | | | | | | | | | | | | | We need the metatypes for anything directly or indirectly exposed to QML. Switching this on has no runtime overhead. For interface libraries we cannot generate any metatypes, though. Change-Id: I7b7f85bb4e16c28d00383c5c88b0f1c172c8d193 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* | Merge integration refs/builds/qtci/dev/1618564901Qt CI Bot2021-04-167-179/+193
|\ \ | |/ |/|
| * QNetworkDiskCache: Switch to unique_ptr in most casesMårten Nordheim2021-04-161-4/+6
| | | | | | | | | | | | | | | | | | Because take() is deprecated, and these pointers are meant to leave the scope in some branches. Pick-to: 6.1 Change-Id: I5432d91a28f4c5c8c17fadf7ce3bcd41716e216a Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| * QNetworkDiskCache: Drop the file mmap-ingMårten Nordheim2021-04-161-12/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Presumably the code at some point would do a QByteArray::fromRawData-style thing. But now it doesn't do that so the current code was a bit strange. It would map the content of the file to memory only to then copy the content into a QByteArray. Then it reparents the file to the QBuffer, keeping it alive even if its not needed. Fixes: QTBUG-92838 Pick-to: 6.1 6.0 5.15 Change-Id: I88f8cd1b64e0fd13d08b5cc4df44661e216da340 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| * Revise deprecation of countriesForLanguage()Edward Welbourne2021-04-163-39/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It was originally marked \obsolete without any comment on what was to be used to replace it, or deprecation markings in the declaration, so it got missed at 6.0. More recently it's been deprecated in favor of a territory-based name; but actually it was obsoleted by (iterating the territory() of each return from) matchingLocales() in Qt 4.8. So back out of adding territoriesForLanguage to replace it and, instead, mark it as deprecated in the declaration, in favor of matchingLocales(). Also rewrite the implementation to be exactly that replacement. Rewrote the one example using it. Fixes: QTBUG-92484 Change-Id: Iedaf30378446dd9adac5128b7ee5fee48aab1636 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * Use QTimeZone to determine offsets outside the system-function rangeEdward Welbourne2021-04-162-21/+61
| | | | | | | | | | | | | | | | | | | | | | | | Follow up on some comments saying "TODO Use QTimeZone when available" in converting times, outside the range supported by the system's time_t functions, between local or zone time and UTC. Since this required two formerly static functions in qdatetime.cpp to access QTimeZone's d-ptr, turn those into methods of QTZ's friend QDTPrivate. Change-Id: I27fe03d8eff9f4e98661263b1a1d4d830f4e7459 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
| * Extend time_t-based handling all the way to the end of time_tEdward Welbourne2021-04-162-109/+112
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At least some modern 64-bit systems have widened time_t to 64 bits fixing the "Unix time" problem. (This is even the default on MS-Win, although the system functions artificially limit the accepted range to 1970 through 3000.) Even the 32-bit range extends into January 2038 but the code was artificially cutting this off at the end of 2037. This is a preparation for using the same also all the way back to the start of time_t. In the process, simplify and tidy up the logic of the existing code, update the docs (this includes correcting some misinformation) and revise some tests. Fixes: QTBUG-73225 Change-Id: Ib8001b5a982386c747eda3dea2b5a26eedd499ad Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge integration refs/builds/qtci/dev/1618561273Qt CI Bot2021-04-163-12/+21
|\ \
| * | Catch invalid offset returns from QTimeZone backendsEdward Welbourne2021-04-163-12/+21
| |/ | | | | | | | | | | | | | | | | | | If the backends run into an error in computing the offset, they return INT_MIN; but they are valled via the front-end, which returns zero when the zone is invalid. So treat INT_MIN returns from the backend the same as the case of being invalid. Change-Id: Ic3c4dfe964dbfba4030c770213eca8a63e84736d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>