Commit Graph

16093 Commits (47df0eb5131a5fc0decd049bd3f9eefeb26276df)

Author SHA1 Message Date
Volker Hilsheimer 3ff66569ea Doc: Fix syntax error
Amends e0ecb0ded2

Pick-to: 6.5 6.5.0
Change-Id: If315d97e93047a8bece36c727c7646d30eb7458b
Reviewed-by: Andreas Eliasson <andreas.eliasson@qt.io>
2023-03-05 06:00:02 +01:00
Thiago Macieira 8413824ca0 qsimd_p.h: remove LZCNT feature from the ARCH_HASWELL list
And for good measure, I'm also removing BMI2. The one we really care
about ensuring gets enabled instead of -mavx2 is FMA anyway.

Complements commit 29d3938aa5 (which in
turn complemented commit a98cf15ed1),
which removed BMI1 because AMD introduced it before AVX2. Looks like
they also introduced LZCNT in some earlier processor too (family 10h) or
GCC 12 began emitting __LZCNT__ for that family -- IIRC the AMD feature
list was bigger than just the lzcnt instruction.

Fixes: QTBUG-111698
Pick-to: 6.4 6.4.3 6.5 6.5.0
Change-Id: I7f354474adce419ca6c2fffd1748f5b24f69a692
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2023-03-04 10:59:56 -08:00
Volker Hilsheimer d48dbafeb2 Doc: fix qdoc warning, explicitly qualify enum type
Pick-to: 6.5 6.5.0
Change-Id: Ie289f2468a3a71d35696907691586a31f70d5b1e
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2023-03-03 20:05:27 +01:00
Volker Hilsheimer c1cbb12e57 Doc: fix links to qFuzzyIsNull
The function is in the QtNumeric documentation context.

Pick-to: 6.5 6.5.0
Change-Id: Ibc6a8961bc04efd4ab1eb50bb371e6a169d513dc
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2023-03-03 20:05:27 +01:00
Marc Mutz cbb484b713 qstrncpy(): document that we don't implement strncpy() fill-all-[dst,len)
The Windows version didn't, ever since we started using strncpy_s(),
and we might change the non-Windows version, too.

Pick-to: 6.5 6.4 6.2 5.15
Change-Id: Iee1c09674d296be806d4be42b1891940120b4a01
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-03-03 18:16:22 +00:00
Marc Mutz a53429c1ec [docs] Fix typo in QMessageAuthenticationCode::reset() documentation
Pefer → Prefer

Pick-to: 6.5
Change-Id: Ie9fd09452f5d99d799a045ee59fc11a2b9c5a599
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-03-02 21:37:10 +01:00
Marc Mutz 50389d4973 Mark QMessageAuthenticationCodePrivate::initMessageHash() as noexcept
It only calls other noexcept functions:
- QCryptographicHash::addData(QByteArrayView)
- xored()

Pick-to: 6.5
Task-number: QTBUG-111688
Change-Id: Idd8c485a48b8243b359638086c373288c1c6f96d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-03-02 21:37:03 +01:00
Marc Mutz 590172ccc5 QMessageAuthenticationCode: port Private::setKey() to QByteArrayView
The only change is the signature of the function.

Also mark it as noexcept. It calls all functions in-contract and
doesn't allocate memory.

Task-number: QTBUG-111676
Pick-to: 6.5
Change-Id: I505c1f51da704fd46e538a68d6d8703f7cdefbc8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-03-02 21:36:50 +01:00
Edward Welbourne ac6c7aa12f Simplify and relax UTF-8 locale override machinery for Darwin
There's no need to try the various permutations of the language
and region specific locales, as they all point back to the same
CTYPE in /usr/share/locale/UTF-8/LC_CTYPE

In addition, processes started from launchd come with an empty
locale environment (LC_ALL/LC_*/LANG), and hence will default
to the "C"/POSIX locale, even after picking up the environment.
This primarily applies to applications launched from Finder,
but also affects processes launched as background services.
And since a child process will inherit its parent's environment
the empty locale environment is propagated when running apps
from IDEs such as Qt Creator or Xcode, or commands in an SSH
login session (as sshd is a background service), unless the
environment has been explicitly set up by the shell (Zsh).

Since neither of these situations is the result of user
misconfiguration, it makes little sense to spit our a
warning.

We however still warn if we detect that the character
encoding has changed from the default "C" encoding, or
if the encoding is "C", but we detect that the user has
modified any of the relevant locale environment variables,
as this indicates either a change in the system default
behavior, or that the user has explicitly requested a
"C" locale, which is wrong.

