The modification to the existing constructor was necessary to avoid
ambiguous overloads from plain strings. They'd previously only match
QByteArray, but now they match QByteArrayView too.
The QByteArray constructor must stay even in Qt 7 because the pattern is
stored. The QByteArray indexIn also stays in because of ambiguous
overloads. Unless we want to remove the const char* overloads.
Change-Id: I2bbf422288924c198645fffd16a92859b67f3978
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
We were to strict in what surface type we allowed scrolling for. The
RasterGLSurface type is an odd one, used by widgets to compose GL
and raster content, which means we still have a raster backingstore
we can scroll. It's just the flush that's different.
Pick-to: 6.2
Change-Id: Ia229c21c00ad38df9e87f4fc78e341e030ef228d
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
The --skip-benchlib option was misnamed: there are several benchlib
tests, of which it only skipped the callgrind one. As there is no
other test involving callgrind, rename to --skip-callgrind.
Change-Id: I0179fd35dd79c525f79e4a28a626e964323409bf
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The comment against the use of this claimed qvsnprintf() lacks 64-bit
support, which is probably untrue by now but certainly irrelevant as
the value being formatted is a qreal, not a 64-bit integral type.
Since %g wants a double, make the value passed explicitly double by
casting its denominator. Casting its numerator to qreal was
superfluous as that's its type already.
Change-Id: I5ff885fbeb9b638b2b0507061e0a19e3b8522143
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Make the overloads taking a size private (they're only called by the
implementation of the others) and have them take qsizetype for the
size, rather than size_t. Make the still-public ones consistently
return 0 on failure and move the documentation to them.
Change some spurious checks (QTestCharBuffer::size() is necessarily
positive) to assertions, use '\0' for the nul character to make it
visually distinct from the integer 0. Use a do..while loop instead of
break-ing out of the tail of a for (;;) loop. Remove spurious extra
nul-termination - the function taking size alread did that, so the
wrapper to size-expand needn't. Minor style cleanups.
Change-Id: I7440f3d9be5e3b2dd88c2aad62bcd1af9fc02278
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The extern declaration for filter_unprintable() was nowhere used and
no such function is anywhere defined.
The for (;;) loop with lots of reasons to break; was better structured
as a do {...} while loop. A comment on -1 as return from qvsprintf()
was misplaced. The '\0'-termination after calling qvsprintf() was
redundant as vsprintf() reliably '\0'-terminates anyway. Turned a
static const into a constexpr. Assert size (a QTestCharBuffer
necessarily has size >= 512).
Change-Id: I5b7729b9bd66fea0ee7ce3e7cfdde6770f10b36c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The QtNetwork project file excludes the dnslookup source files for Unix,
despite the dnslookup feature is always on. This inconsistency leads to
linker errors when building applications against QtNetwork:
(error #412) unresolved symbols: 1
QDnsLookupRunnable::query(int, const QByteArray &, const QHostAddress
&, QDnsLookupReply *) from libQt6Network.a(qdnslookup.cpp.o)
Turn the feature off for INTEGRITY and remove the condition from the
project file.
Pick-to: 6.2
Change-Id: If086da51ca343f598eb273236e7b6338f5da1e97
Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This patch introduces support for the WinRT UI languages API.
We are using the Win32 API to get the list of preferred languages when
the system locale is used. However, this API returns an incomplete
list.
As Qt 6 supports Windows 10 and above, we can make use of the WinRT
API, if it's supported by the compiler. This API returns the full list,
as reported by the Windows system itself.
Note however, that this API can't be used with Clang and MinGW, so
we still have to fall back to Win32 API for these compilers. We also
do it if WinRT API returns an empty list of languages for some reason.
Fixes: QTBUG-94341
Pick-to: 6.2
Change-Id: I1d23c68d2ec298ae7835d0d18718876ff041aede
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
We don't have any APSPI2 includes in our public headers and should
therefore not export the target that provides ATSPI2 include paths for
consumers.
Link against PkgConfig::ATSPI2 instead of the _nolink target.
The former will not be exported.
Pick-to: 6.2
Fixes: QTBUG-97023
Change-Id: I4b12e0c2230917feeb963c02565e6db24f757bd3
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
The `QFont` documentation refers to Roman Czyborra's personal page with
the intent of providing information about encodings.
The page seems to have been down for many years and may contain
information that is now deprecated such that it is now replaced with a
link to the Unicode Technical Report 17 about the Unicode Character
Encoding Model.
The new link was chosen as a substitute as it seems to cover or provide
the intuition for, standing by the last captured version of Roman
Czyborra's personal page on the Wayback Machine, many of the same
concepts.
Task-number: QTBUG-96127
Pick-to: 6.2
Change-Id: Ibf901b5023688c14efb3d6f77a10609f7ba80e72
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
The "qt" property can also be filled with a json object like this:
"qt": {
"x86":"/home/.../Qt/6.3.0/android_x86",
"x86_64":"/home/.../Qt/6.3.0/android_x86_64",
"arm64-v8a":"/home/.../Qt/6.3.0/android_arm64_v8a",
"armeabi-v7a":"/home/.../Qt/6.3.0/android_armv7"}
That allows to update the options.qtInstallDirectory when changing the
current architecture.
The "qtHostDir" property is also added to provide the path to the qt
host installation (rcc, qmlimportscanner).
Change-Id: I3f0c36cc7a7030d45adc1a4dccaaad61dd538aea
Task-number: QTBUG-88841
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Calling emscripten_async_run_in_main_runtime_thread_()
with a pointer to a static lambda was too clever, use
an anonymous function as callback instead.
Pick-to: 6.2
Task-number: QTBUG-94344
Change-Id: I2d8a8b0ffc2dd1d02018aa5902550216d00f641d
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
With the QRegExp variant removed, it was weird to have all QSFPM
tests in "tst_qsortfilterproxymodel_regularexpression", even those
completely unrelated to regexps. Instead of reuniting into a single
executable as before, I simply split it out in separate executables:
* tst_qsortfilterproxymodel has the "standard" QSFPM tests
* tst_qsortfilterproxymodel_regularexpression has the regexp-related tests
* tst_qsortfilterproxymodel_recursive is separate as before
Change-Id: I345530b4352671164008bba4805af7b12ac90247
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
The await() method waits for the result of async operation in a
non-blocking way (triggering processEvent periodically).
It means that during this wait some other things might happen, and
there would be no reason to wait for the end of the operation execution.
This patch implements an additional parameter - a function that specifies
a condition for an early return. When this function returns true, the
await() method returns with E_ABORT, which makes it possible to
distinguish it from timer expiration.
Task-number: QTBUG-96057
Pick-to: 6.2 5.15
Change-Id: Ide73d768b7cbb3a35be7160ce7555aeb2dca5235
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Juha Vuolle <juha.vuolle@insta.fi>
\relates takes a class name as argument, but doesn't deal nicely
with a templates full definition.
Pick-to: 6.2
Task-number: QTBUG-97028
Change-Id: I7c608717c5d552bc553073534104dece01b8ff96
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
We can only start timers in threads started via QThread, and even then
we cannot assume that the thread runs an event loop. So only start the
timer when we are in the main thread.
Add a test that verifies that we don't get the warning message.
Pick-to: 6.2
Change-Id: I40d7d9ff115720f9ecd3eedaebbade2643daf843
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Qt6Config.cmake calls cmake_minimum_required to ensure a recent enough
CMake version is used in projects.
That call does not set policies in the calling subdirectory scope,
because find_package introduces a new policy scope.
If a project using Qt has a 'cmake_minimum_required(VERSION 3.1)'
call and is configured with a recent CMake, many policies will
still be set to OLD.
One such policy is CMP0071 (Run AUTOMOC on GENERATED files). The
policy value is queried at generation time rather than at target
definition time, which means we can't influence the policy value
(e.g. inside the implementation of qt_add_executable for example)
The inability to influence the policy value for targets created by our
own CMake functions is unfortunate and can lead to issues (in the case
of the above policy to compilation / linker issues).
Record the version of the last cmake_minimum_required call before
the Qt packages are found and error out if the version is lower than
the minimum supported one.
A project can reduce the error into a warning by specifying a
-DQT_FORCE_MIN_CMAKE_VERSION_FOR_USING_QT_IN_CMAKE_MIN_REQUIRED=3.xyz
option when configuring the project.
If the option is used and build issues arise, no official support is
given.
All the CMake example projects shipped with Qt specify a minimum
version of 3.16 already (which is the minimum for shared Qt builds),
so it shouldn't be an issue to require that in other user projects as
well.
Implementation wise, we follow the existing pattern to record
what the minimum and computed versions for static and shared Qt
builds are at qtbase configure time.
These are then checked before the Qt6 or QtFoo packages are
find_package'd.
Amends 6518bcc167
Pick-to: 6.2
Task-number: QTBUG-95018
Task-number: QTBUG-95832
Change-Id: I1a1d06d82f566c92192a699045127943604c8353
Reviewed-by: Craig Scott <craig.scott@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Not relying on some implicit include coming from other include.
Pick-to: 6.2 5.15
Fixes: QTBUG-96621
Change-Id: I11f6a20e98871eacee51ad723c484f25916c2882
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Don't bother overwaiting in waitForDone(), if it was done at one point
after it was called we can return true. And do not stop threads recently
awakened by a startThread call as they have tasks to do.
Make allowing at least one thread regardless of reservation more
standard instead of hacked in certain places.
Pick-to: 6.2
Change-Id: I304bcdc5822f440d5e72fc33ba2aa1678c9ba0d0
Reviewed-by: David Faure <david.faure@kdab.com>
If we know at compile time that a window system interface event will be
delivered synchronously, then we can allocate it on the stack avoid a
new/delete. This is the case for a large number of events.
Add a template helper class that is specialized for the three delivery
types to allocate the event object on the stack if possible, and on the
heap otherwise. We can use that factory in the event handler functions,
via a helper function, to replace the heap-allocation and call to
handleWindowSystemEvent.
Done-with: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Change-Id: If92fc91ef07f3542a37dfb0fed20e15a3d19b8f0
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This header is a C++17 feature that is already used unconditionally
in qtypeinfo.h.
Change-Id: I26330d298e95102f3e94c0c69fc95c1025666eb4
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Testlib is not thread safe. Store the status into variable and check
it in the main thread instead.
Pick-to: 6.2
Change-Id: I840c8a3dceb1115a1b81ffeaa0fab96f9d2f1ff0
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Qt requires a compiler that support C++17 thus __cplusplus
is always 201703L or higher. This patch removes checks
for __cplusplus value that always succeed.
Change-Id: I4b830683ecefab8f913d8b09604086d53209d2e3
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Item views can open an editor widget on the first key press, and need to
take special care not to break input methods. The initial key press
starts compositing by the system input method, which is then interrupted
by the focus transfer to the editor.
To solve this problem, the widget needs to keep focus while the initial
composition is ongoing, and only transfer focus to the editor once the
composition is either accepted or cancelled by the user. Add a state flag
that is set during this initial preedit phase.
During this initial composition, the item view will receive all input
method events, and needs to forward these to the open, but not yet focused
editor for the user to get the correct visual feedback during the preedit
phase. The item view also needs to report to input method queries on
behalf of the editor to make sure that the IM UI is correctly positioned
without covering the user input.
Implement a test that simulates the sequences through synthesized
QInputMethodEvents; we can't simulate the entire system input stack.
Fixes: QTBUG-54848
Change-Id: Ief3fe349f9d7542949032905c7f9ca2beb197611
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
In addition to checking the .lnk extension, check that the
the specified path is not a path to a directory.
Pick-to: 6.2
Fixes: QTBUG-85058
Change-Id: I83cef3d94c6ffa82a88f374c5b41779e88fe40b8
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
At the current state, Qt::WA_StaticContents is not respected on any
platform, and optimizations for opaque widgets is not implemented on
Cocoa.
Task-number: QTBUG-73117
Change-Id: I48b7b0c4436da5a609fdbe51bb1c9789a2a059bd
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This is a manual test of QWindow::requestActivate() and how it
interacts with implicit activation from the window system. Written in
order to test QtWayland, but hopefully also useful for testing on other
platforms.
Task-number: QTBUG-91542
Change-Id: Id18dc6d146d213a7c730cff343d9fc25f6c42514
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
On macOS, we get explicit notifications when a window becomes or resigns
the key, before we have had a chance to close open popups. The popup is
then closed later, but the delivery of the WindowDeactivate event has
already been aborted as QApplication interprets such notifications while
in popup mode as delayed focus events.
This leaves the focus widget still displaying focus even though its
window is no longer active. Trying to activate the window again then
does not correctly transfer focus.
To fix this, close all popup explicitly when a window resigns key.
Task-number: QTBUG-78750
Fixes: QTBUG-66513
Fixes: QTBUG-69710
Pick-to: 6.2
Change-Id: I590757c7d3532dbe4b5358a8e121ce8aa871a699
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
When building for armeabi-v7a, building and APK using
"ninja foo_make_apk" works. Building it by calling
"gradlew assembleDebug" works. Opening the "android-build" folder
in Android Studio and clicking the "Build" button works.
But clicking the "Run" or "Debug" button in Android Studio does not
work when the attached phone is arm64-v8a. Then Android Studio
automatically selects the v8 architecture which does not find the Qt
libraries. This patch adds explicit ABI selection to the gradle
configuration files. With explicit ABI selection, Android Studio does
not try to outsmart you.
Pick-to: 6.2
Fixes: QTBUG-96701
Task-number: QTBUG-87022
Change-Id: I4ad6356c38b7eca004c0e0dbbb357cab7de84c0f
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
QDoc modifies its linking behavior depending on whether the -installdir
command line option was set or not; Without -installdir, QDoc will
use 'https://<url>' to link to targets loaded from external
documentation modules, instead of using relative paths.
Drop the -installdir if QT_BUILD_ONLINE_DOCS was set. This behavior matches
the 'build_online_docs' scope that was used for qmake documentation
targets, and is useful for documentation projects that are not part of
Qt but want to link to Qt docs simply by loading the index files of Qt's
modules.
Pick-to: 6.2
Change-Id: Ib1bbf7b9d784e0c276d2bc520240af4a6c8ba903
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
This fixes a bug where calling exec() on a secondary
thread would make the thread exit.
Task-number: QTBUG-94344
Pick-to: 6.2
Change-Id: I259c7ebbd53271609af88aca141d88c282cbcd34
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
In the Android gradle files, the variable qt5AndroidDir refers to Qt5
and might confuse users. This patch renames to qtAndroidDir.
Pick-to: 6.2
Change-Id: Ib18a3cd2c38646e4c6c0435dae9234f0f7887eb5
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Store isWidgetType and isWindowType once to avoid multiple tests, and
use a single QWidget* variable for widget receivers once we handle those
explicitly, rather than separate declarations for each event type.
Fix indentation to make it more obvious that the entire switch statement
is only executed for widget receivers.
Remove unreachable code for QGraphicsWidget key handling. At that point,
we already know that the receiver is a widget, which QGraphicsWidget is
not, so this code was never executed anyway.
Minor clean-ups, coding style improvements, and standardisations of
repeating patterns.
Change-Id: Idfe944f041ae82372b17082a5ffc4df13802359b
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
On Android, when the system library directory does not exist,
no error message was given. This led in turn to error messages like
Can't find 'nulllibQt6Core_armeabi-v7a.so'
which are not very helpful.
Pick-to: 6.2
Task-number: QTBUG-80766
Task-number: QTBUG-96701
Change-Id: I4187e4a68d9e78e198152306a3e664c30c51ab18
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
When official version is available variableValue path need to be
changed.
Task-number: QTQAINFRA-4540
Change-Id: Ie5fe676962297aa5f18f225eb4b8dfe0957671c8
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
This adds a few snippets to show how the functions can be used, and also
removes workarounds for oldver versions of qdoc that weren't clang based
- those workarounds also seem to have caused some bitrot.
Remove documentation for an overload of registerMutableView that
currently does not exist (for a member function with an ok parameter).
Fixes: QTBUG-96963
Pick-to: 6.2
Change-Id: Ibc867d08bcacbc7add8c965df9864d6f339a5d54
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
qobject.h has #include <chrono>, which #includes <ctime>, which includes
<time.h>.
datetime.cpp:2621:23: error: 'localtime_r' was not declared in this scope; did you mean 'localtime_s'?
Pick-to: 6.2
Change-Id: I2bbf422288924c198645fffd16a922719c4ce7d4
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
There was a bug in the pdf writer for cosmetic pens when they were
drawn using native pdf strokes (QTBUG-68537). The workaround that was
done for that bug was to disable native atroking for such pens, so
they would always be emulated. The drawback of that was that painting
with dashed cosmetic pens would then produce unexpectedly large pdf
files, since it would contain individual strokes for every dash.
This change fixes the original bug and removes the workaround,
re-enabling native stroking for cosmetic lines.
Pick-to: 6.2 5.15
Fixes: QTBUG-86094
Change-Id: I58d06ad2db81206025ca2de394f072e822c03d47
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
Reviewed-by: André de la Rocha <andre.rocha@qt.io>
In the PDF engine, transforms are implented with a global pdf
transform if and only if the current pen is "simple", that is,
renderable by a native pdf pen. For non-simple pens, the painted
objects are transformed by QTransform instead. Hence, the internal
simplePen flag was used to indicate both a pen state and a transform
state.
This commit splits these two states into separate flags. No behavior
is changed, but it prepares for an improved implementation of cosmetic
pen rendering.
Pick-to: 6.2 5.15
Task-number: QTBUG-86094
Change-Id: If02e1dfc021778e3db7c9ff9a1ed35b3d6cbf3f8
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: André de la Rocha <andre.rocha@qt.io>
To make it a little cleaner
Task-number: QTBUG-91023
Change-Id: Ib99cc722b47835d13707beeeea35573729e4b032
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
MSVC defaults to a C++ dialect which is not standard-compliant. For
a number of years, it has offered a switch (/permissive-) to enable
standards conformance, but it was entirely opt-in. While we do build
(and test) Qt under /permissive-, our users do not necessarily do
that for their own software.
Meaning, we risk subtle bugs and build issues for the code present
in our headers (because users may use them in non-/permissive- mode).
This has already happened multiple times (QTBUG-95880, as well as
19b5520abf).
So far, we couldn't *enforce* /permissive- for client code, as MSVC
didn't deem it stable, and various SDKs (like Windows') were not even
building under it.
This has now changed. /permissive- is now deemed fully stable and
supported, and turned on by default when using /std:c++20 (since VS 2019
16.11 [1]). So, starting from 6.3, we can now pretend its presence.
Unfortunately /permissive- does not set any special macros for us to
test [2], so test one of its side-effects: that an implicit conversion
from std::nullptr_t to bool is ill-formed (the conversion is explicit).
[1] https://devblogs.microsoft.com/cppblog/msvc-cpp20-and-the-std-cpp20-switch/
[2] https://developercommunity.visualstudio.com/t/Pre-define-a-macro-when-compiling-under/1253982?space=62&q=permissive-+sfinae&entry=myfeedback
[ChangeLog][Platform Specific Changes][Windows] When using MSVC
Qt now requires standards compliance mode. This requires passing
the /permissive- command line switch. Note that when using C++20 or
above, the /permissive- switch is implied by default.
Change-Id: I464ed36ff707fa3ada52c543433a6b0ab715748e
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Currently it is not possible to build unit tests for
Android in a developer build.
This patch fixes this.
Fixes: QTBUG-94882
Change-Id: I30ccacc4536032ee3a7fbf05ce90bbbcdb8331a6
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This adds preview support in GTK file dialog implementation,
this is helpful for a lot of applications
like image viewers, messengers and etc.
[ChangeLog][Platform Specific Changes][Linux] A native GTK
file dialog (created via QFileDialog or QtQuick.Dialogs)
now shows an image preview pane.
Task-number: QTBUG-3796
Task-number: QTBUG-53167
Change-Id: Ib80108c09b84d774440a0445adcccab4b64652ef
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Destroy the QDBusPendingCallWatcher object when received
the QDBusPendingCallWatcher::finished signal later.
Pick-to: 5.15 6.2
Change-Id: I1ec67bf7c286f38200c374ad92df2a1579588a8a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Unix QThread implementation stores pthread_t as a system thread ID
when the thread is created, but never resets the system ID when
those threads are destroyed. Some implementations may reuse the
same thread IDs for new threads, and this may cause QThread::wait()
to erroneously complain that "Thread tried to wait on itself".
This patch sets the system thread ID to nullptr when the thread is
about to exit and be destroyed by the system.
A regression test is added to tst_qthread.
Fixes: QTBUG-96846
Pick-to: 5.15 6.2
Change-Id: I0850425dd0e09af50e59c9038e7e662a2a624beb
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>