Commit Graph

68454 Commits (7229cc75a4afa6d4cd367398f0da0cf73f8a80a2)

Author SHA1 Message Date
Tor Arne Vestbø 7229cc75a4 macOS: Query platform window for size when flushing child windows
Otherwise we will not pick up the effects of the QHighDpiScaling layer
to the QWindow size, such as when setting QT_SCALE_FACTOR explicitly.

Fixes: QTBUG-122967
Pick-to: 6.7 6.5 6.2
Change-Id: I9dc914728c5aff28ef52ea3a502c94bcc91738bd
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 270866923cce6184cd368fc5466e79bf5f845549)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-21 20:06:33 +00:00
Alexey Edelev 589661c0d5 androiddeployqt: Fix the --sign argument handling ordering
Allow using the follow arguments after '--sign' argument in
androiddeployqt. The previous fix had no effect since we should
consider the argument count first and the type of arguments next.

Amends 9c56a77027

Fixes: QTBUG-128254
Task-number: QTBUG-109619
Pick-to: 6.7 6.5
Change-Id: I34eac4def94c1d0c8d304f383d60c1e21b7dc6a2
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit fd2c408af2f300e100d94a386743c7cbe74fadef)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-21 20:06:32 +00:00
Tor Arne Vestbø 7f09ec878b Bump Apple OS deployment targets and minimum/maximum SDK/Xcode versions
As documented in our platform support docs.

Change-Id: Iadcf369facbe5d798827c486e564a6e124f2836c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 1bd70d671247a9b0e709fda2a077a9dbf46c276f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-21 17:02:12 +00:00
Mårten Nordheim 727b71bd2b Http2: speed up window_update for many streams
By keeping a list of blocked streams we can query just those instead of
any and all open streams when we get additional data transfer budget.

In the future we could additionally sort them by priority, if we start
taking priority into account.

