Commit Graph

48899 Commits (ad2da2080c8b99665cd32237ab365fee5461cf66)

Author SHA1 Message Date
Timothée Keller ad2da2080c Windeployqt: prevent output for --list option
Some outputs weren't guarded with the optVerboseLevel which caused them
to occur even with the --list option. Add a guard to prevent for that.

Fixes: QTBUG-122257
Pick-to: 6.7 6.6
Change-Id: Ide060cda4ac6f9b4470ca608120e2b8aa4819de5
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2024-03-15 11:42:36 +00:00
Jarek Kobus 63b2cf8a45 QFutureWatcher: Fix race for initial emission of resultReadyAt()
When connecting a QFutureWatcher to the QFuture it will connect to the
output interface, which will queue up events to notify about the current
state. This happens in the thread of the QFutureWatcher.

Since 07d6d31a4c unfortunately the sending
of those events was done outside the lock, meaning the worker-thread
could _also_ send events at the same time, leading to a race on which
events would be sent first.

To fix this we move the emission of the events back into the lock
and because it is now inside the lock again anyway, we will revert
back to posting the callout events immediately, so this patch also
partially reverts 07d6d31a4c

Fixes: QTBUG-119169
Pick-to: 6.7 6.6
Change-Id: If29ab6712a82e7948c0ea4866340b6fac5aba5ef
Reviewed-by: Arno Rehn <a.rehn@menlosystems.com>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2024-03-15 11:42:36 +00:00
Christian Ehrlicher f813b76fb2 SQL/PostgreSQL: cleanup usage of QT_CONFIG(datestring)
Creating a QString from a QDate/QTime works even when
QT_CONFIG(datestring) is not defined, so no need to ifdef it out.

Pick-to: 6.7
Change-Id: Ib3594036f309393b612d3fbf21f51be9c36a9391
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-03-15 12:42:36 +01:00
Anton Kudryavtsev f76af5f78c TimeZone: optimize offsetFromUtcString
Use view types more to avoid needless allocations

Change-Id: Ifdf5c8f6fecc54a0583444fbf3fe151c2c20002e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-03-15 11:08:13 +00:00
Anton Kudryavtsev 2d6c4b5ee7 FreeType: reduce allocations in computeFaceIndex
Change-Id: I6693f14b38be7d4fa09378674bcf5da1883608a4
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2024-03-15 14:08:13 +03:00
Christian Ehrlicher 91f8d1de37 SQLite: Update SQLite to v3.45.2
[ChangeLog][Third-Party Code] Updated SQLite to v3.45.2

Pick-to: 5.15 6.2 6.5 6.6 6.6.3 6.7
Change-Id: I3b841bc009f2e0ed6dcfa1b93cbb8bce0cd9ad47
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-03-15 07:29:59 +00:00
Mitch Curtis f1bb9cfbf6 Add AA_DontUseNativeMenuWindows
Also add some categorized logging output to make it easier
to check if native menus are being created.

[ChangeLog][Qt Core] Added AA_DontUseNativeMenuWindows
application attribute. Menu popup windows (e.g. context menus,
combo box menus, and non-native menubar menus) created while this
attribute is set to true will not be represented as native top level
windows, unless required by the implementation.

Task-number: QTBUG-69558
Change-Id: Iba11b89c67d942ce6c5a28a7c57a86e63c020618
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2024-03-15 13:32:47 +08:00
Wladimir Leuschner df24438e6a QWindows11Style: HighDPI aware qDrawPlainRoundedRect
Pick-to: 6.7
Change-Id: Ic9562a20bce59c265c539a1378f5f8fd8e9e9a17
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-03-15 03:59:26 +00:00
Timothée Keller c6fff128d7 Revert "Windeployqt: remove unused library list"
This reverts commit a05abede68.

Reason for revert: Causes QTBUG-123325

Change-Id: I251b67798af3d768db6f2836b52ded558c0c8211
Pick-to: 6.7
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2024-03-14 23:55:29 +00:00
Thiago Macieira 2781c3b624 SQL/MySQL: pass UTC date/time stamps to the server
The MYSQL_TIME structure doesn't support per-datum timezone and in any
case the server would not store it: the TIMESTAMP type is always stored
in UTC. So instead let's configure the session time zone to UTC and use
QDateTime to convert to/from it.

Fixes https://bugs.kde.org/show_bug.cgi?id=483060

