Commit Graph

64782 Commits (0d85d0a72fd0136bd89e201d0cc1bf7fac2c24c8)

Author SHA1 Message Date
Ivan Solovev 0d85d0a72f qfloat16: extend comparison with integral types
qfloat16 implemented comparison with int, but not with other integral
types. As a result, comparing qfloat16 vs qint64 or short was
ambiguous, because the compiler had (at least) two options:
* qint64 -> int
* qint64 -> float

Fix it by explicitly introducing comparison operators for other integral
types.
Use the new compare helper macros for that, and implement helper methods
as templates restricted on integral types.

Note that we have to manually extend the std::is_integral type trait
because libstdc++ only treats __{u}int128_t types as integral when
compiling in -std=gnu++XX mode, and we compile Qt in -std=c++XX mode.

Fixes: QTBUG-117637
Change-Id: Id0c074af1e9ccc2c2492eb2cc4ee62a4a7131b07
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2023-12-08 14:53:37 +01:00
Ivan Solovev e1eec6476a qfloat16: use new comparison helper macros
This replaces all the other helper macros which were used to
generate the relational operators before, and also gains support for
operator<=>() in C++20 mode.

Change-Id: I40cec3cb5a5c42523787414d610e00afe6fc86f8
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2023-12-08 14:53:37 +01:00
David Redondo 706dafe347 Make some QScreen native interfaces public
[ChangeLog][QtGui][QScreen] The QAndroidScreen, QWaylandScreen and
QWaylandWindow native interfaces are now available on QScreen to
provide a handle to the underlying platform screen.

Task-number: QTBUG-113795
Change-Id: I83d70046678dfb79ee08544ddfc1820f3ff2d118
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-12-08 14:53:37 +01:00
Volker Hilsheimer 1c42b1e8c7 QIcon: harden font file discovery in Android icon engine
Amend f54393ba70 by trying more font file
candidates, and don't try to download fonts if the query is pointing at
a resource.

Change-Id: I3fffc6fb3faa45b95540ebdf6cdf8ee4a49ebd78
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-12-08 14:53:37 +01:00
Tinja Paavoseppä 2bc7d38bd6 Android: Make QtWindow wrap the QtLayout instead of inherit it
The layout is a ViewGroup, and should be created in the Android UI
thread, while for ease of use on C++ side we should be able to
construct the Java object in the platform window constructor to
avoid later calls not having a valid object reference. Trying to
make a blocking call to Android thread from Qt thread can lead to
dead locks, so move only the creation of the layout itself into
Android thread, making the QtWindow a wrapper for it, which we can
immediately return to C++/Qt thread. Most of the calls made to
QtWindow are anyway already passed to the Android UI thread.

As a drive by, add a missing QtNative.runAction() to
bringChildToFront().

Change-Id: Ib2495ddda8267384656557cbe40be5da869f82c3
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-12-08 15:53:37 +02:00
Tinja Paavoseppä 6ff88f97a6 Android: Add preliminary support for child windows
Update the manual test case for embedded windows to have
native window on Android.

There are still some sharp corners, for example:

* The windows are implemented with SurfaceViews, which makes
  z-ordering with multiple of them a bit tricky. The Surfaces
  they instantiate are basically z-ordered to either be below
  everything, with a hole punched in the window, or on top of
  everything, with the Surfaces created later on top of the
  ones created earlier. Also, with the foreign views it looks
  like the native view is on top of the Surface, because it
  is created later. And since the child windows create their
  Surfaces before the parent, they would be behind the parent
  window, currently circumventing this with letting the
  parent be z-ordered behind everything, and the children
  on top of everything. A follow up commit addresses this by
  changing the native view class to TextureView when multiple
  windows are present.
* Parent window always gets the touch events - fixed in
  a follow up commit
* If a child window has a text edit, it does not receive
  focus when clicking on it

