Commit Graph

59147 Commits

Author SHA1 Message Date
Cristian Adam
501018ea33 Win32: Add "longPathAware" manifest / rc for internal tools
This will enable all qt internal tools to be able to access files
on paths longer than 255 characters.

Two examples that were not working before: moc and windeployqt.

Fixes: QTBUG-109207
Change-Id: I93f9770f1d3c4f3f2cca4655e4bed89c95b9786b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-12-08 17:56:47 +01:00
Sami Shalayel
b341480922 tests: add timeout for the dbus test message
The test message sent to the dbus might never see a reply, e.g. in case
of a misconfigured dbus. Instead of waiting for a reply and stopping the
static top-level build, timeout after the CI had enough time to receive
the dbus message (5 seconds).

Change-Id: Ic6d60e7d1ddb2d864dc4a78d4edbd0ef7b6604c2
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2022-12-08 17:56:47 +01:00
Øystein Heskestad
3fedcd4e4a Add Boyer-Moore Latin-1 string searcher with optional case sensitivity
[ChangeLog][QtCore][QString] Added Boyer-Moore Latin-1 string searcher with optional case sensitivity

Task-number: QTBUG-100236
Change-Id: I200a0dac7c8012add1ee02511dba791d233115e0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-12-08 17:56:47 +01:00
Timothée Keller
bb5d4094e0 Update list of windeployqt modules
Added Positioningquick, Sensorsquick, Webenginequick, and Webviewquick
modules to windeployqt list

Task-number: QTBUG-105135
Pick-to: 6.4
Change-Id: I26c0b5006453c8533ff94967b2e8f03ede88bf7e
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2022-12-08 17:56:47 +01:00
Alexander Rezepkin
a63d709195 QSysInfo::prettyProductName(): Add macOS Ventura product name
Pick-to: 6.2 6.3 6.4 5.15
Change-Id: I5f54866e30f08465943922e3dee5150f37054225
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-12-08 19:56:47 +03:00
David Edmundson
687a206b2e QWidget: use window device pixel ratio for metrics
Most code uses the window/backing store DPR, except for this path that
uses the screen.
On wayland it's possible to get a different ratio for the screen and
window which causes some subtle rendering issues. For other platforms
behavior shouldn't change.

Change-Id: Ie390ba3bdfc183815df9e7e79e508d3e15d61f25
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2022-12-08 14:35:18 +00:00
Kai Köhne
cbd5bc0b58 Doc: Fix paths for Files property in qt_attribution.json files
qtattributionsscanner expects file paths to be separated by a space.

Pick-to: 6.2 6.4
Change-Id: I4c9dfea0f086fc9631cb06f40e2d3cab0a32ca4e
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-12-08 15:14:17 +01:00
Volker Hilsheimer
c95de359b4 QComboBox: Don't dereference potential nullptr, simplify
Amends a874087504, which tested whether
d->container is nullptr to decide whether to hide the popup, and then
dereferences d->container later without checking again. This raised a
correct static analyzer warning.

Simplify that logic. hidePopup() does nothing if there is no visible
container, and we don't want to accept() the cancel key if there isn't.
So the closeOnCancel logic isn't actually needed, we only need to accept
the ShortcutOverride to make sure that QComboBox sees the Cancel key
even if there is a shortcut registered, and then we can handle and
accept the cancel key to call hidePopup() only if the popup is visible.

Add test to verify that this interaction works as expected.

Pick-to: 6.4
Task-number: QTBUG-108908
Change-Id: I60d92b068f0f5139d629cf4a58e225512170df77
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-12-08 15:14:17 +01:00
Jaishree Vyas
57a4c0d73c Doc: Document Qt Serialization with use cases
Added some background about Serialization with the classes and used cases.

