69142 Commits

Author SHA1 Message Date
Thiago Macieira
c68c0fb64c QWaitCondition/Unix: fix execution with negative deadlines
pthread_cond_timedwait() doesn't like it.

Change-Id: I37ae26948fbc72fd1028fffd107e561cc54c4553
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit d60472c2c436fc464d5a1b81538967676f71b6a0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-02 16:25:06 +00:00
Joerg Bornemann
d614b12da6 CMake: Report success for 'separate_debug_info' where applicable
Don't disable the separate_debug_info test but mark it as successful on
Apple platforms and MSVC. This enables us to simplify the condition of
the separate_debug_info feature. Also, we fix the error on MSVC when
passing -separate-debug-info to configure.

Fixes: QTBUG-108015
Change-Id: Ifb1f18b2be8a0b5693a3448c1b8198f773f94ffb
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit f663a08f2067f7890e4b71fd1137791a7e96c613)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-02 16:25:06 +00:00
Ivan Solovev
0f2afeba04 Docs: fix documentation for deprecated QDateStream::readBytes overload
The patch that introduced the deprecation lost '!' at the beginning of
the comment block. As a result, the documentation for the deprecated
method was not generated at all.

Amends cbc6ee0eb9ef42c7024fa527bb94ac89953709a6.

Change-Id: Ief2f4aae7e21363224fa44ef42847aa132ea769a
Reviewed-by: Jaishree Vyas <jaishree.vyas@qt.io>
(cherry picked from commit 4ce7235fdd6183478eebfcf2f1d6058a172b285a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-02 16:25:05 +00:00
Alexandru Croitor
45c8ab1149 CMake: Split target finalization code into a separate function
It was duplicated across a few public API.
Splitting it will also allow it to be be reused in a future change
in another function.

Also add the ability to use the poor man finalizer approach for
CMake 3.16, but only via an opt-in that will be set by the qt build
process, so that the finalizers can be used for tests in a future
change.

Task-number: QTBUG-93625
Task-number: QTBUG-112212
Change-Id: I097faf5e3db98457acfdfb3ae2011efb6640f35e
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 2bbc0bda30e0c34ea63f0b6836c34c765a06e049)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-02 14:49:16 +01:00
Alexandru Croitor
ef3db62459 CMake: Add an install_tools target for static builds
We offer a build target called 'host_tools' to build just host tools
and their dependencies within a Qt build, but it was not possible to
easily install the built tools.

Add convenience custom targets called 'install_tools' and
'install_tools_stripped' to install the host tools when building
a static Qt build.

The convenience targets will be useful for qdoc static builds, to
easily be able and install the tools, without having to specify each
tool's install target separately.

The current approach doesn't work for shared Qt builds because it
would necessitate tracking the libraries that the tools depend on, so
those are installed as well.

So for now, this is limited to static builds only, where there
are no shared library dependencies that have to be installed.

The implementation passes 'host_tools' as an installation component
for qt_internal_add_tool installed targets. The custom target then
just calls cmake --install with the component name.

Task-number: QTBUG-91243
Task-number: QTBUG-128730
Change-Id: Ic047ec3b8683043f496b4b2c3cf883a3e70440b3
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit c64190caa7d515e0efc60a3c435d9d779efd5ac3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-02 14:49:16 +01:00
Alexandru Croitor
ff0285ce6b coin: Build qdoc as part of repo instructions for CI doc building
Backstory.

The current approach for building documentation in the CI is that we
build a static qdoc in a Jenkins job, manually provision it in
qt5.git, and then build qt documentation using that somewhat
old qdoc version.

Updating the provisioned qdoc is a very slow process, because changes
first need to be merged into qttools, then a Jenkins job needs to be
manually run, then provisioning needs to be updated, and sometimes it
also depends on a full qt5.git submodule update or has to wait for
other unrelated changes to qt5.git.

The new approach.

This change adds CI instructions to build a static qdoc (and
other relevant tools necessary for documentation generation)
using the latest qttools/dev/HEAD sha1 in a specific host platform's
qtbase build instructions, and then uses those tools for documentation
generation and doc warning checks in each repo's TestDocs CI test
phase.

To enable these new instructions, the host platform and the doc
checking platform need to be tagged with the 'DocsGenerationV2'
feature.