Task-number: QTBUG-116187
Change-Id: I32188ec5e3d3fce9fd8e3a931e317d1e081f691c
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-12-08 15:53:37 +02:00
Tinja Paavoseppä 0a92d881bb Android: Make QtLayout per window instead of per screen
Each QAndroidPlatformWindow has its own QtLayout,
instead of one for the whole app/screen. This paves the
way for addition of child windows.

Task-number: QTBUG-116187
Change-Id: I36c68cea1a5f27ded3696bcfc2fbc04d9a8ce79e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2023-12-08 15:53:36 +02:00
Juha Vuolle 0bfec6cd11 QHttpHeaders: reserve memory for headers when creating from a container
To avoid any potential resizes during append looping

Task-number: QTBUG-119002
Change-Id: I8f4c391f05b5c5bd0b48a4f17b11996652006508
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2023-12-08 15:53:36 +02:00
Juha Vuolle 11b19b3341 Mark REST helper classes as tech preview
Task-number: QTBUG-119002
Change-Id: Icf4d50b0e6f25e4e5f82df0b23a249332bbf55bf
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-12-08 15:53:36 +02:00
Juha Vuolle 8da4156da7 Add PATCH support for QRestAccessManager
It is somewhat common HTTP method with RESTful use cases
(partial updates on resources)

Task-number: QTBUG-114637
Change-Id: Id252d3f4b54c3ebb8df5c93259e64a4af2d0ca2f
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-12-08 15:53:36 +02:00
Juha Vuolle a80ed49b10 QRestAM custom HTTP 'method' support
This commit adds support for sending custom, non-standard, HTTP
methods / verbs.

Fixes: QTBUG-116262
Change-Id: I77addb389a7e4346b63526176bf8323696a7a337
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2023-12-08 15:53:36 +02:00
Juha Vuolle 98b240d00a Add username/password support to QNetworkRequestFactory
Task-number: QTBUG-114717
Change-Id: I8d6beb6f81668dcba59cbaee6044606fb874bad2
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-12-08 15:53:35 +02:00
Juha Vuolle b72701a690 Add QDebug support for QRestAccessManager
Task-number: QTBUG-114705
Change-Id: Id33dbfd6906989dfcde654a4f7d6ab4b5e743c33
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-12-08 15:53:35 +02:00
Juha Vuolle 0f34316fb7 Add QDebug support for QRestReply
Task-number: QTBUG-114705
Change-Id: I6c355d683389b773082c5966434d733bf5aec506
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-12-08 15:53:35 +02:00
Juha Vuolle 6420e8b895 Add QDebug support for QNetworkRequestFactory
Task-number: QTBUG-114705
Change-Id: If3e9d67ee310192debf58771e365f6035d4b2da6
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2023-12-08 15:53:35 +02:00
Juha Vuolle 669a48e5ae Functions for setting request transfer timeouts
Added to both QNetworkRequestFactory and QRestAccessManager

Task-number: QTBUG-114717
Change-Id: Ibca55bba548a034a0da7ea60550642c150b63dc2
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-12-08 15:53:35 +02:00
Juha Vuolle 090991123d Support for std::chrono as transferTimeout type
Provide users with means to use more modern time/duration type.

Please note that since QTimer does not currently support
timeouts larger than 'int' milliseconds, the limit on how long
durations can be expressed, remains. This should not
be an issue in practice with network requests, as a typical
int32 system can express timeouts of ~24 days.

[ChangeLog][QtNetwork][QNetworkAccessManager] Add std::chrono
support for transfer timeout.

[ChangeLog][QtNetwork][QNetworkRequest] Add std::chrono support
for transfer timeout.

Fixes: QTBUG-118714
Change-Id: If85678a5994c59bac5926e47f98c9cfeb2a07c30
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2023-12-08 15:53:34 +02:00
Juha Vuolle 298d5a4bbd Add uploadProgress signal for QRestReply
Task-number: QTBUG-114717
Change-Id: I2052e4cc4da90962483f5f1931dc20552e484e34
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2023-12-08 15:53:34 +02:00
Juha Vuolle e9f703ed3b Add signals and methods for QRestReply download progress
These include:
- readyRead(), signal for indicating new data availability
- bytesAvailable(), function for checking available data amount
- downloadProgress(), signal for monitoring download progress

