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>
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>
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>
Use view types more to avoid needless allocations
Change-Id: Ifdf5c8f6fecc54a0583444fbf3fe151c2c20002e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
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>
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>
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>
Replace all divisions by constant with multiplications of its inverse
Change-Id: I05aa0631e8117e7d42da0eaa30077cd230caa919
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
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>
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>
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>
...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>
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>
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>
...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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Just so we don't accidentally use different precisions. Amends commit
bfc7535a10.
Change-Id: I83dda2d36c904517b3c0fffd17b5258e88dd194e
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
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>
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>
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>
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>
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>
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>
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>