The built tools are cached in a separate archive using a new Coin
feature, which is then extracted during each repo's TestDocs phase.

Pros and cons.

The benefit of this new approach is that we will always use a mostly
up-to-date qdoc from qttools/dev/HEAD when generating documentation,
making the documentation team's life easier.

Specifically, once the doc tools are built in qtbase with the latest
qttools/dev/HEAD sha1 that was available during that integration, the
resulting built tools are then used for doc checks in dependent repos.

A newer qttools/dev/HEAD sha1 will only be used for a particular
repo once the qtbase dependencies.yaml sha1 is updated, or when doing
qt5.git changes that cause a rebuild of qtbase.
Note that while new tools are built due to dependency updates, the
used qttools sha1 is not recorded in any way in any of the
dependencies.yaml files.

qtbase doc checks will always use the latest qttools/dev/HEAD sha1 at
the integration time, because the tools will always be built from
scratch.

The downside of the new approach is that, by default, the doc
generation will not use a pinned version of qdoc anymore,
but rather follow the flow described above. This has a chance of
introducing failures which are unrelated to integrating changes.
This should happen rarely because the doc team usually tries to fix
doc warnings before changing qdoc's code.

If temporary pinning of qttools or qt5.git is required when testing the
docs of a specific repo, it can be achieved as follows:
- set the QT_CI_BUILD_REPO_DOC_TOOLS env var to "1" in the repo
  coin/module_config.yaml file build instructions, to ensure the doc
  tools are built in that repo, rather than reuse the ones built in
  qtbase

- set the QT_CI_DOC_TOOLS_PIN_GIT_REF env var to the desired qttools
  sha1 or other git ref, in the same build instructions phase

- optionally set the QT_CI_DOC_TOOLS_TOP_LEVEL_PIN_GIT_REF env var to
  the desired qt5.git sha1 or other git ref, in the same build
  instructions phase, if a different version of qt5.git is required

- optionally set the QT_CI_DOC_TOOLS_USE_CI_TOP_LEVEL_BRANCH env var
  to ON, in case if the module branch that the CI job computes should
  be used as the qt5.git branch

- set the QT_CI_FETCH_REPO_DOC_TOOLS env var to "1" in the repo test
  instructions, to ensure the just built doc tools are fetched instead
  of the qtbase-built ones

Test running this new approach will allow us to collect some feedback
on how often breakages happen, and how much easier it makes the
documentation team's work, or how much harder it makes the life of
regular integrations.

The abundant amount of optional pinning options should be enough to
avoid any permanent integration dead locks.

Task-number: QTBUG-128730
Change-Id: I8606cb3076036a4a0ec652d0fa74d270e8f5dfdf
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit 1f646bb978ed94c25f6224e801779c929096c0ae)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-02 14:49:15 +01:00
Alexandru Croitor
32a6d50301 CMake: Allow specifying an optional host tools path for doc generation
Introduce a new QT_OPTIONAL_TOOLS_PATH cmake variable that can be set
to a path where some of the documentation generation host tools might
be located.

This allows using specific builds of qdoc, qvkgen, qdbusxml2cpp and
qtattributionsscanner for documentation generation.

QT_HOST_PATH wouldn't be sufficient in this case, because it requires
all host tools to be installed for the given path, otherwise
configuration will fail

In contrast with QT_OPTIONAL_TOOLS_PATH we can specify the paths only
for the tools listed above, while continuing using other build tools
from the usual locations, either built or found.

As a drive-by, fix the usage of CMAKE_EXECUTABLE_SUFFIX to be based
on the host platform.

Task-number: QTBUG-128730
Change-Id: I2796be3a9772b106788ce63a4aed890516e8b716
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit aab8b7727d8acff989dbdf9b01ca7fb2b12da541)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-02 14:49:15 +01:00
Alexandru Croitor
de6615057e coin: De-duplicate test docs instructions
Add a new coin_test_docs_common.yaml file that contains the common
instructions for configuring a documentation warning build.