Task-number: QTBUG-114717
Change-Id: Id6c49530d7857f5c76bd111eba84525137294ea7
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-12-08 15:53:33 +02:00
Juha Vuolle e560adef21 Add REST client convenience wrappers
[ChangeLog][QtNetwork][QRestAccessManager] Added new convenience
classes QRestAccessManager and QRestReply for typical RESTful
client application usage

Task-number: QTBUG-114637
Task-number: QTBUG-114701
Change-Id: I65057e56bf27f365b54bfd528565efd5f09386aa
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Mate Barany <mate.barany@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2023-12-08 15:53:33 +02:00
Juha Vuolle f587ba1036 QNetworkRequestFactory convenience class
The class provides a way to represent server-side service endpoints.
With RESTful applications these endpoints typically have a need for
repeating requests fields such as headers, query parameters,
bearer token, base URL, SSL configuration. This class allows setting
of the repeating parts, while allowing the setting of changing parts
on a per-request basis.

[ChangeLog][QtNetwork][QNetworkRequestFactory] Added a new convenience
class to help with the needs of repeating network request details
imposed by the server-side service endpoints, which is common
with RESTful applications.

Task-number: QTBUG-113814
Change-Id: Iabcfaed786949ffbb0ad0c75297d0db6ecc1a3cc
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Mate Barany <mate.barany@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-12-08 15:53:32 +02:00
Juha Vuolle 925ce9e908 Add QHttpHeaders class
New QHttpHeaders class for use in place of
std::pair<QBA,QBA>, QMap<QBA>, and QMultiMap/Hash<QBA,QBA>
to represent HTTP headers.

[ChangeLog][QtNetwork][QHttpHeaders] New QHttpHeaders class

Task-number: QTBUG-107042
Change-Id: I54766886a491acfc9a813a3414322a75011acb9d
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2023-12-08 15:53:32 +02:00
Assam Boudjelthia 0919f97811 CMake: pass ndk-stack path to androidtestrunner
CMake knows about the ndk path so always pass the ndk-stack path
and not rely on the env var being set.

Change-Id: I2cfd8e0708c6b284964dc3dc85b1f080742b125d
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-12-08 15:53:32 +02:00
Edward Welbourne d2f15d65c7 Improve week-day-based resolution of two-digit year numbers
Where a date format only gives the last two digits of the year, along
with month and day of month, the day of the week can help settle the
question of which century to use. The date-time parser has used this
for some time, rather crudely, but only considered centuries adjacent
to the default (1900 through 1999).

Refine that by using QCalendar's new matchCenturyToWeekday(). Simplify
the account of parsing now that client code doesn't have to do this
for itself.

Task-number: QTBUG-46843
Change-Id: Id054cc87ec867a2498145932d721c3368210cba0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-12-08 11:40:37 +01:00
Edward Welbourne 4799516de9 Add a section on date ambiguities to QDate::fromString()
There are various pitfalls and reasons to be wary of short formats.
Make clear what the hazards and remedies are. Expand on the existing
paragraph about the base-year for the century of two-digit years.

Task-number: QTBUG-46843
Change-Id: If7c3d13eec826671f8dce686e520a17c11572bc3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-12-08 11:40:37 +01:00
Edward Welbourne 9bf7d2a76a Adapt ASN.1 datetime parsing to use the new century control
It previously had to kludge a 1900-to-1999 date into a 1950-to-2049
range; it can now tell QDTP to do that for it. In particular, this
fixes a problem with 00-02-29, which failed to parse using 1900 as
base year so couldn't be corrected to 2000-02-29, which is now the
date it finds directly.