Task-number: QTBUG-126772
Change-Id: Ieab250893e157d2c50b0db2fdc10aa2dc3c38048
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
(cherry picked from commit 1e57371695752d4112fa59c89d38e58b977d55bc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-21 17:02:11 +00:00
Mårten Nordheim 5ac0c50cae Http2: Clean out streams as they get deleted
Instead of keeping the empty QPointer in the hash forever
let's try to keep the hash lean as to not punish iteration
over it as the streams are being created and deleted.

Task-number: QTBUG-126772
Change-Id: Id7afa684a19e6a16726e5bda5debdd2f2bbe86ab
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
(cherry picked from commit 94e8bb96304fd2ea2ddfdf2499f4024131a16a8a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-21 17:02:11 +00:00
Tor Arne Vestbø 987b215f08 macOS: Implement NSServicesMenuRequestor protocol for Writing Tools support
The AI based Writing Tools in macOS 15 uses the NSServicesMenuRequestor
protocol to interact with custom NSView.

By implementing the protocol we also gain support for service menu items
such as "Look Up in Dictionary" or "Make New Sticky Note".

Note that we only support plain text for now, which means that a rich text
selection will lose all its styling when fed through a service that changes
the text. To support rich text we need IM plumbing that operates on QMimeData.

The Writing Tools feature itself is only available on macOS 15.1.
To trigger it a native context menu with edit actions has to be shown,
meaning this will not work out of the box for Qt Widgets. For Qt Quick
with popupType set to Popup.Native the menu item is added as expected.

Task-number: QTBUG-126238
Change-Id: I2cd4aa9af8d613c7c67b3c19a70a23660dde2154
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 888429a734bf379ee59519b5d6047561df66c9a5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-21 17:02:11 +00:00
Mårten Nordheim ece128fc5e Http2: fix some potential constness issues
The function is not const, and the access to the hash was
not const, so it would check if detaching was necessary.

Change-Id: Ie46cb89db20c8d9b227d50b4b6c5053dcb5791eb
Reviewed-by: Mate Barany <mate.barany@qt.io>
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
(cherry picked from commit ca735d8d4113490c54671e6a99a89c2379ea68da)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-21 17:02:11 +00:00
Paul Wicking 3be0f9e4ea Doc: Fix issues in print media type in offline style
When generating HTML output, QDoc references CSS styles that control
the visual appearance. For a standard build of Qt's documentation (a
'local' build, if you will), an "offline" style is the default. This
style sheet is maintained in `qtbase.git`.

This style is not particularly well maintained, as it is not the style
in use for documentation published to `doc.qt.io`. As such, some
issues where found as a side-effect of other work. In particular, an
ill-placed background image in the `@media print` CSS instructions was
found in the print dialogue from locally generated content. While
validating the fix, it became clear that the `toc` CSS class was moved
into an obstructing position in the same media type.

Change the `@media print` definition such that:
- The `toc` class is hidden entirely.

Task-number: QTBUG-124162
Fixes: QTBUG-128205
Change-Id: Ic427036a698d7fc0e07e9190289e5d2c196885d9
Reviewed-by: Andreas Eliasson <andreas.eliasson@qt.io>
(cherry picked from commit dd669c84657c48c27318b246db83b82478d6951a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-21 17:02:10 +00:00
Tian Shilin 6f0b55e292 fix: Redundant condition in cacheSaveDevice
If cacheSaveDevice is false, then if must be true; if
cacheSaveDevice is true, then only need to judge
whether !cacheSaveDevice->isOpen() is true or not, so
the second judgment condition on cacheSaveDevice I think
it is not necessary.eg: '!A || (A && B)' is equivalent to '!A || B'

Change-Id: I5201d54017d2457ba4b92ee99bb968a0961ccbb9
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 3ecbf28aa6ee43fe967ef219f909f3784e5b3d26)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-21 17:02:10 +00:00
Laszlo Agocs 9d26d58eba rhi: manual test: Do not blindly enable qt.rhi.* logging
Now that qt.rhi.general is not the only category, this is
not ideal.

Change-Id: Ied3533327dc310cee5fce75fe5760454167161b7
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit a537703a4df516da9b7f9126c719a1ccb9271647)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-21 17:02:10 +00:00
Tinja Paavoseppä 52f8e8e634 Android: Make QtLoader subclasses singletons
When embedding QML to non-Qt Android apps, it is
possible that the QtView will be recreated, after e.g.
an orientation change. This will lead to a new
QtLoader being created and trying to load the Qt libraries
again, even though they have already been loaded.

Also, once adding support for having more than one
QtView, it doesn't make sense to try and load the
libraries again. Having the loaders be singletons
and checking whether the libraries have
already been loaded avoids this.

Task-number: QTBUG-124114
Change-Id: I2273fc58a8f1268f03d3348b782e74d83759f351
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 092b3a0ff9c24edd0fc60dc436aaefcca2b1939c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-21 17:02:10 +00:00
Tinja Paavoseppä a0a2d14cc3 Android: Remove unused imports for QtEmbeddedLoader
Change-Id: If5e3caf1df91c41eaf7fe2dddd1e4e94e9116138
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 9e259de282826f14878417978fc7b8201ad76a48)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-21 17:02:10 +00:00
Tinja Paavoseppä 6e813c4072 Android: Track QtLoader success better
QtLoader doesn't really handle failures in a way that's visible outside
the class itself. There is the abstract finish() method subclasses can
implement to handle clean up in the loader itself, but it's not visible
outside, which leads to trying to execute paths of code we know are not
going to work, since if the Qt libraries are not loaded the Qt app is
not going to work.

Make QtLoader throw an exception if invalid arguments are passed to it,
as there is no way for the loader to do its job properly if the passed
Context is not what we expect it to be, so might as well exit early.

Make the loadQtLibraries() method return a boolean, letting the caller
know whether the loading was successful or not.

As a result, the finish() method can be removed, and the caller can
handle failure as appropriate for it.

Task-number: QTBUG-124114
Change-Id: I2dc1a0846eb404112f88e9da365db2ab071f4317
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 2b48614f68cbf98d6597819749b732556c32cb44)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-21 17:02:10 +00:00
Tinja Paavoseppä 984b56d9c9 Android: Remove context member from QtLoader
Both QtActivityLoader and QtServiceLoader already have separate
members for their Activity and Service, respectively, and
the QtEmbeddedLoader should become more like a singleton, so holding
a reference to the Context, which anyway is only used when setting up
the loading, is unnecessary.