Task-number: QTBUG-128730
Change-Id: Ifc86570f3c98e64364f3c2c2bb71f45eaaee0c19
Reviewed-by: Toni Saario <toni.saario@qt.io>
(cherry picked from commit 3da46b5fc2ea04be85c458f9eac88dbe1f091757)
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2024-11-02 14:49:15 +01:00
Alexandru Croitor
1e2069b3b3 CMake: Add a script to build qdoc and friends from qttools/dev/HEAD
A new QtBuildStaticDocToolsScript.cmake script is added which:
- clones qt5.git
- initializes required submodules for building doc tools
- checks out qttools/dev/HEAD
- syncs the dependency SHA1s as specified in qttools'
  dependencies.yaml file
- configures qt5 as a top-level static build
- builds qdoc and other tools required for documentation generation
- installs them into a custom prefix under a subdirectory of the
  repo's root build dir.

The script is intended to be used as part of qtbase's CI build
instructions. See the follow-up coin change for reasons on why we want
to do that and how to configure optional ref pinning, instead of using
dev branch always.

Task-number: QTBUG-128730
Change-Id: I836fc2f1b47c07171d2a2bd54a85bc2145212e46
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit f7f02c791bcbee44597f1fe24570ebdf352ec648)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-02 14:49:15 +01:00
Toni Saario
3a665a308d Revert "Coin: sign only x86 packages"
This reverts commit 8d5e7d50d8dbf1ad79bd8ff9f6ef6028eba481c9.

Reason for revert: Arm packages should be sign-able now.

Change-Id: I6a896bfd84927da9c15647d207a6ad5024a27949
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
(cherry picked from commit a33811ee8d746d70a7eba4ba8b1d321ace96f741)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-02 13:49:14 +00:00
Tor Arne Vestbø
cfa9691cba cmake: Always export Apple version requirements
The full set is needed, on all platforms, so that we can use them
during documentation builds.

Pick-to: 6.5
Change-Id: Ie555094a8e365fada7e43da6899e312d774eadb2
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 179982a81a292bfe3f9dc16888f7c9777f1b2251)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-02 13:49:14 +00:00
Tor Arne Vestbø
01d5246695 cmake: Set all Apple version defines in .cmake.conf
Allows us to pick up these defines when building documentation on
non-Apple platforms.

Pick-to: 6.5
Change-Id: Icd1029e87a56ecfa81875f024a7d959250cd9bbe
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit 0c1c3dfad2cf435bde81c11545ad28b73956253c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-02 13:49:14 +00:00
Tor Arne Vestbø
918cd43a84 doc/cmake: Allow passing additional defines to qt_internal_add_docs
Useful to base documentation on data known to the build system,
such as the macOS minimum deployment target.

Pick-to: 6.5
Change-Id: I280f3b34e935c878321c24936a52dce406fdf014
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit db9bd4ab3ba80d8bd31fcdb3fc6f93ed8332a9f9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-02 10:12:29 +00:00
Christian Ehrlicher
168f4aee26 QStyleSheetStyle: Don't calc size for CT_SpinBox when not handled
Let the size for CT_SpinBox be calculated by the base style when
QStyleSheetStyle does not draw the spinbox. This makes sure the returned
size matches the size needed by the style which draws the spinbox later
on.

Fixes: QTBUG-130642
Change-Id: I99aca7440c4ce9800d78f76a209097a93f320cd2
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 96adebed606cdbc73c73778917d777dc04c6e93e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-02 10:12:28 +00:00
Marc Mutz
ced68767da QByteArrayView: port IsCompatibleByteTypeHelper from is_same-chain to specialization
Less templates to instantiate, so faster compilation.

Pick-to: 6.5 6.2
Change-Id: I0552e496895db2710f33b8fd4b555cfa5c2d8157
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 327e8a904cb8e6665b7e42ae35cdcfd2afc84409)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-02 02:48:02 +00:00
Thiago Macieira
44bf5566cb moc: handle nested structs with meta content
We already disallow them for classes; this was a mistake in not handling
the "struct" keyword. The C++ syntax is valid, but moc is unable to
parse two classes at the same time. Users can define the inner outside
of the body of the outer class and that works.

[ChangeLog][moc] Fixed a bug that caused moc to attempt to parse a
nested struct (not class) with meta keywords and this produced code that
wouldn't compile. Nested classes and structures are permitted, but must
be defined outside of the declaration of the outer class.

