Commit Graph

44400 Commits (cb54da236662563bfdc2f58a01320c3bd360cbff)

Author SHA1 Message Date
Edward Welbourne cb54da2366 Support Cyrillic's equivalent of 'E' as exponent separator
Only Ukrainian is actually recorded in CLDR as using U+0415 as
exponent separator; all other Cyrillic-using locales officially use
plain ASCII 'E'. However, it seems reasonable, in all Cyrillic
locales, to recognize both (given that they look very similar).

Task-number: QTBUG-107801
Change-Id: I70a1e60a2d9fe7e254e01d32c5bad909ea4b8c76
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
2023-02-24 13:37:07 +01:00
Edward Welbourne 4931fe9b02 Fix parsing of numbers to cope with non-single-character tokens
In some locales signs and the exponent are not single character
tokens. Replace QLocaleData::numericToCLocale() with a tokenizer that
will cope with this. At the same time, cache the locale data needed in
support of that, so that we don't repeatedly recreate QString()
objects just to compare them against input tokens.

The caching class is inspired by Thiago's proposal for fixing the
performance, which also inspires the optimization of the C locale in
the tokenizer used here.

Add some testing that round-tripping numbers via strings works for the
locales with signs and exponents that use more than one character.

Task-number: QTBUG-107801
Change-Id: I9fd8409a371ed62ed969d9ebc8b09584e752f7fb
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-02-24 13:37:07 +01:00
Edward Welbourne d753941817 Use isAsciiDigit() in a few more places in qlocale.cpp
Use the function now in qtools_p.h in several more places.
(A later commit rewrites the remainder away.)

Change-Id: I782f0dceffe0e6e76753643a889011a834bc3ff0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-02-24 13:37:07 +01:00
Edward Welbourne e0f9671338 Reflow some code and comments in the aftermath of a dedent
There's more space to the right now, so we may as well use it.

Change-Id: I653c52e1a2fb9eb2a0b027be90fb7bc2734a5e85
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-02-24 13:37:07 +01:00
Edward Welbourne 846e532458 Dedent some switch statement bodies to match coding style
The case labels are meant to line up with the switch statement.

Change-Id: I62a45ffca22582d2264ecb3eb5ad7fbfe2aa148b
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-02-24 13:37:06 +01:00
Ivan Solovev 2a4c64cbed Add QtConcurrent Examples page
The QtConcurrent examples were only discoverable from the
"All Qt Examples" page, which was very inconvenient.

This patch adds a separate page for all Qt Concurrent examples, and
links to it from the module's main page.

Pick-to: 6.5
Change-Id: Iecabd9e21033605c1ec74232ce4f3d68b0c78d82
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Jaishree Vyas <jaishree.vyas@qt.io>
2023-02-24 12:59:52 +01:00
Marc Mutz 494786ce73 QMessageAuthenticationCode: make messageHash a QCryptographicHashPrivate
... avoiding one more memory allocation, and giving us access to
QCryptographicHashPrivate::result, for use in subsequent commits.

The only real adjustment to users of QMACPrivate::messageHash is that
instead of

   messageHash.result();

they now need to use

   messageHash.finalizeUnchecked();
   messageHash.resultView() // .toByteArray()

I.e. explicitly finalize.

Pick-to: 6.5
Change-Id: I80b1158b062554bbf8afa7241674a892de27f204
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-02-24 07:26:55 +01:00
Marc Mutz d53f8d6bbb QCryptographicHash: move addData(QIODevice*) to Private
To be reused in QMessageAuthenticationCode.

Pick-to: 6.5
Change-Id: Ie4f003ad38ce9072cf6ee52ef2d7a63438e4d7ae
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-02-24 07:26:19 +01:00
Marc Mutz d2e1c0aef1 QMessageAuthenticationCode: re-use messageHash for hashing the key
With the OpenSSL3 code allocating state on the heap instead of in
QCH::Private's inline union, reset() should be faster than even a
static hash() call. Even in the non-OpenSSL3 case, using less
QCH::Private objects to do the same thing means we increase effective
data cache size.

Pick-to: 6.5
Change-Id: I0b1347864081169a24c5d349702931afdab6c5bf
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-02-24 07:26:13 +01:00
Marc Mutz 8de0262ded QMessageAuthenticationCode: use SHA-256 instead of insecure SHA-1 in doc sippet
Pick-to: 6.5
Change-Id: I5b39229abbb3e21d90fd83f5f3bcbe1afe609526
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-02-23 22:56:59 +01:00
Marc Mutz 2a2fc4d16d QMessageAuthenticationCode: remove lazy initialization of messageHash
This just complicates the code, for the small benefit of avoiding a
messageHash seeding from an empty key that then has to be reset.