Fixes: QTBUG-103951
Pick-to: 6.4 6.3 6.2
Change-Id: I3ff179b814fc5d424f2ac2ffaf3237b90ddd7e2b
Reviewed-by: Vladimir Minenko <vladimir.minenko@qt.io>
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
2022-12-08 13:28:43 +01:00
Volker Hilsheimer
9bc36308c7 Windows: regenerate systray icon when screen resolution changes
When the screen resolution or scale factor changes, then we have to
recreate the system tray icon so that it doesn't get blurry. Such
changes generate a WM_TASKBARCREATED message, which we already handle
through a self-registered message ID to re-add the icon when the task
bar/explorer crashed. So call updateIcon there to recreate the HICON
before adding it again.

For this to work, we have to actually store the QIcon in the already
present (but so far unused) m_icon member, and reset that member before
calling updateIcon, which would otherwise be a no-op.

Fixes: QTBUG-108641
Pick-to: 6.4 6.2
Change-Id: If3dd042416b7f61bbb3b43f7d563e52b406136a2
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-12-08 13:28:43 +01:00
Marc Mutz
be36b6356a qglobal.h: remove __ASSEMBLER__ check
__ASSEMBLER__ and __cplusplus cannot both be defined at the same time,
so it suffices to check just one of them. Thanks to Thiago for
noticing.

Change-Id: I92e43d1a1c551ee48c51490b2878bb0c84bfb36f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-12-08 05:08:24 +01:00
Marc Mutz
e4851fedd4 Move qVersion() into it's own header
Partially reverts 50b05e3e2a.

The move of qVersion() from qglobal.h into qlibraryinfo.h, a header
not included by qglobal.h, was a conscious, documented, QUIP-0006-
allowed, but stetching the SiC Type A definition, and therefore
unwarranted, SiC.

Fix by moving qVersion() into its own header file, qtversion.h,
included from qglobal.h.

[ChangeLog][Editorial] Remove the entry for qVersion() being moved to
qlibraryinfo.h.

Fixes: QTBUG-108818
Change-Id: I3524802348635512a63fbbb55ddc28ad28f331e8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2022-12-08 04:08:22 +00:00
Mikolaj Boc
4673f00277 Resolve the ownership problems in qClipboardPasteTo
A deleted mMimeData instance might be referenced if more that one file
item is present in the clipboadData. This fix uses a continuation
mechanism to only run the actual qWasmClipboardPaste when all the
data has been collected. The ownership of QMimeData is then transferred
to the global QClipboardData q_clipboardData.

Fixes: QTBUG-108841
Change-Id: I16def48d70ebbffc68462ed74ccd9ee8ee8053de
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2022-12-08 03:37:03 +01:00
Mårten Nordheim
effd3b4d83 macdeployqt: Add networkinformation as plugins to be deployed
This was missed during original patch

Pick-to: 6.4
Fixes: QTBUG-108677
Change-Id: Icd8960f2f41468dc12c3269b12df777acd962753
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2022-12-07 18:31:49 +00:00
Thiago Macieira
3465b9fe74 QString: merge and optimize the two overloads of SSE2's ustrncmp()
The algorithm is the same, differing only on how we load data onto
vector registers, so they can be merged, simplifying the code base.

For all strings over 16 characters in length, we loop and then we
perform a final overlapped comparison, if necessary. I've kept the 32-
byte-per-loop solution even for pre-AVX2, because that should pipeline
better. For any strings between 4 and 16 characters, we perform a pair
of maybe-overlapped comparisons, of either 4 characters or of 8, so we
consume the full string. That leaves a tail of at most 3 characters in
scalar code.

Change-Id: Ib42b3adc93bf4d43bd55fffd16c8c15d6d761af2
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
2022-12-07 09:57:59 -08:00
Alexey Edelev
cff4cde412 Allow 'We mean it.' disclaimer to have follow text
Replace the regex that looks for 'We mean it.' disclaimer with simple
string lookup to allow the disclaimer to have a follow text or be in
the middle of the sentence.

Amends b89d63515b