The fix for this revealed a bug in the presence of Q_DECLARE_FLAGS for
inner classes. This can be easily fixed by moving the token for
Q_DECLARE_FLAGS value outside of the [Q_META_TOKEN_BEGIN,
Q_META_TOKEN_END] range.

[ChangeLog][moc] Fixed a bug that caused moc to reject a class (not
struct) containing Q_DECLARE_FLAGS that was defined inside the body of
an outer class containing Q_OBJECT or Q_GADGET.

Fixes: QTBUG-130498
Pick-to: 6.5
Change-Id: I2a3f148f70280e87302afffd3e7617e5861bb338
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 4e4eef175bc0d0e2a34875ae98f2ddf9eee73b35)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-02 02:02:09 +00:00
Marc Mutz
c6e13deab6 tst_QPromise: remove some unneeded mutable from lambdas
Lambdas that only capture by reference never need to be mutable.

Drop the keyword (and the now-superfluous parentheses).

Amends 385f0732d927f0eba8ecf990ee9bc19936475edd.

Pick-to: 6.5 6.2
Change-Id: Iaa6451c1c26f1aed198c447ee59198c4e0285b15
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 37daf732d5089c58a6428124263243509d152987)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-01 22:54:18 +00:00
Volker Hilsheimer
9e99f2a977 QStyle: block future changes that result in QPainter warnings
Amends ff9818135db28e287e7818defd9c1a9acdebacdc and follow-up changes,
which shouldn't have passed CI as they resulted in runtime warnings
until ca8ca216dbd5d374aa05d96db8052c2411baae7c.

Change-Id: Ib3688779d5bcba06ce992453e62fb841251f6a62
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit 3662be51935827e2fdb384bc407e055470e831c0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-01 22:54:06 +00:00
Volker Hilsheimer
20fbd34400 QHeaderView: update the view correctly in resetDefaultSectionSize
Changing the default section size requires that we inform the parent
view of the header about size changes, and that we update the header
so that we repaint with the new section sizes. This didn't happen.

The private setDefaultSectionSize implementation does all that. However,
QHeaderView only remembers if the default section size was explicitly
overridden; it doesn't care if individual sections were resized, and
overwrites explicitly resized sections. This breaks QTreeView, where
calls to setColumnWidth resizes individual sections, but a style change
(e.g. when setting a style sheet, which results in posted events) would
then overwrite all section sizes with a new default.

To fix that, only resize those sections to the new default that had the
old default before.

This still breaks tests that assume that changing the default section
size will affect sections that have been explicitly resized. To make
those tests pass, and to minimize behavior changes, also resize sections
to the new default section size if they don't have a valid size before,
and adjust the problematic test to resize all sections to 0.

[ChangeLog][QtWidgets][QHeaderView] Changing the defaultSectionSize no
longer affects sections that don't have the old default size.

Fixes: QTBUG-116013
Change-Id: I02fee3f7fda66f4d982bacea1b4a8b14c896bb65
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 32578a088db5769e919a4ec5ebf33346479e7a68)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-01 23:53:56 +01:00
Volker Hilsheimer
800d7138a3 QHeaderView: add test for not overwriting resized sections
If we change, reset or update the default section size, e.g. in response
to style changes or programmatically, then we don't want to override
explicitly specified column widths in e.g. a tree view.

Add a test that verifies that we don't overwrite.

Task-number: QTBUG-116013
Task-number: QTBUG-122109
Task-number: QTBUG-123154
Change-Id: I3d9a6ac685da39a59436b91f56e86b0f705e645c
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 3ca0288aa927108de4c57119d9767998021a6089)
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-11-01 23:53:52 +01:00
Volker Hilsheimer
9f79ffe8f0 QHeaderView: modernize calculateAndCheck helper function
Use QCOMPARE_* macros to compare results, and use a qScopeGuard to emit
diagnostic output in case of failure.

Task-number: QTBUG-116013
Change-Id: Id13ba70244d5c58c14c088619dbf0ee835492eb7
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit d9098760134bad9c1d18837a204ea7fb26d30e43)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-01 23:53:48 +01:00
Eskil Abrahamsen Blomfeldt
98d03964ac Windows: Fix missing glyphs for very large font
When the font size gets to a certain size (at some point
after 1200 pixels), DirectWrite will just return an empty
rect as the bound for it and does not want to render it. At
this point, you might want to consider other ways of
rendering the text, but since the same did not happen
e.g. with the Freetype backend, it was an unfortunate
platform difference.