Done-with: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Fixes: QTBUG-111443
Pick-to: 6.5.0 6.5 6.4 6.2
Change-Id: I6fd14d1f8adddc2914d6ff4d3b5ad34a3871ef82
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-03-02 18:39:10 +01:00
Edward Welbourne fff9395c28 QCoreApplication::initLocale(): Improve warning on failure
If we fail to set a UTF-8 locale, the warning claims Qt shall use a
UTF-8 locale, for which it reports an empty string, when in fact it
isn't using a UTF-8 locale, although it'll interact with the system as
if it were.

Also, the user is liable to understand "system locale encoding" as
referring to the underlying system rather than whatever they may have
configured in a local shell; and a non-native speaker assures me the
use of "shall" is also apt to confuse; so reword the messages.

As the old locale is only needed for the code path prints the
warning we can defer resolving it until we know we're going to
use it, by querying the locale at that point.

Done-with: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Pick-to: 6.5.0 6.5 6.4 6.2
Change-Id: Ie6a6e7a707200e58335fcb64cb1584f0c307895a
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-03-02 18:39:10 +01:00
Edward Welbourne 91bea4470e Tidy up QCoreApplicationPrivate::initLocale()'s #if-ery
Explain each exception cleanly and as itself, thereby avoiding the
need for long and tangled #if-ery conditions.

Make sure to setlocale(LC_ALL, "") everywhere we think we have
initialized the locale, including Integrity - it plainly has
setlocale(), since we call it for LC_CTYPE - since we should at least
give it the chance to set its implementation-defined default locale,
instead of the standard-defined POSIX locale in use on entry to
main().

Done-with: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Pick-to: 6.5.0 6.5 6.4 6.2
Change-Id: Iab00984ba45dfc9a324b6a3c12e3d330b655a5a9
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-03-02 18:39:10 +01:00
Volker Hilsheimer c9dc3d7427 Doc: fix link to XML Streaming page
Pick-to: 6.5 6.5.0
Change-Id: Ibc8e869e140e25d7f90bd8ff922918afb3935e42
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-03-02 18:30:22 +01:00
Marc Mutz 189444d8c4 De-pessimize QCryptographicHash::reset() in OpenSSL3 mode
Instead of going through the whole dance with provider loading,
context creation etc, just call EVP_MD_CTX_reset() to reuse the
already-setup context, if any.

This makes QCryptographicHash::reset() adhere to its noexcept
specification again (assuming EVP_MD_CTX_reset() doesn't allocate
state, and, despite its non-void return type, cannot fail on a valid
context), and should greatly improve the speed of reset(), addData(),
resultView() cycles.

Pick-to: 6.5
Change-Id: I7c35b61cbeab1ffd6dd258e8389ea614d49e2e1e
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Jan Grulich <jgrulich@redhat.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-03-02 14:54:09 +01:00
Tor Arne Vestbø 3b08cbff69 Remove redundant information in QString::toLocal8Bit() docs
Pick-to: 6.5
Change-Id: I794621a599bfab85c6a19300225d0e1ad4948362
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-03-02 12:51:15 +01:00
Tor Arne Vestbø 349bd4db22 Document that to/FromLocal8Bit() does not consider CFStringGetSystemEncoding
The CFStringGetSystemEncoding() defaults to Mac Roman, unless overridden
via ~/.CFUserTextEncoding, which very few users do or even know about.

Make a note in the to/FromLocal8Bit() that we don't consult this function,
or its NSString wrapper, when determining what the local 8 bit encoding is.

Task-number: QTBUG-111443
Change-Id: I89b6040c62d42de0daea9df908d97d9a23e7b160
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-03-02 12:51:14 +01:00
Mårten Nordheim af95f97466 DNS Lookup: Change local function to return struct instead of enum
This let's us get rid of an out-parameter.

Task-number: QTBUG-108873
Pick-to: 6.5
Change-Id: Ifc08d3905932f28ecdfdf3a7de1499700cc7e606
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2023-03-02 12:08:10 +01:00
Marc Mutz 52c7f699ac QDebug: fix std::string/view stream operators; add u8 versions
Make them templates, for two reasons:

- so they can accept std::pmr types and, in general, any basic_string
  with custom allocators and char_traits

- to break overload ambiguities with the Qt string view types

Also, add the missing C++20 char8_t overloads.

Also, avoid creation of a QString in the sizeof(wchar_t) == 2 case
(Windows). Add a comment to optimize for the sizeof(wchar_t) != 2 case
later.

Found in API review.

