Commit Graph

69263 Commits (dce6ef8fac794282cc4cc59617b2b5dc68e0c4df)

Author SHA1 Message Date
Thiago Macieira dce6ef8fac QThread/Unix: do clean up the QAdoptedThread for the main thread
Commit 1ed0dd88a3 ("QThread/Unix: make
QThreadPrivate::finish() be called much later") introduced this problem.
Commit 4fabde349f16b59f37568da2a4c050c6dd53a34e split the thread
termination in two phases, but did not fix this.

This re-applies commit 950b35cf97 ("Clear
the current thread data for the main thread"), which was reverted in
commit 7dc622290b ("Make sure QThreadData
and QAdoptedThread object is destroyed at app exit"), both from Qt 5.1.

Between Qt 5.1 and 6.7, the responsibility of clearing the
QAdoptedThread for the main thread was split: it could occur either in
~QCoreApplicationData if exit() was called in that thread or in
~QThreadData() if it wasn't (e.g., when the Qt "main thread" is not
main()'s thread):
  * frame #0: 0x0000000101db8a28 QtCore`QAdoptedThread::~QAdoptedThread(this=0x000060000176c070) at qthread.cpp:139:1
    frame #1: 0x0000000101db81eb QtCore`QThreadData::~QThreadData(this=0x0000600002468000) at qthread.cpp:82:5
    frame #2: 0x0000000101db8379 QtCore`QThreadData::~QThreadData(this=0x0000600002468000) at qthread.cpp:57:1
    frame #3: 0x0000000101db841c QtCore`QThreadData::deref(this=0x0000600002468000) at qthread.cpp:108:9
    frame #4: 0x0000000101f4ec79 QtCore`destroy_current_thread_data(p=0x0000600002468000) at qthread_unix.cpp:104:11

This commit centralizes and gives ~QThreadData() the exclusive
responsibility.  That requires not resetting QThreadData::threadId so
~QThreadData can know it is theMainThread.

Fixes: QTBUG-130895
Task-number: QTBUG-129927
Task-number: QTBUG-129846
Task-number: QTBUG-130341
Task-number: QTBUG-117996
Change-Id: Ie3f3cbdc5523837b505cfffd95fba5e6498b5069
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 65093a84c2b94b1543fd4593bc45d491951d28d4)
2024-11-15 03:17:29 -07:00
Dheerendra Purohit 3d9a48ad37 QProgressbar without text does not progress smoothly
The jerk with QProgressBar occurs when setTextVisible(false) is used.
Condition exists to handle repaint when text visibility is true but not
handled when text visibility is false.
Usage of auto leads to type confusions.

Add the logic to repaint for every 1 pixel change in the value when
text visibility is false.
Avoid using auto when type is obvious.

Fixes: QTBUG-45048
Change-Id: I0fdc62c7aabdaef52bc4bdc20e82141a4a7d29d5
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 913b98d4120b56487a14eb96b5e5252fdd939603)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-14 23:46:16 +00:00
Eskil Abrahamsen Blomfeldt 83a749c4f9 Upgrade to Harfbuzz 10.1.0
[ChangeLog][Third-Party Code] Upgraded Harfbuzz to version
10.1.0.

Pick-to: 6.5 5.15
Fixes: QTBUG-131150
Change-Id: Idd8380b77ad861456cbd7260ad43af9a93fee58a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 4f4c07e94d997473eefe2dae9927766009692496)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 88cf96680095f003404dd7282a7a36785f6e8e14)
2024-11-14 23:46:16 +00:00
Alexandru Croitor 79a6660ec9 CMake: Decouple applied cmake policies from CMake version set
We might want to raise the minimum CMake version for building or using
Qt, while keeping the minimum and maximum CMake policy NEW values
lower than the CMake min/max versions, because bumping the policy
values requires more testing.

Previously we always used the min cmake version as the lower range
for the policies.

Split QT_MIN_NEW_POLICY_CMAKE_VERSION and
QT_MAX_NEW_POLICY_CMAKE_VERSION
into per-type variables:

- QT_MIN_NEW_POLICY_CMAKE_VERSION_QT_SHARED
- QT_MIN_NEW_POLICY_CMAKE_VERSION_QT_STATIC
- QT_MIN_NEW_POLICY_CMAKE_VERSION_QT_APPLE