As a fail safe, we detect when this occurs and fall back to
the QFontEngine base class approach of drawing the glyph as a
QPainterPath instead.

[ChangeLog][Windows] Fixed an issue where glyphs might be missing
for very large fonts.

Fixes: QTBUG-126671
Change-Id: I13cc1e5d71fae114e2a7933a7c5f7b9980237390
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit a5ddcbb76b674470f0c3d1d5e0bb7697a2828d25)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-01 22:53:36 +00:00
Friedemann Kleint
9d5e3ffc33 QWidget::mapTo/FromGlobal(): Fix transformation for QGraphicsView with offsets
Amends 474af0a61d6154006966a775d186687aa8881708.

The code had an error showing when the QGraphicsView was not at 0,0
in the window.

Task-number: QTBUG-128913
Task-number: QTBUG-52507
Change-Id: Ic228cc7e71ef54dd23c946b9d90f9c45aac793d9
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 733459637e10edca006b0ad9b68299496e1b4ebd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-01 22:53:30 +00:00
Friedemann Kleint
607ac728ed Brush up the qgraphicsproxywidget test
- Reduce clang-tidy warning from 789->591
  (Use auto, nullptr, member initialization, etc).
- Introduce string literals, replacing deprecated QLatin1String
- Streamline/rearrange layout code
- Fix QCOMPARE(.., bool)
- User per-class includes following Qt conventions

Task-number: QTBUG-128913
Change-Id: I787f39b5ddfe34ba18e33f469b68ccbcfc2709a3
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 25e16e20cc434f484380dfa59c1b8a3d6f772920)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-01 22:53:24 +00:00
Friedemann Kleint
5d612a72ad QWidget::mapTo/FromGlobal(): Fix transformation in case of QGraphicsItem::ItemIgnoresTransformations
Extract a helper returning the transform from
QGraphicsViewPrivate::mapToViewRect() and use that.

Fixes: QTBUG-128913
Change-Id: Idc31f653c23cd7d0e5bbb8af560f010f01ac4d4b
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit deb4e08c1212aa3d43f62f9e7211bf69d3be0ada)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-01 22:53:19 +00:00
Christian Ehrlicher
5f3e64235e Itemviews: avoid unneeded calls to rowCount()
Avoid unneeded calls to rowCount() in a for loop as this might get
expensive for large models.

Change-Id: Ic949ba64f5068b4e6ca0d0c9bc51f181e220da70
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 4280e4c12e289aeb0ed28f07b0036e89bc8fb35f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-01 22:53:12 +00:00
Edward Welbourne
fcd52bf984 Rework the tzAbbr() helper of dateTimeToString()
Break out the offset-specific code (partly in preparation for handling
its localization better, but also) to ensure we try more candidates
and, when using the system locale, only use QTimeZone::displayName()
if we must - as it may oblige us to instantiate the system time-zone
instance. Tweak ordering of #include headers while I'm about it.

Change-Id: I183ddd1bcb181120df5561bfdc4d89a218292ee0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 1b909695a66500b3cceb0fee668b12a663ed3b8b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-01 14:31:32 +00:00
Assam Boudjelthia
04a9d7fe00 Android: make accessibility delegate protected memeber
so also we can call it directly from extended classes
without using get() calls.

Change-Id: Ie0aa7509620e3d675816b9efb1db8b092e1c4a8f
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
(cherry picked from commit 48f9ab09464a3e8259ceb75ff13b55901cd74760)
2024-11-01 14:31:32 +00:00
Marc Mutz
7be419bb23 tst_QPromise: DRY the inspection of QFuture's handlers
Not all test cases inspect all of failed, then, and canceled, but it
doesn't hurt to always collect all three.

Avoids having to write the same type of code over and over again.

Amends bf3fc5c95cb4e6acedf242c00b7a1c3b455062bb (but really
1f22fc995a36193cd67e8190858bb33614d149f4 and
855c4484693015cb6498f2183d95de1377d49898, which each duplicated the
initial pattern without refactoring).