Task-number: QTBUG-46843
Change-Id: I7ac936bdfb15b78daed5d237c5d921c800af4951
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-12-08 11:40:37 +01:00
Edward Welbourne 41f84f3ddb Give the caller control over the century used for two-digit dates
The twentieth century is now some way behind us, so using its years
when parsing a date-time format that only provides the last two digits
is increasingly likely to produce unwelcome results. Most such formats
are saved by the "redundant" presence of a day-of-week field but, for
those that are not (notably including ASN.1 date fields), there is a
need to provide some way to over-ride the twentieth century default.

Allow the caller to pass a base year to the fromString() methods, of
QDate and QDateTime, and to QLocale's toDate() and toDateTime(), that
indicates the first of 100 consecutive years, among which the two
digits given can select a year. Add some test-cases to exercise the
new API.

[ChangeLog][QtCore][QDate] When fromString() has only a two-digit year
to go on, it is now possible to set the start-year of the century
within which this selects.

[ChangeLog][QtCore][QDateTime] When fromString() has only a two-digit
year to go on, it is now possible to set the start-year of the century
within which this selects.

[ChangeLog][QtCore][QLocale] When toDate() or toDateTime() has only a
two-digit year to go on, it is now possible to set the start-year of
the century within which this selects.

Fixes: QTBUG-46843
Change-Id: Ieb312ee9e0b80557a15edcb0e6d75a57b10d7a62
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-12-08 11:40:36 +01:00
Edward Welbourne b8fac53803 Add QCalendar::matchCenturyToWeekday()
This takes a YearMonthDay and a day-of-the-week, returning a QDate
that (if possible, else invalid) has the given day of the week and
differs from the YearMonthDay only in the century. This is useful when
resolving dates with only two-digit year information, which can be
disambiguated by the day of the week. Added tests of the new API.

This adds a new virtual method to QCalendarBackend, for which that
base class does provide a brute force implementation, so derived
classes do not need to add implementations. It is, however, a
binary-incompatible change for any backend plugins that may be in use
to implement custom calendars.

Worked out the details for the Gregorian calendar to make it possible
to compute the right century (and whether any century works) without
trial-and-error searching. Coded that up as its implementation of the
new method.

[ChangeLog][QtCore][QCalendar] Added a matchCenturyToWeekday() method
for use when resolving dates given day, month and last two digits of
the year, along with day of the week. Any custom calendar backend
plugins shall need a recompile and may, optionally, implement the new
virtual method behind this.

Change-Id: I6003c8d9423d6bfb833957bb5120f2d423219c7a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-12-08 11:40:36 +01:00
Kai Köhne c5864a96a6 headersclean: Re-add zero-as-null-pointer-constant warning
Amends 0f985e16ba, which accidentally
dropped this flag (duh!).

Change-Id: Ie772f9e524625edfcdcda4d73a9a712fcd77f8c8
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2023-12-08 10:40:33 +00:00
Marianne Yrjänä 65081c67f3 Revert "OpenSSL: remove support for 1.1"
This reverts commit d201c0a218.

Reason for revert: QNX have support only for OpenSSL1.1.
QNX will start supporting OpenSSL3 with upcoming QNX8.0 but as long as we want to support QNX7.1 (and even QNX7.0) removing OpenSSL1.1 support from Qt is not an option.

Change-Id: Ia2083eda318779968eb6ee84fff2f56ebe3dadf7
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2023-12-08 06:10:51 +00:00
Marc Mutz e240f559e4 QUrlQuery: drop the qpair.h include
[ChangeLog][QtCore][Potentially Source-Incompatible Changes] qurlquery.h
no longer includes qpair.h (for qMakePair).

Change-Id: I593ca3fee5f330992b46170bb660b1b33a663428
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2023-12-08 03:18:32 +01:00
Volker Hilsheimer c0b1eaaaaa QFont::Tag: use new comparison helper macros
Task-number: QTBUG-104111
Change-Id: Id57b075d00e657c2606b6c1a8f1215ed0d067cbd
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2023-12-08 03:18:32 +01:00
Marc Mutz cd39a469a9 Add tests for CompactStorage
They're too trivial for their own QTestLib-based approach, but we
don't want them in the header, either, reducing the compile times for
all users, so put them into an otherwise empty .cpp file.

