summaryrefslogtreecommitdiffstats
path: root/src/corelib
Commit message (Collapse)AuthorAgeFilesLines
* Fix UB in QProcess deprecation warning fixesJoerg Bornemann2020-03-061-1/+2
| | | | | | | | The commits e1e08629 and 66e905b1 introduced undefined behavior. Fix this by assigning the result of takeFirst to a temporary. Change-Id: I9e29412cf632d4836b95d47e12d8c07ab0645fbb Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Doc: Mark QColorSpace enum as introduced in Qt 5.15Kai Koehne2020-03-061-2/+2
| | | | | Change-Id: Ibf2da1ebb4eb9520a2a507ed6afb89f7176391bb Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Doc: Fix \sa link for QResource::uncompressedData()Kai Koehne2020-03-061-1/+1
| | | | | | | | No point in linking to itself. Change-Id: Id0bf3fa6878417e541ec0997d34758b0c59e99b3 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix deprecation warning in QProcess::execute(QString)Joerg Bornemann2020-03-051-5/+3
| | | | | | | | Implement this method in terms of splitCommand and QProcess::execute(QString, QStringList). Change-Id: I1fe78fb53d8b6b34a8796f9fbda380a98a840c99 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QLoggingRegistry: use QStringView/QLatin1String moreMarc Mutz2020-03-052-26/+22
| | | | | | | | | | | | | | | | | - QLoggingRule::parse() and the ctor take pattern as QStringView - parseNextLine takes lines as QStringView and produces the pattern as QStringView for QLoggingRule - (setContent has to wait for QStringTokenizer) - QLoggingRule::pass()'s first argument is always QLatin1String, so take it as one Use chopped() more, add a std::move(). Change-Id: Ic95ea77464a9922fef452846bc6d5053bd5de56e Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QLatin1String/QStringView: add (missing) member compare()Marc Mutz2020-03-054-6/+53
| | | | | | | | | | | [ChangeLog][QtCore][QLatin1String] Added compare(). [ChangeLog][QtCore][QStringView] Added compare() overloads taking QLatin1String, QChar. Change-Id: Ie2aa400299cb63495e65ce29b2a32133066de826 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QString/QByteArray: make all symmetry-checked member-compare() combinations ↵Marc Mutz2020-03-053-4/+31
| | | | | | | | | | | | | | | | | | | noexcept In QByteArray, they were just not marked as such. In QString and QStringRef, the implicit conversion from QChar to QString would destroy it. Add a QChar overload, delegating to QStringView. Added docs for the new overloads, copying from the nearest neighbor so as to not look out of place. All string classes use different wording for these functions. A cleanup of this state of affairs is out of the scope of this patch. Change-Id: I0b7b1d037aa229bcaf29b793841a18caf977d66b Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Android: Bump gradle (plugin) versionsBogDan Vatra2020-03-041-0/+5
| | | | | | | | | Move min & target sdk from AndroidManifest.xml to build.gradle Fixes: QTBUG-70817 Change-Id: Id9bb9825a3232587e0255b2d3d6f0273c5f9b66a Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* QMimeXMLProvider: fix another issue with -no-mimetype-databaseThiago Macieira2020-03-032-5/+10
| | | | | | | | | | | The compiler must emit the destructor for the members of a class in an inline constructor, in case the constructor throws. This won't work in Qt 5.15 due to QList requiring knowing whether QMimeMagicRuleMatcher is trivial or not. Another solution would be to use QVector. Fixes: QTBUG-82547 Change-Id: Ia8b65350cd5d49debca9fffd15f79db872ed7c0c Reviewed-by: David Faure <david.faure@kdab.com>
* Add operator-> to the key-value iterator for QHash and QMapIvan Čukić2020-03-032-3/+36
| | | | | | | | | | | | | | This patch adds the arrow operator to the stl-like key-value iterator (QKeyValueIterator) for QMap and QHash. This allows using normal member access syntax it->first and it->second instead of having to use (*it).first and (*it).second. [ChangeLog][QtCore][Containers] Added operator-> to the key-value iterator for QHash/QMap. Change-Id: I9cfa6480784ebce147fcfbf37fec5ad0080e2899 Reviewed-by: Vitaly Fanaskov <vitaly.fanaskov@qt.io>
* QEventDispatcherWin32: unregister event notifiers on closeAlex Trotsenko2020-03-033-4/+10
| | | | | | | | | | | | | | | | | | When QEventDispatcherWin32::closingDown() is called, threadData->eventDispatcher is already nullptr and the application will no longer process the events. Thus, just as it works for socket notifiers and timers, it makes sense to disable all active event notifiers at this point. Otherwise, it seems possible that an object in signalled state can provoke a data race in the notifier's callback on 'edp' pointer, if QWin32EventDispatcher destructor is running simultaneously. Task-number: QTBUG-64152 Task-number: QTBUG-70214 Change-Id: I6e77f3eeca1b0ea639021e73b86798cba0200ebf Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Fix missing return-type in doc of qfloat16::copySign()Edward Welbourne2020-03-031-1/+1
| | | | | Change-Id: I617081fe3335a85191be7882578644621d5ffede Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Suppress warnings where QString and its tests use SplitBehaviorEdward Welbourne2020-03-031-0/+3
| | | | | | | | This is a follow-up to commit 895939c7f91d0c8424a0638c42d05cb42293a142 to fix deprecation warnings it added. Change-Id: I3d86655ec2c84c1bdcac9c70436075fc78f2f781 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QMap: undeprecate QMap::count(Key)Mårten Nordheim2020-03-032-32/+19
| | | | | | | For compatibility with std::map Change-Id: Icba536244aadcad97c59dfd4bb22a7fdea881a7b Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QMap/QHash: Use versioned deprecation macroMårten Nordheim2020-03-032-10/+10
| | | | | | | Because then it can be configured Change-Id: Ib4c20dd64bedfe2ebadf13283698c50d4c0bc527 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Undeprecate QHash::count(Key)Mårten Nordheim2020-03-032-29/+14
| | | | | | | For compatibility with std::unordered_map. Spotted in the API review. Change-Id: Ic34600d55baebcbbf115c1090cd555984037c44c Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Avoid UB in QList::removeAt()Lars Knoll2020-03-031-2/+5
| | | | | | | | | | | Always keep the out of bounds check for backwards compatibility, but warn about it, so that we can remove it in Qt 6. Amends commit ebf695bc779a63a5730df05ab246305c0ab342e4 Change-Id: I3f1e7e8f9f20feb0b0f06ff9083c26682f1c7d3b Reviewed-by: Richard Öhlinger <richard.oehlinger@adbsafegate.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Warn about Q(Date|Time)+ switching to C locale in Qt 6Edward Welbourne2020-03-031-0/+24
| | | | | Change-Id: I3a3afc3fb4ddca405a75097feb15aee0e72b3b19 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Make QProcess::splitCommand accept QStringView, as per header reviewVolker Hilsheimer2020-02-282-2/+2
| | | | | | | | | A static function that only parses the string to create the list, so no need for a QString overload. Change-Id: I1df297adb795095d6eec94ccfcad52498178a7b1 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Deprecate QString::SplitBehavior in favor of Qt::SplitBehaviorEdward Welbourne2020-02-282-34/+101
| | | | | | | | | This requires changing which of the two families of methods gets to take a default argument for its behavior. Task-number: QTBUG-81853 Change-Id: I6759bedd9af364d6e12bb39cd539b5dcba37027e Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* De-inline Qt::SplitBehavior splitters of QString and QStringRefEdward Welbourne2020-02-284-81/+142
| | | | | | | | | | | Convert the QString::SplitBehavior variants to call them, rather than the other way round and convert the internal infrastructure to use Qt::SplitBehavior, ready to deprecate the QString::SplitBehavior versions without generating intenal warnings. Task-number: QTBUG-81853 Change-Id: Ia6b78881c3d0e30a7bbd4dfd00cc15a407f448a2 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Core: Use Qt::SplitBehavior in preference to QString::SplitBehaviorEdward Welbourne2020-02-2811-13/+14
| | | | | | | | The Qt version was added in 5.14 "for use as eventual replacement for QString::SplitBehavior." Move another step closer to that goal. Change-Id: I446f9ddc8f8de4a0b79b09edb44f7c1496fbc33f Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Docs: Use Qt::SplitBehavior in preference to QString::SplitBehaviorEdward Welbourne2020-02-281-7/+7
| | | | | | | | | | | The Qt version was added in 5.14 "for use as eventual replacement for QString::SplitBehavior." Move another step closer to that goal. Applied suitable wrapping round various char and string literals, since docs are meant to show best practice. Change-Id: Ie061905fad26f9b4dda3eedba4612704f0a19126 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Doc: Fix punctuation for QMetaType::QMetaType()Kai Koehne2020-02-281-1/+1
| | | | | Change-Id: I99d78ae475844f3d145952fd789c5753979745f7 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Doc: Fix documentation for deprecated methods in QJsonDocumentKai Koehne2020-02-281-4/+10
| | | | | | | | \deprecated has to stand on its own - qdoc will ignore anything on the right side of it. Change-Id: Ib698aa66826d6430bbafd926a9c64febd5463c5c Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Doc: Fix wording of operator=!(QMetaType, QMetaType()Kai Koehne2020-02-281-1/+1
| | | | | Change-Id: I02ca10f968acb42a6e0d793cad78d7d0baa7f472 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Doc: Replace 'In alternative' with 'Alternatively'Kai Koehne2020-02-281-1/+1
| | | | | | | Amends b19220d17fa66de5ded41690ffff263ee2af5c63 Change-Id: Ic6869ce77440b43b30248f1130dabe8cc1b231e9 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* QConcatenateTablesProxyModel: Add getter for sourceModelsKai Uwe Broulik2020-02-272-0/+12
| | | | | | | | Currently, there's no generic way to get the source models as there's only calls to add or remove them. Change-Id: I23cdef7c93328b58a80ec4659b44073f8ff05088 Reviewed-by: David Faure <david.faure@kdab.com>
* QMimeXMLProvider: add missing semi-colon in the #else caseThiago Macieira2020-02-271-1/+1
| | | | | | Fixes: QTBUG-82547 Change-Id: Ia8b65350cd5d49debca9fffd15f74e22c0536805 Reviewed-by: David Faure <david.faure@kdab.com>
* Merge "Merge remote-tracking branch 'origin/5.14' into 5.15"Lars Knoll2020-02-271-0/+4
|\
| * Merge remote-tracking branch 'origin/5.14' into 5.15Lars Knoll2020-02-271-0/+4
| |\ | | | | | | | | | Change-Id: I4212d070d5752275085e754b96f0392113604dba
| | * QObject: treat T* -> bool conversions as narrowingMarc Mutz2020-02-261-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Following wg21.link/LWG3228, it was found that a proper variant fix requires that T* -> bool conversions be treated as narrowing conversions in subclause wg21.link/dcl.init.lst. wg21.link/P1957R2 was accepted in Prague 2020 as a DR and retroactively applies to older C++ standards. Since we hard-code the algorithm of [dcl.init.lst], we can and must add this manually. [ChangeLog][QtCore][QObject] For the purposes of QT_NO_NARROWING_CONVERSIONS_IN_CONNECT, pointer (incl. pointer-to-member) to bool conversions are now considered narrowing. This matches the resolution of a defect report in C++ itself. Change-Id: Ifa9a3724c9c8ccd3dd6614928dbbe37477591dc1 Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
* | | Fix QDateTimeEdit's handling of invalid time in dst gapVolker Hilsheimer2020-02-271-0/+8
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During a spring forward, a time-zone omits an hour. A QDateTime with such an hour is invalid, but QDateTimeEdit's handling of this invalid time was not done correctly. With this fix, up/down changes of any field that would result in an invalid date-time corrects the time to be valid, while leaving as much as possible of the user-entered data unchanged. To do that, we rely on QDateTime::toMSecsSinceEpoch to return a value even for such an invalid time, which then can be used to construct a valid QDateTime. Edits that would result in an invalid hour are reverted to the previous when pressing return, if correctionMode is CorrectToPreviousValue. This change also implements support for CorrectToNearestValue, which uses the same mechanism as when stepping over an invalid time. Include a test that verifies that the various interactions result in a reasonable value. Since QDateTimeEdit does not respect the timezone or timespec of the QDateTime it is initialized with, we have to find the first hour of daylight saving time for a year that we know works for most time zones. Failing that, we have to skip the tests. Verified in a wide range of time zones. Change-Id: I05b906ae3b5f6681891d23704f00f9c10cd479ae Fixes: QTBUG-79803 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | Add an expansion limit for entitiesLars Knoll2020-02-264-2/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Recursively defined entities can easily exhaust all available memory. Limit entity expansion to a default of 4096 characters to avoid DoS attacks when a user loads untrusted content. Added a setter and getter to allow modifying the expansion limit. [ChangeLog][QtCore][QXmlStream] QXmlStreamReader does now by default limit the expansion of entities to 4096 characters. Documents where a single entity expands to more characters than the limit are not considered well formed. The limit is there to avoid DoS attacks through recursively expanding entities when loading untrusted content. The limit can be changed through the QXmlStreamReader::setEntityExpansionLimit() method. Fixes: QTBUG-47417 Change-Id: I94387815d74fcf34783e136387ee57fac5ded0c9 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* | QHash/QSet: Base iterator tag on warning version rather than deprecationMårten Nordheim2020-02-262-52/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If you have deprecation warning version set to 5.15 and the "disable deprecated before" set to something lower then it will complain about usage of operator-- inside std::distance which is used in our generic collection iterator. This also required changing over to the QT_DEPRECATED_VERSION_5_15 macro so that the deprecation warning would also be disabled. This is a possible work-around - change the iterator tag if it would trigger a warning. Fixes: QTBUG-82397 Change-Id: I3e0ecae5edebba2a3560e7c3785bd9d1a6d0076d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Improve argument name for std::function argumentAllan Sandfeld Jensen2020-02-264-19/+19
| | | | | | | | | | | | | | | | | | | | | | | | Less \a fun though. Note using references in this API would just duplicate the API, but still end up with a copy when creating the QRunnable. By having the copy apparent directly in the API, we not only save the duplication, we also hint to the caller to use move if they want to avoid a copy. Change-Id: If11476d4b38853839c1e87e0339807a1798fc875 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2020-02-263-12/+12
|\| | | | | | | Change-Id: Iad459349ea8b4090d79b4771bfff8f656a8a8189
| * Use QT_DEPRECATED_X instead of Q_DECL_DEPRECATED_XThomas Sondergaard2020-02-253-12/+12
| | | | | | | | | | | | | | | | | | Allow deprecation warnings to be controlled with QT_NO_DEPRECATED_WARNINGS. Fixes: QTBUG-82424 Change-Id: I6df55ee2abaf4c141ac9b0e7661e46ba3706b20e Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Rename AA_MSWindowsDisableVirtualKeyboard to AA_DisableNativeVirtualKeyboardAndre de la Rocha2020-02-252-5/+5
| | | | | | | | | | | | | | | | | | | | | | Renaming the attribute to make it platform-independent, since in spite of currently being supported only on Windows, it may be eventually supported on other platforms where it may be useful. Task-number: QTBUG-76088 Change-Id: Id98ccd7a34e1c43b1f2274efce6ab4b4aff24f03 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Doc: Fix documentation warnings for Qt CoreTopi Reinio2020-02-259-20/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - QCborError: Classes cannot relate to header files; use \inheaderfile instead and link to the class from header file documentation. - QRecursiveMutex: QDoc doesn't allow shared documentation comments for duplicating \fn docs between the base and deriving classes. Remove the sharing, the function documentation is available under 'All Members' doc for QRecursiveMutex. - QMultiMap: unite() and one overload of insert() were not recognized because their definitions in the same header file interfered with QDoc - use Q_CLANG_QDOC macro to comment them out, and tag \fn comments to ensure that the function documentation is matched. Change-Id: Ic96869904a72d92453e4ffa6901000147571969b Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2020-02-222-1/+7
|\| | | | | | | Change-Id: Iace12004afdfe765a3068dfcf6f1320c1123c539
| * Replace usage of std::result_of with decltypeMårten Nordheim2020-02-211-1/+1
| | | | | | | | | | | | | | | | It's slated for removal in c++20 Fixes: QTBUG-82240 Change-Id: I7b35c151413b131ca49b2c09b6382efc3fc8ccb6 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| * QString: Add missing number() crosslinks to setNum()Andre Hartmann2020-02-201-0/+6
| | | | | | | | | | | | Change-Id: I22a4c86034b399782115bb078c298b211095476a Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | Doc: Remove \pagekeywords commandTopi Reinio2020-02-211-2/+0
| | | | | | | | | | | | | | The command does nothing, it was not implemented by QDoc. Change-Id: Id1e5fcc02101723e9089df55d9f8949e50c89b3f Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | Back out of calendar support in Qt::DateFormat methodsEdward Welbourne2020-02-202-28/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We're deprecating the locale-specific date-formats, which are the only ones that use the calendar. The QDateTime::toString() variant was new in 5.15, so we can simply remove it again. The QDate one was present in 5.14, so we need to keep it; deprecated it at 5.15 for removal at Qt 6. [ChangeLog][QtCore][QDate] QDate::toString(Qt::DateFormat, QCalendar) no longer takes calendar into account for Qt::TextDate. There was no matching support in QDateTime and the locale-independent formats are intended to be standard, rather than customized to the user. Fixes: QTBUG-82178 Change-Id: I09db8a82ec5a4eab22f197790264fa3a3724e383 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | QMultiMap: Work around compiler problem in MSVC 2017Oliver Wolff2020-02-201-19/+18
| | | | | | | | | | | | | | | | | | | | In more complex projects (like MuseScore) it is possible, that MSVC 2017 chokes on the usage of "using typename ...". Just fully specify the iterators when they are used. Fixes: QTBUG-82166 Change-Id: I5e7882a0963445fc8529cfcb59d2aae606a2777e Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Merge "Merge remote-tracking branch 'origin/5.14' into 5.15"Liang Qi2020-02-186-11/+8
|\ \
| * | Merge remote-tracking branch 'origin/5.14' into 5.15Liang Qi2020-02-186-11/+8
| |\| | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/tools/qlinkedlist.h src/plugins/platforms/wasm/qwasmintegration.cpp src/plugins/platforms/wasm/qwasmscreen.cpp Change-Id: Iefca7f9f4966bdc20e7052aca736874861055738
| | * wasm: add platform qsettingsLorn Potter2020-02-185-31/+276
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since the backend is async, the settings will not be ready to read/write instantly as on other platforms, but only be ready after the filesystem has been synced to the sandbox. This takes at least 250 to 500 ms. The QSettings status() or isWritable() can be used to discern when the settings are ready for use. This also fixes a crash in threaded wasm Task-number: QTBUG-70002 Change-Id: I080bdb940aa8e9a126d7358b524f32477db151b6 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
| | * wasm: fix crash when qtvkb tries to load a pluginLorn Potter2020-02-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We do not have dlopen, harfbuzz seems to try and load the thai plugin using dlopen when just iterating through the language selector in virtualkeyboard.. Fixes: QTBUG-78825 Change-Id: Iee064a1d9a628784e3ce46d641cd157a69bcb696 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>