Pick-to: 6.5 6.2
Change-Id: Ifb2a3589f8aed9017fbdff20e4edb64e8c9e2488
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 9d0da873f0ddadb60e61fbd6c96c8b00f026e99f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-01 14:31:31 +00:00
Marc Mutz
ab4919f316 tst_QPromise: don't wait() indefinitely
In unit-tests, blocking operations should be timed, whenever possible,
so that a proper failure is logged instead of a watchdog timeout
(which is reported as a crash).

Wait for 60s and wrap the wait() in QVERIFY(). Since this can fail,
mark ThreadWrapper's dtor as non-noexcept.

Amends 385f0732d927f0eba8ecf990ee9bc19936475edd.

Pick-to: 6.5 6.2
Change-Id: I3462017cb1a7580c901b98e9b1c3741853f32dc6
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 32d12c2ebace41361c789e5aa58430ebf9f687b1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-01 14:31:31 +00:00
Marc Mutz
ae01520633 Fix cxx11_future test
The test incorrectly failed on Linux because of a linker error
(unresolved symbol pthread_create()).

Fix by adding Threads::Threads, which provides -lpthread, where
needed.

Amends ced943e936e335a16e9b479a2010e5bbee1af4f1.

Fixes: QTBUG-130621
Change-Id: I25f7a5d6528576700628a85953c2e5c1a88dfe41
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 129523280cb7a6c9af5c6edc2da09bb333bc7833)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-01 14:31:31 +00:00
Tor Arne Vestbø
65c2600b7b coin: Prepare building environment for documentation warning build
So that we don't rely on building/running Qt auto tests just to
build the docs.

Change-Id: If3939717c57e8d4074afe0d611a1d04e65da7d36
Reviewed-by: Toni Saario <toni.saario@qt.io>
(cherry picked from commit 876622c3e2702610ff8e26adc773441c07afb52b)
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2024-11-01 09:42:57 +01:00
Tor Arne Vestbø
e72c7e6a6a macOS: Account for selection when computing input-method ranges
Text insertion from an input method such as Writing Tools can come in
without there being any marked (preedit) text. In this case, if there
is a selection, Qt's input-method protocol specifies that the receiver
should remove the entire selection before processing the range of the
input-method event. But we were not taking selection into account when
computing the range passed to QInputMethodEvent, resulting in inserting
the text at the wrong location.

We now consider both marked and selected text when sanitizing and
computing ranges. For now we assume that there can't be selected
text and marked text at the same time, and we also assume that the
incoming replacement range is not a subset of the selection range,
as this would mean we would need to extract parts of the selection
into the commit string up front.

Change-Id: I8948735a10265f92c01bc4e01870a7870fb1081f
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit 500d19bb54c8fff58b169bb3c5a9aaaa5277151f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-01 08:42:53 +00:00
Tor Arne Vestbø
1537fdb01e visionOS: Use PRIVATE for Swift CMake properties in platform plugin
Change-Id: I7c7462ea179a484befbc9eaf8943de8963c0926a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 9ef87298e58396e493558d307ef318098068ec67)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-01 08:42:49 +00:00
Volker Hilsheimer
cfee3304be a11y: add more nullptr checks for the view
Interface implementations related to child navigation might be
called while the object is getting destroyed, in which case the view
might already be degenerated to a widget. In that case, qobject_cast
will fail and we would dereference a nullptr later.

Prevent that by adding more nullptr checks. As a drive-by, reuse the
down-cast pointer in more of the implementation.

Pick-to: 6.5
Fixes: QTBUG-129582
Change-Id: I06a80576a5d71150787f493e2b6c9a58696eac99
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Reviewed-by: Dheerendra Purohit <dheerendra@pthinks.com>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 9965f9a191a426e65e32b3f833f2aedcc19ef405)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-01 07:44:20 +00:00
Marc Mutz
86b676ffc6 QAnyStringView: group the char-ish ctors visually
Separate them with blank lines from the other ctor sets, remove an
internal blank.