- QT_MAX_NEW_POLICY_CMAKE_VERSION_QT_SHARED
- QT_MAX_NEW_POLICY_CMAKE_VERSION_QT_STATIC
- QT_MAX_NEW_POLICY_CMAKE_VERSION_QT_APPLE

And change qt_internal_upgrade_cmake_policies to use the min new
policy as the lower range, instead of the min cmake version.

Task-number: QTBUG-131169
Change-Id: Ib39a377edf20e497dc8f7d742b48d102a66c6a95
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 572a313bb9678a920f5c59617b8a15a7b4866a7c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-14 18:59:00 +00:00
Ivan Solovev d17bb8fa85 Doc: fix deprecation version for QScopedPointer's member-swap()
The code tells that it's deprecated in 6.2, while the docs were
mentioning 6.1. Update the docs to use the correct deprecation version.

Amends 1bf48c16b166c80d208f130fb4f8130f63ef741c.

Pick-to: 6.5 6.2
Change-Id: I4ec3b8e840ec5aa534ea1f2687a23584178bb4a6
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 0b34a205cc3ab6985efa705d066e85167ce0181c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-14 18:58:59 +00:00
Alexandru Croitor 6a77e6f550 CMake: Fix install location of dSYM bundle for Qt apps
Previously we used the TARGET_FILE genex as the destination where
to place the extracted dSYM bundle of an app in the build folder. For
Qt apps that have the MACOSX_BUNDLE property set, this is incorrect,
because it placed the dSYM bundle inside the app bundle.

We then manually install the dSYM bundle to the correct location.

Because the build folder app bundle still contains the dSYM
bundle, and CMake copies the entire app bundle dir when installing the
app, this resulted in installing the dSYM bundle twice.

Aside from waste of space, this is also against the Apple guidelines,
and leads to certain issues with code-signing.

Check the MACOSX_BUNDLE property to determine if the executable is a
bundle, in which case treat it the same way we treat framework
bundles, by placing the dSYM bundle next to the app bundle.

Change-Id: I7fb8fe49e0b26d0df8a32fc82530bbee32b51382
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit a60d42d873e67281e5e30bcaa3daa2f8edffe7eb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-14 17:45:36 +00:00
Alexandru Croitor d2fe1537f5 CMake: Move separate debug info handling to an executable finalizer
Currently the separate debug info handling is done inside the call of
qt_internal_add_executable. But there might be extra properties set
after the executable is created, which we might want to consider when
handling the separate debug info, like whether the executable is a
macOS bundle.

Introduce a new qt_internal_finalize_executable finalizer. Move the
separate debug info handler to be called in this finalizer.

To be consistent run the separate debug info handler in a finalizer
for qt tools as well.

Change-Id: I46412249aaab099628a50b11efff541f5719aff5
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit aa06c8dbfa0fc4bf573ef7be7706a76d812bae55)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-14 17:45:36 +00:00
Axel Spoerl d952be28ff Fix tst_gestures flakiness on XCB
X11 spawns painting threads and sends an expose event at the same time.
While the worker is still paining, QXcbScreen::topLevelAt() may not
find the window, even if it reports being exposed.

Wait until windows are exposed and painted.
Remove workaround to intercept warnings about undeliverable gestures.
Remove qWait() antipattern.

Fixes: QTBUG-130811
Fixes: QTBUG-84258
Fixes: QTBUG-69648
Fixes: QTBUG-67393
Fixes: QTBUG-67392
Fixes: QTBUG-67389
Fixes: QTBUG-68861
Fixes: QTBUG-70224
Fixes: QTBUG-70223
Fixes: QTBUG-67395
Fixes: QTBUG-70227
Fixes: QTBUG-70226
Fixes: QTBUG-70209
Fixes: QTBUG-70153
Pick-to: 6.5
Change-Id: Id126fe884ba360551425f3e2b29674f5b9419fff
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 705bac063cc5ec535ff5467a208d5653555ae8f9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-14 17:45:35 +00:00
Alexandru Croitor d0ff36878d CMake: Remove double addition of LicenseRef-ICC-License to the SBOM
It's already automatically added as part of the license iteration code
in _qt_internal_sbom_begin_project which globs
${PROJECT_SOURCE_DIR}/LICENSES/LicenseRef-*.txt and adds those.

Adding it a second time manually is unnecessary, and breaks conversion
to SPDX 3.0 with the spdx java preliminary tool.

