summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.11' into devLiang Qi2018-05-143-23/+13
|\ | | | | | | | | | | | | | | | | Conflicts: mkspecs/features/qt_module_headers.prf tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp tests/auto/widgets/kernel/qwidget/BLACKLIST Change-Id: I2a08952d28d1d0e3d73f521a3d44700ce79ff16c
| * QByteArray::setNum: use the existing latin1 lowercasing tableThiago Macieira2018-05-131-15/+3
| | | | | | | | | | | | | | Not sure this makes the code faster, but it removes two functions. Change-Id: I5d0ee9389a794d80983efffd152d830da44b1bfe Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * QString: fix off-by-one errorThiago Macieira2018-05-101-4/+4
| | | | | | | | | | | | | | | | | | The check for having N valid characters is ptr + N <= end, because ptr + N == end indicates that we have exactly N characters in the string. Change-Id: I5d0ee9389a794d80983efffd152d28d5aa485ce4 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
| * Fix build with GCC 8: memset/memcpy/memmove of non-trivialsThiago Macieira2018-05-091-4/+6
| | | | | | | | | | | | | | | | qarraydataops.h:73:17: error: ‘void* memset(void*, int, size_t)’ clearing an object of non-trivial type ‘struct TCBPoint’; use assignment or value-initialization instead [-Werror=class-memaccess] Change-Id: I5d0ee9389a794d80983efffd152ce10eb557341f Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devLiang Qi2018-05-081-0/+2
|\| | | | | | | | | | | | | | | Conflicts: src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp tests/auto/corelib/io/qresourceengine/qresourceengine_test.pro Change-Id: I3169f709cc2a1b75007cb23c02c4c79b74feeb04
| * Fix build without features.timezoneTasuku Suzuki2018-05-081-0/+2
| | | | | | | | | | Change-Id: I3f8421103afa61baf415636b4dc8cf93fb477bcc Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* | qsimd: add support for new x86 CPU featuresThiago Macieira2018-05-054-328/+393
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds detection for: VAES, GFNI, AVX512VBMI2, AVX512VNNI, AVX512BITALG, AVX512VPOPCNTDQ, AVX512_4NNIW, AVX512_4FMAPS. These features were found in the "Intel® Architecture Instruction Set Extensions and Future Features" manual, revision 30. This commit also adds support for RDPID (already in the main manual) and the Control-flow Enforcement Technology, which appears in a separate Intel paper. This new support was done by adding a new generator script so we don't have to maintain two tables in sync, one in qsimd.cpp with the feature names, and the other in qsimd_p.h. Since we now need a lot more bits, it's no longer worth keeping the two halves of the qt_cpu_features variable mostly similar to the main two CPUID results. This commit goes back to keeping things in order, like we used to prior to commit 6a8251a89b6a61258498f4af1ba7b3d5b7f7096c (Qt 5.6) At the time of this commit, GCC 8 has macros for AVX512VPOPCNTDQ, AVX512_4NNIW, AVX512_4FMAPS, AVX512VBMI2 and GFNI. Change-Id: I938b024e38bf4aac9154fffd14f7afae50faaa96 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | qsimd: remove support for systems without 64-bit atomicsThiago Macieira2018-05-052-17/+7
| | | | | | | | | | | | | | | | We had that as a concession for early toolchains that failed to include the necessary libraries. They must now be up-to-date. Change-Id: I938b024e38bf4aac9154fffd14f7a630ef160cd5 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-05-051-3/+2
|\| | | | | | | Change-Id: Ib58433da04bffb5dfab5486b80f17f39cc4145fa
| * Fix the enabling of AES with ICC and MSVC on some low-end processorsThiago Macieira2018-05-041-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | GCC and Clang assume that all Sandybridge (2nd generation) and newer Intel Core™ processors have AES, which I used as a source of information for this code. However, there are a few low-end parts that miss this feature, like Intel Core™ i3-2350M, i3-3130M, i3-4000M. [1] https://ark.intel.com/products/series/75025/4th-Generation-Intel-Core-i3-Processors Task-number: QTBUG-67705 Change-Id: If90a92b041d3442fa0a4fffd1525b9afbcb6e524 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | QContiguousCache: add assertion to avoid negative capacityChristian Ehrlicher2018-05-041-0/+2
| | | | | | | | | | | | | | | | | | | | The ctor of QContiguousCache and setCapacity are accepting negative values for the capacity. While this should not be done it can happen by accident. Therefore add Q_ASSERT to ensure a positive value. Task-number: QTBUG-19700 Change-Id: I7458100c07c687cdeaebe86400343d79b5a6330a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Protect all accesses to the global engine cache by a mutexLars Knoll2018-04-251-34/+32
| | | | | | | | | | | | | | | | | | | | Otherwise, we'll end up with corrupted memory when using QRegExp from multiple threads. Amends bbdc1b5ccbb19405f997cd67ec53b2c4860105f7. Change-Id: I9d35897629d0bc26503aa0c537c5f99013921fdd Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-04-242-6/+22
|\| | | | | | | Change-Id: If950406391f79d99f0101f0b6755395accb26f34
| * Doc: Advocate use of std::initializer_list constructor in Q[String]ListKai Koehne2018-04-232-6/+22
| | | | | | | | | | | | | | | | | | We're relying on C++11 since a while, so lets not advertise creating lists of strings with operator<<() anymore. Change-Id: I14a3442ff852ac2c106d90c63504eb9ebb737609 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: hjk <hjk@qt.io>
* | Speed up QTimeZone::isTimeZoneIdAvailable by a factor 43David Faure2018-04-234-2/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Creating and sorting a list of bytearrays just to check if one entry is present, is really overkill. By adding a new virtual method isTimeZoneIdAvailable() in the backend classes, we can do this much more efficiently. Implemented for Utc and Tz backends, the others fall back to the slow way. The new benchmark shows, in release mode: Before: 43 msecs per iteration (total: 86, iterations: 2) After: 1.1 msecs per iteration (total: 73, iterations: 64) Change-Id: Ic0d79a41d74e2ce6aa088fa7986c41d33902c36b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-04-221-22/+27
|\| | | | | | | Change-Id: Id32f0ae002772444c0b61cd132ef81f96fe3b895
| * QByteArray: Use nullptr for "Safe and portable C string functions"Andre Hartmann2018-04-211-22/+23
| | | | | | | | | | | | | | | | Change the documentation to use nullptr and modify the related code also while at it. Change-Id: I6264a254828159cda54e90393835ea04e131350b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * QByteArray: Add a note regarding overlapping pointers to qstr(n)cpyAndre Hartmann2018-04-211-0/+4
| | | | | | | | | | | | | | Stated e.g. in http://en.cppreference.com/w/c/string/byte/strcpy Change-Id: I42fd5a5fa6a63b67a7105aa56e93e3d3f2193cf7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-04-201-1/+1
|\| | | | | | | Change-Id: I0bea38585382b5d9c8d7a013bf6bcb3a6008d159
| * Doc: link to QEnableSharedFromThis from QSharedPointer docsMitch Curtis2018-04-181-1/+1
| | | | | | | | | | Change-Id: I1c4a168c0581b6273b99a7ea8faa29114bda39e2 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* | Prefer the raw data, if it specifies a locale, before shedding tagsEdward Welbourne2018-04-191-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | QLocaleData::findLocaleData() was checking its given data with likely tags filled in, but not checking it without; then it went on to blot out some of the given data with Any, checking first with likely tags then without. The lack of this second step with the full data seemed misguided. Change-Id: I58ee09f5a2a3355446333fc9985a2fb818491e2f Reviewed-by: Jason Erb (Suitable Technologies) <erb@suitabletech.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Unicode TR 35: add likely subtags in the specified orderEdward Welbourne2018-04-191-8/+16
| | | | | | | | | | | | | | | | | | | | The Likely Subtags section (4.3) of Unicode TR 35 stipulates a quite specific order for trying the various candidate lookups; we had two of them swapped and were missing the last. Change-Id: Idcd8e7f7c9849be3ee805245e7746435e992c1db Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devLiang Qi2018-04-111-7/+7
|\| | | | | | | | | | | | | Conflicts: src/plugins/platforms/ios/quiview.mm Change-Id: I0fd0adeca1590fffddd577873172f6d987a60412
| * Fix integer overflow (1 << (' ' - 1))Mikhail Svetkin2018-04-101-7/+7
| | | | | | | | | | | | | | | | | | On platforms where integer by default is int32(max is 2147483647) and (1 << (' ' - 1)) will be 2147483648 Change-Id: I790d33bd4e473925d6897dd87cbffdfe8dd7938f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | QCryptographicHash: Add a static method to retrieve hash lengthMårten Nordheim2018-04-102-0/+41
| | | | | | | | | | | | | | | | | | | | | | | | It's useful when you need to check how long a hash will be without first generating one. [ChangeLog][QtCore][QCryptographicHash] Add a static method, hashLength, which returns the length of the output of a hash function in bytes. Change-Id: Id6a454016523de83d157fd95c50105c6db4bb1d9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | Add wildcard-to-regexp support to QRegularExpressionSamuel Gaist2018-03-304-1/+192
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This method will make QRegularExpression on par with QRegExp and will allow to replace this class when a wildcard expression can be set through an API (e.g. QSortFilterProxyModel::setFilterWildcard). For other use cases, see QTBUG-34052. [ChangeLog][QRegularExpression] Implemented support for wildcard patterns. Warning: QRegularExpression might not give the exact same result as QRegExp as its implementation follows strictly the glob patterns definition for the wildcard expressions. Change-Id: I5ed4617ca679159430c3d46da3449f6b3100e366 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-03-301-4/+6
|\| | | | | | | Change-Id: If9cc79a7cc098104333821bc3b345f6890f01825
| * Fix MSVC2017 compilation with enabled relaxed constexpr on 32-bit targetOlivier Goffart2018-03-281-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The problem is that qCountLeadingZeroBits is calling qPopulationCount which is only conditionally constexpr, so qCountLeadingZeroBits can only be marked constexpr if qPopulationCount is also. On MSVC2017 64bit this is not a problem because it uses builtins function in this case. (which is not constexpr, but it works because the compiler is not forced to diagnose the problem because of the "?:" operator. The error being fixed is: qalgorithms.h(847): error C3615: constexpr function 'qCountLeadingZeroBits' cannot result in a constant expression qalgorithms.h(858): note: failure was caused by call of undefined function or one not declared 'constexpr' qalgorithms.h(858): note: see usage of 'qPopulationCount' Task-number: QTBUG-67259 Change-Id: I65a3dfae12ca49394bec14ffefdd41a07fee1c32 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/5.11' into devLiang Qi2018-03-283-25/+58
|\| | | | | | | | | | | | | | | | | Conflicts: src/plugins/platforms/cocoa/qnsview.mm src/plugins/platforms/cocoa/qnsview_mouse.mm src/testlib/testlib.pro Change-Id: Ia0ce4243418fe6a485b0f290c67bd433b3b04ff2
| * Animation: Fix case where QEasingCurve::valueForProgress returns nanSvenn-Arne Dragly2018-03-261-21/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, we would divide by zero in BezierEase::findTForX if factorT3 was zero when solving the cubic equation. This change fixes the problem by adding solutions for the special cases where the cubic equation can be reduced to a quadratic or linear equation. This change also adds tests that cover cases where the equation becomes quadratic, linear or invalid. Task-number: QTBUG-67061 Change-Id: I2b59f7e0392eb807663c3c8927509fd8b226ebc7 Reviewed-by: Christian Stromme <christian.stromme@qt.io>
| * fixup oversight in rvalue overloads of operator+=() and operator<<()Eric Lemanissier2018-03-262-4/+4
| | | | | | | | | | | | | | ammends 4dee5446bee9c7417bf6f5dc44294a0b7238a9ba Change-Id: Ia0ca27644eb71815a93d6e76681b8a9e61a4e7ab Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-03-217-61/+51
|\| | | | | | | Change-Id: I35a6555e3885e489f88aa9b4b0142e1017f7a959
| * Modernize the "regularexpression" featureUlf Hermann2018-03-206-59/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | Use QT_CONFIG(regularexpression), disentangle it from QT_BOOTSTRAPPED, switch it off in the bootstrap build, remove the #ifdefs from qregularexpression.{h|cpp}, and add QT_REQUIRE_CONFIG(regularexpression) to the header. qregularexpression.{h|cpp} are already correctly excluded in tools.pri if !qtConfig(regularexpression). Change-Id: I21de154a6a118b76f99003d3acb72ac1e220d302 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
| * QSharedDataPointer: use swap-and-move in the move constructorThiago Macieira2018-03-191-2/+10
| | | | | | | | | | | | | | | | | | | | This makes the pointer that was in the moved-into object be destroyed before the return of this function (if the reference count was 1), instead of letting it live in the moved-from object. Task-number: QTBUG-66322 Change-Id: I3debfc11127e4516b505fffd151209292bd3adaa Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * q{,Utf8}Printable: avoid creating a copy of a QStringThiago Macieira2018-03-181-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have this QString() constructor call to permit things that convert to QString but aren't QString to be used in qPrintable, like a QStringBuilder-powered fast operator+ expression, like: qPrintable(string1 + ": " + string2) Unfortunately, it meant that we unnecessarily created a QString copy if the input was already QString. Change-Id: Iecab8770aa5840aba8edfffd1516bc94cec791a9 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Share and cache QRegExp engines where possibleLars Knoll2018-03-201-5/+15
| | | | | | | | | | | | | | | | | | | | | | | | QRegExpEngine is immutable once created, so we can easily share them between different QRegExp instances. This requires a QHash for engines that are currently in use in addition to the cache for currently unused engines. Task-number: QTBUG-65710 Change-Id: I165c12a7b065c488ecd14258a7cdfe0e62666632 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* | Add nullptr comparison to Q{Explicitly,}SharedDataPointerThiago Macieira2018-03-181-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | [ChangeLog][QtCore][QSharedDataPointer] Added operator== for nullptr. [ChangeLog][QtCore][QExplicitlySharedDataPointer] Added operator== for nullptr. Task-number: QTBUG-66635 Task-number: QTBUG-66946 Change-Id: I72f5230ad59948f784eafffd151a18e34384d844 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-03-151-1/+0
|\| | | | | | | Change-Id: I8b5a10d897a926078895ae41f48cdbd2474902b8
| * QByteArray::setRawData(): don't null-terminate initialization from nullptrOswald Buddenhagen2018-03-141-1/+0
| | | | | | | | | | | | | | | | it's antithetical to do that, as raw data is documented to be not null- terminated. QString doesn't, either. Change-Id: I7ded83a09f64e747a248f9bdac2a364032aae4c0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-03-101-1/+4
|\| | | | | | | Change-Id: Ia2441257c23169f8ca6a3933b2371255e1ba64e6
| * Doc: improve QScopedPointer::reset() documentationMitch Curtis2018-03-081-1/+4
| | | | | | | | | | | | | | | | - Fix grammar - Mention take() Change-Id: I3bde229755549230ad3d0962da6eeb164a060fb1 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-03-084-0/+41
|\| | | | | | | Change-Id: Idf471ca5c6cf211813466b539ce45bdc1ae9b97c
| * Add missing rvalue overloads of operator+=() and operator<<()Christian Ehrlicher2018-03-074-0/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | They were forgotten when the overloads for append()/push_back() were added in Qt 5.6 [ChangeLog][QtCore][QVarLengthArray] Added missing rvalue overload of operator+=() and operator<<() [ChangeLog][QtCore][QVector] Added missing rvalue overload of operator+=() and operator<<() Change-Id: I20fedfba2bf282773bd1f9cf2c8ec06f05896a7d Reviewed-by: Martin Smith <martin.smith@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | implement non-member operator+ for iteratorsEric Lemanissier2018-03-066-0/+12
| | | | | | | | | | | | | | | | | | all of these iterator classes already have a member operator+, which allows iter+int. This commits addes non-member operator+, which allows int+iter, and forwards to the member QList and QArrayData iterators now satisfy RandomAccessIterator concept Change-Id: I25c1dd8cea299e735d5a5e288dbe23dc1d7a1933 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-03-021-0/+2
|\| | | | | | | Change-Id: I967eca8f34584fca3a1e5696978e70f620582a2a
| * QLocale: Update the system private on QLocale default constructor if neededAlbert Astals Cid2018-03-021-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When first starting an Android app we have invocation order issue, to load the platform plugin we create the default QLocale (needed by the resource locator code to see if :/qt/etc/qt.conf exists) so when the android platform plugin loads and creates its own QSystemLocale, the QLocale defaultLocalePrivate is already created and pointing to globalLocaleData which means that systemData won't be called and thus the code that triggers the call to QLocalePrivate::updateSystemPrivate won't be called when calling QLocale(). I thought of two ways of fixing this, one was calling QLocalePrivate::updateSystemPrivatea() from the QAndroidSystemLocale constructor, but giving the responsibility to not break things to the plugin seems a little fragile, so making the check on QLocale() seems better. Without this patch an Android app doing QApplication app(argc, argv); qDebug() << QLocale().name(); qDebug() << QLocale().name(); qDebug() << QLocale::system().name(); qDebug() << QLocale().name(); would print "" "" "ca_ES" "ca_ES" now it correctly prints "ca_ES" the four times. Task-number: QTBUG-41385 Change-Id: I2cf419f59aa008fa3aca11295fe7d42c40bcc32e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-02-281-1/+1
|\| | | | | | | Change-Id: Ib21e6b9030b4d5363f440d082ce3df28098d1b95
| * Silence a GCC 8 warning in qringbufferVille Voutilainen2018-02-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | qtbase/src/corelib/tools/qvector.h:782:16: error: ‘void* memmove(void*, const void*, size_t)’ writing to an object of type ‘class QRingChunk’ with no trivial copy-assignment; use copy-assignment or copy-initialization instead [-Werror=class-memaccess] memmove(b + 1, b, (d->size - offset) * sizeof(T)); ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from ../../../include/QtCore/5.11.0/QtCore/private/qringbuffer_p.h:1, Change-Id: I6583241223fe3fc76c0b792779993a34aa9485fe Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Alex Trotsenko <alex1973tr@gmail.com> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-02-282-5/+4
|\| | | | | | | Change-Id: I1ce43c8a214a869c5c4ac4245bb92c88c6bc6999
| * QDate/Time,QTimeZone: Fix empty documentation section titlesFriedemann Kleint2018-02-272-5/+4
| | | | | | | | | | Change-Id: I674c4bb1805a7f7bc95512b07b0278446ebe7772 Reviewed-by: Martin Smith <martin.smith@qt.io>