Task-number: QTBUG-87480
Change-Id: I2a9d7306beb51de62d00b79980a12da6f170df93
Reviewed-by: Robert Griebl <robert.griebl@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-12-07 14:58:41 +01:00
Alexey Edelev
cfcc4ef8ed Add _lib_pri targets to all
In CMake versions older than 3.20 add_dependencies have no effect
when adding interface libraries. So need to add the '_lib_pri'
targets to ALL to make sure that the related rules executed.

Amends 190e58e1f4

Pick-to: 6.2 6.4
Fixes: QTBUG-109240
Fixes: QTBUG-109239
Change-Id: I7c565ce3bc15e549569317454c2f7caac823cf66
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-12-07 14:58:41 +01:00
Edward Welbourne
c50b20a484 Shuffle QTimeZone so backend-dependent parts are contiguous
Coming work shall limit the feature to controlling these parts of the
class, while making the rest visible to all builds.

Change-Id: I602c604c8c66bd4f1816a9dabef19c72527831a5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-12-07 14:58:41 +01:00
Edward Welbourne
de1895f423 tst_QDateTime: explain one test-case more carefully
In the process, split some long lines. The test relies on omitting the
hour (so as to get the default, 0) from both the format string and the
string parsed, so as to test that the parser correctly handles the
corner case where the zone skips the first hour of the day. This was
not entirely obvious when reading the row data, so make it explicit in
a comment.

Change-Id: I919b292b78bd399a8749806a0e913d43f5b414e1
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mate Barany <mate.barany@qt.io>
2022-12-07 14:58:41 +01:00
Edward Welbourne
33bb8fcae9 Add to test-cases for tst_QDateTime::fromStringStringFormat()
Test a few more cases are correctly handled.

Change-Id: I7f286ba93f59bf0168cac789cd30590f40e98cee
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-12-07 14:58:41 +01:00
Edward Welbourne
0522443f4b tst_QDateTime::operator_insert_extract() Correct handling of 4.0's spec
The spec deseralized isn't a Qt::TimeSpec; handle it correctly instead
of taking for granted that QDateTimePrivate::Spec's values happen to
match.

Change-Id: I67f3c960f3a3b90cdad3c1eca673f7ec8fd10b82
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-12-07 14:58:41 +01:00
Edward Welbourne
49af4d48d1 tst_QDateTime: check a few more details
Mostly pedagogic checks in operator_insert_extract(), but also
sanity-checking, to confirm spec conversions produce results equal to
what each came from.

In daylightTransitions(), verify the spring forward goes from standard
time to daylight-saving time.

Change-Id: Ieb9c603ee2eadecea055da4e8889528161f4d999
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-12-07 14:58:41 +01:00
Edward Welbourne
5a1fbef109 tst_QDateTime: Modernize some comparisons
Use QCOMPARE(a, b) in place of QVERIFY(a == b), similar with
QCOMPARE_LT() and QCOMPARE_LE(); and use a scope-guard to emit a
message on failure instead of incurring the cost of building a string
for the message, even when the passing test doesn't need it.

Change-Id: I3884bc40e89a4b1ba881968b99faab27d4b1abc9
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2022-12-07 14:58:40 +01:00
Edward Welbourne
ddd686775c Elide parameters passed as their default
Principally to get Qt::LocalTime mentions out of the way ahead of the
QTimeZone work on Qt::TimeSpec, but also mop up trailing 0 parameters
to QTime for seconds and milliseconds.

Change-Id: I51041582faae100894a567c9e5ae96a60a3b2d8c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Mate Barany <mate.barany@qt.io>
2022-12-07 14:58:40 +01:00
Edward Welbourne
c9889d1f61 Prefer QDate::startOfDay() over QDT(date, QTime(0, 0), ...)
Change-Id: If02186791c2b8004b407b88393c132dc6d28a5ae
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Mate Barany <mate.barany@qt.io>
2022-12-07 14:58:40 +01:00
Edward Welbourne
ccedfd063e tst_QDateTime::fromMSecsSinceEpoch(): remove a stray debug statement
Left over from long ago, making confused use of Qt::hex.