Task-number: QTBUG-122899
Change-Id: Id42a02c6f2e536880b37a0ed773cf62426b46b97
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit b11aaf066eaf1491a1661dd8f3baa66acfbd46f6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-14 15:04:35 +00:00
Jani Heikkinen 429bf6cbb2 Bump version to 6.8.2
Change-Id: I6cc4fcc89a134afabc464f18adc3d0c3c01b8a78
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-11-14 15:04:34 +00:00
Lars Schmertmann 7463b443ce Remove lint expection in developer build
Avoid lint exception for dependency updates in
the developer build so we do not miss updates.

Change-Id: I7856a2773e49258c6497ae5d4978a4ea519e9a04
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 6bb3feffd56424d0990b1345f343012a60e3351e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-14 12:08:52 +00:00
Christian Ehrlicher 0f80bb1811 SQL/Doc: add notes about QDateTime handling
Add a note on how timestamps are handled for the different database
drivers.

Task-number: QTBUG-130118
Change-Id: I1bad480fa18b5b719870635db1444c8db8c7d966
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit d63f14473345cdb83c2da00a19892f57e661a5d0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-13 23:56:26 +00:00
Thiago Macieira 2b3e56e2b4 QCoreApplication: use QThread::isMainThread() more
QCoreApplicationPrivate::mainThread() asserts that there is a main
thread, which means we can't use it to detect after the main thread has
been unset (late destructor-on-exit).

Change-Id: Iedcd0827d1e659f3de35fffd60cac0b47cc496bb
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 9bac90db46913ae70fd29676cb22890b4ac9aaa4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-13 21:57:00 +00:00
Thiago Macieira 752ee25559 QCoreApplication: remove now-unnecessary thread affinity check
Partially reverts commit 65953e05d3 (the
rest will be addressed in the next commit) now that we have an atomic
access to the QCoreApplication instance.

This thread-affinity check code was there because the code had a data
race in accessing QCoreApplication::self. It ensured that we only read
that variable if the receiver was in the main thread, because if a
receiver is not in the main thread, then it can't be QCoreApplication.

Change-Id: I09618961cca80fef2dc1fffdab65316164023207
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit a90349aa2141767147498d8f6a6d69dc25af89bc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-13 21:56:53 +00:00
Thiago Macieira a00bff6525 Add a way to access QCoreApplication's instance atomically
We use it from many places in Qt that may run before QCoreApplication
has been created (officially not supported but it happens) and after it
has been destroyed. In particular, we have code in QtDBus that runs in
another thread after QCoreApplication has been destroyed and uses the
event system. Accessing QCoreApplication::self anywhere but the main
thread was a race condition in those conditions.

Change-Id: If4ad1af9301dca98ba69fffdf88c63b220db53ac
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 7d92ecd9173a5ce4af8eb6ac05d6e7648d433db4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-13 21:56:47 +00:00
Volker Hilsheimer ced0e12987 iconbrowser test: URI-encode the remote path
Otherwise the download fails. We need to provide both the encoded path,
and the name for the local file, as cmake doesn't provide an encoding
helper.

Change-Id: Id2d1c197f9ee1326ee229ebd32e5af156c970aed
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 5ecbba1648676a9b2ca6a097c133ff5e9e0a4bd1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-13 18:04:25 +00:00
Marc Mutz 7d60aa0ab2 tst_QPromise: complete the port to RUN_TEST_FUNC
When we consolidated "all" test functions to use RUN_TEST_FUNC, the
cancel() test function was inexplicably overlooked.

This patch ports this last test function.

Amends 4c00337ccb8e4266fa5a4af4fba40e5b62aba81b, whose commit message
contains rationale for this change, but not repeated here.

Pick-to: 6.5 6.2
Change-Id: I9461f8e816a25c731d6229df15ee88dcc8c4e165
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 3e71f256d5813ef699a4030f718fee1d1e53bba1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-13 18:04:25 +00:00
Marc Mutz 6be6081ffe [docs] Add missing docs for QScopedPointer::swap()
Only the ADL swap was documented, but this class has member-swap, too
(albeit deprecated), so document it.

