| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
| |
Resolves multiple QDoc warnings of type "No output generated for X::Y
because X is undocumented."
Pick-to: 6.11
Task-number: QTBUG-141665
Change-Id: I9b2d7b1ecfb694316e32801839f89d543ea2f861
Reviewed-by: Topi Reinio <topi.reinio@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixes the following QDoc warnings:
* (qdoc) warning: Can't link to 'qt_add_android_permission()'
* (qdoc) warning: Can't link to 'raiseError(const QString &message)'
-> raiseError() now takes QAnyStringView
* (qdoc) warning: Can't link to 'I18N Example'
* (qdoc) warning: Can't link to 'Hello tr() Example'
-> Examples were removed, replace with 'Localized Clock' example
* (qdoc) warning: Can't link to
'QCharConverter::FinalizeResult::Error::NoError'
Pick-to: 6.11
Change-Id: I8e11a8896dd10652852e81c5d7ddf080f69aba37
Reviewed-by: Topi Reinio <topi.reinio@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
GCC says that CaseConversion::Upper is ambiguous between
- struct QUnicodeTables::CaseConversion
- enum class QtIcuPrivate::CaseConversion
In a -unity-build, those two entities are in-scope at the same time,
so disambiguate by renaming the entity with narrower scope.
The alternative, fully qualifying the enum uses with the QtIcuPrivate
namespace would have caused similar churn, and would have run the risk
of being removed again by the mythical maintenance programmer, due to
use of "using namespace QtIcuPrivate;" in at least some of the
functions that refer to the enum.
Amends eaf77edebdf1c0b1682c28c014f2d81479af0051, which added the
conflicting QUnicodeTables::CaseConversion and/or
6f4d64b21ec90a792c7c8308a6615ca87b9ea6eb, which added
QtIcuPrivate::CaseConversion, which this patch changes now.
Pick-to: 6.10 6.8 6.5
Task-number: QTBUG-109394
Change-Id: I1f6379a200ae0cea5befd5d6cf210be14c0344f0
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Include two new languages, Ladin and Shan, and document the various
languages and scripts that show up in the cldr2qlocalexml.py output,
that I have checked and seen to contain inadequate information. This
may make it easier for future updaters to spot new unknown codes when
they show up.
These are not picked back to past versions because they're naturally
documented as [since 6.11] and picking would involve each past branch
getting a minor version as its since.
Fixes: QTBUG-141949
Change-Id: If0cb3e3b33cd3ce636fd29e904a9ddd617940314
Reviewed-by: Mate Barany <mate.barany@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The code to trim trailing zeros from z (or zz, but not zzz) format
correctly checked for whether the text ended with the locale's zero,
but incorrectly chop(1)ed to remove the zero, neglecting the
possibility that the zero is longer. Noticed while checking where else
we used QLocale::zeroDigit() possibly naively.
Add Fulah-Adlam tests for milliseconds, which confirmed the problem
does actually appear. Fix dropping of trailing zeros from millis.
Pick-to: 6.10 6.8 6.5
Change-Id: Id080f082b2890a102809ba8d0f687d55ac082357
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
This is just the plain upgrade without adding new languages.
It required two changes to expected data in tests.
[ChangeLog][QtCore][Third-Party Code] QLocale now uses v48 of the
Unicode Consortium's Common Locale Data Repository (CLDR).
Pick-to: 6.10 6.8 6.5
Task-number: QTBUG-141949
Change-Id: I8d3a299c602e6cd5ea76c6bc479028aeda8b8e50
Reviewed-by: Mate Barany <mate.barany@qt.io>
|
| |
|
|
|
|
|
|
|
|
| |
Pointed out by Marc in code review.
Drive-by, use \c to markup ushort.
Pick-to: 6.10 6.8 6.5
Change-Id: I81e9997bd07d3c8e4093f42b3a9c2068d8ba4e6e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As mentioned in QTBUG-141899, we were not considering the projection
itself can throw when designing exception safety in
QArrayDataOps::assign(). The fix will be to inspect the projection for
noexcept'ness, and, failing it, take a slower path. To prevent that
from pessimizing QString::assign(), mark the projection lambda as
noexcept.
Amends f5ed163c19c4a165a61e6fbfdaf5ee39b5587a0c.
Task-number: QTBUG-141899
Pick-to: 6.10 6.8
Change-Id: I14f798398cf0e59cfbb167994f66e802d6271e1a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
|
| |
|
|
|
|
|
| |
This de-duplicates the code.
Change-Id: Ia40131ccd0d45e32794ea059c8fe9e310df98812
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
|
| |
|
|
|
|
|
| |
To ease using QStringAlgorithms mehtods in the next commit.
Change-Id: Ia523c0dcc818dac6c1a1e9eecab71134a227e04c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Since 2024, the preferred upper-casing of ß in the German locale is ẞ,
not SS. See https://en.wikipedia.org/wiki/%C3%9F reference [5].
[5] https://www.rechtschreibrat.com/DOX/RfdR_Amtliches-Regelwerk_2024.pdf,
specifically §25 E3 on p.48 (German only).
Qt currently implements the old semantics, by following
Unicode. Document the work-around needed to get the new behavior.
Task-number: QTBUG-141534
Pick-to: 6.10 6.8 6.5
Change-Id: I0fe5c9d4f454f8e4dce84767deecdd9aa55bfab5
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Like getWordBreaks(), this one is a bit more complicated than the
first two, since there's a nested loop. Solve it by using a copy of
the QStringIterator for look-ahead loop.
To see that old and new version are equivalent, observe that qsizetype
`i` and `lookahead` always pointed _onto_, while QStringIterator
always points to just _after_ the last-consumed code-unit.
Pick-to: 6.10 6.8 6.5
Change-Id: Id272b1a1597912eb611acb544b5ef0ac1d13a754
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
This one is a bit more complicated than the previous two, since
there's a nested loop. Solve it by using a copy of the QStringIterator
for look-ahead loop.
To see that old and new version are equivalent, observe that qsizetype
`i` and `lookahead` always pointed _onto_, while QStringIterator
always points to just _after_ the last-consumed code-unit.
Pick-to: 6.10 6.8 6.5
Change-Id: I391fafcf2418dac39b4aea3b3a3a675114233dff
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
After fixing the roundabout way of updating 'eor' in a previous
commit, this is now trivial (no nested loop).
Amends c20422af13fb30751eaa58e8755c7a9a7fd20a50.
Pick-to: 6.10 6.8 6.5
Change-Id: Idbbfc503f4bf3878d1fc57729224c99973bddc32
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
We know they're SG, so don't go through the properties trie, hard-code
the result.
As a defense against changes, add checks to the generator and
tst_QUnicodeTools.
This is in preparation of porting getLineBreaks() to QStringIterator.
Pick-to: 6.10 6.8 6.5
Change-Id: Ib3567398ba56f7ad3ce6fbca81f6b0f40379ee7d
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(those which don't have nested loops due to the need for look-ahead).
Use QStringIterator's new nextOrRawCodeUnit() to replace a
Clang-21-Wcharacter-conversion-prone pattern of parsing a UTF-16
string.
Amends cbfdec66033d14020d3e8a49bacc0d12d2b6798e (getGraphemeBreaks();
though that commit merely moved the code there from Harfbuzz) and
824180a12249e48c0e3280fec64940825ce0aa6e (getWhiteSpaces()).
Pick-to: 6.10 6.8 6.5
Change-Id: I26b64fca6a26bb7ea4ab8ad14ba590213e949190
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These entries are quite repetitive, esp. the all-zero entry for
uncased characters (but not only: there are also 137 non-zero
duplicates), and each one takes 8 bytes of the total 20 bytes of
sizeof(Properties).
Make a new array with these entries and only store an index into it in
Properties. The new array happens to have a size of 448 entries (down
from 3372 unique Properties), so 9 bits would suffice for the index,
but a sizeof(Properties) == 14 is probably rather pointless, so add a
reserved field to prop the struct up to 16. That sounds like the ideal
size for rapid indexing and probably improves qGetProp() performance,
esp. if case information is not needed.
Theoretically, this should save 3372 * 4 - 448 * 8 = 9904 bytes. The
TEXT size of libQtCore, however shrinks by a bit more, 10596 bytes, on
optimized Linux AMD64 Clang 19 builds.
Picking to all active branches, because the Unicode tables are
still maintained in all of them.
Fixes: QTBUG-139427
Pick-to: 6.10 6.9 6.8 6.5
Change-Id: If4dc47ef06c674ad0263f0623ec408a25b977b3a
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The old code updated the `eor` variable in the third field of the for
loop, after the increment of the loop variable, `i`, to the then-value
of `i`. The variable was initialized as zero.
This is a very roundabout way of doing things, because, if you look at
it from the right angle, `eor` will always have the value 'i' has when
entering the loop body.
Proof:
- First round: i = 0, eor = 0. So i == eor. Check.
- Next round: i = 1 + whatever value `i` had at the end of the
previous iteration. eor := i, so i == eor. Check.
So rewrite the code to create `eor` at the beginning of the loop body,
with the then-value of 'i'. This allows marking it const, too, and
scoping it correctly, drastically improving readability.
The tighter scoping runs afoul of the assert(eor == string.size())
after the loop, which, however, is pointless, because it's true by
construction: the loop has no break statement, so the only way it can
be exited is by failing the loop condition. At that point, eor := i
and i == string.size(), so eor == string.size().
Partially reverts 3df159ba174c1775a0e77d2305a639eeab1ea71d, but the
loose scope of the variable was present even before that.
Pick-to: 6.10 6.8 6.5
Change-Id: I983aef94caa8a3bc09ab378b8bb9bb4a18dabeb4
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Make 'pos' and 'prop' const, indicating that they're not modified by
the lengthy loop body, and don't re-use 'ucs4' and 'prop' from the
outer loop, make the inner loop have their own versions. This shadows
the outer loop ones, but -Wshadow is not in effect in implementation
files. I found it more important to avoid churn than to rename the
variables to avoid the shadowing. Shadowing is well-defined in C++.
These are in preparation of porting the function to QStringIterator.
Pick-to: 6.10 6.8 6.5
Change-Id: Ia8b136c2cf4c8bc70d7444456adae93aecf6138b
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Make 'pos' and 'prop' const, indicating that they're not modified by
the lengthy loop body, and don't re-use 'ucs4' and 'prop' from the
outer loop, make the inner loop have their own versions. This shadows
the outer loop ones, but -Wshadow is not in effect in implementation
files. I found it more important to avoid churn than to rename the
variables to avoid the shadowing. Shadowing is well-defined in C++.
These are in preparation of porting the function to QStringIterator.
Pick-to: 6.10 6.8 6.5
Change-Id: I2b0c135276ccef403802dba8b780dcbf8c0ed519
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
While fixing Clang 21 -Wcharacter-conversion warnings, I came across
many code snippets that used a pattern like
char32_t ucs4 = string[i];
if (QChar::isHighSurrogate(ucs4) && i + 1 != len) {
ushort low = string[i + 1];
if (QChar::isLowSurrogate(low)) {
ucs4 = QChar::surrogateToUcs4(ucs4, low);
++i;
}
}
(this one from qunicodetools.cpp)
The natural question is why this was never ported to QStringIterator,
and the answer is: because QStringIterator doesn't support this.
Add new functions nextOrRawCodeUnit() (and previousOrRawCodeUnit()),
to fix this shortcoming.
The name of the functions is chosen so that it will work also in a
future UTF-8 string iterator.
Add tests that verify that the old code and the new functions produce
the same series of code points.
Pick-to: 6.10 6.8 6.5
Change-Id: I34ba8e416ee290badc1c16e33b46a17d56741574
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
... where applicable
Simplifies the code.
In some cases, the code queries more than one property of the
character, in which case we keep using qGetProp().
Amends 85899ff181984a1310cd1ad10cdb0824f1ca5118 and
1f73d4b87c153224b4eeee164269d0b313a11a8b.
Pick-to: 6.10 6.8 6.5
Change-Id: I27cc0e5607b1e730f649c9d73f05f6b1227bdd17
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
|
| |
|
|
|
|
|
|
|
| |
Pointed out by Thiago in code review.
Drive by, tighten the scope of the local variables.
Change-Id: Id12af76daac382495cb6abad6a6ecf35cdd1cbc9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
For the rvalue overload the changes are done in-place unless the byte
array is shared, in which case the changes are written to a new array to
prevent detaching.
One immediate beneficiary of this overload is qDecodeDataUrl().
[ChangeLog][QtCore][QByteArray] Added rvalue overloads of
percentDecoded() and fromPercentEncoding().
Change-Id: I2aadfbf93f06a72460ec04692355f73a6c892e30
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
|
| |
|
|
|
|
|
|
| |
We can delegate to QByteArrayView, which now has inline versions of
those two functions, so long as the input is Latin1.
Change-Id: Ica7a43f6147b49c187ccfffd179eb0f3748164b2
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There are no space characters in Unicode outside the BMP at the moment
(QUnicodeTables::MaxSeparatorCodepoint == 0x3000 at this point), but
if there were, the old code would flip the QCharAttributes::whiteSpace
on the low-surrogate position, not the high one, as all other
functions do.
Fix by using the same pattern used by the other boundary-finding
functions: save the index at the start of the loop, and use the saved
value when indexing into attributes[].
Amends 824180a12249e48c0e3280fec64940825ce0aa6e.
Pick-to: 6.10 6.8 6.5
Change-Id: I116a5e1da6c9df5e4237073481d71efbf956f27f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Clang 21 started warning about all conversions between charNN_t types
(since fixed for char16_t → char32_t¹), and QChar appears to be the
only header in QtBase that is affected by it. While char16_t →
char32_t has already been fixed upstream, we ought to have our public
headers clean of even this overzealous warning, so fix them by adding
an explicit cast. I would have used 'char32_t{ucs}', but the warning
is so buggy it's not fixed by braced initialization (filed as upstream
bug report https://github.com/llvm/llvm-project/issues/164220).
Interestingly, the warning does not trigger, for the same code, in
constexpr function, but proactively "fix" those, too, so we don't need
to re-touch these functions later.
As a drive-by, remove the pointless inline keywords from these
functions to make horizontal space for the cast.
Done-with: Thiago Macieira <thiago.macieira@intel.com>
Task-number: QTBUG-141204
Pick-to: 6.10 6.8 6.5
Change-Id: I2a9e46ea4f327fb554418c4649d189a98e15ffae
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Q_PRESUME wraps a Q_ASSERT/[[assume]] and can be used as a stop-gap
until [[assume]] can be used unconditionally. It has stricter
semantics than the deprecated Q_ASSUME and is helpful to silence static
analyzer warnings.
Documentation and [ChangeLog] in the next commit so it won't be
cherry-picked.
Fixes: QTBUG-141074
Pick-to: 6.10
Change-Id: Id5376bcc5e9e9708c836ceff5eea982c2b0e382e
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Tim Blechmann <tim.blechmann@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Same pattern as in the previous few patches: the old code used a
char32_t to temporarily store a UTF-16 code point, narrowing it back
to char16_t in a call to QChar::surrogateToUcs4(), triggering Clang 21
-Wcharacter-conversion.
Solution is also the same: keep the UTF-16 code unit in a separate
variable, until we have determined whether it needs surrogate decoding
or merely promotion to char32_t.
Amends the start of the public history.
Pick-to: 6.10 6.8 6.5
Change-Id: I955948348d637c4fe13485808bef47a4ee58f7bf
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The old code defined four variables outside a complex loop (with a
nested goto). These can all be defined at their point of
initialization, though, improving readability of the function (a tiny
bit...), because the tighter scope makes it obvious that the loop
isn't carrying state in these variables from one iteration to the
next.
The construction is safe, because, in C++, a backwards goto will
destroy all variables declared after the label¹, iow: u2 and c2 are
re-created by each jump though `advance`.
Found while trying to fix char32_t → char16_t narrowing highlighted by
Clang 21's -Wcharacter-conversion.
Fix function has many other problems (most prominently, said goto),
but they're out of scope of this immediate patch series, though they
should eventually be fixed. This is security-critical code; we ought
not have to deal with assembler-esque C++ code in such components.
Amends f4d02ecdbf54987a0bada20fe8f8537e90c051d8.
As a drive-by, change the c variables from char16_t back to ushort,
because they don't represent characters, but character combining
classes, partially reverting 7b04e0012b40203970f27869db2ab3e838ffe359.
¹ https://en.cppreference.com/w/cpp/language/goto.html#Explanation
Pick-to: 6.10 6.8 6.5
Change-Id: If06356483bc77a16812d2790bd98f793bc74faa2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Same pattern as in the previous few patches: the old code used a
char32_t to temporarily store a UTF-16 code point, narrowing it back
to char16_t in a call to QChar::surrogateToUcs4(), triggering Clang 21
-Wcharacter-conversion.
Solution is also the same: keep the UTF-16 code unit in a separate
variable, until we have determined whether it needs surrogate decoding
or merely promotion to char32_t.
Amends 2e0a4b13addf1f56112bac38448be96fb02f650d.
Pick-to: 6.10 6.8 6.5
Change-Id: I291871c73b26a1766c30f0c1c6858e09d9693678
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For years, I've been confused by the various foldCase() overloads,
until Clang 21 -Wcharacter-conversion now forced me down the rabbit
hole.
Turns out that there's just one user of the ch,ch& overload and it's
readily ported to the ch*,ch* overload, so do that and remove the
now-unused overload.
Amends the start of the public history.
Pick-to: 6.10 6.8 6.5
Change-Id: I8ddd22b08423540f58c1a5fe0ef36c93c8b337f1
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
... which triggers Clang 21 -Wcharacter-conversion.
Instead of using the char32_t ucs4 variable to temporarily store the
read from *ch, keep using *ch until we have determined whether it
needs to be decoded as a surrogate pair or can simply be promoted to
char32_t.
Since this touches most lines of the function, anyway, take the
opportunity to rename the first argument from 'ch' to 'cur', and change
pointer arithmetic to indexing operations.
Amends the start of the public history.
Pick-to: 6.10 6.8 6.5
Change-Id: I47a026fd509da8fa3dee4b6be30ac4432148d9c6
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The only caller, ucstricmp(), passes UTF-16 code units, as implied by
the implementation of foldCase(char32_t, char32_t&) (which decodes
surrogate pairs, which shouldn't exist in UTF-32, and, if they do, not
be decoded). Of course, the accumulator variables were char32_t, but
only because C++ enforces this, due to the foldCase() signature.
Fix by taking both arguments as char16_t instead of char32_t.
As a drive-by, don't store the first argument in a char32_t and then
narrow it for the QChar::*surrogate*() calls, use the argument
instead.
Found by Clang 21's -Wcharacter-conversion.
Amends the start of the public history.
Pick-to: 6.10 6.8 6.5
Change-Id: Ic08b695749d7f68353a4af8703eb6a86ba88d567
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The old code used a char32_t to temporarily store a UTF-16 code
point. Upon finding it to be a surrogate, it then had to narrow it
back to char16_t for the call to QChar::surrogateToUcs4(). It also
invoked QChar(uint), a ctor which should have never existed to begin
with.
Rewrite the functions to keep the UTF-16 code point in a char16_t
variable until it's inspected to be either safe for promotion to
char32_t or else has been decoded (or decoding failed). This requires
to write 'uc = c' twice instead of once, but allows us to add a
comment on the failed-decoding path to guide the reader of the code,
improving readability.
Specifically declare `uc` as uninit'ed to provoke compiler warnings
when code is changed to forget to assign to `uc`.
Found by Clang 21's -Wcharacter-conversion.
Amends the start of the public history.
Pick-to: 6.10 6.8 6.5
Change-Id: I8d43b4c0e0b3852ddf730f349886bd6943b94f17
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
|
| |
|
|
|
|
|
|
| |
The implementation was already using the Ops (like in (*this)->emplace),
so this is only natural. We want to access the extra operations anyway.
Change-Id: Id1f422be54154f2c41b0fffd416dcb1916e8f022
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
|
| |
|
|
|
|
|
|
|
|
| |
It brings all the nested namespaces inside the Qt namespace into scope,
which may have unwanted side effects. This is analogous to IWYU, but for
`using namespace` directives.
Pick-to: 6.10 6.8 6.5
Change-Id: I054a701458ca55915e5663e055b754c07b4007d4
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This completes the security marking for this subdirectory:
$ for i in $(find src/corelib/text -type f) ; do
if ! grep -qE '^ *(//|#) .*Qt-Security +score:' "$i"; then
echo "$i"
fi
done
src/corelib/text/qt_attribution.json
The JSON file was also explicitly marked in a previous commit.
QUIP: 23
Fixes: QTBUG-135195
Pick-to: 6.10 6.8
Change-Id: Ia780a061541aa7f16d2b7303d91d747b31ccd2fb
Reviewed-by: Matthias Rauter <matthias.rauter@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
QString and QByteArray are critical, too, and not because of their
ownership semantics, but because of the algorithms operating on
them. Collation is one of those algorithms.
The headers are not decls-only, but they only contain trivial
implementation (like (QChar*, int) -> QStringView forwarders, or the
move SMFs or swap()), so are significant.
QUIP: 23
Task-number: QTBUG-135195
Pick-to: 6.10 6.8
Change-Id: I2e3418fd74b12cbfa297576f25a37ec2ea050902
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Matthias Rauter <matthias.rauter@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In order to support (unscoped) enums, the overload accepted everything
that implicitly converted to q(u)longlong. But like the reporter of
QTBUG-138471 found out, that incorrectly matches types that implicitly
convert to float. Those types used to call the FP-ish overload set in
6.8, but that one is now restricted to actual FP types (by way of
being a template constrained, essentially, on std::is_floating_point),
and a type that converts to float is not itself a floating-point
type. Unfortunately, the int-ish overload accepted the call,
truncating the float to an int for printing.
Fix by being more explicit in the arg(int-ish) constraint, saying
exactly what we want: integrals, enums, but not scoped ones, and
nothing that already matches the string-ish or FP-ish overloads.
[ChangeLog][Potentially Source-Incompatible Changes][QtCore][QString]
Fixed the integral arg() overload to reject types that merely
implicitly convert to an integral type. This was always the intent,
but 6.9 and 6.10.0 incorrectly accepted types that implicitly convert
to float to match this overload, causing truncated results. We now
reject such types. A backwards-compatible fix is to cast such types to
a C++ type whose displayed form matches your intent.
Amends 563ed822f867c6c3040956017d4ca7f3795f172c.
Fixes: QTBUG-138471
Pick-to: 6.10
Change-Id: I6f3b6b93c243df574b878794b6304109d28d58ff
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
... over Qt::Literals::StringLiterals.
The latter works, but is needlessly verbose. Since such code is
copy'n'pasted, use the preferred form everywhere, to avoid
proliferation.
The docs have been fixed to suggest the shortcut in a separate commit.
As a drive-by, move them to their preferred location, after the
QT_BEGIN_NAMESPACE, but only if they were far away to begin with.
Pick-to: 6.10 6.8 6.5
Change-Id: I0325f749f3b5a331d9c6af458a9bd3bb70d4aa3b
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
The latter is needlessly verbose. The nested inline namespaces (in Qt
and std alike) are designed to allow skipping the ::literals
middle-man, so let the docs reflect that.
Amends e440fec7fc729342dce7c8421618a95dab11a36b.
Pick-to: 6.10 6.8 6.5
Change-Id: I6180833647c8a97a272330663f6e5011a196fcb6
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It's "(user-defined) literal operators for Qt string types", not
"(user-defined) string literal operators for Qt types".
The latter sounds like there could be string literal operators for
arbitrary Qt types, which is decidedly not the case. The namespace is
called StringLiterals, yes, but it means "literals for strings", like
chrono_literals means "literals for chrono types".
Amends e440fec7fc729342dce7c8421618a95dab11a36b.
Pick-to: 6.10 6.8 6.5
Change-Id: I728ee02ebc971812d5daa9fcc753093f4c0a20a3
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
CLDR says we shouldn't let them get in the way of parsing. Some
existing data includes them, in various combinations, and the signs
those wrap are alway either U+2212 MINUS SIGN or the ASCII
HYPHEN-MINUS and PLUS SIGN, which are handled by special cases in any
case. So simply skipping over the invisibles, when they are
encountered and not matched as part of some other CLDR-supplied token,
suffices.
In order to handle the invisibles (and any we see fit to skip in
future), turn the last few quirk cases of nextToken() into a switch
that deals with the invisibles and startsWith() checks of the other
quirks. The diff is best viewed with leading space changes ignored.
This fixes some test-cses created explicitly to expose this issue. It
also turns some previously-invalid test-cases into valid ones, where
I'd tested (as part of the Qt 6 fixing of misguided "single character"
assumptions) that using only the "first character" of a sign (where it
happened not to be the sign itself) was broken - but the first
character, in such cases, was in fact an invisible mark we should have
been ignoring anyway.
This does incur a small slow-down (a few percent on average, but less
than the standard deviation of the fractional speed changes). I think
it's worth it for the correctness.
Fixes: QTBUG-139922
Change-Id: I4e1772efa760744c1aca8209f1680d60c4e9e2e9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The `QStringLiteral` called the QString constructor, but
qstringliteral.h does not pull in qstring.h. This prevents compilation
when application code does not include qstring.h.
Furthermore qstring.h included qstringliteral.h and downstream code
depends that QStringLiteral is provided by qstring.h.
This patch moves all functionality into qstring.h and leaves
qstringliteral.h empty.
Pick-to: 6.8 6.10
Change-Id: Ie9f97398746c2b3a9fa02ce90ec3a27ba1a5acf4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
|
| |
|
|
|
|
|
|
|
| |
qstringview.h includes qstringliteral.h without using any of its
content. So it can be removed.
Pick-to: 6.10 6.8
Change-Id: I83920f424d3878bd5dcabcd402071beda4b50363
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
|
| |
|
|
|
|
|
|
|
| |
There aren't going to be more than 256 boundary types. This allows is to
claim the tail-padding (6 bytes on 64-bit architectures) at the end as
reserved.
Change-Id: Id00afe23000fc9e1ac3bfffd3ba9a8c7a531d8f6
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
By reordering the members smaller than a pointer to the end. Amends
commit 0ae5b8af9c2af514f316211b71a03defc0f1b65a, which changed the pos
field from int to qsizetype, though a padding hole existed before that
commit too. The correct ordering would be to put qsizetype pos after the
attributes pointer, since qsizetype can be reduced in size to int, but
that's unsupported and I can't be bothered.
There's currently a 3-byte padding between the new boolean field and
the BoundaryType. And as a bool type, it is using all the 8 bits in
the member. The padding is fixed in the next commit, explicitly
marking the reserved space.
Drive-by apply NSDMI to the freeBuffer, which we couldn't before commit
cc16e9e4030f310cf344b340a01c99c257f3841b because it was a bitfield.
Drive-by fix coding style of the member initialization list.
Change-Id: I1701f4a73b7810dc6efafffd4ed34b822c36cac3
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
|
| |
|
|
|
|
|
|
|
|
| |
Calling groupSizes() afresh potentially repeats some system calls,
when done for the system locale, that have already been done by
NumericData; so reuse the latter's results and save repeating that.
To that end, have NumericTokenizer expose its m_guide.groupSizes().
Change-Id: Id4f69f76b88c420943c8ab8a0f712e7c1ef52c67
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It was previously the only locale using short month name in the short
date format, where all others used two-digit or unpadded month number.
Since this anomalous format was used by no other locale and wasn't
even a substring of some locale's long format, but was one of the
first in date_format_data[], most other locales' date formats have
changed position within this block of character data, causing trivial
changes to two columns of the main locale_data[] table.
[ChangeLog][QtCore][QLocale] The C locale now, in line with all
locales derived from CLDR data, uses numeric month rather than
the abbreviated month name.
Change-Id: I5451036fa170236d88a46bef93a37c299de53a63
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
|