Task-number: QTBUG-124114
Change-Id: I412f4dbd45e48add9ea091eb589c7ef9a3942399
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit ae0db7a61de1f0f9b36810a94984c69f5d7e5d1e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-21 17:02:09 +00:00
David Edmundson 6af4e5f604 QWidget: Store initialScreen as QPointer
A Toplevel QWidget can hold a pointer to the screen where it will
eventually show contents, before a QWidgetWindow is created which then
takes precedence.

The screen member of QWindows is always kept up-to-date when a screen is
removed, but not the contents of a toplevel window. If a widget has
setScreen called but is never shown, it has potentially dangling pointer
which can cause issues in the future.

Pick-to: 6.7 6.5
Change-Id: Ia7c80549e8b3c90a75cdde745487e87ecddaca63
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit d67acf94afffde6a71498be6e30447f3acf7558e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-21 13:59:05 +00:00
Kaloyan Chehlarski 5c94c5a4ef QAbstractItemView: Fix shift-select after changing index through model
When setting the current index through the related model's
QItemSelectionModel::setCurrentIndex(), the selection can also change.
However, attempting to shift-select after doing so would produce
an unexpected selection, because the internal variable that keeps
track of the start index of the current selection would still have
its old value.

This change moves where said variable is set: instead of doing that
in QAbstractItemView::setCurrentIndex(), it is now done inside the
currentChanged() slot instead. This slot will get called both when
the selection is modified through the QAbstractItemView class itself,
as well as when it's modified from the outside (e.g. from the model).

Pick-to: 6.7 6.5 6.2
Fixes: QTBUG-127381
Change-Id: I6d38320e656aa5a102ce079604590672c88ecad1
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit fb2d64bc57aadf5bf140c72cf7eb2a5f391b7d55)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-21 13:34:23 +00:00
Shyamnath Premnadh 887076220a Documentation: Update API documentation of QAndroidPrivate
- Some references of androidActivity() were replaced by
   QNativeInterface::QAndroidApplication::context()

Pick-to: 6.7 6.5 6.2
Fixes: QTBUG-127926
Change-Id: Ib2fdb3d13ad72121895c5464d8a21cda33bb28b3
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 91f70771a86a5110eff96ac40bba0b5770154708)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-21 07:33:36 +00:00
Christian Ehrlicher 2d6788d6eb Widgets/QMdiSubWindow: fix high-dpi painting of control buttons
The high-dpi painting for the buttons in the QMdiSubWindow was broken
for the windowsvista style because an invalid widget was passed to the
paint routines. This lead to a wrong calculation of the devicePixelRatio
and in the end very blurry icons.

Pick-to: 6.7
Fixes: QTBUG-127288
Change-Id: I0f604ddb4faf66a6e850a1504582076f22418fcd
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
(cherry picked from commit 8b261a2ad7884f8fe7a93a678c9fce5052e42c98)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-20 18:23:52 +00:00
Michał Łoś a7fc60015d Enable mouse handling on VxWorks
Provide implementation of QEvdevMouseHandler for VxWorks OS.

This is a preparatory change before actually using this handler, as Qt
is not supporting evdev on VxWorks yet.

Task-number: QTBUG-115777
Change-Id: Ie92418c903a54ea1d6683e08762d4cc88c4956ac
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 2003532cd84141434f698d723458f0672766fc0c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-20 18:04:37 +00:00
Orkun Tokdemir d92264a089 CMake: Remove QT_NO_SHOW_OLD_QT_WRAP_CPP_WARNING
Fixes: QTBUG-128145
Change-Id: Iffa1e6ba05d6cca1323e01861d8028c06b34a656
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit f60237ac93859be11415aa28c097137da23aea60)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-20 18:04:36 +00:00
Petri Virkkunen b48b0dba63 Android: Clear QtEditText focus after keyboard is hidden
Since QtEditText only needs focus for the virtual keyboard, focus
should then be removed once we're done with the virtual keyboard.