Pick-to: 6.7 6.5 6.2
Change-Id: I71a6636172170387c9e4a264d2d118c2a9ce6f91
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
(cherry picked from commit 1bf48c16b166c80d208f130fb4f8130f63ef741c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-13 18:04:25 +00:00
Alexey Edelev 97420aaa46 Android: Do not duplicate copy_if_different command for android target
The CMake copy_if_different command, which copies the android target
library to a libs/<arch> directory could be executed in different code
paths which caused a multiple access to a same file in a filesystem.

Avoid doing this and depend on <target>_prepare_apk_dir target for the
depfile code path too.

Pick-to: 6.5
Change-Id: Ib62cf24ecc69a17ce1b52cd1f001aeff866051cd
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 76fef03f19ab2a41ec9fdc9a72a08b5e1ea80a95)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-13 18:04:25 +00:00
Allan Sandfeld Jensen b52a0f8e10 Fix ubsan warning of illegal cast and illegal method call
Avoid casting an event to a type it does not have. Instead use a static accessor class.

Task-number: QTBUG-99563
Change-Id: Ideb11779b1510cd10a27fb8bc40bcc8e4849bf15
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit acc3ef6653c710b509e9321663986910f88ac3b4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-13 14:22:36 +00:00
Mate Barany 3b541daff7 Add type annotations to CldrReader
Add some type annotatons to cldr2qlocalexml.py as well. Based on the
default arguments the constructor of CldrReader was expecting callables
that return None, but in reality we are passing in functions that
return integers.

Task-number: QTBUG-129613
Change-Id: I06832240956ea635ca0cc0ec45c466a3b2539ff7
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 812f79e75f2d6f2675c4b032f3a98610721e98de)
2024-11-13 15:08:05 +01:00
Edward Welbourne 33bf7dc9f8 Make static constexpr data tables inline in corelib/t*/q*_data_p.h
This should keep gcc from complaining that they're unused const
variables. Pick to 6.8 required conflict resolutions in non-generated
code and qlocalexml2cpp.py due to dev's updates to handle time zone
name L10n; regeneration of data took care of the other conflicts.

Fixes: QTBUG-128930
Change-Id: I4d0bccc5f158dfc72e4cf38a085b90cb562dc185
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 08ef4d232df82c056d4f5fda636b62b65fc054ad)
2024-11-13 15:04:00 +01:00
Volker Hilsheimer 686c4835c1 QMenu: don't show an empty menu
If a menu contains no or only invisible actions, then its sizeHint might
become invalid (depending on style), resulting in an invalid geometry.
In that case,  return early from popup(). Otherwise we try to show popup
window with an invalid size, which results in unpredictable behavior,
depending on the windowing system.

To minimize possible fallout from this change, don't return early from
QWidget::show (or QWindow::setVisible), but fix this locally in QMenu.

The QMenuBar test used empty menus to confirm that hovering over other
menu bar entries would highlight the menu bar entry under the mojuse,
and close the currently open menu. This can be tested better and more
reliably  with menus that are not empty, which is (probably) also going
to fix the test on wayland.

Fixes: QTBUG-129108
Change-Id: Icc52528e89baefea04b3b27e6f02674bf74162b2
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 353ce5344fbde5a6cecbdd2c131e1cf0f4b7f383)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-13 05:12:11 +00:00
Christian Ehrlicher ca65f94003 Windows11Style: add styling for PE_IndicatorBranch
Add PE_IndicatorBranch so the correct arrows are used instead the
windows 10/vista ones.

Change-Id: I5328a91b883078b4564890729f73dbfc573cbf00
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
(cherry picked from commit 02bf12072feee46f3b5f966a88f5094c55553b48)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-12 23:07:13 +00:00
Paul Wicking d4f782814e Doc: Move Easing Curve example into Graphics category
This example is for the animation framework (graphics),
it isn't about multimedia. Use the correct category.