Change-Id: I7f411e4888ee1a637d2212fd6976dd003f8da9ce
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-12-07 14:58:40 +01:00
Edward Welbourne
a24e131ee5 tst_QDateTime: split some data table rows across lines more tidily
Several were overlong (or soon to get so by being made longer); others
were inconsistent with neighbors; one was inconsistent with itself.

Change-Id: I272680499605a757e4827d27021bf234a91cf77a
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-12-07 14:58:40 +01:00
Edward Welbourne
2dd83a0778 tst_QDateTime: Inline some trivial delegations by _data() functions
Change-Id: Ib174a3ef1e4e913c6dc433b17854295cf529ad8f
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-12-07 14:58:40 +01:00
Edward Welbourne
e3321cf599 Suppress output of debug message only produced to test against crash
As a result, also make sure the test will fail if output to debug
stream doesn't produce the expected result.

Change-Id: I9914c9c41c8d8b79f32dfb8e0c735f12e2d59f5e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-12-07 14:58:40 +01:00
Edward Welbourne
40c4a7c055 Tidy up in tst_QVariant
Put core includes all in a common form, sort alphabetically.
Remove a stray blank line.

Change-Id: I211c6b407f5e49d907cb065521883567f1dd30f4
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-12-07 14:58:40 +01:00
Edward Welbourne
3e76b841a2 Clean up operator>>(QDataStream &in, QDateTime &dateTime)
Make the tz variable more local (saving some #if-ery).
Recognize that the Qt 4 (and 5.1) format didn't store offset or zone
so we're treating offset from UTC as UTC and zone as local time.
Don't assign a variable the value it already has.
Omit parameters when they're the default value anyway.
Improved some comments.

Change-Id: Ie29a66b50ecb8ed8b0566a0ecbc6492c6ba63e61
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-12-07 14:58:39 +01:00
Edward Welbourne
3f0fda3783 tst_QDateTime::timeZone(): use QVERIFY() to test bool
Comparing to true and false doesn't enrich the output.

Change-Id: Ie26a3f3d584f88310b8d4a31cad07be8dc8cb646
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-12-07 14:58:39 +01:00
Mårten Nordheim
a94dcc3125 Work around missing wait_for declaration
Certain older SDKs don't declare the specific wait_for overload but
still uses it. So, we declare it.

Also add the factorycacheregistration include to wipe out any factory
that may be created and cached in the TU.

Change-Id: I778ab1b8724306b17bb6a2daa0b7364f268ded83
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2022-12-07 14:03:03 +01:00
Ahmad Samir
9d9c25e214 Use QString/QByteArray range erase()
Change-Id: I0fb81306ebe8fc7acd63bb62dc6720c734461da0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-12-07 15:03:03 +02:00
Aleksandr Reviakin
83be948833 Remove useless Q_OBJECT in Semaphores example
Fixes: QTBUG-108859
Change-Id: I1acf47b9dfd9c38546a2e965baa74067cedffc4a
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2022-12-07 14:03:03 +01:00
Mikolaj Boc
4d07f84307 Fix the coordinate problems in wasm windows
The QWasmScreen's top left coordinate does not precisely translate
to correct page coordinates, especially when fixed position is used
and page margins are set. Also, this is wrong in complicated setups
with e.g. multiple nested elements.

Therefore, to get the correct coordinates in pointer event handlers,
we have to assume the local coordinates of the screen, and translate
those to the (possibly incorrect) coordinates that QWasmScreen thinks
it has in page.

It is another problem to fix the wrong coordinates QWasmScreen thinks
it has in the page.

This has been checked with complicated setups with screens in scroll
containers, screens with fixed position, screens with relative position,
with and without body margins etc.

Change-Id: I749f2507fec7ae278b6f9d7d13ae288e65472dba
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2022-12-07 13:03:03 +00:00
Mikolaj Boc
6d780fa0ab Fix the qwasmcompositor_main test
This got broken with the introduction of the compositor patch.

Change-Id: I7d85795eb537449855a4cce3c8b6b031095c3f7f
Reviewed-by: David Skoland <david.skoland@qt.io>
2022-12-07 14:03:03 +01:00
Axel Spoerl
2f22a6e465 Mark static mm_load8_zero_extend [[maybe_unused]]
static Q_ALWAYS_INLINE __m128i mm_load8_zero_extend(const void *ptr)
is unused when compiled on Android.
This causes a compiler warning and blocks CI, if compiled with -Werror.

This patch marks the method [[maybe_unused]], in order to prevent the
warning.

Change-Id: Ife10c0a84ac34196405ce9c2356351d825751adb
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-12-07 10:26:06 +01:00
Marc Mutz
68fd43212c corelib/QMakeLists.txt: fix order of files in in qNN section
They're supposed to be lexicographically ordered, so fix.

Pick-to: 6.4
Change-Id: I88acad048990b16b7e9dd073f55608a80e71c416
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-12-07 08:39:38 +01:00
Marc Mutz
6631444eb1 QString/QByteArray/QList: de-pessimize op+ [2/2]: overload on rvalue LHS
The + operator is left-associative, so a + b + c is (a + b) + c.

Apply the same trick C++20 applied to std::string's op+ and overload
for rvalue left-hand sides. This means that a + b + c is now
equivalent to

  [&] {
      auto tmp = a;
      tmp += b;
      tmp += c;
      return tmp;
  }()

removing a ton of temporary buffers (not objects, because CoW makes it
impossible for the compiler to track the single conceptual object
passing through the chain) when not using QStringBuilder (which isn't
available for QList).

This is BC, because the operators are all inline free functions or at
least inline members of non-exported classes.

Use multi-\fn to document the new operators. No \since is needed, as
this doesn't change the set of supported operations, just makes some
of them faster.

[ChangeLog][QtCore][QList/QString/QByteArray] Chained additions (a + b
+ c) now produce only one temporary buffer for the whole expression
instead of one per addition. Using += or QStringBuilder is still
faster, though.

Change-Id: I87e837d8803e79dc29c9268f73e6df9fcc0b09a3
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-12-07 07:39:38 +00:00
Giuseppe D'Angelo
e7e3e4cf25 WASM: don't use a static_assert when an #error would suffice
No need to involve the compiler, make the preprocessor error out.

Change-Id: I37d3f241bd0879ba123fe26342aaaaff74c2fb6b
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2022-12-07 07:24:14 +01:00
Thiago Macieira
04e668f6ba QFutureInterfaceBasePrivate: pack to remove padding
This structure was 216 bytes with 3 padding regions: 3 bytes between
continuationState and refCount, 4 bytes between m_progressValue and
m_progress, and 1 byte at the end after the booleans. The total of 8
bytes can be neatly reduced.

And since it's now a multiple of 16, we should get an effective 16 byte
reduction in malloc()ed size.

Change-Id: I69ecc04064514f939896fffd172e46d1d68cb28b
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-12-06 22:24:14 -08:00
Thiago Macieira
e02933a17c QAnyStringView: move the two assertions to a central place
Move the assertions to qtypes.cpp, next to where one of them already
existed.

Change-Id: I51d12ccdc56c4ad2af07fffd172dae7c49d78273
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-12-07 06:24:14 +00:00
Thiago Macieira
8be744df8a QAnyStringView: move the tag bits to the LSB for Qt 7
This removes the TODO that was left in the file. It's also applied for
bootstrapped use of QAnyStringView, even though it's currently not used
in the bootstrap lib.

Along with the previous commit of inverting the order of the members,
the code generated by GCC 12 for a visitation compares as:

_Z1f14QAnyStringView:                                           _Z1f14QAnyStringView:
        movabsq $4611686018427387903, %rcx                    |         movq    %rsi, %rax
        movq    %rdi, %rdx                                    |         shrq    $2, %rsi
        movabsq $-4611686018427387904, %rax                   |         andl    $3, %eax
        andq    %rsi, %rax                                    |         cmpq    $2, %rax
        andq    %rcx, %rsi                                    <
        movabsq $-9223372036854775808, %rcx                   <
        cmpq    %rcx, %rax                                    <
        je      .L15                                                    je      .L15
        movabsq $4611686018427387904, %rcx                    |         cmpq    $1, %rax
        cmpq    %rcx, %rax                                    <
        je      .L16                                                    je      .L16
        jmp     _Z1fI20QBasicUtf8StringViewILb0EEEvT_                   jmp     _Z1fI20QBasicUtf8StringViewILb0EEEvT_
.L16:                                                           .L16:
        movq    %rsi, %rdi                                    |         jmp     _Z1fI17QLatin1StringViewEvT_
        movq    %rdx, %rsi                                    <
        jmp     _Z1fI13QLatin1StringEvT_                      <
.L15:                                                           .L15:
        movq    %rsi, %rdi                                    <
        movq    %rdx, %rsi                                    <
        jmp     _Z1fI11QStringViewEvT_                                  jmp     _Z1fI11QStringViewEvT_

Fixes: QTBUG-109086
Change-Id: I51d12ccdc56c4ad2af07fffd172db128ca4105a5
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-12-06 22:24:14 -08:00
Thiago Macieira
497275a8ba Q{Latin1,}StringView: invert members so the order is (data,size) in Qt7
Matches Q{Any,Utf8}StringView as well as std::basic_string_view in
Microsoft's STL and LLVM libc++, but not GCC's libstdc++. Interestingly,
it does match the order in libstdc++'s non-small std::basic_string.

Applied for bootstrapped use, so we ensure this works and keeps working.

Change-Id: I51d12ccdc56c4ad2af07fffd172db18254fff083
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-12-06 22:24:14 -08:00
Marc Mutz
1501f45c33 QFont: replace a QVLA with a C array
QVarLengthArray doesn't allocate, but is nevertheless dynamically
initialized, incl. thread-safe static overhead.

Turn the QVLA<QPair<int,int>> into a std::array<int,2>[] instead. This
container has constant initialization and the use of array<int>
instead of pair<int, int> means we can use the bool inverted argument
as an index into the array instead of having to switch over .first and
.second.

Saves ~600B in text size and ~100B in BSS on optimized Clang 15 AMD64
Linux builds, and the copying, under mutex protection, of the data at
runtime.

Amends 3558704ed5.

Pick-to: 6.4
Change-Id: Iad48eca4eef77011d4094125670ea302e8beae46
Reviewed-by: Jonas Karlsson <jonas.karlsson@qt.io>
2022-12-07 07:24:14 +01:00
Marc Mutz
20d1477c14 tst_QString: fix custom QCOMPARE for strings > 2Gi characters
Same fix as in tst_qbytearray's QCOMPARE() in
cb9715557c.

Pick-to: 6.4 6.2
Change-Id: I2222d9015ae7121a2fbcf5b936b27de20e873064
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-12-07 07:24:13 +01:00
Marc Mutz
76cf4e67ab QCssParser: remove unused QPair include
Nothing uses QPair in this header, or the implementation file.

Change-Id: I59e37fd8d483a0b6da404e1093f0fbb7c35bc92e
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-12-07 07:24:13 +01:00
Marc Mutz
e2c08b5f3a qcompilerdetection.h: de-duplicate feature test macro discussion
Both links are valid for both C++14/17 and C++20+ variants, they're
just sorted differently. Mention that.

Pick-to: 6.4
Change-Id: Id88ec05f935fd6d01c0f1e733ca42faaaa88dd25
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2022-12-07 07:24:13 +01:00
Amir Masoud Abdol
ca24ee14df Create the versioned variant of Qt tools in cross platform build
In cross builds, we are not creating versioned links for qt tools. This
patch addresses that. I've changed the signature of the
`qt_internal_install_versioned_link` such that it can be used for
non-target as well, so in cross build the qmake or qtmake.bat can be
processed with the same function.

Fixes: QTBUG-109024
Change-Id: I246621c18325d084622ca92b422e815ed06f1381
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-12-07 07:09:15 +01:00