After this, focus will be received back by QtWindow, which will then
handle key inputs properly.

As a drive-by, remove the default focus highlight on QtWindow to stop
the ugly flickering that happens when QtWindow receives focus back from QtEditText.

Pick-to: 6.7
Task-number: QTBUG-126187
Change-Id: I911e3371d9c582b2805dc895ef49b0d4210714f3
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
(cherry picked from commit dc71864d4a358149a2531d324645934e47879dba)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-20 16:08:02 +00:00
Joerg Bornemann f35cc3a115 CMake: Don't hard-code "libexec" in qt-configure-module
If INSTALL_LIBEXECDIR was set to something != "libexec",
qt-configure-module contained the wrong path to qt-cmake.

Fixes: QTBUG-128137
Pick-to: 6.7 6.5
Change-Id: Ic095ff8cb804bbdd72e238e75ac867b7cc3bd478
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 12b0f73a9e9cef35395d0a1560a51604c1c054ff)
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2024-08-20 13:50:32 +02:00
Mårten Nordheim 5caa31cb21 QByteArray: fix lastIndexOf for char values with set sign bit
lastIndexOf will convert the `needle` to unsigned char, which is then
'upcast' to int, before we search. But the string itself was searched
using signed char, meaning any values with the signed bit set would
mismatch.

Add tests for indexOf and lastIndexOf.

Amends 4c12ae7e67

Fixes: QTBUG-128199
Change-Id: I0ce7d7d9741f21650ef6f0f012a94e00d84a0f02
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 7b1f3bdc503ea7aceacc9fa8d388d843f1d7b131)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-20 11:40:56 +00:00
Ulf Hermann 833c0040cb moc: Print method index to JSON output
We want to be able to index into the metaobject from code generated by
qmltyperegistrar. And we don't want to rely on some implicit promise
that certain methods are in the "right" order in the output. This is
similar to what we've done with properties.

Change-Id: I8d97b65598338fcff57c6b0866708232066c94cb
Task-number: QTBUG-127442
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 484e72a1074279dca1253ae07515461ad231de3c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-20 08:51:01 +00:00
Alexey Edelev a29573d136 Check the PROJECT_NAME when attempt to build sql drivers
Check the PROJECT_NAME but not CMAKE_PROJECT_NAME when attempt building
sqldrivers. This should be save since we expect that the project() is
called pre-Qt repo.

Task-number: QTBUG-127953
Change-Id: Ief3f11ba747ded0984ccfe1cfa6b7b47da538137
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 3e1a223318dbda50a010ba851841a9e51c80c42b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-20 01:59:46 +00:00
Giuseppe D'Angelo 1f3e8c3162 QString::replace: fix a performance regression
eb60e94020 refactored the QString::replace
helpers as to avoid a full copy of a string (when detaching) only to
then modify it in order to apply replacements into the new copy.

Unfortunately it also introduced a regression: if we are replacing into
a string that does not need detaching (that is: it's non-static and
there are no shallow copies of it), and the string does not have
sufficient capacity, then the code chose to allocate a brand new string
and do piecewise copies/replacements into the new string.

This is suboptimal, as it precludes the possibility that the string gets
reallocated in place (via a realloc() that doesn't actually move the
string data in memory), which is a huge performance win. (It also
precludes the possibility of compacting the string data "to the left" in
case we do have sufficient capacity, but not at the "right end".)

This caused a 3x slowdown when replacing in large strings.

Solve this by removing the capacity check and unconditionally
reserve()ing enough space so that we can then do in-place replacements.

Change-Id: I921e3ea65222eca8125996d8d3ea77e9c09ba205
Pick-to: 6.7
Fixes: QTBUG-127549
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 315210de916d060c044c01e53ff249d676122b1b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-20 01:59:31 +00:00
Alexandru Croitor 6d8bab3073 CMake: Don't forward FRIENDLY_PACKAGE_NAME to sub-attribution targets
Instead, the package name should be determined by the sub-attribution
target name. Otherwise the build system will try to generate multiple
files with the same name, but different content.