Pick-to: 6.5
Change-Id: I30139520f582a38863a0936f8eca4b1ed33e37c8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-03-02 06:33:35 +01:00
Marc Mutz c6dbae9550 qobjectdefs.h: properly disable rvalue qReturnArg()
template <typename T> qReturnArg(T&&) is an unconstrained perfect
forwarder, and will "win" for everything for which `T&` is not an
equal match. e.g. a volatile T.

Restrict the deleted overload to actual rvalues. We don't need to use
`const volatile T&&`, because rvalues never bind to `T&`, we just need
to get off using a universal reference, and adding const does that.

As a drive-by, change the deleted overload's return type to void, to
mimic std::as_const(), the prototype for rvalue-deleted function
overloads.

Pick-to: 6.5
Change-Id: If4fbc311677b993488859b2c4e226b94daed71fe
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-03-02 04:49:48 +00:00
Marc Mutz 5573e2d6ac QBasicTimer: replace new qint64 overloads with chrono ones
Found in API review.

As per "chrono first" initiative[1], implement the int overload via the
chrono one, not vice versa

[1] https://lists.qt-project.org/pipermail/development/2023-January/043563.html

Pick-to: 6.5
Change-Id: I65fe7039ad8ae5f9eb21d9c59a46b9c5c152fac3
Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-03-02 03:56:33 +01:00
Volker Hilsheimer b7b712181b Doc: point at tetrix example for QBasicTimer usage
The wiggly example is gone, but tetrix shows how to use QBasicTimer
as well.

Pick-to: 6.5
Change-Id: Iaad78b0d7e2136ef41d98f634d0680e6f7f3c4e1
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-03-01 22:22:26 +01:00
Volker Hilsheimer 721b4a4b5a Doc: move snippet for implicit translation context
The 'sdi' example is a candidate for removal, so point at the
spreadsheet example instead, which is not.

Pick-to: 6.5
Change-Id: I4405f2421db8be79898a38ca4f3fa1ea5fe0280b
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-03-01 22:22:26 +01:00
Volker Hilsheimer e27766c5e2 Doc: fix qdoc warning
The \brief of a class documentation needs to end with a full stop.

Change-Id: Ia609d7bc6695e785207c0bf4e570a5edeaeaf460
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: <safiyyah.moosa@qt.io>
2023-03-01 22:22:26 +01:00
Tor Arne Vestbø 3154aec540 doc: Fix spelling of 'equivalent' in QString documentation
Pick-to: 6.5
Change-Id: I1d39bee80fbaf3e3e6eb5e383fd845bb0f9071e5
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2023-03-01 22:22:26 +01:00
Ahmad Samir 79578fd691 q_core_unix: take timespec args by value
From the review, timespecS are trivial and small, so they get passed in
registers anyway.

Change-Id: Iedf1f17af1fd58643a0c103230b1fea3c2fe1e49
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2023-03-01 22:10:58 +02:00
Marc Mutz 0f447e875d QVarLengthArray: move a static_assert() to the correct place
Having the Prealloc > 0 assertion only in the QVLA(qsizetype) ctor
makes no sense. Prealloc > 0 is mandated by the class as a whole, not
that particular ctor, so we shouldn't delay the assertion to the
instantiation of this ctor.

Move it to class scope instead, alongside the assertion for
nothrow-destructible.

Pick-to: 6.5
Change-Id: I0225a4533841e5b433a3d9781b2642c084f775ab
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-03-01 20:10:58 +00:00
Marc Mutz b37b820ce8 qobjectdefs.h: optimize AreOldStyleArgs
Use a template alias instead of C++98-style inheritance.

Saves one template instantiation.

Pick-to: 6.5
Change-Id: I95ee9cf1e5eac1db5fc8e05cd95f5e745134214d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-03-01 21:10:58 +01:00
Marc Mutz ebb833d7f7 Apply q20::remove_cvref_t around the code
Found in API review. It's not BC-critical, but let's get this into 6.5
to minimize the diff to our future LTS.

Pick-to: 6.5
Change-Id: Iaa63afad1d31f6edef29e1185897d925f47a094d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-03-01 21:10:57 +01:00
Assam Boudjelthia 81a748efb7 Android: fix and document QStandardPaths behavior on different versions
Partially revert e1440dd7bc for Android
versions below 11 which could take advantage of the manifest
flag android:requestLegacyExternalStorage. And for other newer versions
avoid returning them while adding a note to the docs about this
behavior.