Pick-to: 6.5 6.2
Change-Id: I5cb165930520681b68a85b57d05a86c0ca440805
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit f68443d981babe9e2d98b9e7cad53b287d8229c6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-01 04:01:21 +00:00
Christian Ehrlicher
905dfd3915 QStyleSheetStyle: fix drawing CE_MenuItem with icons
Drawing a CE_MenuItem with icons when some entries don't have an icon
resulted in a misalignment of the text for the entries without an icon.
Fix it by honoring QStyleOptionMenuItem::maxIconWidth which is set by
QMenu depending on whether on if it's entries has an icon or not.

Fixes: QTBUG-130704
Task-number: QTBUG-127536
Change-Id: I826cdce5ead5da0d1e5fdd8a5e2a6972306457b2
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 44634c58ceb79a63102592ec4e1b8a7399a8a660)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-01 04:00:56 +00:00
Volker Hilsheimer
92005e34e8 QCompleter: add more nullptr checks for the widget
The widget might become nullptr, especially after delivering events to
it. So consistently test for nullptr before calling the event function.

Fixes: QTBUG-128478
Pick-to: 6.5
Change-Id: Ieed4e8b68b41488fafd9946d718c1d77fad39a44
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 6b86d9d08b407a56bad2d37f65169e36356b0741)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-01 04:00:49 +00:00
Volker Hilsheimer
8c40e8cf12 QTranslator: work around uiLanguages not including lang_Terr variants
Amends 7a7f2547f3e9ddf4e50decd85189200033193177, which added the triplet
including the script before the language_Territory name without it. The
truncate-from-the-end algorithm in QTranslator ended up trying the pure
language first, and - if found - ignored any more specific territory-
variant that might be present.

To fix this, replace the truncate-from-the-end algorithm when we try
to find files, and instead create a comprehensive list of fallbacks,
avoiding duplicates as we go along. Insert those fallbacks right after
their base-entry. We then try to find files for each entry, with and
without the prefix.

This fix is needed only in 6.8 and 6.5; from 6.9 onwards, the change to
QLocale::uiLanguages in 84afaafc9c6968dd76fcadc5392065d340543521 fixes
this on the correct level, making kludges in QTranslator unnecessary.

As a drive-by, replace int indices in for-loops with qsizetype.

Fixes: QTBUG-124898
Pick-to: 6.5
Change-Id: Ia3deceb4ed2c6ef5ca0a815cc7b8878bf29ef088
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2024-10-31 23:15:29 +02:00
Christian Ehrlicher
26774ee8f5 Tests/QSqlQuery: fix tst_QSqlQuery::lastInsertId() for PostgreSQL
Fix tst_QSqlQuery::lastInsertId() for PostgreSQL - there must be no
other query inbetween insert and lastval() to acutally receive the
correct last inserted id.

Change-Id: I6c5bda4b1e54ec89b80caa6abf7afcc9cfe1e28b
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 4b9631359bd3c1cae7344846193e3d10c3a54725)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-31 19:46:55 +00:00
Assam Boudjelthia
74a5f3c308 Android: pass QString directly to jni call in QAndroidItemModelProxy
Change-Id: I69b21972008809e4e8eb12e05aea9d959a4f7ee6
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
(cherry picked from commit 9bb2b6cec8bc502414edfcb328498663fde30f44)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-31 19:12:11 +00:00
Assam Boudjelthia
2d88b05376 Android: move QtAccessibilityDelegate instance to QtActivityDelegateBase
Similar to the display manager and the input delegate, keep the
accessibility delegate under the base class. Also, following the same
pattern as in the parent patch, assign a default instance for this in
the delegate in the constructor, and initialize anything later when
needed. Also, make sure calls for various objects under the
QtAccessibilityDelegate are safe and guarded.