Change-Id: Iae7fc4d4a29a0648b91752040854288e02da7045
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-12-08 04:18:32 +02:00
Marc Mutz b6ff86e556 corelib/CMakeLists.txt: restore lexicographical order of SOURCES
Amends 8d367dec15.

Pick-to: 6.6 6.5
Change-Id: Ia1fd819ebabf6df143c06f56624365d3e37fa1c9
Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-12-08 02:18:32 +00:00
Rym Bouabid 4fa9f13397 Make QAtomicScopedValueRollback public API
Move the private header to public.
Make documentation a part of public interface.

[ChangeLog][QtCore][QAtomicScopedValueRollback] New class.

Task-number: QTBUG-115107
Change-Id: I6c9f5448e74a5b62f4d97ee079944f4b1b731121
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2023-12-08 02:24:41 +01:00
Lorn Potter d784c14d10 wasm: prevent native mobile keyboard from popping up always
also fix misspelled 'inputMode' which seems to work.
we need to re focus to the canvas when window is raised
which will automagically close the native keyboard
when user clicks on non edit area.

Fixes: QTBUG-101404
Pick-to: 6.6 6.5
Change-Id: Iced9abc7b23e079b1060d2474a139aa653a8ca01
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
2023-12-08 09:22:33 +10:00
Marc Mutz a5bcb41678 tst_bench_QImageReader: add a benchmark for raw QFatoryLoader operations
This is Eirik's QtCore-only QTBUG-114253 reproducer added to the
nearest fitting existing benchmark.

Done-with: Eirik Aavitsland <eirik.aavitsland@qt.io>
Pick-to: 6.6 6.5 6.2 5.15
Task-number: QTBUG-114253
Change-Id: Iba68bedebae908af497267860e2b230db269787e
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2023-12-07 22:55:08 +00:00
Marc Mutz 6c60117d01 tst_QString: explain TransientDefaultLocale better
A default-constructed QLocale gets initialized with the
currently-active default locale, and apparently retains that setting
henceforth. That is why the `prior` member is not explicitly
initialized, which is confusing at face value.

Explain the mechanism better, and explicitly default-initialize the
member, so the next reader of the code saves the time to research
this.

Amends 76dfda1ad1.

Pick-to: 6.6 6.5 6.2 5.15
Change-Id: I1d1171f8564c70a971938b92b809f63ba5637d3a
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2023-12-07 23:55:08 +01:00
Marc Mutz f395934419 QTest: Extract Method writePrettyUnicodeChar from toPrettyUnicode
Easier to reason about by separating the concerns into separate
functions.

Pick-to: 6.6 6.5
Change-Id: I34666766ac2879577faea17bbd2b700bcb803f51
Reviewed-by: Jason McDonald <macadder1@gmail.com>
2023-12-07 23:55:08 +01:00
Marc Mutz 0a86a77e5f tst_containerapisymmetry: remove the extra push_back
... and make sure it cannot happen again by using Extract Method to
let the compiler do the counting between the resize and the
sequence-of-push_back alternatives, because this author clearly can't.

Amends 3c0fdd7341.

Pick-to: 6.6 6.5
Change-Id: If18f30d60f556e5e668876a38423f3e519fb79b0
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-12-07 23:55:08 +01:00
Marc Mutz 9dd1953218 QByteArray: bring end() into idiomatic form
For contiguous containers, end() is always begin() + size(), so use
that instead of data() + size().

Centralizes what it means to be an iterator in just begin() now, which
will simplify a follow-up commit of Thiago's.

Pick-to: 6.6 6.5
Change-Id: I53ca1a335910bdea3d46b9496ba39bc1a2d3fd93
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-12-07 23:55:07 +01:00
Marc Mutz 72422d7d1b QString::indexOf(): fix UB (signed integer overflow) in negative from handling
The `from` value is not constrained, so the code must be able to
handle all values, incl. `Min := numeric_limits<qsizetype>::min()`.