Change-Id: I32f0ce13a5496c8fbc871d8f2454575c25684eba
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
(cherry picked from commit 382fd3010b5ba8038a6bfe4415f06a0f6ed8029b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-12 23:07:13 +00:00
Edward Welbourne 696daaf050 Let QDateTimeEdit control the century to use for two-digit years
Amends commit 41f84f3ddb - in which I
neglected QDTE. It just needs to set defaultCenturyStart to its old
initial year to match the prior behavior.

Fixes: QTBUG-126698
Task-number: QTBUG-46843
Change-Id: If1edafe25778ad064f8f4393c8b1b3bbf5c957dc
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 130e066868634f4663b4640ee1923eece1c171b1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-12 23:07:13 +00:00
Lars Schmertmann 9dc063e7de Avoid linter warning "Obsolete Gradle Dependency" for androidx
This is a Qt dependency that the user cannot influence.

Pick-to: 6.8.1 6.5
Change-Id: I6efbfefb5901588f4c99b4edfa05b21b68ab01a7
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit cfefce57a4ff446305cd1f839e7c5203bac7a6c5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-12 20:06:57 +00:00
Christian Ehrlicher ab1f7d56ab Windows11Style: sync PE_IndicatorHeaderArrow with PE_IndicatorBranch
Make the sort indicator arrow drawn in PE_IndicatorHeaderArrow a little
bit smaller (the same size as for PE_IndicatorBranch.

Change-Id: I34035a845b1a0f5ebdb1257d802360ce3df7e703
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
(cherry picked from commit 8945f7d6eb6c370ab5992d6250194f7b2c9df969)
2024-11-12 17:23:37 +01:00
Marc Mutz e228cd14e4 Create qdoc macros for C++ class docs 1.4: member-swap(), \internal
We have some patterns for how to document certain functions, but we
also vary the sentences a lot, and you have to look up one
documentation piece and copy it, essentially. If we ever want to
change them, we end up with shotgun surgery.

So apply DRY to the documentation and start a collection of macros to
help with repetitive C++ class documentation tasks.

The first macro is for member-swap(), and this fourth patch is for
documentation that used to be \internal. But the classes are public,
so don't hide the swap() member functions, document them.

Task-number: QTBUG-129573
Pick-to: 6.7 6.5 6.2
Change-Id: Id81b5ace05a7ccaf2a2194ebd56af10e8a98d7be
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 5a9bd64366b2ce2757843db0358cd48e4369b3d7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-12 13:09:02 +00:00
Marc Mutz b8c9a4c3d1 Create qdoc macros for C++ class docs 1.3: member-swap(), non-standard phrasing
We have some patterns for how to document certain functions, but we
also vary the sentences a lot, and you have to look up one
documentation piece and copy it, essentially. If we ever want to
change them, we end up with shotgun surgery.

So apply DRY to the documentation and start a collection of macros to
help with repetitive C++ class documentation tasks.

The first macro is for member-swap(), and this third patch is for
documentation that used a non-standard phrasing for documenting
member-swap(). By using the macro, the documentation automatically
conforms to what the documentation team picks as the \memberswap
expansion going forward.

As a drive-by, fix doc block indentation to the Qt standard of 4
spaces (only in changed lines), and add a few blank lines where they
were missing before.

Fixes: QTBUG-129573
Pick-to: 6.7 6.5 6.2
Change-Id: If007602d7690572fcbb848a8d0235416c908cfd2
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 82058367923ce164024885854c139ee5e0d89949)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-12 13:09:02 +00:00
Marc Mutz e1f46ee8ae Create qdoc macros for C++ class docs 1.2: member-swap(), simplified phrasing
We have some patterns for how to document certain functions, but we
also vary the sentences a lot, and you have to look up one
documentation piece and copy it, essentially. If we ever want to
change them, we end up with shotgun surgery.

So apply DRY to the documentation and start a collection of macros to
help with repetitive C++ class documentation tasks.

The first macro is for member-swap(), and this second patch is for
documentation that used the simplified phrasing ("Swaps this X with \a
other."), which this patch adopts as the text for \memberswap, too,
because it doesn't repeat the macro argument, making it easier to find a
grammatically-fitting argument than in the traditional phrasing.

This doesn't change the documentation, except as follows:

* standardizes on simpified instead of traditional phrasing for docs
  that already use the \memberswap macro
* adds the "very fast and never fails" blurb, if it was missing
* changes the function's argument name to `other`, as required by
  the macro.

Task-number: QTBUG-129573
Pick-to: 6.7 6.5 6.2
Change-Id: I1123e783ce0da76c5997ff74007d77504ac5b334
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 5627e113793df3df24742d7af502a075c2c9e95d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-12 13:09:02 +00:00
Marc Mutz 285bfffc63 Create qdoc macros for C++ class docs 1.1: member-swap(), traditional phrasing
We have some patterns for how to document certain functions, but we
also vary the sentences a lot, and you have to look up one
documentation piece and copy it, essentially. If we ever want to
change them, we end up with shotgun surgery.

So apply DRY to the documentation and start a collection of macros to
help with repetitive C++ class documentation tasks.

The first macro is for member-swap(), and the first patch is for
documentation that used the traditional phrasing ("Swaps the X \a
other with this X.").

This doesn't change the documentation, except as follows:

* adds the "very fast and never fails" blurb, if it was missing
* changes the function's argument name to `other`, as required by
  the macro.

Task-number: QTBUG-129573
Pick-to: 6.7 6.5 6.2
Change-Id: Ib494bd218334724b3b43796ba6f71fb52b83aa94
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 3ccb4ce781463f1b8e0cb4c9283b3067fe92a32e)
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2024-11-12 13:09:01 +00:00
Oliver Wolff faa5f5ad31 qwindowssystemtrayicon: Fix position of popup window
The code in QMenu::popup relies on
QGuiApplicationPrivate::lastCursorPosition being up to date to decide
on the final position of the popup being shown. As cursor movements
outside of Qt windows do not trigger an update of that position, we have
to do a forced update of it in QWindowsSystemTrayIcon::winEvent.

Fixes: QTBUG-130832
Pick-to: 6.5
Change-Id: I45523688e21e294819337c69ad5b48eba5178446
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 922369844fcb75386237bca3eef59edd5093f58d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-12 13:09:01 +00:00
Tor Arne Vestbø 1e7a6451f8 qpa: Add logging when registering and unregistering QInputDevice
Change-Id: If2e7d106a449f3dc8ecb148540e21e1b70ec180e
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit ba4227ece04dd751e1a68f3bb5779d93ea830b73)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-12 10:13:35 +00:00
Tor Arne Vestbø b41bded9b8 qpa: Export lcQpaInputDevices (qt.qpa.input.devices) for QPA plugin use
And use from macOS and xcb platform plugins.

Change-Id: I84a2d933551a59cf220ecb6841d8d756e58724a0
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit 9d8744c77b03eb091061976dd084cb0ca3f6252b)
2024-11-12 10:13:33 +00:00
Jarno Lämsä c81e250f85 Don't support moving files to trash on VxWorks
On VxWorks 24.03, the `AT_FDCWD` wasn't defined, which happened to
branch to the correct branch. VxWorsk 24.09 TP does define the
`AT_FDCWD`, which causes the preprocessor directives to branch to a
branch where moving files to trash would be supported.