Task-number: QTBUG-129704
Change-Id: I14a57d8e0916127ae8fa00acb3265b92803087dc
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
(cherry picked from commit af73c7a99eeea346efb65bed1d6e643e74ef33a6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-31 19:12:11 +00:00
Paul Wicking
6c6f456987 Doc: Fix typo
While interfaction sounds like an interesting term, here we want to
use the more appropriate word interaction.

Fixes: QTBUG-130720
Pick-to: 6.7 6.6 6.5
Change-Id: Idbbe2176d8c3b68df80ba652312b60359d67e839
Reviewed-by: Jerome Pasion <jerome.pasion@qt.io>
Reviewed-by: Safiyyah Moosa <safiyyah.moosa@qt.io>
(cherry picked from commit aa701532f63d0bb6b335e1ccd3acb55f682478a2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-31 15:36:21 +00:00
Kai Köhne
0fa23ce99d Show Custom Completer example as part of UI Components category
Pick-to: 6.7
Change-Id: I6f91d5b684bcc16eb145d5c504ccc8dbe9149c8a
Reviewed-by: Mats Honkamaa <mats.honkamaa@qt.io>
(cherry picked from commit 2f50933fa42f3ef101bfc00c54f92b70f13d309f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-31 15:36:20 +00:00
Assam Boudjelthia
f8d4bab7c0 AndroidTestRunner: warn if exit code retrieval fails
This helps in debugging instead of returning -1 silently.

Change-Id: I7d145e86af04a6cc0cd0e4a6c2dbe6c4d2fd714c
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit fc4d352683afe681037268955a58e233cffe24eb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-31 15:35:47 +00:00
Mårten Nordheim
bbfc7b2ca9 Http: fix how we treat must-revalidate
We calculated the expiry at time of download by looking at Max-Age, but
as long as must-revalidate was true we would just perform the network
request anyway.

One issue this, further, highlights is our PreferNetwork and PreferCache
options having no behavioral differences while being documented to
do different things. They both consult the cache first and returns any
non-stale data from there.

Fixes: QTBUG-128484
Change-Id: I24b62e2bb072446e463482a778da7cfbd82a6835
Reviewed-by: Mate Barany <mate.barany@qt.io>
(cherry picked from commit e4a35df2afc306e566884f3d917daa08e41761f8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-31 15:35:47 +00:00
Joerg Bornemann
847b491520 CMake: Fix qt_add_resources calls in different directory scopes
"Different" meaning here "different from the target's directory scope".

Consider a qt_add_resources call in a directory scope that's different
from the target's directory scope. Then CMake's AUTORCC would pick up
the generated .qrc file. This leads to duplicate symbols errors in the
linking phase.

The reason for that is that we add the .qrc file as source file to the
target, and the SKIP_AUTOGEN property is ineffective, because we're
setting it without the TARGET_DIRECTORY option.

This situation occurs, for example, with a qt_add_translations call in
the top-level CMakeLists.txt on a AUTORCC-enabled target that's defined
in a subdirectory.

Fix this by adding the TARGET_DIRECTORY option when setting SKIP_AUTOGEN
on the generated .qrc file.

Pick-to: 6.5
Fixes: QTBUG-130056
Change-Id: Iedc847eb85d918c5a1df20cb477e3192d1138b7f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit d516a452232bd9b969db19a62586e969dfc54b39)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-31 15:35:47 +00:00
Sami Varanka
ff48e158ab Take Header splitter cursor for QGraphicsProxyWidget
Strangely when a QTreeview is put in GraphicsView using
QGraphicsProxyWidget, QTreeView header splitter cursor does not appears
though section can be resized without that. This change forces
the QGraphicsProxyWidget to take header splitter cursor from lastwidget.

Fixes: QTBUG-128912
Change-Id: I783e8357ae8386af70d28a1495e3b2367921df76
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 769392c3a8055af996f593dccd85ca3f775b1640)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-31 15:35:46 +00:00
Allan Sandfeld Jensen
f0c51f8f83 Avoid assert or crash on plateauing transfer table
If the same value repeats many times the values y1 and y2
can end up being the same cauing an assert or division by 0.

Fixes oss-fuzz 42535976. Credit to OSS-Fuzz for finding the case.

Change-Id: I30afd5cd61163c51949a8c13d4034f4bc11d27a7
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit aa1293f043f5df34ee7501efda6a6a2e8da5fa99)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-31 15:35:46 +00:00
Nils Petter Skålerud
a6ffdfec98 Darwin, permissions: Fix crash caused by callback going out of scope
Change 0990bd49407aac4f96acf78761af1070ff934215 introduced a runtime
crash where callback object was being referenced rather than copied,
causing it to go out of scope and causing a segfault. This patch
captures the callback by copy explicitly.

Change-Id: I9670041273ec8f7bb53108cbaf816e895225cf02
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 05b4b1e1250843155d91c929b25d8a8e188315fa)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-31 15:35:46 +00:00