Amends 5daabb5a74c4e7c5d087da7f9207d79d2ee05b13

Task-number: QTBUG-122899
Change-Id: I10b4ec2fe8f38d70d13918dc980d1bd1d9145cb6
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit d624592ca40e05033432de72e0c4d9f6570b5544)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-20 01:28:03 +00:00
Alexandru Croitor fecea19254 CMake: Don't use root attribution file for system libraries
A project's root qt_attribution.json file might be picked up by the
build system when recording system libraries for SBOM processing.
One such case is qtgrpc.

This caused generation errors in qtgrpc with the following message:

CMake Error: Files to be generated by multiple different commands:
 qt_sbom/SPDXRef-Package-qtgrpc-qt-3rdparty-sources-WrapProtobuf.cmake

This started happening since the SBOM options are now implicitly
propagated to auto-created attribution targets, and each attribution
target attempted to generate to the same partial sbom file.

Any qt attribution file in the project root is not intended to be
used for system libraries, so explicitly disable using the
root attribution file for all system libraries.

As a more long-term fix, we should consider making the partial sbom
files be more unique.

Amends 5daabb5a74c4e7c5d087da7f9207d79d2ee05b13

Task-number: QTBUG-122899
Change-Id: I67544c299e630597f26602d270cd1dfd54cccfb6
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 55b399fdcd12bdfc645d4ec7d25b3c881d11a09a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-20 01:28:03 +00:00
Soheil Armin c90a8a8c35 Android: Rename opt-in CMake flag that generates QML to Java code
The Java QtQmlComponent has been renamed to QtQuickViewContent
as a part of API reviews.
As a result, we also change the opt-in flag
From QT_ANDROID_GENERATE_JAVA_QML_COMPONENTS
To QT_ANDROID_GENERATE_JAVA_QTQUICKVIEW_CONTENTS
that adds an entry to the android-deployment-settings.json.
The flags later will be used by androiddeployqt to enable the
generation of QtQuickViewContent extensions.

Task-number: QTBUG-126976
Task-number: QTBUG-127091
Change-Id: Ie08a9430a5e5a16809f78389144a4a6dfd87ce18
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
(cherry picked from commit be2c03064cdb7bef977d05371e535bedcadb3a0f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-20 01:28:03 +00:00
Soheil Armin 820098c966 Android: Reflect renaming of QtQmlComponent to QtQuickViewContent
Task-number: QTBUG-126976
Task-number: QTBUG-127083
Change-Id: I001a095c2844c725c85113c03c8640f507c8f11e
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
(cherry picked from commit 86e34dfcddf6ffd24780a50b3b4c66b9f6726b70)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-20 01:28:03 +00:00
Soheil Armin 4a3abb02d6 Android: Suppress unchecked cast in QtAIM::roleNames
Change-Id: I46e8358ad51edb3eaf87fd57851037c4c50586eb
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit d6ddda8a5b22a5daafcdb76e2b4a0f5349433546)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-20 01:28:03 +00:00
Soheil Armin 46946d63e6 Android: Add Java QtSignalListener interface
This class is being moved from QtDeclarative to QtCore as a part of
API review resutls.

Task-number: QTBUG-126976
Task-number: QTBUG-127082
Change-Id: I1c7a20daeb0d398bc6faad441ebae6136b4a88ba
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 0acdceed353da61c3c3e1392d0af0d4ecd640821)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-20 01:28:03 +00:00
Soheil Armin 9af91d6eca Android: Add Java QtAbstractItemModel auto test
QtAbstractItemModel used to be a part of QtDeclarative
and is being moved to QtCore based on API reviews.

Task-number: QTBUG-126976
Task-number: QTBUG-127089
Change-Id: I28a921a113ec4f3ad298bf55b40aea334e7721cf
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit baed8a24d07de87da61e9d5e3dbffc8d8ca92918)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-20 01:28:03 +00:00
Soheil Armin e544ae0abd Android: Add Java QtAbstractItemModel and QtAbstractListModel
These classes used to be a part of QtDeclarative and are being moved
to QtCore based on API reviews.

