summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools
Commit message (Collapse)AuthorAgeFilesLines
...
* | | Centralize the MSVC work-around for std::is_permutationMarc Mutz2019-07-121-15/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There's currently only one user, but another one is coming up, so apply DRY and centralize the work-around for the MSVC warning C4996 on use of 3-arg STL algorithms in one place. The code is prepared to handle other algorithms with ease, should any more crop up. Change-Id: Ia881888d6a2b5286c6d8d823bc2b76788efad624 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | QHash: optimize equality operatorMarc Mutz2019-07-121-10/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - First compare the d-pointer before dipping into *d - Keep a running count as we calculate thisEqualRange, as std::distance() on QHash::iterator is very expensive. - Skip the pointless first comparison of the unadvanced iterator's key() with itself (found by Mårten Nordheim) Also rename (it, thisEqualRangeEnd) → (thisEqualRangeStart, it), to keep advancing `it`, which is more natural than advancing an `end` and later resetting it = end. Change-Id: I2c27c071b9ee23425a763328402dad9efee4cbd0 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* | | Introduce QT_NO_LINKED_LIST and mark QtBase (almost) free of itMarc Mutz2019-07-123-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | QLinkedList is still used in several tests. Add exceptions for these subdirs. Change-Id: I50ccd2a0892129d4a47aa4e2400211690da9a82d Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* | | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-07-121-2/+2
|\| | | | | | | | | | | Change-Id: Icaabf08f9af539ddf844d96bc9c3a2d09408ba8a
| * | [Doc] Fix minor typosSze Howe Koh2019-07-102-4/+4
| | | | | | | | | | | | | | | Change-Id: I7e74806218dcc07d800f4ec08e94abce32483f5e Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
| * | doc: Remove erroneous double left braceMartin Smith2019-07-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | A double left brace in a link command was causing qdoc to fail for the remainder of the qdoc comment. This update just removes one of the left braces. Change-Id: Ie4fc0122e0799955b7804c2b6f61393af01747c7 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* | | Move text-related code out of corelib/tools/ to corelib/text/Edward Welbourne2019-07-1062-73640/+0
| | | | | | | | | | | | | | | | | | | | | | | | This includes byte array, string, char, unicode, locale, collation and regular expressions. Change-Id: I8b125fa52c8c513eb57a0f1298b91910e5a0d786 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* | | Be less laissez-faire with implicit conversions to QCharMarc Mutz2019-07-096-26/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QChar currently is convertible from nearly every integral type. This is bad code hygiene and should be fixed come Qt 6. The present patch is the result of compile fixes from marking these constructors explicit. As is clear from the distribution of fixes, only low-level string handling code used these implicit conversions, an indication that they're not in widespread use elsewhere. Change-Id: Ief5336f21e6d181e03ab92893b3d13a14adc7cb0 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* | | QHash: mark the equality operator for QHashDummyValue constexpr noexceptMarc Mutz2019-07-081-1/+1
| | | | | | | | | | | | | | | | | | | | | Who knows what this may end up being good for. Change-Id: Ib5e73b0170ebba54f87f36e75b7c407f801c52a0 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* | | Q_ARRAY_LITERAL: protect the check for literal typesGiuseppe D'Angelo2019-07-061-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some compilers (hello, MSVC) do not produce literal types in Qt because their constexpr support has been blacklisted. Therefore, amend the check for literal types in Q_ARRAY_LITERAL: only do the check if the compiler supports constexpr. Change-Id: I7cffe00dde447d975aa6a7d02248df9c351508ff Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-07-051-2/+2
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf qmake/generators/makefile.cpp Change-Id: Ifb2633a69d0bf8cdf12d799c6259beefc279c49e
| * | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-07-031-2/+2
| |\| | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: I936be3c0df2b9845ff6a85eb3d4442cdabe63d37
| | * [docs] Fix issues in QRect/QMargin API docsMarc Mutz2019-07-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | - Fix grammar in op-(QRect, QMargin) - Correct shunk for grown in op-(QRectF, QMarginsF) Change-Id: Ia0dbd933cc9f6ed5e0dad05a27794c1135c794ed Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | | Add QT_NO_JAVA_STYLE_ITERATORS and mark QtBase free of itMarc Mutz2019-07-034-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... except for tests, which manually undefine the macro. Like QT_NO_FOREACH, this is a technical way to keep JSI-free modules JSI-free going forward. Change-Id: Icf1342da00a700f42f9e32a253d1cdb94c38dd7e Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | Optimize QSet set operationsMarc Mutz2019-07-031-16/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace the identity check with a check for the underlying QHash objects being shared and replace backwards iteration, which is really forwards iteration with wrapping at bucket boundaries, with forward iteration. QSet cannot contain duplicates, so the order in which the RHS elements are presented to the algorithms does not matter. Change-Id: Iad8528e3a9501b14cb85601b221a848aad91480c Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | Make the default ctor of QVarLengthArray implicitUlf Hermann2019-07-021-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | Otherwise "QVarLengthArray<Foo> x = {};" gives a warning. Also, some compilers get confused about "QVarLengthArray()" this way. Task-number: QTBUG-76199 Change-Id: I4296586c0181d3e6e82ca8b7b79aeb9a21645d1f Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | Merge "Merge remote-tracking branch 'origin/5.13' into dev"Liang Qi2019-07-014-2/+55
|\ \ \
| * | | Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-07-014-2/+55
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/network/ssl/qsslsocket_openssl.cpp src/platformsupport/vkconvenience/qvkconvenience.cpp Change-Id: I97ce6ed185f7fdad8102cc58d3cfec0119fd7bb4
| | * | Move the Item typedef to public in the associative Java iteratorsThiago Macieira2019-06-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The documentation talks about them. They're just iterators. Fixes: QTBUG-75123 Change-Id: I194d3f37471a49788a7bfffd15956064b42383b7 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| | * | Document OOM conditions in the QArrayData-based containersThiago Macieira2019-06-283-0/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The other containers probably don't handle as well, so I just documented the ones that I know how they work. Fixes: QTBUG-75470 Change-Id: I95ecabe2f50e450c991afffd159a0483aac35a79 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Albert Astals Cid <aacid@kde.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | | QStringList: utilize QStringMatcher's support for QStringViewMat Sutcliffe2019-07-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This opportunity was missed when adding the QStringView overload of QStringList::filter() in 2a99f60cfbe8a10c8b64b2178573dc8da3d27abe. Change-Id: I8d679b92de6cc76c4d59fd54f01a25579ab3488f Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | | QCharRef/QByteRef: schedule for Qt 7 removalGiuseppe D'Angelo2019-07-012-2/+2
|/ / / | | | | | | | | | | | | | | | | | | | | | With all of their special behavior deprecated, QCharRef and QByteRef can simply be removed. Add a comment. Change-Id: I8bad95424207ae281b5edf348b9ad81c6807dc12 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | QStringList: add QStringView overloads of join, filter, replaceInStringsMat Sutcliffe2019-06-302-0/+116
| | | | | | | | | | | | | | | | | | | | | | | | [ChangeLog][QtCore][QStringList] Added QStringView overloads of join(), filter(), and replaceInStrings(). Change-Id: I9636e21e2e43ed46cce0aa7fa23ab0710aa641ba Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | Remove usages of deprecated APIs from QtAlgorithmsSona Kurazyan2019-06-291-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-76491 Change-Id: I9dab736a0cbd2e86588919640c26e8ce6b3674d0 Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* | | QFreeList: fix memory order on block deletionMarc Mutz2019-06-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Blocks are likely to have been created in a differnt thread from the one performing their deletion, so we need an acquire fence. The rest of the atomics use in the class looks ok, but nevertheless warrants a deeper analysis. Change-Id: I1571ded3a06695b0d58b5bf1d80d6283ac21f959 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-06-271-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/network/ssl/qsslsocket_openssl.cpp Done-With: Timur Pocheptsov <timur.pocheptsov@qt.io> Change-Id: Ibb57a0548b4977797b400637487a56245ac1c024
| * | Fix editing of QDateTimeEdit in 12-hour locales that don't use AM/PMVolker Hilsheimer2019-05-281-12/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code made two incorrect assumptions: that the strings used are "AM" or "PM", or would be translated. Instead, the locale provides the correct strings, and there is no need to translate. However, in order not to break existing translations, we give those preference. And that the AM/PM string is not longer than 4 characters, while in e.g Spanish/Columbia locale the strings are "A. M." and "P. M.", ie 5 characters long. Also, the use of qMin in a function that is asked to provide the maximum section length is wrong. [ChangeLog][QWidgets][QDateTimeEdit] Use the information provided by the locale to determine the AM/PM strings, unless they are already translated. Change-Id: I6d1b05376e5ac62fc58da2cdea2e6cb732ec6747 Fixes: QTBUG-72833 Reviewed-by: Andy Shaw <andy.shaw@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| * | QTextBoundaryFinder: don't break after uppercase followed by commawangChuan2019-05-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [ChangeLog][QtCore][QTextBoundaryFinder] Sentence breaking now no longer breaks between uppercase letters and comma. This is a deviation from the Unicode specification, but produces less surprising behavior. Fixes: QTBUG-75857 Change-Id: If1e78b3be3f20250d01100353ea7da6110985f82 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* | | QString: fix comments for qsizetypeAnton Kudryavtsev2019-06-273-33/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I445ba61513fbafd24834fa48ade849feae4f1324 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | QRegularExpression docs: streamline the anchoredPattern sectionGiuseppe D'Angelo2019-06-231-25/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Users may get confounded by the "essay" about exact matching. We now have a function to build a pattern to do exact matching, just state that that's the solution, end of the story. Change-Id: I0a72aa2255af50a1991540b834f146b6e6bc912e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
* | | QVarLengthArray: add qHash overloadGiuseppe D'Angelo2019-06-232-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [ChangeLog][QtCore][QVarLengthArray] Added a qHash overload. Change-Id: I771203ae3bb575b49f70e9114287dd2690031b42 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | QVector: add a construction from QArrayDataPointerRefGiuseppe D'Angelo2019-06-232-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | To be used to build QVectors out of Q_ARRAY_LITERALs. Change-Id: I6105fd1f2d13f6ce923b79276b4aa7a7f5eff193 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | QString: towards QStringView::arg() pt.4: port QString::arg() to ↵Marc Mutz2019-06-042-9/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QStringView::arg() This allows us to drop QString::multiArg() from the build as soon as we can break BC, ie. in Qt 6. Change-Id: Ibdfbf9e9586952e0ec125120bb5966eb56c0ce67 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | QString: towards QStringView::arg() pt.3: Long live ↵Marc Mutz2019-06-204-23/+161
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QStringView/QLatin1String::arg() This version of arg(), unlike its QString counterpart, transparently accepts views without conversion to QString, and is also extensible to further argument types, say a future QFormattedNumber. [ChangeLog][QtCore][QStringView/QLatin1String] Added arg(), taking arbitrarily many strings. Change-Id: If40ef3c445f63383e32573f3f515fdda84c7fe3a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Port from QAtomic::load() to loadRelaxed()Giuseppe D'Angelo2019-06-2015-53/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Semi-automated, just needed ~20 manual fixes: $ find \( -iname \*.cpp -or -iname \*.h \) -exec perl -pe 's/(\.|->)load\(\)/$1loadRelaxed\(\)/g' -i \{\} + $ find \( -iname \*.cpp -or -iname \*.h \) -exec perl -pe 's/(\.|->)store\(/$1storeRelaxed\(/g' -i \{\} + It can be easily improved (e.g. for store check that there are no commas after the opening parens). The most common offender is QLibrary::load, and some code using std::atomic directly. Change-Id: I07c38a3c8ed32c924ef4999e85c7e45cf48f0f6c Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | QStringView, QLatin1String: add lastIndexOf methodsAnton Kudryavtsev2019-06-185-127/+264
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While touching the code, factor out internal methods to avoid needlees latin1->utf16 conversion. [ChangeLog][QtCore][QLatin1String] Added lastIndexOf(). [ChangeLog][QtCore][QStringView] Added lastIndexOf(). Change-Id: I1c624f00e4ed10111e0d00b86daff7904eeed176 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | QString: towards QStringView::arg() pt.2: port internal machinery to QStringViewMarc Mutz2019-06-061-24/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This involves replacing the use of QStringRef with QStringView and replacing int indexes and sizes with qsizetype ones. Since we use QStringView now, where mid() is cheap and well-defined, remove the offset and length parameters that used to be Part ctor arguments, and use mid() in the caller. Change-Id: I08f3cd467b7b935f734b73d15eb8564b7deaa87e Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | QString: towards QStringView::arg() pt.1: modernize some codeMarc Mutz2019-06-061-14/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace explicit iterator loops with ranged for loops. Also remove the pointless detach() of the QString result, caused by calling mutable data() instead of using the old trick of const-casting constData(). Change-Id: Ia7e2cb2926dc30b4dba33200b17697fd33d22446 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-06-141-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: qmake/generators/makefile.cpp qmake/generators/unix/unixmake2.cpp src/corelib/thread/qthread_unix.cpp tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp Change-Id: I1df0d4ba20685de7f9300bf07458c13376493408
| * | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-06-141-2/+2
| |\| | | | | | | | | | Change-Id: I53a50669face6f68ddc046fd2102de8c1f888b4b
| | * Doc: Fix typos in QDateTime docsTopi Reinio2019-06-071-2/+2
| | | | | | | | | | | | | | | | | | | | | Change-Id: Ibff4555cbd1e980333acd88c697021b4a74998a8 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| * | Merge remote-tracking branch 'origin/5.12' into 5.13Liang Qi2019-06-073-102/+142
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: qmake/generators/makefile.cpp src/plugins/platforms/cocoa/qcocoaintegration.h src/plugins/platforms/cocoa/qcocoaintegration.mm Done-With: Jörg Bornemann <joerg.bornemann@qt.io> Change-Id: I5a61e161784cc6f947abe370aab8f2971a9cbe78
| | * Detect system time zone from linked symlinksDamien Caliste2019-06-041-5/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [ChangeLog][QtCore][QTimeZone] The IANA timezone database backend now properly follows symlinks even when they point to variable locations like /run or /var (useful when /etc is mounted read-only). Fixes: QTBUG-75936 Fixes: QTBUG-75527 Change-Id: If0dc2bfa20659e76c3bd062c75597a9ad01ad954 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * Overhaul Q(Date|Time)+ documentationEdward Welbourne2019-05-291-96/+103
| | | | | | | | | | | | | | | | | | | | | | | | Various things were out of date, misdescribed or just plain wrong. Change-Id: I11b7bd419604067fce2577a42882ebf126629016 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
| | * QRegExp: remove an out of bounds access into QStringGiuseppe D'Angelo2019-05-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... spotted with the brand-new checks for that in QCharRef. The rx[i] == ~~~ check is clearly wrong, as rx is the regexp we're building and `i` was not supposed to index into it. The intended meaning was wc[i] == ~~~, testing if we were seeing the closing bracket of a character set. We need to check for that immediately for dealing with the special syntax of []...] where the ] belongs to the character set (it can't be the closing one as character sets cannot be empty). Fix and add a regression test. Bonus: this code was almost unchanged since 2009. Change-Id: I958cd87fc25558e9d202d18b3dd4a35d0db16d8d Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: hjk <hjk@qt.io>
* | | QWeakPointer: use an alternative work-round for internalData() usersMarc Mutz2019-06-111-11/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous work-around fails, probably because of cross-dependencies. E.g. we have this in QtScXml: In file included from /home/qt/work/install/include/QtCore/qsharedpointer.h:48:0, from ../../src/scxml/qscxmltabledata_p.h:55, from ../../src/scxml/qscxmltabledata.cpp:40: /home/qt/work/install/include/QtCore/qsharedpointer_impl.h:687:12: error: ‘QPointer’ does not name a type; did you mean ‘pointer’? friend QPointer<X> ^~~~~~~~ pointer /home/qt/work/install/include/QtCore/qsharedpointer_impl.h:689:23: error: ‘QSmartPointerConvertFunctor’ in namespace ‘QtPrivate’ does not name a template type friend QtPrivate::QSmartPointerConvertFunctor<QWeakPointer>; ^~~~~~~~~~~~~~~~~~~~~~~~~~~ To fix, grand friendship only to a non-template class with a templated static method that returns internalData(). This fixes most users, except in qmetatype.h, which does not include qsharedpointer.h. In order to use the non-template class in there, we need to delay its name lookup to instantiation time. We do this by artificially making it a dependent name, by using a class template that inherits from our befrieded class. Change-Id: I12b427f1fe9503df819ea5436d780972d6402e68 Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
* | | Q_ARRAY_LITERAL: fix the checks on the payload's datatypeGiuseppe D'Angelo2019-06-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The check was a misnomer -- non-POD types can go in unions since C++11. And we may want them, e.g. types without a trivial default constructor. What we really want is to check for a literal type (so that the array payload can be built entirely at compile time, and put in .rodata). So, amend the check. Also, make the dummy array constexpr, to be sure that we are indeed building the payload using constexpr constructors. That would make the first check redundant, but the fact that we're still using a macro for constexpr makes me think that not all compilers support it, so I'm leaving the first check in... Change-Id: I9f1473aa74dff5b6b6535ae4cd8325451c0b18e6 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | Move away from using 0 as a pointer constantAllan Sandfeld Jensen2019-06-0714-56/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | Cleans up most of corelib to use nullptr or default enums where appropriate. Change-Id: Ifcaac14ecdaaee730f87f10941db3ce407d71ef9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Deprecate QLatin1LiteralGiuseppe D'Angelo2019-06-101-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's an undocumented typedef for QLatin1String. [ChangeLog][QtCore][QLatin1Literal] The undocumented QLatin1Literal type alias for QLatin1String is now deprecated. Use QLatin1String instead. Change-Id: I05eba8b857454e59b9b9d7b07c42fe6fc9c77fec Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Simplify {to,from}Std{List,Vector}Giuseppe D'Angelo2019-06-102-12/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | Use the newly-added range constructors. Change-Id: I7f1d2699d88656fb7dddd11a9d781d810d45b0b4 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>