summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools
Commit message (Collapse)AuthorAgeFilesLines
* Remove handling of missing Q_COMPILER_RVALUE_REFSAllan Sandfeld Jensen2019-04-086-14/+0
| | | | | Change-Id: I7bc6c455fbae4cdad584c76773299a6d8cd40c82 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QEasyingCurve: fix data stream operatorsSamuel Gaist2019-04-061-6/+47
| | | | | | | | | | | | | Until now, QEasingCurve was not streaming all it's internal state. Therefore, doing store/reload operation through QDataStream would not yield the same curve as the original. This patch fixes it. [ChangeLog][QtCore][QEasingCurve] QEasingCurve now properly streams all the data needed to QDataStream. Change-Id: I1619501f5b4237983c8c68e148745a5e58863f55 Fixes: QTBUG-68181 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* Remove handling of missing very old compiler feature checkAllan Sandfeld Jensen2019-04-062-32/+2
| | | | | | | | | | | Removes handling of missing Q_COMPILER_NULLPTR, Q_COMPILER_AUTODECL, Q_COMPILER_LAMBDA, Q_COMPILER_VARIADIC_MACROS and Q_COMPILER_AUTO_FUNCTION. We haven't supported any compilers without these for a long time. Change-Id: I3df88206516a25763e2c28b083733780f35a8764 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Replace qMove with std::moveAllan Sandfeld Jensen2019-04-066-14/+14
| | | | | | Change-Id: I67df3ae6b5db0a158f86e75b99f422bd13853bc9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Merge "Merge remote-tracking branch 'origin/5.13' into dev" into ↵Qt Forward Merge Bot2019-04-0467-1555/+1562
|\ | | | | | | refs/staging/dev
| * Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-04-051-1/+1
| |\ | | | | | | | | | Change-Id: If4974bbf0a166de244dd57cb71b05fa28bcc34ce
| | * Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-04-041-1/+1
| | |\ | | | | | | | | | | | | Change-Id: Ia7328524f2cd9d5995ac8705f0fe0bf570b2e831
| | | * Doc: Use the \nullptr macro instead of 0Venugopal Shivashankar2019-04-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This enables overriding the macro so that it translates to 'None' in the Qt for Python context. Change-Id: Ib3cecf57eeb0405a1929309b71e9f012a07f11cf Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
| * | | Replace Q_DECL_NOEXCEPT with noexcept in corelibAllan Sandfeld Jensen2019-04-0365-1514/+1514
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In preparation of Qt6 move away from pre-C++11 macros. Change-Id: I44126693c20c18eca5620caab4f7e746218e0ce3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * | | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-04-031-4/+2
| |\| | | | | | | | | | | | | | Change-Id: I99a27f9a0402e1ccad45a2d062d784f8d9a08dd3
| | * | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-04-021-4/+2
| | |\| | | | | | | | | | | | | Change-Id: Ia5d893e57deb78bc32e2053a5a79543ff847fe32
| | | * Refine underflow check in QLocaleData::convertDoubleToFloat()Edward Welbourne2019-04-011-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A string can parse as a non-zero double that's smaller than the smallest float yet be a faithful representation of the smallest float. So rather than testing for non-zero doubles less than the smallest float, test for non-zero doubles that cast to float zero; these underflow. This means small values close below the smallest float shall round up to it, rather than down to zero, requiring a tweak to an existing test. Added a test for the boundary case (and tidied the test data). Fixes: QTBUG-74833 Change-Id: I4cb30b3c0e54683574b98253505607caaf88fbfb Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * | | Issue a warning about unused result of qScopeGuard and QScopeGuardJędrzej Nowacki2019-04-021-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the result is unassigned then resulting QScopeGuard is destroyed immediately, we can warn about it, as it is definitely a bug. Change-Id: I627b05cecb3d0e62dbc24373e621f2be36d9b324 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
| * | | Use the QTime API less clumsilyEdward Welbourne2019-04-011-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Various patterns seem to have been copied, notably counting time from QTime(0, 0) rather than using QTime::msecsSinceStartOfDay() and its setter. Unsuitable value types also put in an appearance, and QTime()'s parameters after the first two default to 0 anyway. Corrected a lie in QTime()'s default constructor doc; it does not work the same as QTime(0, 0) at all. Change-Id: Icf1a10052a049e68fd0f665958f36dbe75ac46d5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * | | Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-03-312-24/+25
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/configure.json Change-Id: I93ac67f3bf4844bc7c691183e94bceb922b7b919
| | * | Merge remote-tracking branch 'origin/5.12' into 5.13Friedemann Kleint2019-03-262-24/+25
| | |\| | | | | | | | | | | | | Change-Id: I71cc71881fb638e207d83a8733bad8f267701c0f
| | | * Fix broken data for time-zones with no transitionsEdward Welbourne2019-03-222-24/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While an invalid time-zone shall have no transitions, so may various constant zones, like UTC. The TZ data may include only the POSIX rule for such a zone, in which case we should use it, even if there are no transitions. Broke out a piece of repeated code as a common method, in the process, since I was complicating it further. Added test for the case that revealed this; and made sure we see a warning if any of the checkOffset() tests gets skipped because its zone is unsupported. Fixes: QTBUG-74614 Change-Id: Ic8e039a2a9b3f4e0f567585682a94f4b494b558d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | | * Correct a misguided assertion in QTzTimeZonePrivateEdward Welbourne2019-03-221-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Without ICU, the TZ-DB backend for time-zones tripped over an assertion when running tst_QTimeZone::stressTest(), which happened to probe a zone between its last transition and the first transition of a POSIX rule that followed it. The code assumed there was no interval between these two; apparently, there can be. Change-Id: I3d0ad41fec0a255db2f9bfac54d33aa9b83938e8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * | | Use move more consistently in QScopedValueRollbackAllan Sandfeld Jensen2019-03-271-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use move on the existing value as well so the constructor makes more of a difference. Change-Id: Iee2080da7b7d2d88eb108f0448c61423c7256979 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | | Remove remaining Q_DECL_NOEXCEPT/Q_DECL_NOTHROW usageAllan Sandfeld Jensen2019-04-0411-43/+43
| | | | | | | | | | | | | | | | | | | | Change-Id: I91ac9e714a465cab226b211812aa46e8fe5ff2ab Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | | Allow word break wrapping in Korean textEskil Abrahamsen Blomfeldt2019-04-042-2/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In Korean text, they typically can use both the "Western" style of word wrapping, i.e. breaking on spaces, as well as the East-Asian style of potentially breaking between all syllables. However, the Unicode Line Breaking Algorithm, TR14 defaults to breaks on syllables and specifies a possible tailoring where Hangul is mapped to the AL class instead: "When Korean uses SPACE for line breaking, the classes in rule LB26, as well as characters of class ID, are often tailored to AL" When using Qt, the user would expect the WordWrap wrap mode to break between words in Korean. If you want the syllable-based text layout, you would use WrapAnywhere, probably accompanied by line justification. To avoid breaking QTextBoundaryFinder and other potential clients of QUnicodeTools which depend on getting the precise Unicode data from the algorithm, we do this by passing a flag from QTextEngine when initializing the attributes. This way, it can also be made optional later on, if we decide there is a reason to add an additional wrap mode specifically to handle cases like this. [ChangeLog][Important Behavioral Change] WrapWord now correctly prefers line breaks between words in Korean text. WrapAnywhere can still be used to get breaks between syllables instead. Done-with: Alexey Turitsyn <alexey.turitsyn@lge.com> Task-number: QTBUG-47644 Change-Id: I37b45cea2995db7fc2b61e3a0cc681bbdc334678 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | | QCommandLineParser: warn if defining a duplicate optionDavid Faure2019-04-041-1/+3
|/ / / | | | | | | | | | | | | | | | Fixes: QTBUG-74907 Change-Id: I3741a5241515dfaf4353458a9ef13ceaeb9fea0b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | core: Add deduction guides for QPairMikhail Svetkin2019-03-251-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | [ChangeLog][QtCore] Added support of deduction guides for QPair Change-Id: I41a798390dc2c925b0f8432ba12aa345724de2d7 Reviewed-by: Martin Smith <martin.smith@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
* | | qstringalgorithms: add find methodsAnton Kudryavtsev2019-03-224-204/+208
| | | | | | | | | | | | | | | | | | | | | | | | | | | Also add qsizetype support. It's needed to add find methods to QStringView Change-Id: I45eac082924e27778c24eebbb19d694221c28978 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | QVector: Add assignment from std::initializer_listKari Oikarinen2019-03-212-1/+22
| | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I88a66e4b78ca6f40c328070f275e7163fb0d691c Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
* | | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-03-161-0/+6
|\| | | | | | | | | | | Change-Id: Ief0a0b754c104d5348fee9ee15e967bd37c526f8
| * | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-03-151-0/+6
| |\| | | | | | | | | | Change-Id: I2bf3b4ceb79364330eae4cbf3cdee9a82d1be46d
| | * Doc: fix some typos and missing doc for QScopeGuardEirik Aavitsland2019-03-111-0/+6
| | | | | | | | | | | | | | | Change-Id: Ifd492387abbffa551e08a6bcc01e248b8402254d Reviewed-by: Martin Smith <martin.smith@qt.io>
* | | Merge "Merge remote-tracking branch 'origin/5.13' into dev" into ↵Liang Qi2019-03-154-31/+50
|\ \ \ | | | | | | | | | | | | refs/staging/dev
| * | | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-03-144-31/+50
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/tools/qcollator_win.cpp Change-Id: I6d806d7c58b2057ebde3ad915bb5551f34b700e5
| | * | Doc: Unify terminology for '\0'-terminated stringsChristian Ehrlicher2019-03-132-24/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The documentation for QByteArray and QString is using different notations for '\0'-terminated strings. Unify them by using '\0'-terminated everywhere. Change-Id: Ia26ec5c50635bebba1b54b7fe227ff0bcca4f2ad Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
| | * | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-03-111-1/+1
| | |\| | | | | | | | | | | | | Change-Id: Iecdf00ca61d819bde532daa42f093860ec4a499e
| | | * Fix a couple of small doc things in relation to QScopeGuardAndy Shaw2019-03-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I6e61a18697b95d9e3f534d1d71ebf32fdff4a04f Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
| | * | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-03-091-6/+28
| | |\| | | | | | | | | | | | | Change-Id: Ica3f89ace33585ad7854417a328156f5a68e2a00
| | | * Handle error from MS-Win API in QCollator::compare()Edward Welbourne2019-03-061-6/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CompreString(Ex|) can fail, e.g. if it doesn't like the flags given. Report such failure and treat compared values as equal rather than whichever is first being less. Fixes: QTBUG-74209 Change-Id: If8fa962f9e14ee43cc423a09a67bc58259a24794 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Aleix Pol Gonzalez <aleixpol@kde.org>
* | | | More nullptr usage in headersKevin Funk2019-03-146-16/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Diff generated by running clang-tidy's modernize-use-nullptr checker on the CMake-based Qt version. Skipping src/3rdparty, examples/, tests/ Change-Id: Ib182074e2e2fd52f63093f73b3e2e4c0cb7af188 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | | QStringMatcher: add QStringView supportAnton Kudryavtsev2019-03-142-10/+41
|/ / / | | | | | | | | | | | | | | | | | | While touching the code, deduplicate some methods. Change-Id: I28f469f0e9ae000a34466b0ecc604b5f3bd09e63 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Avoid copying QByteArray created via fromRawData in toDoubleVolker Hilsheimer2019-03-091-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | qt_asciiToDouble accepts a length parameter, so we can just pass that through. No need for explicitly null-terminating, which is where the copy of the data would be made. Change-Id: I4e7921541f03295a2fae6171b35157084ff3ed8c Fixes: QTBUG-65748 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Clean up the QCollator code and commentsEdward Welbourne2019-03-084-51/+69
| | | | | | | | | | | | | | | | | | | | | | | | Broke over-long lines. Reflowed documentation, refined a phrasing, corrected some out of date details and typos. Change-Id: Ic3835bb198bd062f85b3c466b56dc9636d4d3fe4 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | | Report status codes in warnings about API failuresEdward Welbourne2019-03-081-10/+6
| | | | | | | | | | | | | | | | | | | | | | | | Also reuse the status variable, since the value saved in the one previously declared int was an OSStatus, too. Change-Id: I8e8fe308ae71df51e8057d89bc76cab0c6bbedb2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Extend QCollator to support QStringViewEdward Welbourne2019-03-086-76/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This enables some simplification of the existing implementations. Refined wording of the documentation in the process. [ChangeLog][QtCore][QCollator] Added support for QStringView. Change-Id: Idffaae8d109173d47c7be076828f4b58dc334957 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Add QStringView::toWCharArray() to match QStringEdward Welbourne2019-03-084-7/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QCollator needs it to add support for QStringView. In any case, it extends the mirror of QString's API. Naturally, we can reimplement QString's version using it. Change-Id: I5a23a3f2a98c7d59597b5e935542a93764b5e350 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* | | QLineF: mark angle(const QLineF&) as deprecatedChristian Ehrlicher2019-03-052-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | QLineF::angle(const QLineF&) was deprecated during Qt4 times but not decorated with QT_DEPRECATED_X. Add this so it can be removed with Qt6 Change-Id: I8950b646cc5fa8206e47bdd16647d17d615f6c6a Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | Simplify toStdWStringGiuseppe D'Angelo2019-03-051-7/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In C++17: just use std::basic_string::data(). In C++11: dereferencing begin() on an empty string is undefined behavior on all compilers, not just MSVC, so remove that workaround. Instead of the reference-dereference combo, use std::basic_string::front(). Change-Id: I3229597e000311ce71e4083dca6667bb56d8f8e3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | QString: mark obsolete functions as deprecatedChristian Ehrlicher2019-03-042-0/+8
|/ / | | | | | | | | | | | | | | | | | | Mark obsolete functions in QString as deprecated so they can be removed with Qt6: - QString::sprintf() - QString::vsprintf() Change-Id: I9b7748db95291c34b95ff3ad3e3aabc8215aeaae Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-02-261-0/+2
|\| | | | | | | Change-Id: Id511850002d9274d17891c063376ac4b3ff939dd
| * Fix build for size with gccKirill Burtsev2019-02-231-0/+2
| | | | | | | | | | | | | | | | Fixes the error: variable 'isDifferent' set but not used Change-Id: Ibd60b17126057da64a41d325b7ef548316f27c4b Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Fix can not -> cannotRobert Loehning2019-02-252-2/+2
| | | | | | | | | | Change-Id: Ie9992f67ca59aff662a4be046ace08640e7c2714 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | Add conversion to and from long and ulongVolker Hilsheimer2019-02-233-0/+162
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This implements conversion parity with QString, which can convert to and from long and unsigned long. The implementation simply forwards to existing long long overloads or uses the existing helpers, so just as for the conversion to/from int or short, no additional test cases were added. Change-Id: I37ef06d9ce4d80d98bd72720353996bac723e09c Fixes: QTBUG-782 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 783953f09dcfe9c58dc991394535ba07dabe2560) Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | QtCore: replace null and nullptr with \nullptr in documentationChristian Ehrlicher2019-02-186-86/+86
| | | | | | | | | | | | | | Replace null and '\c nullptr' with \nullptr in the documentation. Change-Id: Ib9e0cfc2eb2830b213e6523773603d56180b0998 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>