summaryrefslogtreecommitdiffstats
path: root/src/core5/text
Commit message (Collapse)AuthorAgeFilesLines
* Improve documentation of QStringRef::compareJaishree Vyas2023-12-121-37/+36
| | | | | | | | | | Same as other compare() overloads for consistency and better understanding. Pick-to: 6.7 6.6 6.5 6.2 Task-number: QTBUG-114822 Change-Id: Ie847a26adfd2367bd4601611dca42183da8f24ab Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Fix QStringRef::trimmed()Shawn Rutledge2023-07-251-3/+3
| | | | | | | | | | After qtbase 9d4cd4a63e073a4662ebb189e4d3a0fe6225fb49 trimmed_helper_positions() takes one argument and returns {begin, end} positions. But QStringView::trimmed() is independent of that. Change-Id: I3e397f731a6db7b6f6b3b30ed357c83b9423cd75 Reviewed-by: Ahmad Samir <a.samirh78@gmail.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QStringRef: drop dependency from QAbstractConcatenableVladimir Belyavsky2023-06-121-1/+1
| | | | | | | | It's useless and we may want to drop QAbstractConcatenable entirely in the future. Change-Id: I20ebb325996c143bc5b3839295bab2cd165795cd Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Port to new Q_UNREACHABLE_RETURN()Marc Mutz2022-10-191-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a semantic patch using ClangTidyTransformator to convert sequences of Q_UNREACHABLE() + return into Q_UNREACHABLE_RETURN(), newly added to qtbase. const std::string unr = "unr", val = "val", ret = "ret"; auto makeUnreachableReturn = cat("Q_UNREACHABLE_RETURN(", ifBound(val, cat(node(val)), cat("")), ")"); auto ignoringSwitchCases = [](auto stmt) { return anyOf(stmt, switchCase(subStmt(stmt))); }; makeRule(stmt(ignoringSwitchCases(stmt(isExpandedFromMacro("Q_UNREACHABLE")).bind(unr)), nextStmt(returnStmt(optionally(hasReturnValue(expr().bind(val)))).bind(ret))), {changeTo(node(unr), cat(makeUnreachableReturn, ";")), // TODO: why is the ; lost w/o this? changeTo(node(ret), cat(""))}, cat("use ", makeUnreachableReturn)); a.k.a qt-use-unreachable-return. subStmt() and nextStmt() are non-standard matchers. Change-Id: I3855b2dc8523db1ea860f72ad9818738162495c6 Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* Port from container::count() and length() to size()Marc Mutz2022-10-053-32/+32
| | | | | | | | | | | | | | | | | | | This is a semantic patch using ClangTidyTransformator as in qtbase/df9d882d41b741fef7c5beeddb0abe9d904443d8: auto QtContainerClass = expr(hasType(namedDecl(hasAnyName(<classes>)))).bind(o) makeRule(cxxMemberCallExpr(on(QtContainerClass), callee(cxxMethodDecl(hasAnyName({"count", "length"), parameterCountIs(0))))), changeTo(cat(access(o, cat("size"), "()"))), cat("use 'size()' instead of 'count()/length()'")) a.k.a qt-port-to-std-compatible-api with config Scope: 'Container', with the extended set of container classes recognized. Change-Id: I2b14fe7f6a317f340e306b53930db98ec8d10098 Reviewed-by: Sona Kurazyan <kurazyan.sona@gmail.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* qt5compat: opt in to reduced includesFabian Kosmale2022-07-301-0/+1
| | | | | | | | | And add previsouly transitive includes explicitly. Task-number: QTBUG-97601 Pick-to: 6.4 Change-Id: I553d81000714d3f85341039d662304ae4b3750ed Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* QRegExp: include the QRegularExpression porting docsSona Kurazyan2022-07-281-128/+1
| | | | | | | | | | | | | | The docs are moved to: qtbase/doc/global/includes/corelib/port-from-qregexp.qdocinc Remove the old docs and include the docs from qtbase. Task-number: QTBUG-89702 Pick-to: 6.4 6.3 6.2 Change-Id: Idc2f8cc30e8b104e58b5b0260660495992bbc546 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Eradicate QT_STRINGVIEW_LEVEL usesMarc Mutz2022-07-182-22/+0
| | | | | | | | | | It's not used and not useful. Task-number: QTBUG-100861 Pick-to: 6.4 6.3 6.2 Change-Id: Ibbb609af4bcaf504d1cbc799328d01f7c3821101 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Prepare for adding -Wshorten-64-to-32 to headerscleanTor Arne Vestbø2022-07-091-2/+2
| | | | | | | Pick-to: 6.4 6.3 6.2 Change-Id: I52074fc67909c05daae6d750fc9bf9294d55eaf4 Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Use SPDX license identifiersLucie Gérard2022-06-234-157/+13
| | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. License files are organized under LICENSES directory. Pick-to: 6.4 Task-number: QTBUG-67283 Change-Id: I52b9410c22909f4253094d2458d309e7f6ad2620 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Qt5Compat: replace qSwap with std::swap/member-swap where possibleMarc Mutz2022-05-091-1/+1
| | | | | | | | | | | | | | | | | | | | | qSwap() is a monster that looks for ADL overloads of swap() and also detects the noexcept of the wrapped swap() function, so it should only be used when the argument type is unknown. In the vast majority of cases, the type is known to be efficiently std::swap()able or to have a member-swap. Call either of these. For the common case of pointer types, circumvent the expensive trait checks on std::swap() by using our hand-rolled qt_ptr_swap() template, the advantage being that it can be unconditionally noexcept, removing all type traits instantiations. As a drive-by, remove superfluous inline keywords and template ornaments. Task-number: QTBUG-97601 Pick-to: 6.3 6.2 Change-Id: I7a73d45a282a9e13082178692fed8afec7bae823 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Remove uses of deprecated QString::count()Sona Kurazyan2022-03-161-1/+1
| | | | | Change-Id: I14527f21c72d61dc8acd4aa1c5aee1b706b11c7d Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Remove left-over .pri filesJoerg Bornemann2021-05-051-8/+0
| | | | | | Task-number: QTBUG-88742 Change-Id: Icf25ba58111edcba528dddca7c03bdae423033fa Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Replace discouraged Q_MOVABLE_TYPE by Q_RELOCATABLE_TYPEAndreas Buhr2020-12-221-2/+2
| | | | | | | | | | | | | Q_MOVABLE_TYPE was conceived before C++ had move semantics. Now, with move semantics, its name is misleading. Q_RELOCATABLE_TYPE was introduced as a synonym to Q_MOVABLE_TYPE. Usage of Q_MOVABLE_TYPE is discouraged now. This patch replaces all usages of Q_MOVABLE_TYPE by Q_RELOCATABLE_TYPE in Qt5Compat. As the two are synonymous, this patch should have no impact on users. Task-number: QTBUG-86829 Change-Id: I8e4f523e7d9a8c8900dabae1476631d269645b52 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Fix compile warning from potentially unused overloadVolker Hilsheimer2020-11-261-1/+1
| | | | | | | | On macOS's clang 12, the foldCase overload for char32_t is not used, which generates a compile warning. Change-Id: I68e2e2f00d2c1da7c692fee1f80d900df42895f2 Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
* Doc: Remove obsolete tag from classesKai Koehne2020-11-261-1/+0
| | | | | | | | | | | The module itself is for obsolete API, so there's no point in marking the class also as obsolete. This makes sure that all classes show up e.g. in qtcore5compat-module.html Pick-to: 6.0 6.0.0 Change-Id: I62a98c94c88d748ae056e3f6caf0a7fb74e657a6 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Doc: Fix documentation warningsTopi Reinio2020-10-191-6/+7
| | | | | | | | | | - Remove linking to non-existent functions and examples - Add external linking to Qt 5 docs for codecs - Add missing snippets and dependencies Fixes: QTBUG-87656 Change-Id: Ic9ea72a36ffc4fcdea136d7daa549b524301697b Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Fix the failing buildSona Kurazyan2020-10-071-2/+2
| | | | | | | Fixed the failure caused by fa8d021fa6fcb040fb702b6ffd2deee52a3b748a. Change-Id: I4e686c5ca21a31ad1996d8a6a3ab181257df2b20 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Fix compilation with C++14 [[deprecated]]Allan Sandfeld Jensen2020-10-051-37/+37
| | | | | | | | | Attributes must be on the beginning of the line and not on friend statements. Change-Id: I2ae05e8f3fa6e7a897a6d6305adc86d2b3851cea Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Fix forward-declaration of QStringListAdriaan de Groot2020-09-161-1/+1
| | | | | | | | | | Use qcontainerfwd.h instead of ad-hoc forward declaration (in particular, because `class QStringList` is no longer compatible with the type alias it is now) Change-Id: I77510d9912748ec417d720686f690c15894019de Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Move files from core5 to the subdirectories they belong toKarsten Heimrich2020-08-273-2/+5190
| | | | | | | | | | Some of Qt5Compat features are organized in their own subdirectories, while others reside directly in core5. Moved QRegExp to "text" subdirectory and added a new "tools" subdirectory for QLinkedList. The structure is now similar to what we had in Qt Core. Change-Id: Ibfb3546fd317520f493a6c14091428d813c311bc Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
* Move QStringRef and remains into Qt5CompatKarsten Heimrich2020-08-243-0/+2581
Task-number: QTBUG-84437 Change-Id: Ia18737f63995164edf2857321070913969518cf1 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>