summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools
Commit message (Collapse)AuthorAgeFilesLines
* QOffsetStringArray: fix compilation error with clang-802.0.42Mikhail Svetkin2018-10-011-1/+1
| | | | | | | | error: suggest braces around initialization of subobject [-Werror,-Wmissing-braces] return StaticString<N1 + N2>{ls[I1]..., rs.data[I2]...}; Change-Id: I30f5f50378f1faed648d092eefc5edb46e940239 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2018-10-011-1/+5
|\ | | | | | | Change-Id: Ic8cdb1c2b7c0a786b1313b6c3a3bf7e9ec288712
| * Merge remote-tracking branch 'origin/5.11' into 5.12Qt Forward Merge Bot2018-09-301-1/+5
| |\ | | | | | | | | | Change-Id: Iaa438d14357be1bf75bb645cb8d3245947c055b8
| | * QCommandLineParser: Ensure that an option text ends with a newlineAlexander Akulich2018-09-281-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this change we inserted newline only if an option has a description and ended up with an arbitrary long line with all options. [ChangeLog][QtCore][QCommandLineParser] Fixed a bug that caused the help output to show two options or more in the same line if the options didn't have a description. Task-number: QTBUG-70174 Change-Id: Id54b9ae13ee596869e4dc14e09301aea19eed2f8 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2018-09-297-86/+88
|\| | | | | | | | | | | Change-Id: I6083c3e61b7dbe188f83676f7e7bb268e5ccf2f3
| * | Merge remote-tracking branch 'origin/5.11' into 5.12Liang Qi2018-09-276-58/+60
| |\| | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qconfig-bootstrapped.h src/widgets/util/qcompleter.cpp Change-Id: I4f44f0f074982530f2f2e750ce696230b2754cf3
| | * Modernize the "datestring" featureLiang Qi2018-09-246-41/+43
| | | | | | | | | | | | | | | | | | Change-Id: I2236a456fe3758d9054b22e36fe6316f3522d533 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| | * Modernize the "textdate" featureLiang Qi2018-09-243-17/+17
| | | | | | | | | | | | | | | | | | Change-Id: Ic0b6f13e17c301ed66d6a8297c242086c94ac87d Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * | Doc: Fix QEasingCurve code snippetsTopi Reinio2018-09-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Commit ff2a71e3 accidentally removed a code snippet used in documenting EasingCurve::EasingFunction. This commit restores it and fixes other minor issues in QEasingCurve code snippets. Change-Id: Ib19f602a4abbca3511d3d26c5f6da4910f7104a3 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
| * | Fix some infelicities in the Q(Date|Time)+ docsEdward Welbourne2018-09-251-28/+28
| | | | | | | | | | | | | | | | | | | | | | | | Some of the claims made were not strictly acurate. Change-Id: Ia7c83ce44257acce32814c0bbb3b787bb6b8596b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | | QOffsetStringArray: fix compilation error with ICC18Mikhail Svetkin2018-09-141-9/+6
| | | | | | | | | | | | | | | | | | | | | | | | error: expression must have a constant value static constexpr const auto messages = qOffsetStringArray( Change-Id: I80a6bf5b83f99a8325511ac8a14e0c9819e3d2b7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Make updateSystemPrivate() local to qlocale.cppEdward Welbourne2018-09-113-11/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's not thread-safe so should only be used within systemData()'s locked code. This eliminates the last callers of it by making it a local function of the compilation unit, exposing a method from QSystemLocale() to get round its use of private parts. Make the constructor for QSystemLocale only stomp its _systemLocale global if previously unset, but let instantiation still clear globalLocaleData.m_language_id, so that it can be used as a way to trigger an update to system locale data. Change-Id: I908dca9fd30bbf20f42321ab8f9094f2fa37b7b0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2018-09-113-4/+16
|\| | | | | | | | | | | Change-Id: I1df9adea124326ef7c7802839eb93efc4302b287
| * | QStringList: restore binary compatibility with Qt 5.11David Faure2018-09-102-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 8b6100d512 removed bool QtPrivate::QStringList_contains(const QStringList *that, const QString &str, ...) (in favor of a QStringView overload). However this was used inline in qstringlist.h, so apps were referencing that symbol directly. As a result, upgrading to Qt 5.12 gave errors like libKF5ConfigCore.so.5.50.0: undefined reference to `QtPrivate::QStringList_contains(QStringList const*, QString const&, Qt::CaseSensitivity)@Qt_5' collect2: error: ld returned 1 exit status Change-Id: I862263a9b06157052df894a201dfd86df8c3f4fe Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
| * | Merge remote-tracking branch 'origin/5.11' into 5.12Liang Qi2018-09-101-4/+4
| |\| | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/common/macx.conf Change-Id: I8576493b417912fa5e5501bc2c1b935d186ac209
| | * Merge remote-tracking branch 'origin/5.11.2' into 5.11Qt Forward Merge Bot2018-09-091-4/+4
| | |\ | | | | | | | | | | | | Change-Id: I2fa26fa061cbf5d2bded203a299a19b7d1c31d0a
| | | * Doc: Fix typos in QRectF documentationPaul Wicking2018-08-271-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add missing 's'. Fixes: QTWEBSITE-823 Change-Id: I1acd3b7ae18982248bf3402fa5943ee95c1efdbe Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* | | | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2018-09-091-13/+4
|\| | | | | | | | | | | | | | | Change-Id: I36cda712b4cf960de70e497aef52fbc491099f1c
| * | | Merge remote-tracking branch 'origin/5.11' into 5.12Qt Forward Merge Bot2018-09-071-13/+4
| |\| | | | | | | | | | | | | | Change-Id: I66c7f18a2abd13601da0947919436f7da3549ae9
| | * | Doc: Move the literal code blocks to a separate fileVenugopal Shivashankar2018-09-031-13/+4
| | |/ | | | | | | | | | | | | | | | | | | | | | It's easier to override the code blocks this way. Change-Id: I98d40626a94fdb70a95c50332c2da141e9277070 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* | | QOffsetStringArray/msvc: fix compilation warnings C4100Mikhail Svetkin2018-09-071-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | C4100 - identifier' : unreferenced formal parameter It happens when we call StaticStringBuilder::concatenate(StaticString<N>, StaticString<0>). StaticString<0> is ignored. Change-Id: Ic687bc865aa5d5e7425cbddbd614bde7dbb801df Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | QOffsetStringArray: fix compilation error with MSVC15/17Mikhail Svetkin2018-09-061-42/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MSVC 2015/2017 has a bug with constexpr. It is internal compiler error when we are using QtPrivate::IndexSequence with more than 1024 items. Example: template<int ... I> void foo(QtPrivate::IndexSequence<I...>) { } void bar() { foo(QtPrivate::makeIndexSequence<1024>()); // works foo(QtPrivate::makeIndexSequence<1025>()); // error: C1202: recursive type or function dependency context too complex } Workaround: template<typename> struct Foo; template<int ... I> struct Foo<QtPrivate::IndexSequence<I...>>{ static constexpr void call() { } }; void bar() { Foo<QtPrivate::makeIndexSequence<1025>>::call(); // works } Change-Id: Iedbf5291ac4a9f51f8b5f6b76b83baba920c092d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2018-09-065-4/+46
|\| | | | | | | | | | | Change-Id: I2f6e1c0f649c5098723b776c774a8a689bb60582
| * | ASAN: Disable SSE4.1 code in qstricmp because of heap-buffer-overflowErik Verbruggen2018-09-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Although it is safe to slightly overread a string (provided it doesn't cross page boundaries), ASAN is extremely picky about this kind of behavior. So, do not run with this vectorized code when ASAN is enabled. Task-number: QTBUG-70269 Change-Id: I2b59b524d608afec8985227285feab55158d7247 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * | QStringList: add contains(QStringView) overloadAlbert Astals Cid2018-09-032-2/+24
| | | | | | | | | | | | | | | Change-Id: I953e4ef3167011d0348ea482890e29478bd6f761 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * | Add QString::compare(QStringView, CaseSensitivity)Albert Astals Cid2018-09-032-1/+21
| | | | | | | | | | | | | | | | | | | | | | | | There was a QStringView::compare(QString, CaseSensitivity) but it's good that the symmetric also exists Change-Id: Ic789f11d41eb8cfa393cb51c19bd1f89bb87d912 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Remove QConditional in favor of std::conditional/std::is_unsignedMikhail Svetkin2018-09-055-16/+10
| | | | | | | | | | | | | | | Change-Id: I5e0b9f640eb49aa7f5afdd4f3f15e027659e78ea Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2018-09-032-11/+10
|\| | | | | | | | | | | Change-Id: I8303ca41d0ca9ce1fdb27259db4f9f8448c74bcb
| * | Windows code: Fix to prefer ranged-for, as clang-tidy advisesFriedemann Kleint2018-09-021-3/+3
| | | | | | | | | | | | | | | | | | | | | Change-Id: Id9bb21855ae832cdbbc456326226ec72b634672e Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Luca Beldi <v.ronin@yahoo.it> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * | Windows code: Fix clang-tidy warnings about else after jumpsFriedemann Kleint2018-09-022-8/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | Replace by switch() where appropriate, remove else and unindent code or simplify the return value. Change-Id: Ie988b9068a9579ae5a899b3765e43aad480b564e Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2018-09-025-15/+30
|\| | | | | | | | | | | Change-Id: I33e0abc771a2a772d3334172d50e7b0efe896590
| * | WebAssembly for QtBaseMorten Johan Sørvig2018-08-303-5/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the squashed diff from wip/webassembly to dev. Done-with: Peng Wu <peng.wu@intopalo.com> Done-with: Sami Enne <sami.enne@intopalo.com> Done-with: Morten Johan Sørvig <morten.sorvig@qt.io> Started-by: Andrew Knight <andrew.knight@intopalo.com> Change-Id: I6562433c0a38d6ec49ab675e0f104f2665f3392d Reviewed-by: Lorn Potter <lorn.potter@gmail.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
| * | Windows code: Fix clang-tidy warnings about C-style castsFriedemann Kleint2018-08-302-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace by reinterpret_cast or const_cast, respectively. Use auto when initializing a variable to fix Clang warnings about repeating the type name, do minor tidying along the way, and a few conversions of 0 or NULL to nullptr. Change-Id: Ieb271a87ddcf064f536e1ff05d23b1e688b1b56a Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2018-08-291-0/+5
|\| | | | | | | | | | | Change-Id: Ifb032dc19053481e1b0ede5c5c72540110d62567
| * | JSON: Add qHash functions for JSON and CBOR typesUlf Hermann2018-08-271-0/+5
| | | | | | | | | | | | | | | | | | | | | This way we can easily use them as keys in QHash and QSet. Change-Id: Ie744c3b5ad1176ba2ab035c7e650af483757a0c9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | corelib/tools: Fix auto detection of QOffsetStringArray::m_offset typeMikhail Svetkin2018-08-281-12/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous implementation wrongly calculated the necessary data type to hold the offset indexes. It looked at the amount of elements, but instead we should look at value for the last element in the offset array Change-Id: I84c6985dc3c329df3bbc5a14f9789170877b65bb Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Add Since markers for QLocale enum members added in 5.1 and 5.2Edward Welbourne2018-08-271-123/+123
| | | | | | | | | | | | | | | | | | | | | | | | The early additions don't make clear that they weren't present in 5.0 Change-Id: Ibb233c17701c7598b90f2bb53ee507f86856f66a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* | | Sort QLocale enum entries in documentationEdward Welbourne2018-08-271-249/+249
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | They were previously in blocks, each alphabetic, partly partitioned by the version in which they were added, but not fully so. Since markers indicate that mre clearly. Change-Id: If227b37dae45dac546d3f24674cc6bbecb50152a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* | | Add some missing language codes to our locale dataEdward Welbourne2018-08-273-2/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We were missing a few languages CLDR knew about; so add them to the list in enumdata.py (and add trailing commas to lists to make future additions not need to change the prior last line; python is perfectly happy with this). [ChangeLog][QtCore][QLocale] Added support for Western Balochi, Ido, Lojban, Sicilian and Souther Kurdish. Change-Id: I0d24cff46a0ae8db48ec1db8762088f877319982 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
* | | corelib/tools: Add QOffsetStringArray APIMikhail Svetkin2018-08-272-0/+212
|/ / | | | | | | | | | | | | | | | | This function allows to generate an array of offsets of substrings in a string at compile time. This produces less verbose and easier to maintain source code. Change-Id: I5774b8b91906f6191f2b1244a676c07e7eb15b47 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Disable warnings about deprecated QRegularExpression::PatternOptionsTor Arne Vestbø2018-08-241-0/+3
| | | | | | | | | | | | | | | | | | We still want to have these in the debug output for completeness, so disable the warning instead of removing the lines. Change-Id: I4291adddff486e4ea963be36ac0ebda089a66045 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into 5.12Liang Qi2018-08-221-3/+3
|\| | | | | | | | | | | | | | | | | Conflicts: src/gui/text/qtextengine.cpp tests/auto/corelib/itemmodels/qsortfilterproxymodel_common/tst_qsortfilterproxymodel.cpp tests/auto/corelib/itemmodels/qsortfilterproxymodel_common/tst_qsortfilterproxymodel.h Change-Id: Ib9f968edbb0f3387c89bc25e914321d0738bfadc
| * Cast away -Wclass-memaccess warnings in QVarLengthArray methodsEdward Welbourne2018-08-201-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | With g++ 8.2.0, I get warnings when a QVarLengthArray<QString> calls remove() or prepend(), as some tests in tst_QVarLengthArray do, as they call memmove() "writing to an object of type ‘class QString’ with no trivial copy-assignment; use copy-assignment or copy-initialization instead"; which may indeed be a good argument for not using QVarLengthArray<QString>, but its own tests do. Change-Id: I4f8a64948b32a54e67a285df4ec7788f60739ffb Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Use std::partition_point for faster searches among transitionsEdward Welbourne2018-08-201-56/+55
| | | | | | | | | | | | | | | | | | | | | | QTzTimeZonePrivate's methods were iterating transitions from first to last, or last to first, to find where .atMSecsSinceEpoch crossed some threshold; but the transitions are sorted in order of increasing .atMSecsSinceEpoch, so binary chop would be more efficient than such linear searches. So use std::partition_point() instead. Change-Id: I65c43cb20fca6685a22ea52a4ca2f1089c128ebf Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Scale a correction by a factor of a thousand that it was missingEdward Welbourne2018-08-201-1/+1
| | | | | | | | | | | | | | | | | | | | The difference between two transitions' offsets is measured in seconds, but we add it to a time in milliseconds; so it needs to be scaled to fit. Fortunately rarely enough applied that it hadn't caused any reported problems. Change-Id: I11f9f9e46d43d748220e072ad7504d4c8c5bf192 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Add some local const variables to save some repeated computationEdward Welbourne2018-08-201-8/+7
| | | | | | | | | | | | | | | | | | | | QTimeZonePrivate::dataForLocalTime() makes repeated use of the times sixteen hours before and after the target local time, so compute those up front once instead of each time they're needed, giving them expressive names and making code terser. Change-Id: I4b682cc6de2adb98c3ee5489eec4b63ac1090961 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | QTimeZonePrivate::dataForLocalTime(): cope with negative DST offsetsEdward Welbourne2018-08-201-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The tz database's latest update now records the cases where summer time is deemed standard and winter-time is deemed DST. (This doesn't change what the offsets are, just how they're described.) The resulting negative DST offsets mess up the algorithm for converting local time to UTC, causing tst_QTimeZone::transitionEachZone() to fail for Europe/Dublin in the hour before its transition; so refine the algorithm to cope with the new case. Task-number: QTBUG-69980 Change-Id: I24003872fffb03b2903161859158d0ce998b3073 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Implement exact match expression builder for QRegularExpressionSamuel Gaist2018-08-193-2/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QRegularExpression doesn't offer a direct equivalent of QRegExp's exact match. There are several places in the Qt sources that use this feature. This patch implements a small helper function that builds the expression as recommended in the documentation and updates the related code. [ChangeLog][Core][Tools] QRegularExpression now provides anchoredPattern() which is a helper function to build regular expressions used for exact matching. Change-Id: Idbbf142c4c5cb9b62abf8229f4ce85fd4409e5d0 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | QRegularExpression: refactor wildcard translationSamuel Gaist2018-08-181-24/+35
| | | | | | | | | | | | | | | | | | | | | | This patch refactors the wildcardToRegularExpression method to generate a simpler regular expression. It also fixes some shortcomings of the previous implementation. Tests have been updated to ensure all cases are properly supported. Change-Id: I454e3fe8fe0bb663b2f319d6fa2fa8aec626c50d Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Eliminate QLocale's system_data in favor of globalLocaleDataEdward Welbourne2018-08-171-20/+15
| | | | | | | | | | | | | | | | | | This is simpler than initializing a pointer to its address and accessing it via that pointer; it saves the initialization and a few checks that it's happened. Change-Id: I3d82ee1cb02981654ec769632d3a055e11737113 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>