[ChangeLog][SQL][MySQL] Fixed a bug in passing QDateTime to be passed as
local time to the server, regardless of the QDateTime's time zone
setting. This would cause certain timestamps to be rejected by the
server, such as a UTC time stamp whose time numerically matched the
local timezone's spring forward gap in the transition into Daylight
Savings Time.

Change-Id: I6818d78a57394e37857bfffd17bbce4ae43e823c
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2024-03-14 12:30:33 -07:00
Thiago Macieira b5d73636d2 SQL/MySQL: merge toMySqlDate (which returned MYSQL_TIME) into exec()
It was the only place that called it. Makes the code slightly uglier,
but removes a function that returned a raw pointer. More importantly, it
gets the actual type from QVariant, without relying on it internally
converting from QDateTime to QDate and QTime, or failing to do so in
some cases. This is going to be needed for the next commit.

Pick-to: 6.5 6.6 6.7
Change-Id: I6818d78a57394e37857bfffd17bbcd3f5057eadc
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2024-03-14 12:30:32 -07:00
Allan Sandfeld Jensen 59d1ab57da Strength reduction: div -> mul
Replace all divisions by constant with multiplications of its inverse

Change-Id: I05aa0631e8117e7d42da0eaa30077cd230caa919
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-03-14 20:22:33 +01:00
Allan Sandfeld Jensen 5f516b2442 Optimize cuberoot using Newton-Raphson approximation
Change-Id: I23a2515b42ef6592df0a18f04420670dc2b4ac1a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-03-14 20:22:33 +01:00
Thiago Macieira 111c08d0ea QFutureInterface: fix build with GCC14/C++20: template-id not allowed
When declaring a constructor, you must use the injected name, not a
template.

qfutureinterface.h:472:37: error: template-id not allowed for constructor in C++20 [-Werror=template-id-cdtor]

Pick-to: 6.6 6.7
Change-Id: I6818d78a57394e37857bfffd17bbbf2313001cbf
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2024-03-14 14:11:52 -04:00
Piotr Wierciński a5b00cefef wasm: Dont access QNetworkReply header data through dangling pointer
Fixes: QTBUG-122893
Pick-to: 6.5 6.6 6.7
Change-Id: I3768fdffaec7be4ec0b559fdb365600220e648d1
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2024-03-14 18:11:52 +00:00
Kai Uwe Broulik 4812497786 Move qt_blurImage to Qt GUI
Allows to use it without Qt Widgets or Qt Graphics Views.

Since anyone having imported this through Qt Widget will also be
linking Qt Gui this should be compatible.

qt_halfScaled is also unexported for lack of known users.

Change-Id: I39406dfd4839ed46f8cbfd4651577ab6ece9932c
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2024-03-14 19:11:52 +01:00
Marc Mutz e102edfbf8 QTest::qWaitFor: remove superfluous check for isForever()
When a QDeadLineTimer::isForever() then its remainingTime() is
chrono::nanoseconds::max(), which is exactly representable as
chrono::milliseconds, and greater than 10ms, so the following code
would have done the right thing already.

Let it.

This also removes the duplicate mentioning of the 10ms sleeping
timeslice.

Amends fa296ee1dc.

Pick-to: 6.7
Change-Id: Ibc32d6069b78cd4583df07d0707d98645440b36c
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-03-14 15:54:55 +01:00
Marc Mutz f38ba1827c QTest: add missing <chrono> to qtestsupport_core.h
Don't rely on transitive includes.

Pick-to: 6.7
Change-Id: I350922a47842ad5bdad0dc3f8349b0c82dd4bd0d
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2024-03-14 15:54:54 +01:00
Marc Mutz dd5925fedb QTest::qWaitFor: make a comment terser
...and adjust it to its presence in the new QDeadlineTimer overload,
which sports nanoseconds granularity.

Pick-to: 6.7
Change-Id: Ifa9658ca32c5dc4bef5cf36dec2e452174eebe1c
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-03-14 15:54:54 +01:00
Marc Mutz 710eda7da8 QTest::qWaitFor: remove superfluous qthread.h include
Amends 1abea5f5f1.