Task-number: QTBUG-126976
Task-number: QTBUG-126977
Change-Id: Ic269f23ca2292031cda62faf41428667889537d0
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 55fc15ce8272073b9b404762b83e3e7acee0111e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-20 01:28:02 +00:00
Dominik Holland 81a9cbe1db coin: Introduce a COIN_DOC_CMAKE_ARGS env variable
This can be used to configure extra cmake args for the documentation
build in coin.

Change-Id: I11417bee9630aebe0bbc118cd843b1536101da71
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit b956a909c5ff29bf9824c054750966bdec42c6ca)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-20 01:28:02 +00:00
Soheil Armin 75cc149f45 Android: Add Android types and converters
This is a part of API review changed of Qt 6.8. These private
APIs are being moved from QtDeclarative to QtBase.

Task-number: QTBUG-126976
Task-number: QTBUG-127087
Change-Id: I9bfdb7dea12a2fb6a179d87639364ae28c39243b
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 4413c81c483fda125928392eb32e3320068a872b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-20 01:28:02 +00:00
Thiago Macieira f6d69a7575 QHash: adapt to C++20 ranges not offering operator->()
Iterators no longer provide it, because they may need to return a
temporary in some occasions.

Fixes: QTBUG-128102
Change-Id: Ide0a7a84f612fff73afffffd49889321cb70505f
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit cb40a1fa7f4b06acced1d17e8333742084092f9e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-20 01:28:02 +00:00
Juha Vuolle 6991735367 Darwin: Reset CBCentralManager delegate after processing callbacks
We maintain the CBCentralManager in a retained property, which we
nil when we're done processing the callbacks. But the manager may
still be kept alive by other parts of the system, resulting in
callbacks to our delegate, where we would assert on the check
that the delegate callback manager matched our stored manager.

The conditions for the assert to occur:
- debug build (Q_ASSERT)
- permissions are actually requested
- bluetooth is toggled ON or OFF

This patch fixes this so that the listening delegate is
nil'd and therefore no additional callbacks are received.

Pick-to: 6.7 6.5
Change-Id: I1439881fd55bdfd42bc27ee57f26826fc66c3d85
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit b45d26f59368f530330b7d547846b5a74d80d585)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-20 01:28:02 +00:00
Jøger Hansegård 471debef07 Test QFileInfo::isWritable when it should return false
Extend existing tests to verify that QFileInfo::isWritable returns
false when file is read-only or non-existent.

Task-number: QTBUG-124011
Pick-to: 6.7 6.5
Change-Id: If41241b500aa76036b39a53590b5e0b6ab2f20ea
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 42004d245e2bf4846520e5e186a5c86aa87a6019)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-20 01:28:02 +00:00
Philip Schuchardt 1873ff0346 QFuture: Fix for heap-use-after-free on qfutureinterface watch
Replace deleteLater with destroyWatcher.

If the continuation is called from a separate thread,
emit watcher->run() can't detect thatthe watcher has
been deleted in the separate thread, causing a race
condition and potential heap-use-after-free issue inside
QObject::doActivate. destroyWatcher forces the deletion
of the watcher to occur after emit watcher->run()
completes and prevents the race condition.

Fixes: QTBUG-126013
Fixes: QTBUG-127880
Pick-to: 6.7
Change-Id: Id5f80ad0ec3fbd2d9c1e0d134aecd6b08ba2c79c
Reviewed-by: Arno Rehn <a.rehn@menlosystems.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 2bc82f6a1126025affd6e891efc386c08d5fa013)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-20 01:28:01 +00:00
Eskil Abrahamsen Blomfeldt 9993c1d13e Update Freetype to 2.13.3
[ChangeLog][Third-Party Code] Updated bundled Freetype
to version 2.13.3.

Pick-to: 6.7 6.5 6.2 5.15
Task-number: QTBUG-128124
Change-Id: Ica2fd9ebfd53d6efde4614f09a7fea9f6857eeac
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit 7c7b34f76a78fb144600002c0aebe031e3dd42e9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-19 19:42:55 +00:00
Vlad Zahorodnii 2e6b237b03 QMimeData: Fix hasText() for text/plain;charset=utf-8
text() looks up `text/plain;charset=utf-8` but the hasText() function
has no matching check.