In a sidenote, VxWorks doesn't define `renameat`, `O_DIRECTORY` nor
`O_NOFOLLOW`.

Task-number: QTBUG-130629
Change-Id: I2b850813aeff6f925ab91932efd7aeb13f753f69
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 039b0c6b9b94eb7601fa3b652e8b668d32251f7e)
2024-11-12 04:42:51 +02:00
Tor Arne Vestbø 6ade020b22 macOS: Take QT_SCALE_FACTOR into account when applying NSWindow geometry
Amends 31ec108dd08d6381a15e49b6fbec9337705c3b2a.

Fixes: QTBUG-131093
Pick-to: 6.5
Change-Id: I1fa947e9b4e15c18e4638f0374a9980b2ae2e571
Reviewed-by: Vladimir Belyavsky <belyavskyv@gmail.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit 1e7581fafbaa20971b2ff649738f6b7a95084167)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-12 02:42:51 +00:00
Assam Boudjelthia 07807794f7 Android: fix potential null InputMethodManager object access
Ensure we don't end up calling methods from a null m_imm object
inside runAction(), the code was guarded outside the call but not
inside where it can still happen.

Fixes: QTBUG-129684
Change-Id: I41d7e64a028f551bb53d177e16a77e7ae512a84e
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
(cherry picked from commit 33ef9330f67dd3c6603fb222e1556c31591f1fd9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-11 20:00:53 +00:00
Johannes Grunenberg 4a27d0fe0a QWidget: clamp own rect in pointInsideRectAndMask
The rect of an empty widget (i.e. 0 width/height) will, after adjusting
by -1, be invalid as it will have a width/height of -1. In turn, calling
contains(p) on that rect can return true even though the rect is empty.

Fixes: QTBUG-131001
Pick-to: 6.8.1
Change-Id: I604f5942589f1c1079cae90bd0d3b104344d2c55
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: David Faure <david.faure@kdab.com>
(cherry picked from commit 1731d8af741a0a6cc6cd293be4aef52103d0899b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-11 19:47:03 +00:00
Timur Pocheptsov 51b7476893 QIOSFileDialog: present image picker view without 'parent'
QFileDialog::show()/exec() can be called without having any parent
at all, so the check for 'winGuard' in authorization callback
would prevent image picker from being presented. In the end
we don't need this parent and using 'presentationWindow()' instead.
Check before asking for authorization that we indeed have/no
a parent window.

Fixes: QTBUG-130973
Change-Id: Ie3ba285dfff82ac3f53245a032e133bc26763883
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 6026a5aa21d1c11a87ce76a18e497b9547213e27)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-11 19:47:02 +00:00
Christian Ehrlicher a6a0a38343 QWidget: delete 'extra' in dtor
Call d->deleteExtra() in dtor of QWidget to make sure it's cleaned up
before QWidgetPrivate calls it which might access the already deleted
QWidget through deleteTLSysExtra() /
QWindowContainer::toplevelAboutToBeDestroyed(q).

Amends 006cbf658ea1f5986bbe1baafa7c146780320661.

Pick-to: 6.8.1
Task-number: QTBUG-130932
Change-Id: I9109072a457cc01abd5d1b4e844a3ed3309d942b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 482c41fb6187f3ee1df11e7936fb60f65d12995a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-11 18:34:22 +00:00
Axel Spoerl 05dfd8a0bd tst_Gestures::conflictingGesturesInGraphicsView(): use dynamic size
The test function assigns a hard coded rectangle to gestures and uses
the default size of a graphics view at the same time.
The leads to flakiness, where the gestures can't be delivered when their
size is out of bounds of the view's geometry.

Assign size size dynamically, according to the view's geometry.

Task-number: QTBUG-130811
Pick-to: 6.5
Change-Id: If75f59d15f84e610b4ec987daa2a06ce62539228
Reviewed-by: Frederic Lefebvre <frederic.lefebvre@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 6995709992344ac608f2b2a19b2c3883019bfaeb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-11 18:34:20 +00:00
Joerg Bornemann 997b7d5454 a11y atspi: Fix wrong signal/slot connection
This amends commit 38251c36edf11316a2467169b1d491bf13520fd3.

QDBusServiceWatcher doesn't have a checkEnabledState signal. Use the
correct serviceRegistered signal.

Fixes: QTBUG-131009
Pick-to: 6.8.1
Change-Id: I3f0cdb53929c263d05438b1f5324b51163346d49
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: <ales.astone@gmail.com>
(cherry picked from commit 9f539ab9c111ee30ee1e35ee5927b3bfbb040bda)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-11 18:34:14 +00:00
Alexey Edelev 3db58b2b4f Add the missing check of IntegrityPlatformGraphics_REQUIRED_LIBRARIES
This will allow merging the updated toolchain, otherwise qt5 fails
to find OpenGL and friends. The whole block will be removed once the
toolchain file is merged.

Task-number: QTBUG-128455
Change-Id: If355b1c6360dba7b3567023430785c6d109f9fe8
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit c0b9dc00145a6d2123b99ab8b1de692af5ead39a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-11 18:34:14 +00:00
Pieter Dewachter 828ece4743 Improve performance of QTabWidget::clear
The current implementation of QTabWidget::clear is quite poor because it
deletes the tabs from first to last. When I was playing around, I found
out it's much faster to delete from last to first (with a lot of tabs it
goes from two seconds to 200 milliseconds in my testing). I assume this
has to do with the redrawing of all remaining tabs for each removeTab
call, while this is not necessary when removing in the reverse order.