Pick-to: 6.7
Change-Id: Ic4be7ed9508ae07eaa0f1d618090c8f44bb431fc
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-03-14 15:54:54 +01:00
Alexey Edelev 31a91d2e93 Ensure that per-ABI builds are sequential
The current approach doesn't work correctly because external project
steps that we run on per-ABI build directories look as
'cmake --build <abi/build/dir> --target <target_name>'. When the
project has a single APK this works perfectly fine. But when building
more than one apk this leads to the simultanous build in the same
'abi/build/dir' which causes undefined behavior and concurrent access
to the build artifacts. This is especially sensible when APK targets
have the common dependencies.

The solution is split for two usecases:
- Ninja-like generators, that support job pools.
- Other generator.

For Ninja-like generators we now create job pools per-ABI with job number 1,
this convinces ninja to run only one 'cmake --build' command in single ABI
scope.

For other generators the solution is not that good. We create the dependency
chain between all APK targets and this leads to the build of the unwanted
dependencies. For example if project has apkA and apkB targets, then
apkB_x86 will depend on apkA_x86(assuming x86 is not the main ABI). This is
the only way we may ensure that 'cmake --build' commands won't be running
simultanously.

Fixes: QTBUG-122838
Pick-to: 6.7
Change-Id: I6f48fae57047a29129836168c28e14cde4eaa958
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2024-03-14 15:54:54 +01:00
Piotr Wiercinski a6e7274704 wasm: make qtloader.js use FS.createPreloadedFile when preloading
Currently qtloader.js fetches and copies the files manually. By doing
so we are missing some preproccessing by Emscripten preload plugins.
Use Emscripten API to preload files, so preload plugin for .so can
download, compile and resolve dependencies of imported shared libraries.

This makes looking for dependencies in preload_qml_import.py no longer
needed. Remove redundant code.

Fixes: QTBUG-121817
Change-Id: Idd35f25d5f54123910f813a636407eea23e157cb
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
2024-03-14 14:54:53 +00:00
Laszlo Agocs 0c85b69b86 rhi: gl: Further enhance depth-stencil support for QRhiTextureRenderTarget
...in particular when doing multisampling with multiview.

With this the results are now identical with multiview and
multiview+MSAA on the Quest 3. (previously the depth buffer
was clearly broken when doing multiview+MSAA)

Change-Id: Iec3c6af66510ab76cb0591eb8d002aa5855a399e
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2024-03-14 15:54:53 +01:00
Laszlo Agocs 1b374fc4c1 rhi: vulkan: metal: Ensure ms color data is written out on PreserveColor
Fixes: QTBUG-123211
Pick-to: 6.7 6.6
Change-Id: Id037f8c5a69c2b0ec18d92fe8bb5a34a0a2b0ea0
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2024-03-14 15:54:53 +01:00
Laszlo Agocs bc61d6fcfa rhi: Make it possible to discard depth/stencil even when using a texture
Also implement this for OpenGL ES since it can be relevant with tiled
architectures wrt performance.

Task-number: QTBUG-122669
Change-Id: I90dcfe4f5f9edbb8dfb51189d46b89ef2c7a7c06
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2024-03-14 15:54:53 +01:00
Laszlo Agocs 4c49e0fde4 rhi: gl: Add GLES-specific multisample rendering to texture path
One is not enough, we have to have three code paths for three sets of
APIs/extensions.

Task-number: QTBUG-122669
Change-Id: Id10e19dfcfe16a8c21b6c932965f09539f061549
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2024-03-14 15:54:53 +01:00
Tor Arne Vestbø c956eb8edd Reparent QWindow children when reparenting QWidget
When a QWidget was reparented, we would take care to reparent its
backing QWidgetWindow as well, into the nearest QWindow of the
new QWidget parent.

However we would only do this for the reparented widget itself,
and not any of its child widgets. In the case where the widget
has native children with their own QWindows, the widget itself
may not (yet) be native, e.g. if it hasn't been shown yet, or
if the user has set Qt::WA_DontCreateNativeAncestors.

In these scenarios, we would be left with dangling QWindows,
still hanging off their original QWindow parents, which
would eventually lead to crashes.