This lazy initialization is in the way of using QCH's SmallByteArray
for the key, which this author thinks is the more important
optimization, because it will allow passing keys by QByteArrayView,
removing the impedance mismatch between QMAC and QCH.

Since the QMAC API doesn't distinguish between the absence of a key,
and the presence of a null (ie. empty) key, we can't not call
initMessageHash() when the key is empty, so we should suggest to pass
the actual key to the constructor as often as possible, and use
setKey() only to change the key afterwards.

[ChangeLog][QtCore][QMessageAuthenticationCode] No longer delays
processing of the key to the first setData() or result() call. While
passing a default-constructed key to the constructor and then calling
setKey() continues to work, for optimal performance, we suggest to
pass the actual key as a constructor argument and call setKey() only
to change the key.

Pick-to: 6.5
Change-Id: If0a078f37a16f8306f77d2b2bd5dacf23ce5c3e2
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-02-23 22:56:54 +01:00
Marc Mutz dff0d5133f QMessageAuthenticationCode: make Private::method member const
Like in QCryptographicHash, it's never re-set, so, like there, make it immutable.

Pick-to: 6.5
Change-Id: I88f3dc15febffa8950256aedc5e8d1385fc86ddd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-02-23 22:56:50 +01:00
Marc Mutz d235953a82 QMessageAuthenticationCode: use QCryptographicHashPrivate in finalizeUnchecked()
... basically inlining static QCH::hash(), which, however, accepts
only one piece of data, while we have two.

Avoids the memory allocation of the QCH d-pointer. The toByteArray()
is now the only memory allocation left in finalizeUnchecked(), and
will be removed in a subsequent commit.

Pick-to: 6.5
Change-Id: I7549d6e1c116a4cdc29dac74b867dfa6647022a0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-02-23 21:56:47 +00:00
Marc Mutz 29050fa65b QCryptographicHash: move SmallByteArray out of Private
Rename it to QSmallByteArray, and make the maximum size a template
argument. Initialize m_size to 0, to avoid a partially-formed
default-constructed objects (default-constructed containers should
always be in the empty state).