Also, disable the stack widget's layout while we remove all tabs to
avoid unnecessary event posting, and disable updates of the stacked
widget as well as the tab bar.

Change-Id: I04972de05ab71f98da7f74412aaadc69a36efc32
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 8717c1752f9b72ac7c028b722f0a068e84e64eca)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-11 18:34:14 +00:00
Eskil Abrahamsen Blomfeldt 214101b1b3 Remove assert in QImageTextureGlyphCache::fillTexture()
The assert assumes that we are calculating the transformed bounds
of a glyph with exactly the same parameters as the image of the
glyph is later transformed.

However, when calculating the new bounding box of the glyph in
alphaMapBoundingBox, we do:

  t.mapRect(QRectF(gx, gy, gw, gh))

And then round the width and height up.

When we transform the image of the glyph, we do:

  t.mapRect(QRectF(0, 0, gw, gh)).toAlignedRect()

Note the origin is at origo and we align the rect. This can lead
to the actual transformed image sometimes being larger than what
is returned from alphaMapBoundingBox().

We could change alphaMapBoundingBox() to match the behavior of
the image transform, but it has a risk of missing some corner cases,
especially given that the same code paths are used for scalable
bitmap fonts.

In the end, just removing the assert is safe, since there is a
qMin() protecting against buffer overruns later, and there does
not seem to be any visual difference from actually calculating
the correct bounds.

