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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Comparing to true and false doesn't enrich the output.
Change-Id: Ie26a3f3d584f88310b8d4a31cad07be8dc8cb646
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
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>
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>
This got broken with the introduction of the compositor patch.
Change-Id: I7d85795eb537449855a4cce3c8b6b031095c3f7f
Reviewed-by: David Skoland <david.skoland@qt.io>
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>
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>
No need to involve the compiler, make the preprocessor error out.
Change-Id: I37d3f241bd0879ba123fe26342aaaaff74c2fb6b
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
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>
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>
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>
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>
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>
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>
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>
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>
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>
As far as I can tell nothing uses TYPE anymore.
[ChangeLog][QtCore][CMake] The deprecated TYPE option of the
qt_add_plugin() has been removed. You can specify the plugin
type using the PLUGIN_TYPE option instead.
Change-Id: I786fbc772a23ae0037d9a4cf68018e3af5cb061d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This adds a new platform named wasm-emscripten-64
which sets the build and link argument -MEMORY64
You may see this warning, please ignore at your own discretion:
em++: warning: -sMEMORY64 is still experimental. Many features may not work.
[-Wexperimental]
Fixes: QTBUG-104891
Change-Id: I8d3150d239ba72dbef5c2352e0171d6cfbe51b59
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
m_lastMouseTargetWindow pointer may be kept even though the window
has been removed. This leads to memory access problems.
Change-Id: Ie83b607bf5a815540605671dd1d1ad37288074c5
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
The if constexpr chain assumed the "last case" was critical, when
instead we need to handle fatal as well.
Use the opportunity to have the compiler break compilation in case
someone adds a new enumerator in the future and doesn't handle it
(i.e. does not repeat the mistake that I just did).
Thanks to Kai for spotting the problem.
Amends eb63f2eb05
Change-Id: I21e1dfd0dd17ccf0d6403f1dcd6d56cc2a95ce26
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The main use case is to static_assert on it at the end of a
if constexpr / else if constexpr chain.
See P2593 for a discussion about why this is pretty much the
only "allowed" way of doing so, short of running into IFNDR.
I'm actually adding two versions: one for TTP and one for NTTP,
as Qt code uses both.
Apply it in QFlatMap.
Change-Id: Iaff97e350784683d0c3994020b1352d5188931d6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
In no particular order:
* Clean up #includes.
* Document what is protected by the mutex.
* Use explicit, nullptr.
* Use lock managers, not manual calls to lock/unlock.
* Unlock the mutex before notifying the condition variables.
* Condition variables are always meant to be used in a while loop, and
never with a plain if, because of spurious wakeups.
* Don't lock a mutex just to protect a plain integer. We have atomics
for that use case.
* Remove an unneeded signal, therefore also the need of using
Q_OBJECT and the inclusion of the moc-generated file.
Pick-to: 5.15 6.2 6.4
Fixes: QTBUG-108860
Change-Id: I2afc77955b95de8aa5fb88048cd9feb217f83b4f
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Added DBus, StateMachine and 3DLogic modules to windeployqt module list
Task-number: QTBUG-105135
Pick-to: 6.4
Change-Id: Ied8624e87f62bd655db8b82cf9fe20d72873d823
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
The deprecated path in QScreen still allows to provide a
canvas as the screen element.
The order of parameters in replaceChild call was wrong there,
though.
Change-Id: Id499967e3c9cdc1652e2dc251e352b9564c99f70
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
Make explicit that the result is equal to the original.
Use less roundabout ways of saying what conversion was done.
Change-Id: Iec12223cca1ce166ed9767a63e6dec05ba2fa456
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
These two functions were a long way from their closest relatives.
Relocate to make it easier to compare and contrast within the family.
Change-Id: I30062c16b318f222b75b527c6af5b443770fe36a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Various rephrasings in hopes of greater clarity.
Change-Id: I243e248c850d0da06851327fb0e45b3b817c6ba2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The spec+offset overloads include a note about times outside the
supported range; however, this was missing for the time-zone
overloads. Also label all four as \overload.
Change-Id: I371ea8ff7d2fb26f679a078a1d8b5d70a6131c35
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Going into the grungy details of when 1970 started is rather
incidental; it's the start, in UTC, of the year 1970, so phrase it as
such. Thanks to hjk for help with finding clearer phrasing.
Change-Id: I4be60441662d2ca4dcd8c5a448f609d6050f393b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
There is no guarantee that a change to time representation will change
the date and time of the result.
Change-Id: Ib2d481236ca95638e1258baf4fe660b2f38fa229
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Use indent 4, same as the surrounding docs, instead of 2, for consistency.
Change-Id: If929b48e5f35379f389b47c531154c808610b823
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>