As a drive-by, fix placement of some {'s.

Don't move it into a header of its own, yet, as it lacks a lot of
features expected of a generally-reusable class. Maybe one day.

This is in preparation of re-using the class to hold the key in
QMessageAuthenticationCode.

Pick-to: 6.5
Change-Id: Iee77e03e50afdf2ebc5889feeead344bef8ab3e8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-02-23 22:56:34 +01:00
Marc Mutz 9a18ca59ff QCryptographicHash: move result.clear() to beginning of reset()
... from the end().

It was lonely down there, and prone to be overlooked when performing
early returns in the #ifdef'ery above, as witnessed by the early
returns in the OpenSSL3 code.

Amends 1fe74c3bd3, itself amending
633c136596.

Pick-to: 6.5
Change-Id: I8c941ecb5c4755d8823b2161544cf6f7fe75a239
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-02-23 22:56:29 +01:00
Thiago Macieira 1d167b515e QHash: fix GrowthPolicy::bucketsForCapacity
It was confusing entry capacity with the bucket capacity. The value
maxNumBuckets() returned was the maximum number of entries. This issue
was harmless: we would just fail to cap the maximum to an allocatable
size. But the array new[] in the Data constructors would have capped the
maximum anyway (by way of throwing std::bad_alloc).

So instead of trying to calculate what the maximum bucket count is so we
can cap at that, simplify the calculation of the next power of 2 while
preventing it from overflowing in our calculations. We continue to rely
on new[] throwing when we return count that is larger than the maximum
allocatable.

This commit changes the load factor for QHashes containing exactly a
number of elements that is exactly a power of two. Previously, it would
be loaded at 50%, now it's at 25%. For this reason, tst_QSet::squeeze
needed to be fixed to depend less on the implementation details.

Pick-to: 6.5
Change-Id: I9671dee8ceb64aa9b9cafffd17415f3856c358a0
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-02-23 10:36:36 -08:00
Thiago Macieira 644c06b48f Logging: fix crash when decoding a symbol that isn't a function
Saw this on my FreeBSD VM. The backtrace() function thought the nearest
symbol to something was "_ZTSNSt3__110__function6__baseIFbPvS2_EEE",
which decoded to

 typeinfo name for std::__1::__function::__base<bool (void*, void*)>

The function pointer type inside parameter threw the decoder for a loop
and caused it to crash with the failed assertion in qbytearray.h:

 inline char QByteArray::at(qsizetype i) const
 { Q_ASSERT(size_t(i) < size_t(size())); return d.data()[i]; }

I noticed this
 - because tst_qtimer hung
 - because qFormatLogMessage deadlocked acquiring QMessagePattern::mutex
 - because the logging recursed
 - because qCleanupFuncinfo failed an assertion while formatting the
   backtrace (my QT_MESSAGE_PATTERN has %{backtrace})
 - because QTimer::~QTimer -> QObject::killTimer printed a warning
 - because tst_QTimer::moveToThread produces warnings

Pick-to: 5.15 6.2 6.4 6.5
Change-Id: Ieec322d73c1e40ad95c8fffd17464f86e9725991
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
2023-02-23 10:33:39 -08:00
Marc Mutz d9f9d03fd3 Merge qmessageauthenticationcode.cpp into qcryptographichash.cpp
They share so many things, and QMAC is lacking so many of the changes
QCH has received over the last few months, that it seems QMAC is
better off being implemented in the QCH TU.

Among other things, this will allow QMAC to use QCHPrivate for its
implementation, drastically reducing the number of memory allocations
required to perform HMAC operations.

Pick-to: 6.5
Change-Id: I3c81a52e3a9ad57c14c91c16bc347f215fd407ba
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-02-23 16:28:37 +01:00
Marc Mutz a77e9d671d QCryptographicHash: Extract Method finalize() from resultView()
This brings the code in line with the sibling code in
QMessageAuthenticationCode, which now has a simiar split between
finalize() and finalizeUnchecked().

Pick-to: 6.5
Change-Id: I10701d59d56617ab32fae0df47371f0464e9cc77
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-02-23 16:28:37 +01:00
Marc Mutz 303caa40da QCryptographicHash: make narrowing in addData(QIODevice*) explicit
QIODevice::read(ptr, n) returns qint64, not int. The returned values
are, however, confined to the interval [-1,1024], so no harm
done. Make the narrowing explicit, though.

Pick-to: 6.5
Change-Id: I5f95292ca6e05f0f402e7258e590593eff361255
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-02-23 16:28:37 +01:00
Marc Mutz d32d2137b7 QMessageAuthenticationCode: apply the QCryptographicHash::hash() optimization
... of creating a Private instead of the public class on the stack.

This avoids its memory-allocation, as well as the overhead of the mutex
in finalize().

Task-number: QTBUG-111347
Pick-to: 6.5
Change-Id: I4d144fcfadc0b8c9ba78d395ff7279b2d5d7b050
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-02-23 16:28:37 +01:00
Marc Mutz 2449af142f QMessageAuthenticationCode: fix result() non-re-entrancy
While QMessageAuthenticationCode is not copyable, result() is
nevertheless const, so a user could prepare a
QMessageAuthenticationCode object with setKey() and addData(), pass it
by const reference to two threads, which each just call result() on
it. This should be safe, but because result() performed lazy
evaluation without being internally synchronized, this would cause
data races.

Fix in the same was as b904de43a5 did
for QCryptographicHash. See there for a detailed discussion of the
solution.

Fixes: QTBUG-111347
Pick-to: 6.5 6.4 6.2 5.15
Change-Id: I1feb380973c480ad6268349a0a46ac471b9ca0f7
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: David Faure <david.faure@kdab.com>
2023-02-23 16:28:36 +01:00
Liang Qi 101e57d37c Revert "qxkbcommon: Treat XKB_KEY_{Super,Hyper}_{L,R} as Qt::Key_Meta by default"
This reverts commit 610bafdfc5.

It breaks the tests for Qt Wayland Compositor.

Task-number: QTBUG-111423
Change-Id: I8e411792e991d23cb0cb6b114ab1697c3b9e8c0e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-02-23 15:42:15 +01:00
Piotr Wierciński cd28603360 wasm: Fix checking window flags in QWasmWindow
Querying bit flags by direct comparison yields incorrect results.
As an effect the minimum size for QWasmWindow is not always properly set.
Use testFlags() function instead.

Change-Id: Ie4cf528ed3c6f664abd17615a6898e8fc49d84b5
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2023-02-23 14:16:06 +01:00
Joni Poikelin 8dfca2ee71 Fix crash with removed menus
Pick-to: 6.5 6.4 6.2
Fixes: QTBUG-111388
Change-Id: I9c9f0ad5cc02293197d7e77eeeec3ffa9d72a4af
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-02-23 12:49:58 +00:00
Christian Ehrlicher 78f7a8c418 SQL/OCI: Fix QSQLDriver::record() when tablename is a synonym
Fix the statement when the tablename is a synonym by not appending the
where clause for the table name to the initial statement used for
tables and synonyms later on.

Pick-to: 6.5 6.4 6.2 5.15
Fixes: QTBUG-111339
Change-Id: Ie18a858427d124e80462048b1a9c5e2afa327546
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-02-22 20:24:13 +01:00
Thiago Macieira e69d80e14d qalgorithms.h: fix mistake that MSVC has constexpr bitops in C++17 mode
<bit> exists in C++20 and is properly both constexpr and optimized. But
in C++17 mode, we don't have constexpr bitops and instead elect to have
performance at runtime instead. But somewhere along the line, either
when they were added, when C++20 <bit> support was, or in any of the
bugfixes for other compilers, the nesting of #ifdef got messed up and we
declared that we had constexpr builtins for MSVC in C++17 too.

The macro QT_HAS_CONSTEXPR_BUILTINS isn't supposed to be used by anyone
else... but we ended up not being able to use it ourselves either. So
I'm renaming it to a more precise label.

Pick-to: 6.5
Change-Id: I9671dee8ceb64aa9b9cafffd1741b9b4060c9753
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2023-02-22 11:06:49 -08:00
Marc Mutz ac9d25340a QMessageAuthenticationCode: Extract Methods finalize{,Unchecked}() from result()
This brings the code in line with its sibling code in
QCryptographicHash and prepares for a static hash() optimization and
the fixing of the result() re-entrancy issue (QTBUG-111347).

Task-number: QTBUG-111347
Pick-to: 6.5 6.4 6.2 5.15
Change-Id: I3d0c0cd2a37c2bbeb60974307ff138e26b82bf69
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-02-22 19:24:16 +01:00
Marc Mutz 05f913d57d qstrncpy: NUL-terminate even when src is nullptr
The goal of this function is to ensure that dst is _always_
NUL-terminated. The only exception is if there's no space to write
even one NUL byte, of course, but not when src is nullptr but dst
would have space.

Update the docs to the new behavior and make them more precise.

Fix a test that assumed qstrncpy() would not write to dst for
(dst, nullptr, 10).

[ChangeLog][QtCore][qstrncpy()] Now NUL-terminates the target
buffer even when the source pointer is nullptr, provided the
target buffer has space for at least one byte.

Pick-to: 6.5 6.4 6.2 5.15
Change-Id: I7806d8c71e260f8f02b79af7b6ce94f23599dd69
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-02-22 19:24:16 +01:00
Marc Mutz 4a9e918d4e QMessagePattern: don't use strncpy()
When Qt is configured to return nullptr from isNull() QStrings
(QT5_NULL_STRINGS != 1), then we'd be feeding a nullptr src into
strncpy(), which is UB. I couldn't rule the case of a null QString
lexeme out with local reasoning, seeing as the code is in the else
branch of an if (lexeme.startsWith(~~~) && lexeme.endsWith(~~~)), so
it might be null.

Instead of porting to qstrncpy(), which can deal with a nullptr src
(albeit up to recently, badly), note that the strncpy + the char[]
allocation is a qstrdup(), so use that instead. This also does away
with the queasiness of taking the size() of a UTF-16 string to limit
strncpy() for the L1-recoded version (which, in this instance is safe,
as toLatin1().constData() is NUL-terminated, but in some other
instances was not).

As a drive-by, make sure we don't leak the strdup()'ed string if the
emplace_back() fails.

Amends be98fa32c7.

Qt 5 is not affected, as constData() never returns nullptr there.

Pick-to: 6.5 6.4 6.2
Change-Id: I178d356e560d2749cd6ce0b9364c710a2d117304
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-02-22 18:24:16 +00:00
Marc Mutz 9f5a687ffe qt_inIsoNametoLCID: protect against a nullptr name
The only user of the function, QCollatorPrivate::init(), passes
QLocalePrivate::bcp47Name().constData(). bcp47Name() may return a
default-constructed QByteArray (e.g. for QLocale::AnyLanguage), so
constData() may be nullptr (QT5_NULL_STRINGS != 1). Passing nullptr to
strncmp() or strncpy() is UB, though.

Instead of using the nullptr-hardened q... versions of these
functions, check name for nullptr once, at the top of the function,
and avoid all the lookup code that follows and is known to fail
(because windows_to_iso_list does not contain empty entries).

This way, we take advantage of the std functions' UB for performance
reasons (fewer repeated nullptr checks), instead of being taken
advantage of.

Qt 5 is not affected, as constData() never returns nullptr there.

Pick-to: 6.5 6.4 6.2
Change-Id: I980dace2bca1e983ac526e89fadeb92239ab5f11
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-02-22 19:24:16 +01:00
Mikolaj Boc a596ea0fe2 Support always on top/bottom window flags on WASM
The window stack will now upkeep three groups of windows, always
on bottom (1), regular (2), always on top (3). Windows belonging to
(3) will always appear on top of (2) and (1), and windows from (2) will
always appear on top of (1).

The first window created in the application gets the (1) status, which
is in line with the root window mechanism used before.

Activation has now been decoupled from the top position on the window
stack as a window in (1) or (2) may be active, in spite of the top
window belonging to a higher group.

Fixes: QTBUG-110098
Change-Id: I51f4d2d47163fab26ce5ef28f7a4f23a522c7f91
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2023-02-22 18:07:35 +01:00
Ahmad Samir 96e031edd7 QDateTimeParser: add more unittests for the unquote() static helper
Test documented behavior and serv as a baseline for future changes.

Change-Id: I36a914694d5244c89f28f3e403e11d65492a5eef
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2023-02-22 17:41:20 +02:00
Thiago Macieira 85c69f023f qmath: add qNextPowerOfTwo(unsigned long) - for size_t
This completes the triad uint/ulong/qulonglong, ensuring that one of
them will be size_t and one of them will be uintptr_t (size_t and
uintptr_t don't have to be the same type). The signeds ensure one of
them will be ptrdiff_t too.

Pick-to: 6.5
Change-Id: I9671dee8ceb64aa9b9cafffd17415a0bfcbd68b7
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
2023-02-22 14:27:35 +00:00
Yuhang Zhao f7fd5eaf95 Fix qtbase build when all deprecated code are disabled
Adjust the callers to use the non-deprecated APIs.

Pick-to: 6.5
Change-Id: I8e96f25684a2d613bc400a8626dc9e3af2bb8dcf
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-02-22 22:27:35 +08:00
Volker Hilsheimer b4b4c81401 Revert "Rename {from,to}DOMRect() → {from,to}DomRect()"
This reverts commit 81ce878f55.

Reason for revert: The native type is DOMRect, and in Qt, converters
to/from native types stick to the native capitalisation (e.g. fromCGRect
or fromNSString).

Change-Id: Ic44ec79849fc6accdce1153471dd1ad9117e57ce
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2023-02-22 14:27:35 +00:00
Ahmad Samir 7941d3ab3e QTestTable: quote tag name in duplicate tag warning message
Easier to see what the duplicate tag name is.

Change-Id: Iee156aa7d6766628ec60e712811a83a2ff66dbb1
Reviewed-by: Jason McDonald <macadder1@gmail.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2023-02-22 14:47:14 +02:00
Jarek Kobus 0627ab1727 QThreadPool: Protect the access to internal data with mutex
The class claims to be thread safe, however, when e.g.
one thread is calling setMaxThreadCount() and the second
is calling maxThreadCount() at the same time for the same thread pool
instance, the latter may receive rubbish data.
Protect all public setters/getters with a mutex.

Pick-to: 6.5 6.4
Change-Id: Ief29d017d4f80443fa1ae06f6b20872f07588768
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-02-22 12:27:29 +01:00
Ulf Hermann 3ad9f94ff2 QVariant: Move some inline methods into a private header
We want to be able to use those from qtdeclarative. Clearly, they are
intended to be inline.

Task-number: QTBUG-108789
Change-Id: I3560e9b58213c4f41dbf6553021f3d6187960e8b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-02-22 12:27:29 +01:00
Vladimir Belyavsky 0fe6f818d2 Text: fix Soft hyphen rendering in QTextLayout::glyphRuns()
When calculating the position offset of QGlyphRuns, either
when fetching substrings or when applying fallback fonts,
we would include the advances of non-printable glyphs,
such as the soft hyphen. This was an oversight, and the
other code which calculates the advance (like in
QFontEngine::getGlyphPositions()) does this correctly. We
apply the same logic as there and only include the advance
if the dontPrint flag is unset.

[ChangeLog][QtGui][Text] Fixed an issue where spaces would
sometimes be shown in soft hyphen positions in a string.

Fixes: QTBUG-46990
Fixes: QTBUG-62620
Fixes: QTBUG-67038
Fixes: QTBUG-102483
Pick-to: 5.15 6.2 6.4 6.5
Change-Id: I4e583fb74f7a51424f14917d7cc0894beefec48b
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2023-02-22 10:49:07 +00:00
Laszlo Agocs 1ca1fb86ac rhi: Make some op== and qHash hidden friends
Change-Id: I0ba829b5b3df7ebff2fe7da81424e2623a895325
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
2023-02-22 08:32:52 +01:00
Assam Boudjelthia 30014ed850 Android: avoid duplicate paths from QStandardPaths::standardLocations()
Don't return duplicate path entries from calling
QStandardPaths::standardLocations() and as a pass by no empty entries
either.

Pick-to: 6.5
Task-number: QTBUG-104892
Change-Id: If05b20d2c07d75428cb572d9549a39cf21bdef99
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2023-02-22 04:03:10 +02:00
Marc Mutz 7db28fb4bd Rename QBA::{to,from}Uint8Array() → {to,from}EcmaUint8Array()
Found in API review: from/toUintArray() is too generic a name, make
sure its name gives enough context.

Pick-to: 6.5
Change-Id: Ie10ff06ae11a5e168c4c91b60a9698a41d0429fc
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-02-21 21:34:07 +01:00
Marc Mutz 81ce878f55 Rename {from,to}DOMRect() → {from,to}DomRect()
Because it's QDomNode, not QDOMNode, either (abbreviations aren't
supposed to be all-caps in Qt).

Found in API review.

Pick-to: 6.5
Change-Id: I37bcd8c38d396709d11c4eab035cdfd2145eb245
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-02-21 21:34:07 +01:00
Marc Mutz fed5f24454 QVarLengthArray: fix UBs in insert(it, n, v) ([basic.life], invariants)
In the same vein as e24df8bc72 for
emplace(it, v) and insert(it, rv), this patch addresses the identical
issues in insert(it, n, v). The solution is unsurprisingly the same:
q_rotate() after a resize(size() + n, v).

The 6.2- code will need to look different, because resize(n, v) didn't
exist there.

Pick-to: 6.5 6.4 6.2 5.15
Change-Id: I1ce91969abc20f2a1e5d05a8545b009a2e0994f6
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-02-21 19:56:07 +01:00
Marc Mutz 147dd6e82f QVarLengthArray: Extract Method QtPrivate::q_rotate()
It seems like we'll need this in lots of other places, too.

Pick-to: 6.5 6.4 6.2 5.15
Change-Id: I767495c2eb02a2fc85b6f835ad9003fa89315c7f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-02-21 19:56:07 +01:00
Friedemann Kleint 71c2c03477 Windows QPA plugin: Remove some duplicated declarations
Pick-to: 6.5
Task-number: QTBUG-109394
Change-Id: Ic132495da4bfc12ecf303d018fb4d9ba1c8a1128
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2023-02-21 16:59:02 +01:00
Amir Masoud Abdol ec082fdea6 Fix for a duplicate macro definition
ALIGN was conflicting with a system macro,
/SDKs/MacOSX13.1.sdk/usr/include/arm/param.h.

Pick-to: 6.5
Task-number: QTBUG-109394
Change-Id: Ia460ee781f8bd1a1cdcff0371efab784c9eebb57
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2023-02-21 16:59:02 +01:00
Friedemann Kleint 269f44aebc Direct2d QPA plugin: Add exclusions for Unity builds
Similar to the Windows QPA plugin.

Pick-to: 6.5
Task-number: QTBUG-109394
Change-Id: I8e094e4ec49574441d3fd73e7ac2cc6fe3b5fd5f
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2023-02-21 16:59:02 +01:00
Antti Määttä ce4a7d607c CTF: Create directory ust if it doesn't exist
Pick-to: 6.5
Change-Id: I046c045a21a30eb0b6f0e883aa5b49e953f0a586
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
Reviewed-by: Hatem ElKharashy <hatem.elkharashy@qt.io>
Reviewed-by: Antti Määttä <antti.maatta@qt.io>
2023-02-21 14:51:29 +02:00