[ChangeLog][Freetype] Fixed possible assert when transforming
bitmap fonts.

Pick-to: 6.5
Fixes: QTBUG-130930
Change-Id: I0406e6f45e0d436a5248dd986703bb3a9288b9f4
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
(cherry picked from commit fd75a66f3f65f6c8e8bfb933260676b5c18f2df1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-11 15:39:28 +00:00
Eskil Abrahamsen Blomfeldt 3a0e4b6147 Freetype: Fix transformed text when subpixel AA is on
6ba003f732 fixed transforming
bitmap fonts for the case where 8 bit antialiasing is used.
This is the case when a transform is set on the painter by
the user, but for some reason it is not when high-dpi is
enabled, triggering QTBUG-111796.

An attempt was made at fixing this by drawing the
untransformed glyphs into the cache and then transforming
them as they were put on the screen. This worked with
Qt Quick, but the raster engine does not support this and
instead falls back to QPainterPath rendering in that case.
So b492582b9c caused a
regression and was reverted.

A simpler fix which works for both Qt Quick and QPainter
is to draw the pre-transformed image of the glyph into
the cache for 24-bit AA, same as for 8-bit AA.

In addition, this changes the transformation to nearest
neighbor instead of interpolating, because bitmap fonts
are typically intended to look crisp and it also matches
how native rendered fonts are scaled in Qt Quick.

Fixes: QTBUG-111796
Change-Id: I2d9fd9d98d32820e677916c3d1c744331a72175b
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
(cherry picked from commit b6247ced7e83af4d51ba20be8068f28cc8c006bc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-11 15:39:28 +00:00
Ahmad Samir 60065cc08e platforms/windows: fix deprecated C++ 20 implicit capture of this in [=]
With MinGW, GCC and Clang `[=, this]` is acceptable in C++20 mode, but
MSVC on the CI still builds with C++17. So use `[&]`, the other two
variables used inside the lambda are (const) built-in types, taking by
reference is the same as taking by copy.

Amends a90d99d8da9b2be2e6b8e981cd9dabfb1641e985.

Change-Id: Ib1c746ccf1c02b2ee3891eca5bddd7e47f559dc5
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit bac7f20acd37911813bd774afea55823b8320aa2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-11 15:39:28 +00:00
Alexandru Croitor 79507816fa CMake: Run finalizers for test-like executables on all platforms
Previously we ran some finalizer functions for tests and manual
tests, only for specific platforms, and via different code paths.

This change introduces a new unified way of running all finalizers for
all test-like executables, including benchmarks.

To ensure a smoother transition, the new way is opt-out, and the old
way can be enabled by setting the QT_INTERNAL_SKIP_TEST_FINALIZERS_V2
variable to true in case we encounter some issues in the CI.

The finalizers are only run for test-like executables, and not all
internal executables, because there are some unsolved issues there.

One particular case is in qtdeclarative where that will create a cycle
for qmlimportscanner to depend on itself.
A proper solution here would be to have some kind of mapping or
mechanism to exclude finalizers for targets where they would try to
run themselves.

Task-number: QTBUG-93625
Task-number: QTBUG-112212
Change-Id: I52b3a1c02c298c4a18ce2c75d7e491ae79d191a0
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 25f575e8513a7e49ac73c7e1cb24dcaf3803358e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-11 15:39:27 +00:00
Alexandru Croitor feaeb68a20 CMake: Mark benchmark executables with a property
This will be used in a follow up patch to identify them.

Task-number: QTBUG-93625
Task-number: QTBUG-112212
Change-Id: I39d5eb9f79ac67af0808efeda4d7f4e0a6908cc9
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit df040fb1115071fbea80213814b7dc34b17ba085)
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2024-11-11 16:39:27 +01:00