summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools
Commit message (Collapse)AuthorAgeFilesLines
* QLatin1String, QStringView: add containsAnton Kudryavtsev2019-06-044-5/+96
| | | | | | | | | | | [ChangeLog][QtCore][QLatin1String] Added contains(). [ChangeLog][QtCore][QStringView] Added contains(). Change-Id: I19fd2e155180edd8620c520f4e60a1f86f0603ac Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Deprecate use of QTime as a timerEdward Welbourne2019-05-242-13/+11
| | | | | | | | | | | | | QElapsedTimer does the job better and without the DST kludges. Change-Id: Ic4a566f695648cbe069a21ea8d3e84562b665a3c Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Convert some deprecations to QT_DEPRECATED_XEdward Welbourne2019-05-241-4/+4
| | | | | | | | | | | | | To make their replacements easier to find. They're in the documentation, but weren't in the source. Change-Id: Iea936062feaead636e3dd8e93f0b4c82ed8876cb Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Regenerate Windows Time Zone ID tableEdward Welbourne2019-05-281-999/+1102
| | | | | | | | | | | | | Re-ran util/locale_database/cldr2qtimezone.py to add new zones to the table. Change-Id: I70258a9abbe9815494291deff528f3c18703de40 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Move container block-size calculations to qarraydata.cppEdward Welbourne2019-05-293-104/+107
| | | | | | | | | | | | | | These were in qbytearray.cpp, which doesn't use them, is big and I intend to move it to a different directory than the header, qtools_p.h, that declares them. So move them to a small file that does use them. Change-Id: I5a4684f8c7628e617546019cc3f01d92d829f085 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* corelib/tools: use qUtf16Printable() and %lsMarc Mutz2019-05-294-9/+9
| | | | | | | | | | ... instead of qPrintable() and %s. Saves temporary QByteArray creation. Change-Id: Idd46c99a5da731e29c6d237dc914e256ac7b3fbd Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QDateTimeParser: use qUtf16Printable() and %lsMarc Mutz2019-05-291-29/+29
| | | | | | | | | | | | ... instead of qPrintable() and %s. Avoids temporary QByteArrays. Saves 1.2KiB in text size on optimized Linux AMD64 GCC 9.1 builds. Change-Id: Ie626fc478667007ce9a6bc920b8d4ec0451f2cd0 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QCommandLineParser: add --help-all, to show Qt options as wellDavid Faure2019-05-151-14/+32
| | | | | | | | | | | Sample output at http://www.kdab.com/~dfaure/2019/help-all-example.txt Fixes: QTBUG-41802 Change-Id: I7a3350200761d41481fcb10ec4328e96e548d246 Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QSharedPointer: Fix build error for cross-built toolsFriedemann Kleint2019-05-291-0/+2
| | | | | | | | | | | | | | | | Guard friend declaration within QT_NO_QOBJECT. Amends 28ce318fcbccb5a117ca4e55322ee1c1dd8d05d4. Fixes: QTBUG-76056 Change-Id: I14fbe5457c16e8a366fecdc0a356b68b8609848b Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* qhashfunctions.h: add specializations of std::hash for some Qt typesMarc Mutz2019-05-291-0/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have a problem. Our types don't play well with the std unordered containers, because they do not specialize std::hash. We therefore force our users to come up with an implementation, hindering interoperability, since any two developers are unlikely to come up with compatible implementations. So combining libraries written by different developers will result in ODR violations. Now that we depend on C++11, and thus the presence of std::hash, we still face the problem that the standard does not provide us with a means to compose new hash functions out of old ones. In particular, we cannot, yet, depend on C++17's std::hash<std::string_view> to implement std::hash<QByteArray>, say. There's also no std::hash for std::tuple, which would allow easy composition by using std::tie(). So piggy-back on the work we have done over the years on qHash() functions, and implement the std::hash specializations for Qt types using the existing qHash() functions, with a twist: The standard allows implementations to provide means against predictable hash values. Qt has this, too, but the seed is managed by the container and passed to the qHash() function as a separate argument. The standard does not have this explicit seed, so any protection must be implicit in the normal use of std::hash. To reap whatever protection that std library has on offer, if any, we calculate a seed value by hashing int(0). This will be subject to constant folding if there's no actual seed, but will produce a value dependent on the seed if there is one. Add some tests. A question that remains is how to document the specialization. Can we have a \stdhashable QDoc macro that does everything for us? Task-number: QTBUG-33428 Change-Id: Idfe775f1661f8489587353c4b148d76611ac76f3 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* QtPrivate::QSmartPointerConvertFunctor: Fix deprecation warningFriedemann Kleint2019-05-241-0/+1
| | | | | | | | | | | Fix warning: src/corelib/kernel/qmetatype.h:1723:27: warning: ‘T* QWeakPointer<T>::data() const [with T = QFile]’ is deprecated: Use toStrongRef() instead, and data() on the returned QSharedPointer [-Wdeprecated-declarations] shown when compiling tst_QVariant by using QWeakPointer::internalData(). Change-Id: I5ea543019b4f8e5dfc829939cd2011ae65f12876 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Replace look-up array with simple arithmeticEdward Welbourne2019-05-231-12/+13
| | | | | | | | | | QDate looked up lengths of months in an array. Change it to use some simple arithmetic instead. Benchmark result unchanged: RESULT : tst_QDate::monthLengths(): 0.33 msecs per iteration (total: 87, iterations: 256) Change-Id: I1ab0fa3b97e6716598e50d643a498e0b01c04a96 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Add locale support for Cebuano and Erzya languages (new in CLDR v35.1)Edward Welbourne2019-05-203-4/+33
| | | | | | | Change-Id: I5d0ee7bc27eeca1c046d442b0410128ea5abbdb3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* Rename util/locale_database/ to include the e that was missingEdward Welbourne2019-05-204-5/+5
| | | | | | | | | It was misnamed local_database, quite missing the point of its name. Change-Id: I73a4fdf24f53daac12304de1f443636d89afacb2 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* QString/QByteArray: detach immediately in operator[]Giuseppe D'Angelo2019-05-194-24/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unlike any other implicitly shared container, QString/QByteArray have a "lazy detach" mechanism: their operator[] returns a special object; assignment into that object will actually detach. In other words: QString a("Hello"); QCharRef c = a[0]; // does not detach c = 'J'; // detach happens here This allows this behavior: QString a("Hello"); QCharRef c = a[0]; QString b = a; c = 'J'; // detach happens here assert(a == "Jello"); assert(b == "Hello"); Note that this happens only with operator[] -- the mutating iterator APIs instead detach immediately, making the above code have visible side effects in b (at the end, b == "Jello"). The reasons for this special behavior seems to have been lost in the dawn of time: this is something present all the way back since Qt 2, maybe even Qt 1. Holding on to a "reference" while taking copies of a container is documented [1] to be a bad idea, so we shouldn't double check that the users don't do it. This patch: 1) adds an immediate detach in operator[], just like all other containers; 2) adds a warning in debug builds in case QByteRef/QCharRef is going to cause a detach; 3) marks operator[] as [[nodiscard]] to warn users not using Clazy about the (unintended) detach now happening in their code. This paves the way for removal of QCharRef/QByteRef, likely in Qt 7. [1] https://doc.qt.io/qt-5/containers.html#implicit-sharing-iterator-problem [ChangeLog][QtCore][QString] QString::operator[] detaches immediately. Previously, the detach was delayed until a modification was made to the string through the returned QCharRef. [ChangeLog][QtCore][QByteArray] QByteArray::operator[] detaches immediately. Previously, the detach was delayed until a modification was made to the byte array through the returned QByteRef. Change-Id: I9f77ae36759d80dc3202426a798f5b1e5fb2c2c5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove usages of Q_OS_WINCEJoerg Bornemann2019-05-231-2/+2
| | | | | | | | | | | This platform is history. Change-Id: Iddfab008a509f4828c321730414c8204055cf7af Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* Fix qdoc warnings for Qt 5.14Friedemann Kleint2019-05-213-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | src/corelib/tools/qstring.cpp:9505:clang found diagnostics parsing \fn int QLatin1String::indexOf(QLatin1String l1, int from Qt::CaseSensitivity cs) const error: expected ')' error: out-of-line definition of 'indexOf' does not match any declaration in 'QLatin1String' src/corelib/tools/qstringview.cpp:723:clang found diagnostics parsing \fn qsizetype QStringView::indexOf(QLatin1String l1, qsizetype from Qt::CaseSensitivity cs) const error: expected ')' error: out-of-line definition of 'indexOf' does not match any declaration in 'QStringView' src/corelib/tools/qstringview.cpp:822:Unknown command '\t' src/corelib/tools/qstringview.cpp:825:Unknown command '\t' src/corelib/tools/qstringview.cpp:826:Unknown command '\t' src/corelib/tools/qstringview.cpp:831:Unknown command '\t' src/corelib/global/qnamespace.qdoc:2448:Undocumented enum item 'MarkdownText' in Qt::TextFormat src/corelib/tools/qstringmatcher.cpp:183:No such parameter 'pattern' in QStringMatcher::QStringMatcher() src/network/ssl/qsslerror.cpp:58:Undocumented enum item 'CertificateStatusUnknown' in QSslError::SslError src/gui/kernel/qevent.cpp:5321:Undocumented parameter 'screenOrientation' in QScreenOrientationChangeEvent::QScreenOrientationChangeEvent() src/gui/kernel/qevent.cpp:5321:Undocumented parameter 'screen' in QScreenOrientationChangeEvent::QScreenOrientationChangeEvent() src/gui/kernel/qevent.cpp:5321:No such parameter 'orientation' in QScreenOrientationChangeEvent::QScreenOrientationChangeEvent() src/gui/text/qtextformat.cpp:532:Undocumented enum item 'BlockCodeLanguage' in QTextFormat::Property src/gui/text/qtextformat.cpp:532:Undocumented enum item 'BlockQuoteLevel' in QTextFormat::Property src/gui/text/qtextformat.cpp:532:Undocumented enum item 'BlockMarker' in QTextFormat::Property src/gui/text/qtextdocument.cpp:3294:Undocumented parameter 'features' in QTextDocument::toMarkdown() src/gui/painting/qcolorspace.cpp:659:Undocumented parameter 'colorSpace1' in QColorSpace::operator!=() src/gui/painting/qcolorspace.cpp:659:Undocumented parameter 'colorSpace2' in QColorSpace::operator!=() src/gui/painting/qcolorspace.cpp:659:No such parameter 'colorspace1' in QColorSpace::operator!=() src/gui/painting/qcolorspace.cpp:659:No such parameter 'colorspace2' in QColorSpace::operator!=() examples/widgets/doc/src/icons.qdoc:269:Command '\snippet (//! [43])' failed at end of file 'widgets/icons/iconpreviewarea.cpp' src/widgets/styles/qstyle.cpp:2026:Undocumented enum item 'SP_DialogRetryButton' in QStyle::StandardPixmap src/widgets/styles/qstyle.cpp:2026:Undocumented enum item 'SP_DialogYesToAllButton' in QStyle::StandardPixmap src/widgets/styles/qstyle.cpp:2026:Undocumented enum item 'SP_DialogIgnoreButton' in QStyle::StandardPixmap src/widgets/styles/qstyle.cpp:2026:Undocumented enum item 'SP_DialogNoToAllButton' in QStyle::StandardPixmap src/widgets/styles/qstyle.cpp:2026:Undocumented enum item 'SP_DialogAbortButton' in QStyle::StandardPixmap src/widgets/styles/qstyle.cpp:2026:Undocumented enum item 'SP_RestoreDefaultsButton' in QStyle::StandardPixmap src/widgets/styles/qstyle.cpp:2026:Undocumented enum item 'SP_DialogSaveAllButton' in QStyle::StandardPixmap src/testlib/qtestcase.qdoc:439:Undocumented parameter 'TestClass' in QTest::QTEST_HIGHDPI_SCALING_MAIN src/testlib/qtestcase.qdoc:452:Undocumented parameter 'TestClass' in QTest::QTEST_NO_HIGHDPI_SCALING_MAIN Change-Id: Ib0e9bf81c5caaa6b1fc644ac92085af47c600e0e Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Long live Qt::SplitBehavior!Marc Mutz2019-05-213-0/+64
| | | | | | | | | | | | | | | | | | | | | | | The is a copy of the QString::SplitBehavior enum, but scoped in the Qt namespace instead of inside QString, where it creates problems using it elsewhere (QStringView, in particular). Overload all QString{,Ref} functions taking QString::SplitBehavior with Qt::SplitBehavior. Make Qt::SplitBehavior a QFlags for easier future extensions (e.g. a hint to use Boyer-Moore searching). Added tests in QStringApiSymmetry. [ChangeLog][QtCore] Added new Qt::SplitBehavior. [ChangeLog][QtCore][QString/QStringRef] The split functions now optionally take Qt::SplitBehavior. Change-Id: I43a1f8d6b22f09af3709a0b4fb46fca61f9d1d1f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QCharRef/QByteRef: warn when triggering the resizing operator= behaviorGiuseppe D'Angelo2019-05-194-8/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The whole reason of QCharRef/QByteRef existence is to have a magic operator=. This operator= delays the actual detach up to the moment something is written into the Ref, thus avoiding spurious detaches to the underlying string/byte array. operator= has also an extra feature, it allows this code to succeed: QString s("abc"); s[10] = 'z'; assert(s == "abc z"); This last behavior is *extremely* surprising. The problem with all of this is that this extra convenience is outweighted by the massive pessimization in the codegen for operator[]; by the maintenance burden (QChar APIs need to be mirrored in QCharRef, etc.), and, for the automatic resize, by the fact that it's an super-niche use case. Cherry on top, std::basic_string does not do that, and no Qt or std container does that. In other words: any other container-like class exhibits UB for out of bounds access. We can't just go and change behavior, though. This is something coming all the way back from Qt 2 (maybe even Qt 1), which means we can't deprecate it at short notice. This patch simply adds a warning in debug builds in case the special resizing behavior is triggered. While at it, removes some code duplication in QByteRef. [ChangeLog][QtCore][QString] The behavior of operator[] to allow implicit resizing of the string has been deprecated, and will be removed in a future version of Qt. [ChangeLog][QtCore][QByteArray] The behavior of operator[] to allow implicit detaching and resizing of the byte array has been deprecated, and will be removed in a future version of Qt. Change-Id: I3b5c5191167f12a606bcf6e513e6f304b220d675 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Fix compilation error on compilers not supporting [[nodiscard]]Jędrzej Nowacki2019-05-211-4/+4
| | | | | | | | | | | | | | | | | | __warn_unused_result__ and [[nodiscard]] both are masked by Q_REQUIRED_RESULT but there are some minor differences between them. In general [[nodiscard]] is more flexible while __warn_unused_result__ can cause warnings in some contexts, for example: error #2621: attribute "__warn_unused_result__" does not apply here error #3058: GNU attributes on a template redeclaration have no effect That is a fix for regression caused by b91e6f6f40864d54903d707d7f19a9732188b670. Change-Id: Icf11b832f31e714a88536828051f4b7f348cdb36 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Fix build without features.timezone on macOSTasuku Suzuki2019-05-211-2/+0
| | | | | | | | It is no longer needed after bd78f57463c381203099d7939c9d37cba0341713 Change-Id: I73aceb10eab7c9fdc7d0dfbe89012df7d0110205 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Qt 6: unexport QCharRef / QByteRefGiuseppe D'Angelo2019-05-182-3/+10
| | | | | | | They're fully inlined classes. Change-Id: Id9e5f1a1a0b3d8ee49ba45ad2157ffa38fe265cd Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* QScopeGuard: some cleanupsMarc Mutz2019-05-211-3/+2
| | | | | | | | | | | | | | Use qExchange() in the move ctor and pass the function object by rvalue ref. This saves one move construction and doesn't produce unexpected results. The qScopeGuard free function should take the function object by value, because it decays and because we can't create an rvalure reference in a deduced context. But once we're inside qScopeGuard, the extra object isn't needed anymore, so optimize it away. Change-Id: I94cbc45f9bf6ca086e100efd922a0b4643a81671 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Tidy up in qdatetime.cppEdward Welbourne2019-05-151-18/+7
| | | | | | | | | | Break a line before a close-brace. Added blank lines. Remove some duplicate blank lines and spurious \fn directives. Fixed placement of & between type and parameter name in the function declarations that made these last redundant (these are the WS-only changes). Change-Id: I7ee06a7cbb4f9cb275d5ad87246d8fbc9c9b6668 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Cleanup the fallout of QWeakPointer::data() deprecationGiuseppe D'Angelo2019-05-171-2/+17
| | | | | | | | | | | | | | | | | There are still users of QWeakPointer::data(), which under certain compilers will make headersclean fail. So this patch: * ports data() to a private internalData() function and calls it from all the usage points; * adds cleanup notes for Qt 6, once some of the deprecated machinery around storing unmanaged QObjects in QWeakPointers can get removed. Change-Id: Id3bcbd23374c18a2026861c08a4dcba1670673c1 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Deprecate QWeakPointer::data()Giuseppe D'Angelo2019-05-162-6/+5
| | | | | | | | | | | It's a dangerous API to have. Upgrade to a shared pointer if accessing the raw pointer is required. [ChangeLog][QtCore][QWeakPointer] The data() function has been deprecated. Change-Id: Ie5d34f4fb500b3cfa14d2c0b1b08484df072129c Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Merge "Merge remote-tracking branch 'origin/5.13' into dev" into ↵Liang Qi2019-05-152-9/+14
|\ | | | | | | refs/staging/dev
| * Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-05-152-9/+14
| |\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qfloat16.cpp src/corelib/global/qfloat16.h src/plugins/platforms/windows/qwindowswindow.cpp Change-Id: I0938aaa6a9771f55e48c95ed29f6f5291431b947
| | * Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-05-122-9/+14
| | |\ | | | | | | | | | | | | Change-Id: I0c00ffe0eabebc919f22d6faa4bf958b288e8fd9
| | | * QSharedPointer: fix threadsafety docsGiuseppe D'Angelo2019-05-111-8/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Try and explain better the situation around QSharedPointer: it's reentrant, not thread safe. Change-Id: Ief9d28be8ea3fbaa6014cb6b999626db1bab52ca Reviewed-by: Martin Smith <martin.smith@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | | * Update CLDR version in attributionEdward Welbourne2019-05-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a follow-up to 43abe86e. Change-Id: I2442304c9c79bcb1932fb173b8d993a242d79f4b Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* | | | QContiguousCache: add noexceptGiuseppe D'Angelo2019-05-151-2/+2
|/ / / | | | | | | | | | | | | Change-Id: I069842fe705d2e73222ffb095792d7e3e518cfd9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | QSharedData: code tidiesGiuseppe D'Angelo2019-05-141-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add noexcept and honor the RO3 to silence warnings. In theory this could also be constexpred, but there might still be compilers we support that do not have constexpr initialization for atomics... Change-Id: Ibb94a2f4392908451cf7985d48f999581f03398d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | QSharedData: unexport in Qt 6Giuseppe D'Angelo2019-05-141-1/+5
| | | | | | | | | | | | | | | | | | | | | It's fully inlined anyhow. Change-Id: I8cb78ad6f75d3cc3b27cf91a3ba271cf312c9555 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | QByteData: use int to return the number of managed QByteArraysGiuseppe D'Angelo2019-05-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The internal QByteArrays are kept in a QList, so we can use int to get the count. This matches what operator[] takes, and gets rid of a bunch of warnings when iterating over a QByteData using a plain int as a index variable. Change-Id: Ib44d4101612135b976979a8464442e94706f8736 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | QTypeInfo: move QLinkedlist declaration to qlinkedlist.hMarc Mutz2019-05-141-0/+3
| | | | | | | | | | | | | | | | | | | | | This is in preparation of deprecating QLinkedList. Change-Id: Id5018b7fbc89f8b76b86e97cd09d18b4b8cb6234 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | QDataStream: move QLinkedlist operators to qlinkedlist.hMarc Mutz2019-05-141-0/+15
| | | | | | | | | | | | | | | | | | | | | This is in preparation of deprecating QLinkedList. Change-Id: I7540b784736a48cf4857d1969440d35ec64457e2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-05-139-3709/+3712
|\| | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/tools/qstring.cpp Change-Id: I81dbf90fc936c9bf08197baefa071117bddb1c63
| * | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-05-092-3614/+3636
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/tools/qlocale_data_p.h (Regenerated by running the scripts in util/local_database/) src/gui/opengl/qopengltextureuploader.cpp Done-With: Edward Welbourne <edward.welbourne@qt.io> Done-With: Allan Sandfeld Jensen <allan.jensen@qt.io> Change-Id: I12df7f066ed0a25eb109f61c4b8d8dea63b683e2
| | * Update locale data to CLDR v35.1Edward Welbourne2019-05-072-3623/+3645
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The formatting of times in Norwegian has reverted to using dots in place of colons, as it did before v31 (commit 82deb0ad1), so reverted the tests to their state before that. Change-Id: I8a09ce253731bb0f0f3caca117f06ad568940a81 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * | Doc: replace even more null/0/nullptr with \nullptr macroChristian Ehrlicher2019-05-087-95/+76
| | | | | | | | | | | | | | | | | | | | | | | | Try to replace all wordings like '.. to 0' with '.. to \nullptr'. Also checked for 'null pointer' and similar. Change-Id: I73341f59ba51e0798e816a8b1a532c7c7374b74a Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | | QSharedPointer/QWeakPointer: fix swap()Giuseppe D'Angelo2019-05-111-12/+6
| | | | | | | | | | | | | | | | | | | | | | | | Do not specialize std::swap, just add swap in Qt's namespace. Also add swap() for QWeakPointer, and sprinkle noexcept. Change-Id: Ifb06c214f1865d42f3f2cddf5f980aede6bde185 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Deprecate QQueue::swap(i, j)Lars Knoll2019-05-101-1/+1
| | | | | | | | | | | | | | | | | | | | | QList::swapItemsAt() is the replacement. Change-Id: Id0f194f9b63fd34c612f15e7952c33564f90120c Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Add support for /etc/TZ as default value for $TZEdward Welbourne2019-05-101-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is used by uClibc, at least. [ChangeLog][QtCore][QTimeZone] The TZDB back-end now recognizes the contents of /etc/TZ as a fall-back for $TZ (as used by uClibc). Fixes: QTBUG-75565 Change-Id: I3067e2d023cf30a85633575b5d7dc0ee3ec36927 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Support POSIX rules as $TZ valuesEdward Welbourne2019-05-101-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The TZ environment variable can validly contain a POSIX rule, rather than an IANA ID, as described here: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html#tag_08_03 However, if TZ were set to such a value, leading to it being used as systemTimeZoneId(), it would be passed to QTzTimeZonePrivate::init(), which is a no-op unless it manages to open a zoneinfo/ file with the given ianaId as name. When the environment variable doesn't name a zoneinfo/ file, we would thus get an invalid time-zone. We can, instead, check whether the ianaId looks like a valid POSIX rule and, if it does, use it as m_posixRule, enabling us to correctly handle this case. Tweak parsing of POSIX rules so that a zone using name "UTC" or "GMT" with an offset other than 0 will be rejected as invalid. This avoids parsing a zone name such as "GMT+17" or "UTC+00:01" as a POSIX rule, where it should be understood as an offset from UTC (and only certain well-established offsets are supported). Added two test-cases to tst_QTimeZone::tzTest() for validity of a POSIX zone value - a simple one constructed during discussion of the bug, the other taken from an example in: http://leaf.sourceforge.net/doc/buci-tz3.html Task-number: QTBUG-75565 Change-Id: Ia5cb1cc56b13b0f6b56258e48be98d04d909e32a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | QStringView, QLatin1String: add indexOf methodsAnton Kudryavtsev2019-05-105-12/+141
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [ChangeLog][QtCore][QLatin1String] Added indexOf(). [ChangeLog][QtCore][QStringView] Added indexOf(). Change-Id: I9f56e5b40030e39b29e50914a46beb58013b537b Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Deprecate conversion functions between QList and QSetLars Knoll2019-05-073-9/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Users should use range constructors instead to do the conversion. Keep conversion methods between QList and QVector as these will turn into a no-op in Qt 6, whereas forcing people to use range constructors would lead to deep copies of the data. Change-Id: Id9fc9e4d007044e019826da523e8418857c91283 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Add swapItemsAt() to QVectorLars Knoll2019-05-072-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | This closes one compatibility gap with QList, to make it easier to replace QList with QVector in Qt6. Change-Id: I5655bc4cd2150a6f09a1ed68c0742f3b42ca47e4 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Merge "Merge remote-tracking branch 'origin/5.13' into dev" into ↵Liang Qi2019-05-076-31/+24
|\ \ \ | | | | | | | | | | | | refs/staging/dev
| * | | Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-05-076-31/+24
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/kernel/qobject.cpp src/corelib/kernel/qvariant.h src/corelib/tools/qlist.h Done-With: Milian Wolff <milian.wolff@kdab.com> Done-With: Allan Sandfeld Jensen <allan.jensen@qt.io> Change-Id: I6803f7239aa137a51a7467fab7cc7a01302a848d