Pick-to: 6.7
Change-Id: Id309cd3bd11003813057704338beb36c65974f4a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 014fb179d81456577c745418017e333faeb1f08e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-19 19:42:55 +00:00
Ivan Solovev a77987e600 QModelIndex: do not use compareThreeWayMulti() and asTuple()
There are doubts that the implementation would result in a huge
template bloat. Also, compareThreeWayMulti() seems to be inefficient,
because it copies the tail over and over again.

Rewrite the comparison helper functions to get rid of the
compareThreeWayMulti() calls. This also allows us to drop the asTuple()
method.

Amends ece36a7394.

Found in 6.8 API review.

Change-Id: I8be4e5f56c350039acde78c2e591e29773f3472c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 564f2cbbddbca3f118198f0fb4ca0a97b95b8a59)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-19 19:42:55 +00:00
Eskil Abrahamsen Blomfeldt aa9a991169 Respect QTextDocument::defaultFont() in ODF writer
The ODF writer would ignore the default font set on the document
and just output default values according to spec, such as "Sans"
for the font family.

With this patch, any settings set explicitly on the default font
will be taken into account, granted that they are not overridden
by any properties in the QTextCharFormat.

[ChangeLog][Text] The ODF backend to QTextDocumentWriter will now
respect the default font set on the QTextDocument.

Fixes: QTBUG-124570
Change-Id: Ia937420f7f721bbf3264661160cb0a593907358c
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit 77a9a208227ecf750d620b3048053fd4fc4299a4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-19 19:42:55 +00:00
Morten Sørvig 9313c60cd9 wasm: fix compile error due to EM_BOOL type change
emsdk 3.1.62 changes the EM_BOOL type from int to  bool. We were
using int in two places in the wasm platform plugin.

Use EM_BOOL instead to stay compatible with emsdk editions earlier 
and and later than 3.1.62

Pick-to: 6.7
Change-Id: I837e76f869225859643dd5a98a28a1eefb5f14a4
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
Reviewed-by: Even Oscar Andersen <even.oscar.andersen@qt.io>
(cherry picked from commit 48beca4e7635cf2031c6707042d623c4daf44778)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-19 19:42:55 +00:00
Alexandru Croitor 1bd96b5f40 CMake: Read CPEs from attribution files when generating SBOMs
Also split up the CPE handling to allow for more values to be set,
rather than preferring the first one that is encountered.

Task-number: QTBUG-122899
Change-Id: I3209cb5d66f5483c7294b40816431d9df75e00e5
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 47fd38be4bce0958fcfce8080d1580c4e3c2a15b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-19 11:47:53 +00:00
Alexandru Croitor c33e213a6a CMake: Read UpstreamPURL from attribution files when generating SBOMs
Task-number: QTBUG-122899
Change-Id: Id65770cdee17c6bf4701b10565ab428f3e28887f
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 95b7fe49900904d19fca21876c84f97c2a6ae03d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-19 11:47:52 +00:00
Alexandru Croitor ba4172d0d7 CMake: Rework SBOM PURL handling to handle multiple values
Using a single PURL for a target is not enough to represent all the
information that an SBOM processing tool might want to know about.

For example for the bundled harfbuzz package, we want to inform at
least about two versions: the upstream version that was originally
imported into Qt sources, and the Qt version or sha1 of the sources
that were used, because the 3rdparty code might have been modified and
there might be new Qt-specific vulnerabilities.

To handle this, we need to generate multiple PURLs for a single
target.

Introduce six new options to be understood by qt_internal_add_module
and other SBOM functions:
 - PURL_QT_ARGS
 - PURL_MIRROR_ARGS
 - PURL_3RDPARTY_UPSTREAM_ARGS
 - PURL_QT_VALUE
 - PURL_3RDPARTY_UPSTREAM_VALUE
 - PURL_MIRROR_VALUE