But the result of negating `Min` is not representable in qsizetype, so
it's UB to try.

Fix by multiplying both sides by -1 (which flips the relational
operator).

This works because the size() of a string is always non-negative, and
the negation of all such values is representable in the same type. Add
a comment to avoid a "fix back".

Amends f9b867216b.

Pick-to: 6.6 6.5
Change-Id: I10d2e400b86f07a6a6c0a61080a27f41a16b3517
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-12-07 23:55:07 +01:00
Marc Mutz 8f44ec2e48 QUrlQuery: s/QPair/std::pair/
They're literally the same, QPair is an alias for std::pair, so this
is both SC and BC.

Also port from qMakePair to std::make_pair, so we can later drop the
qpair.h include (not done here to avoid breaking 6.6/6.5 users
relying on this transitive include for qMakePair().

Pick-to: 6.6 6.5
Change-Id: I593ca3fee5f330992b46170bb660b1b33a663427
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-12-07 23:55:07 +01:00
Marc Mutz 9d54b5c57e QDebug: remove QPair streaming docs
QPair _is_ std::pair. If this wasn't a fake-definition under #ifdef
Q_QDOC, the compiler would have complained long ago.

Pick-to: 6.6 6.5
Change-Id: Idfe589ff13115d3d908572a17b849f634ec86787
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2023-12-07 23:55:07 +01:00
Thiago Macieira db991cb4e1 QBitArray: replace the member operator~ with a hidden friend
Which takes the array to be inverted by value, so we get free move
semantics and allowing us to perform the negation in-place.

[ChangeLog][Potentially Source-Incompatible Changes] The bitwise AND,
OR, XOR, and NOT operator functions on QBitArray are now hidden
friends. This may cause source-incompatibility in unusual coding styles
(like 'array.operator~()') or with classes that have a casting 'operator
QBitArray()'.

Change-Id: I85b3fc2dd45c4693be13fffd1795ba1fbaf23769
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2023-12-07 14:55:07 -08:00
Thiago Macieira 9b176281df QBitArray: refactor operator~() to write to an uninitialized buffer
No functionality change otherwise.

Change-Id: I85b3fc2dd45c4693be13fffd179627b2747c132b
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2023-12-07 14:55:07 -08:00
Thiago Macieira 9323351695 Re-do the namespace fix for the linker scripts
This amends and corrects b63045477e. The
fix there was incorrect for two reasons:
1) it missed one symbol in QtCore (the QFutureInterfaceBase one
   added in 0f0371c830.
2) it only worked for namespaces that were 15 characters long

Instead, just use a wildcard where the namespace should be for Qt
symbols (note: an extra wildcard appears for plain types because they go
from <N><type> to N<N><namespace><N><type>E).

Pick-to: 6.6
Change-Id: Iae41eb8991e349ceb836fffd179d6e709d6632f8
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
2023-12-07 14:55:06 -08:00
Marc Mutz 40592d38f8 QSpan: add some C++20 reminder code comments
Change-Id: I1cd698bde290cbd37d13103cd6832a739d9c548b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-12-07 23:38:15 +01:00
Marc Mutz 03e78e5d62 Long live QSpan as public API!
Provide qspan_p.h as backward-compatibility header.

[ChangeLog][QtCore][QSpan] New Qt equivalent of std::span.

Fixes: QTBUG-115022
Change-Id: I1cc27dc0aa1f7406f0a41d7a75f176cd7f858feb
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-12-07 22:38:15 +00:00
Marc Mutz 5885db33e3 QSpan: fix an MSVC warning-turned-error:
qspan_p.h(35): error C2220: the following warning is treated as an error
  qspan_p.h(35): warning C4245: 'initializing': conversion from 'int' to 'const size_t', signed/unsigned mismatch

Add an explicit (functional-style) cast to silence it.

Pick-to: 6.6
Change-Id: Id29fda3def1c60415b3e0fe72eaf82c8bc57d363
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-12-07 23:38:15 +01:00