We now reparent both the QWindow of the reparented widget (as
long as it's not about to be destroyed), and any QQWindow
children we can reach. For each child hierarchy we can stop
once we reach a QWindow, as the QWindow children of that
window will follow along once we reparent the QWindow.

QWindowContainer widgets don't usually have their own
windowHandle(), but still manage a QWindow inside their
parent widget hierarchy. These will not be reparented
during QWidgetPrivate::setParent_sys(), but instead
do their own reparenting later in QWidget::setParent
via QWindowContainer::parentWasChanged(). The only
exception to this is when the top level is about to
be destroyed, in which case we let the window container
know during QWidgetPrivate::setParent_sys().

Finally, although there should not be any leftover
QWindows in the reparented widget once we have done
the QWidgetWindow and QWindowContainer reparenting,
we still do a pass over any remaining QWindows and
reparent those too, since the original code included
this as a possibility.

We could make further improvements in this areas, such
as moving the QWindowContainer::parentWasChanged() call,
but the goal was to keep this change as minimal as possible
so we can back-port it.

Fixes: QTBUG-122747
Pick-to: 6.7.0 6.7 6.6 6.5
Change-Id: I4d1217fce4c3c48cf5f7bfbe9d561ab408ceebb2
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-03-14 13:50:36 +00:00
Tor Arne Vestbø b30121041c QMessageBox: Respect explicit accept/reject after closing dialog
If the dialog is closed by pressing a button, the button will be
reflected via clickedButton(), and the result() will reflect either
the QMessageBox::StandardButton value, or an opaque value for custom
buttons.

Depending on the role if the buttons, the accepted or rejected
signals are emitted.

If the user called accept() or rejecct() on a dialog that had
already been closed by a button, we would as a result of
1f70c073d4 emit a signal based
on the original button that was clicked, instead of respecting
the newly triggered function.

It's a questionable use-case, as the clickedButton() is still
the original button e.g., but we should still avoid regressing
this, so we now emit the signals based on the newly stored
result code instead of using the clicked button as the source
of truth.

To allow this we had to change the opaque result() value for
custom buttons to stay out of the QDialog::DialogCode enum,
but this should be fine as the documentation explicitly says
that this is an opaque value.

Fixes: QTBUG-118226
Pick-to: 6.7 6.6 6.5
Change-Id: Ia2966cecc6694efce66493c401854402658332b4
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-03-14 14:50:36 +01:00
Tor Arne Vestbø d8371ebbd2 macOS: Forward application{Will,Did}FinishLaunching to reflection delegate
If a custom application delegate is installed prior to creating the
Qt application delegate we will forward callbacks to the delegate,
but this has to be done manually for any callback we implement.

Fixes: QTBUG-122996
Pick-to: 6.7 6.6 6.5
Change-Id: Ia25e2c4b8cac37130d604c772c875c5d76c66764
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2024-03-14 14:50:36 +01:00
Wang Zichong 2dbcb25bfa QMessageBox: ensure setTextFormat() also apply to informative text
QMessageBox::setTextFormat can set the text format for its text label,
but the informative label will still use its default text format. This
change allow the setTextFormat also apply to the informative label, thus
user can use their preferred format like Markdown in the informative label.

Task-number: QTBUG-122712
Change-Id: I6f7487b29712ca07cee27171453312ff1707eea3
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2024-03-14 21:40:53 +08:00
Marc Mutz 2ff93ea0ee QRestReply: fix "No relevant classes found." moc warning
QRestReply is no longer a QObject, so remove the includemocs line from
the .cpp file.

Amends 9ba5c7ff6a.

Pick-to: 6.7
Change-Id: I6c0ba6b9e3b82f84f3b509755e7da5b33e607776
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
2024-03-14 11:44:16 +01:00
Marc Mutz ef7b641a3c QTest::qWaitFor: scope a variable tighter
When fa296ee1dc ported this function
from int timeout to QDeadlineTimer, the need to keep this variable
outside the do-while so it could be checked in the loop exit condition
fell away.

Moving the definition of the variable to the first (and only)
assignment makes the code clearer and the variable a constant.

Amends fa296ee1dc.

Pick-to: 6.7
Change-Id: I7a0fe01dc68ff140beeb0e76b141c84d4bd28458
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2024-03-14 06:35:42 +00:00
Thiago Macieira 6708107873 Bootstrap: remove unused sources
qiterable.cpp is even a comment-only source.

Change-Id: I01ec3c774d9943adb903fffd17b79d567a435594
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2024-03-13 18:48:21 -08:00
David Faure d1aa7b3d19 Remove QObjectPrivate::isSender/senderList, no longer used
Only QAccessibleWidget was using them, and this was changed some time
ago. No point in keeping dead code.

Change-Id: I14bc40e6d87df234987e82385ce13433c2b82744
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-03-14 02:58:02 +01:00
Timothée Keller a88b6bca21 Windeployqt: improve multiple directory warning
The multipleDirs warning was added to avoid surprises related to where
windeployqt would deploy files when using binaries from different paths.
To do this properly, make the warning message more meaningful, and
suppress the warning when the --dir option is specified, i.e. when the
user is already explicitly choosing where to deploy.

Pick-to: 6.7 6.6
Change-Id: Ie2984f4af740776c568610370d49ad4ff85ffff0
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2024-03-14 02:58:02 +01:00
Thiago Macieira a30824a984 Bootstrap: remove the UTF-16 and UTF-32 codecs
Unlike most of everything else in the Bootstrap lib, this is code that
couldn't be eliminated by the linker because they were referenced in one
static array. Maybe an exceptionally smart whole-program analysis could
do it, but GCC and Clang LTO modes don't do that now.

I removed the code that performed detection from HTML and from data too.
I could have left the detection of UTF-8 and "other" but this code
wasn't necessary. In particular, QTextStream couldn't benefit from it
because it already defaults to UTF-8, so the detection code would never
determine anything different from the input.

Drive-by removed QStringConverter::availableCodecs() too because it was
in the middle of functions #ifdef'ed out to.

This reduced the size of release-mode moc
   text    data     bss     dec     hex filename
1079858    5440     640 1085938  1091f2 original/moc
1074386    5200     640 1080226  107ba2 updated/moc
  -5472    -240       0   -5712         difference

Change-Id: I01ec3c774d9943adb903fffd17b7f114c42874ac
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
2024-03-13 17:29:14 -08:00
Thiago Macieira 6508902d89 Bootstrap: remove qnumeric.cpp by using qnumeric_p.h
That is, use the inline functions that refer to <numeric_limits> and
<cmath> directly, instead of the out-of-line wrappers. Someone should
verify if the hacks for QNX's <math.h> are still required.

Change-Id: I01ec3c774d9943adb903fffd17b7ee560b4b71b9
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2024-03-13 17:29:14 -08:00
Thiago Macieira d637bc0a5a Bootstrap: remove QDirListing/QDirIterator
Bootstrapped tools don't usually need to list directories; they should
operate on file lists passed to it by the build system instead.

This may deserve a QT_FEATURE.

Change-Id: I01ec3c774d9943adb903fffd17b7ecfba2702fc5
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2024-03-13 18:29:13 -07:00
Thiago Macieira af383319f6 QSingleShotTimer: use the Duration alias from the event dispatcher
Just so we don't accidentally use different precisions. Amends commit
bfc7535a10.

Change-Id: I83dda2d36c904517b3c0fffd17b5258e88dd194e
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2024-03-13 17:29:13 -08:00
Thiago Macieira f8da484d57 QEventDispatcher*: port the Unix dispatchers to V2
They're all ported in one go because all the changes are the same and
they all rely on QTimerInfoList. The changes are:
 - use Qt::TimerId to uniquely identify timer IDs
 - use Duration (nanoseconds) to specify the timer interval
 - rename registeredTimers() to timersForObject(), which is const

Change-Id: I83dda2d36c904517b3c0fffd17b52958767d8a68
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2024-03-13 17:29:13 -08:00
Thiago Macieira 9dc2935462 QTimerInfo: store nanoseconds instead of milliseconds
No change in behavior, other than the ability for the precise timers to
be even more precise. There's a reduction in the stored interval range
from 292 million years to 292 years, but there's no change in behavior
because the timeout is stored as a steady_clock::time_point, which is
nanoseconds with libstdc++ and libc++. Now, if there's an overflow,
it'll happen on the call to registerTimer() instead of inside the
calculation of the wake-up.

Change-Id: I83dda2d36c904517b3c0fffd17b3d1f2d9505c1c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2024-03-13 17:29:13 -08:00
Thiago Macieira 1ca89b65d8 QAbstractEventDispatcher: port timer uses to the V2 API
Change-Id: I83dda2d36c904517b3c0fffd17b52b71739928dc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2024-03-13 17:29:13 -08:00
Thiago Macieira afa86c60e6 QTimerInfo: correct CoarseTimer beyond the [20ms,20s] range earlier
Simplifies some code.

Pick-to: 6.7
Change-Id: I83dda2d36c904517b3c0fffd17b3d18f2dfbc2b3
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2024-03-13 17:29:12 -08:00
Thiago Macieira 7ce75b1a2b QAbstractEventDispatcher: add an adaptation layer to use V2 methods
This way, we can begin using the V2 methods now, regardless of whether
the concrete dispatcher class has been ported or not.

Change-Id: I83dda2d36c904517b3c0fffd17b52a6256b083af
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2024-03-13 17:29:12 -08:00
Thiago Macieira af6afad3b3 Short-live QAbstractEventDispatcherV2
This class is a temporary hack to enable transition to an API based on
std::chrono for the Qt event dispatcher. In Qt 7, it will be merged with
QAbstractEventDispatcher, replacing the pure virtuals there with the
ones defined here.

The new API differs from V1 in the following ways:
 - uses Qt::TimerId instead of int to identify timer IDs, so we can't
   accidentally confuse them with something else
 - uses Duration (nanoseconds) to specify the interval, instead of a mix
   of int and qint64
 - add the missing const to remainingTime()
 - rename registeredTimers() to timersForObject() (I'd have kept the
   original name but we can't overload the name if the parameters are
   exactly the same; we could have used QT6_DECL_NEW_OVERLOAD_TAIL, but
   I think the new name is actually better)

Because the old API was mixing int and qint64, we didn't officially
support any timer for more than 2^31 ms (~24.85 days). This should
extend the valid range to 292 years once the dispatchers are ported
over.

Change-Id: I83dda2d36c904517b3c0fffd17b3a7e0afef4b59
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2024-03-13 17:29:12 -08:00
Anton Kudryavtsev e10c9b5c0f QTextMarkdownImporter: use string view more
to reduce allocations. While touching code, reorder condition
and extract string literal to remove magic number

Change-Id: I3972097dc9b976438e9ba0029f674cea2614f966
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-03-13 19:34:23 +00:00
Anton Kudryavtsev ed553b720d QTextDocumentFragment: use range for more
to improve readability

Change-Id: I42109e33fc076763c5b681d4837a81399c5aed5d
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2024-03-13 22:34:23 +03:00
Tatiana Borisova 1cd95e3165 QCborValue: use new comparison helper macros
Replace public operators operator==() and operator!=() of QCborValue
to friend method comparesEqual().
Replace public operator<() of QCborValue to friend method
compareThreeWay().

Use QT_CORE_REMOVED_SINCE to get rid of current comparison methods
and replace them with a friend.

Delete #if 0 && __has_include(<compare>) blocks,
since they are not required anymore.

Task-number: QTBUG-120300
Change-Id: I884ff6ce2a71618b0e3eaa907f0852f93c2a073c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2024-03-13 20:34:22 +01:00
Ivan Solovev 5ea434b09f QOperatingSystemVersion: use partial ordering for relational operators
QOperatingSystemVersion intentionally does not define operator==() and
operator!=() since ae072cd9c4.
It means that we cannot use comparison helper macros.

Still, we can manually define four relational operators or
operator<=>() in C++20 mode, and give the class a partial ordering.
We choose partial ordering, because versions of different OS types are
incomparable.

Implement the operators in terms of helper function compareThreeWay(),
which potentially allows to use this class in some templated code.

As a drive-by: make the static compare() function noexcept, because
it really is.

Fixes: QTBUG-120360
Change-Id: Id4c9ce740e42baa719ca0ee84146d087b21675c6
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-03-13 20:34:22 +01:00
Ivan Solovev e55ee873e9 QTypeRevision: use comparison helper macros
QTypeRevision consists of two quint8 values: major and minor version.
Each of the versions can be unknown.
The rules for comparing with the unknown version are as follows:

 zero version < unknown version < non-zero version

At the same time, two unknown versions are considered equal.

This makes the comparison a bit tricky, but it still fits into the
category of strong ordering.

Replace the existing friend relational operators with helper functions
and comparison helper macros, making this type strongly ordered.

Update the unit-tests to use the new comparison helper test functions.
As the test functions check the reversed arguments as well, we can
reduce the number of rows for the data-driven comparison test.

Fixes: QTBUG-120359
Change-Id: Ib6f1037fc7b5fed148e35ee48b56b05dcd36b3b4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-03-13 20:34:22 +01:00