The first three options take multiple arguments, and will generate a
PURL for each used variant, based on the purl parsing options that
were previously handled. For example passing:
  PURL_3RDPARTY_UPSTREAM_ARGS
      PURL_TYPE "github"
      PURL_NAMESPACE "harfbuzz"
      PURL_NAME "harfbuzz"
      PURL_VERSION "v8.5.0" # tag

will generate a PURL pointing to the upstream harfbuzz repo hosted
on github.

The next three options allow specifying a purl value directly as a
single string, rather than as separate parts. This might be useful
when the PURL is pre-constructed and read from a qt_attribution file.
Example:
  PURL_3RDPARTY_UPSTREAM_VALUE "pkg:github/harfbuzz/harfbuzz@v8.5.0"

When no arguments are specified, targets like Qt modules or Qt
3rd party libraries will have automatically generated QT and MIRROR
variant PURLs that point to code.qt.io and github.com, along with
important info like the version and subdir source path for a given
target.

Third party libraries are expected to be manually annotated with a
3RDPARTY_UPSTREAM variant PURL that points to the original upstream.
In a future change, these will be read from a qt_attribution.json
file.

The final set of generated PURLs for the harfbuzz package might look
like:

  pkg:github/harfbuzz/harfbuzz@v8.5.0
  pkg:github/qt/qtbase@5018b71e99f?library_name=BundledHarfbuzz#src/3rdparty/harfbuzz-ng
  pkg:generic/TheQtCompany/qtbase-BundledHarfbuzz@5018b71e99f?vcs_url=https://code.qt.io/qt/qtbase.git@5018b71e99f&library_name=BundledHarfbuzz#src/3rdparty/harfbuzz-ng

Additionally a few more purl parsing options are added.

Add a PURL_USE_PACKAGE_VERSION option that will use the
qt_attribution.json or custom PACKAGE_VERSION value as the PURL
version, so it doesn't have to be manually specified.

This is an opt-in, and not the default, because some attribution
files contain plain text, white-space separated, strings as the
version value (like the 'sha3' 3rd party lib) which ends up generating
a broken PURL and a failing JSON conversion of the SBOM.
So we have to manually annotate targets that should use the
attribution json package version, until a better way to handle this
can be found.

Add a PURL_VCS_URL option that will generate a PURL qualifier (a HTTP
query parameter) with the given value, to indicate to SBOM-processing
tools what is the upstream repo URL for the package.
They can use this information to display known vulnerabilities for the
package hosted at that URL.
This is mostly useful for the generic QT purl variant, and is
automatically generated for Qt entity types.

Task-number: QTBUG-122899
Change-Id: Ie000b01b478bef4bff6f4803dd39e37b7a8055d5
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit f7e1123620b623be0c321b54eaba7a1d618a7ce1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-19 11:47:50 +00:00
Alexandru Croitor bb26830b3c CMake: Detect 3rd party header modules during SBOM generation
They should inherit the version of the 3rd party library they are part
of, and not be treated as Qt modules.

Task-number: QTBUG-122899
Change-Id: Ibf99f4481fbc1acca488fc96cca048298b080d35
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit b17dfbbb992b1d38d7a1aeb2b0109bab9cb1e4e3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-19 11:47:49 +00:00
Alexandru Croitor 1ddf6ea20b CMake: Propagate SBOM options to auto-created attribution targets
Previously if an option like CPE was passed to a 3rd party target that
would create nested attribution targets, one per entry in the
attribution file, the CPE option would only apply to the first /
parent target, but not to the nested targets.

This change will now propagate all SBOM options to the nested targets,
but only if the parent target is not a Qt entity type like a module,
plugin, etc, which means it will only apply to 3rd party attribution
targets. The restriction is there because because mostly only 3rd
party attribution targets should inherit the same set of CPEs and
similar SBOM values.
If the restriction proves to be too strict, it will be re-assessed in
a future change.

Task-number: QTBUG-122899
Change-Id: I96cfa046ad611c10877b7a06504b35615b539bbe
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 5daabb5a74c4e7c5d087da7f9207d79d2ee05b13)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-19 11:47:47 +00:00