Pick-to: 6.5 6.4 6.2 5.15
Fixes: QTBUG-108013
Fixes: QTBUG-104892
Task-number: QTBUG-81860
Change-Id: I10851c20e2831bddaa329164c941e2ae71f0a497
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
2023-03-01 22:10:57 +02:00
Amir Masoud Abdol 1895948bb9 Silence a warning caused by Concatenation of char16_t and QByteArray
Pick-to: 6.5
Change-Id: I34a8ff5587dfa538594b1374cfc819012ce924c1
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-03-01 17:31:41 +00:00
Volker Hilsheimer b6fae509aa Doc: point at fetchmore example for QDir usage
The Find Files example is gone.

Pick-to: 6.5
Change-Id: I63bc33c3b9db7c8bfcf07fbcee0182a492c01dbd
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2023-03-01 18:31:41 +01:00
Marc Mutz 6990f23813 Long live QMessageAuthenticationCode::resultView()!
Use it in a few places.

[ChangeLog][QtCore][QMessageAuthenticationCode] Added
QCryptographicHash-style resultView().

Change-Id: I745d71f86f9c19c9a9aabb2021c6617775dab1cf
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-03-01 17:20:41 +01:00
Assam Boudjelthia 7af39be052 Android: document limitation for QFile::copy() operation for content uri
Document that the operation is not supported.

Pick-to: 6.5 6.4 6.2 5.15
Task-number: QTBUG-98974
Change-Id: I1faacb7af7e11943d6da62313ed104fda063d30d
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
2023-03-01 18:20:41 +02:00
Edward Welbourne 5078369119 Update QLocale docs of "single character" token functions
Since 6.0, these functions all return QString, to cope if the
character is outside the BMP so surrogate-encoded, and it has lately
come to light that some of them are, in any case, multi-character
tokens. Now that the code correctly handles that, update the docs to
paint a more faithful picture of what these tokens are.

Fixes: QTBUG-107801
Change-Id: I0a364432408a166fae86666f8e5de4f59622b2a3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-03-01 16:36:05 +01:00
Marc Mutz bcc6015a3a QMessageAutenticationCode: add some Q_ASSUME()s to xored()
... telling the compiler all there is to know about block.size(), so
it hopefully vectorizes the function well.

Pick-to: 6.5
Change-Id: Icb3d5c983402e52a65c72af15f806f3a3fe6411f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-03-01 10:58:13 +01:00
Marc Mutz c1e2ec16db QMessageAuthenticationCode: statically assert HMAC works for all algorithms
... by checking that for each algorithm, that the algorithm's result
size is not larger than the algorithm's block size.

Pick-to: 6.5
Change-Id: I4daf7900e72766d180954b15edb06687a57f939f
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-03-01 10:58:09 +01:00
Marc Mutz 1fb0dca140 QMessageAuthenticationCode: use QSmallByteArray for the key
Add more API to QSmallByteArray:

- const op[] overload
- copy construction and -assignment from QSmallByteArrays with smaller N
  (for implicitly converting a HashResult into a HashBlock, incl. a
  static assertion that it always fits
- STL-style assign()

This allows us to use HashBlock for the key, instead of a QByteArray.

To make-it-cool®, add a method that xor's all bytes in a
QSmallByteArray with a given value and returns the result. We use that
algorithm twice in the implementation, and the code simplification at
the call sites is amazing.

Pick-to: 6.5
Change-Id: I7fbc11538544b4a8d1771dc8ad025be154d446df
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-03-01 10:58:04 +01:00
Volker Hilsheimer b0eeed1fd1 Remove unneeded include of qfloat16.h
Amends 5838074912.

Pick-to: 6.5
Change-Id: Ib591aeb9ecb2f7910cd6fe50f578f283b9acd6ff
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2023-02-28 19:03:53 +01:00
Amir Masoud Abdol 38ee9ee849 Avoid resetting CMAKE_AUTOMOC_MACRO_NAMES
Instead of overwriting the CMAKE_AUTOMOC_MACRO_NAMES, we try to append
our desired moc names to it, and don't get rid of what's there.

Thanks for Friedrich W. H. Kossebau for filling a descriptive bug report
and offering a solution as well.

Pick-to: 6.5 6.4 6.2
Fixes: QTBUG-110497
Change-Id: I582af431151cacfe24085b890ae9dba0a0e53f3f
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2023-02-28 18:15:24 +01:00
Morten Sørvig 50057fec93 wasm: use emscripten::ProxyingQueue
Use ProxyingQueue for proxing calls from secondary threads
to the main thread. This replaces the previous usage of the
private emscripten_async_run...() API.

Keep the existing "trampoline" which in addition proxies
using a JavaScript zero timer. This makes sure that
the proxied call is made with a clean stack, and not
e.g. while the main thread is waiting on a mutex.

Change-Id: I66cfdc2cf4bc733b1732973677c2ae46d85c8e7c
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
2023-02-28 17:53:10 +01:00
Marc Mutz 45c096a543 QXmlStreamWriter: hold the indent in std::string, not QByteArray
This means that, thanks to std::string's SSO, we won't allocate to
hold the indent step string anymore, at least for non-pathological
indents of up to 15-23 characters, depending on the particular
std::string implementation.

Task-number: QTBUG-103302
Change-Id: I63685619e86a3aa7bcfac41db84f64a78859bdb7
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2023-02-28 16:53:10 +00:00
Andreas Eliasson 8ecd81ae86 Doc: Remove duplicate words
Change-Id: Ia7a38a1035bd34d00f20351a0adc3927e473b2e7
Pick-to: 6.5 6.4 6.2
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2023-02-28 16:53:10 +00:00
Jan Grulich 86a517ac78 Fix QCH:supportsAlgorithm() result for unsupported hashes in OpenSSL
OpenSSL doesn't support some Blake2s and Blake2b hashes and querying
these would automatically report that they are unsupported, while we are
actually using non-OpenSSL implementataion for these and therefore they
are always supported.

Pick-to: 6.5
Change-Id: I300694459891c3103502705d6c8271caa47d8d01
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-02-28 08:40:05 +01:00
Mårten Nordheim acc6dc9c09 Mark variable only used in Q_ASSERT as unused
Change-Id: Idee2a4772c7c12e293838a647ed768295612f794
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-02-27 12:10:43 +01:00
Marc Mutz e388d219a4 QCryptographicHash: don't include openssl/sha.h
... it conflicts with rfc6234/sha.h's SHA{1,224,256,384,512} symbols.

We can't drop the rfc6234/sha.h header, as openssl/sha.h doesn't give
us the algorithm's block sizes, necessary for HMAC
(QMessageAuthenticationCode).

But we can drop openssl/sha.h. The only reason we included the header
was to get access to SHA<N>_DIGEST_LENGTH, but this is a well-known
value and easily obtained from rfc6234/sha.h as SHA<N>HashSize, so use
that.

Even reduces #ifdef'ery.

Amends d9f9d03fd3.

Fixes: QTBUG-111467
Pick-to: 6.5
Change-Id: Ice19ad8c788fb2828666647cc40abb894cd7af2b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-02-27 09:10:09 +00:00
Marc Mutz ce955cd3ca QMessageAuthenticationCode: Extract Method setKey() from initMessageHash()
This makes it explicit when we process the key (setKey() called) and
when we don't. That the old initMessageHash() left the key alone if it
already had the correct size was properly hidden in plain sight. The
split makes clearer what's going on.

Pick-to: 6.5
Change-Id: Ib013dbf8b976aa9f564224866091256aa8434cbd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-02-26 16:27:45 +01:00
Marc Mutz bdb13a1b31 QSmallByteArray: add sufficient API to make conversion to QByteArrayView implicit
Iterators were missing. Provide a const data() overload to implement
the iterator functions in their natural form.

Pick-to: 6.5
Change-Id: I906013e55fce2effbedba0d283fb4cea3b512fdd
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-02-26 07:51:47 +01:00
Marc Mutz 54a4d4bf76 QCryptographicHash: implement non-OpenSSL3 part of supportsAlgorithm()
Unconditionally returning true is incorrect, not only just since
NumAlgorithms was added in 0411d98192.
The values may have gaps, we might be compiling with SHA1_ONLY, and,
on a language-lawyer level, enums can legally contain values other
than those explicitly enumerated, so give the right answer in all of
these cases.

Pick-to: 6.5
Change-Id: I705d4f759b2572b8b3d1cee18b7939939eedbbac
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-02-26 07:51:13 +01:00
Thiago Macieira ec2c27d596 QDeadlineTimer: add a few missing default template parameters
I don't think any of these make a difference because the Duration is an
implied parameter because of the time_point arguments, but this makes
the code match QDeadlineTimer::deadline<T>.

Pick-to: 6.5
Change-Id: Ieec322d73c1e40ad95c8fffd17468a41182944ab
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-02-25 18:14:11 -08:00
Thiago Macieira 81783d02e8 QElapsedTimer & QDeadlineTimer: use NSDMI for their two fields
Pick-to: 6.5
Change-Id: Ieec322d73c1e40ad95c8fffd174654d643c05097
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-02-25 18:14:11 -08:00
Thiago Macieira cf059ac9ec QThread/Unix: move qt_nanosleep to qthread_unix.cpp
It's the only place that uses it.

Pick-to: 6.5
Change-Id: Ieec322d73c1e40ad95c8fffd17465370ac209c2f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2023-02-25 18:14:11 -08:00