Commit Graph

50409 Commits (c802de110bb57b71ab2a91ea14a3d9f533bb415d)

Author SHA1 Message Date
David Faure 1925abe174 QComboBox: don't call model->index() with row = -1, during reset
This leads to an assert in QConcatenateTablesProxyModel::index()
for instance.

Change-Id: Icd0ae1497705484b021067034c0d8f39049c04ed
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 1ba3277b4c79b80788e2d600840876856ec6933d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-22 03:37:12 +00:00
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
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
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
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
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
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 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
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
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
Andre Hartmann bc1011dc36 Doc: Use consistent terminology in Q(Chrono)Timer's docs
Unify the wording "running" and "active".

"Running" seems more natural, so keep that wording,
and replace "active" with "running" in API docs.

Change-Id: I300f530d1cfe789f74ed32f57afe9388f2127ead
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 94f87d6d65f42140dbf58b8c6badd1a4c61c8c76)
2024-08-19 11:11:04 +00:00
Ville Voutilainen 1079d210d1 Fix an evaluated use of std::declval in qjnitypes.h
While other compilers don't seem to have trouble with this, the latest
NDK (27) compiler does. That compiler diagnoses the empty-pack case, even though in that case there is no actual use of declval, as the pack-expanded expression contains no use of declval.
For other compilers, that may work for functions that have no arguments, but will not work for any function that does have arguments; in that case, the attempt to use declval will always be ill-formed, and there will be an attempt to use declval.

The fix is straightforward; we have a Ret(*)(Args...), its return type
is simply Ret. So use a simple trait instead of the result of a call.

Task-number: QTBUG-127468
Change-Id: I0dc9e1201914ab94acc2940870be7c6d8cb16c12
Pick-to: 6.7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 236c6ec6f4c777d0534539f1c293cfc74006a6eb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-19 00:50:16 +00:00
Marius Kittler a75b432c8a Fix QCommandLinkButton in Windows 11 style when darkmode is used
Fix polishing QCommandLinkButton in Windows 11 style: The condition
for QCommandLinkButton needs to be checked before the condition for
QAbstractButton; otherwise it is never entered and the colors from
the Vista style are used breaking darkmode.

Pick-to: 6.7
Change-Id: Ie9e1c20b38a52b2d72f28279e38deb533595b974
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
(cherry picked from commit a17c34d2b7ef8391e5485d0ba06966ece793d184)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-18 21:57:52 +00:00
Christian Ehrlicher 328a2642dd QLoggingRegistry: Misc fixes
Fix the name of the env var in the debug output for QT_LOGGING_CONF
and adjust the documentation to not suggest to add quotes around the
value of QT_LOGGING_RULES as this will not get properly parsed.

Change-Id: I2da4f841c42c6af6e73d09f19d9baada3582bcd1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 753d035e152f0572ba99717d04116a882a506bef)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-18 20:29:09 +00:00
Marc Mutz 2f8d5ea487 QUuid:: fix UB in (Id128Bytes) ctor
After qbswap() has run, the Id128Bytes active member is data64, yet
the rest of the QUuid constructor accesses .data. This is UB.

Use the void* dest overload of qbswap() or memcpy() the Id128Bytes
into a char buffer and consume data from there instead.

Amends 686c02224c.

Task-number: QTBUG-120637
Pick-to: 6.7 6.6 6.5
Change-Id: Iba62a692391a5600b867c30dcb3bc50b82ee072f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit f5b7e8a3fbc27082651b8eda08f1fe4ff7d70f3f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-18 19:35:03 +00:00
Andre Hartmann 68326ad432 Doc: Clarify setInterval() and start() for active timer
Despite using different code paths, both stop and then
re-start an already active timer, which invalidates
the id().

While at it, port the occurrences of timerId() to the
modern function id(), which exists in both QTimer and
QChronoTimer

Change-Id: I5db099b198b1c11e1cdbd0fbb30ecece5d0135c8
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit ea0f8cee55e56d0f03ea9a185faee328b5cfa7bf)
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2024-08-18 20:14:53 +03:00
Thiago Macieira 5f46669178 QMimeData/Docs: include the fact that some functions may convert
QMimeDataPrivate::retrieveTypedData() converts if the target MIME type
is text/plain or if the target meta type is QByteArray.

Fixes: QTBUG-127296
Change-Id: I4878533dcb2d4b3e8efefffd17e49ade9fbb32f8
Reviewed-by: David Faure <david.faure@kdab.com>
(cherry picked from commit 05aaf2a684e49d6034f3860fb55a70e75de61e49)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-18 00:44:20 +00:00
Ahmad Samir 9c64b6a201 Q{Chrono,}Timer: de-duplicate API docs
Change-Id: Ib88d89e5f8dae4a834467c05e2e5fa6983e7cd76
Reviewed-by: André Hartmann <aha_1980@gmx.de>
(cherry picked from commit 46b8da642b9016c84d0cba12dab9bae3fba24ae4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-17 22:19:05 +00:00
Michael Weghorn 32b0ff2124 a11y atspi: Map QAccessible::Border to AT-SPI2 panel role
Instead of mapping QAccessible::Border to ATSPI_ROLE_FRAME
("A top level window with a title bar, border, menubar, etc." [1]),
map it to ATSPI_ROLE_PANEL ("A generic container that is often used to
group objects."), as widgets using that role (in particular QFrame)
are not top-level windows, but rather containers for other widgets.

[1] https://docs.gtk.org/atspi2/enum.Role.html#frame

Fixes: QTBUG-127552
Pick-to: 6.7 6.5
Change-Id: I565793b6e02903402cfc764e2e38d391a2960af1
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit a19d66385fc9fa13ce5ee811386ad104c0718941)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-17 18:11:00 +00:00
Mårten Nordheim 699f722789 http2: delete byte device without deleteLater
If we own the byte device we can just delete it directly when we are
done with it.

Change-Id: I9da99943ff61925f6f5416df403bcd747c2558d5
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
Reviewed-by: Øystein Heskestad <oystein.heskestad@qt.io>
(cherry picked from commit 4bc878ff4fbacd39d4c0ed1e8e742fd18fa74fed)
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-08-16 17:34:30 +00:00
Marc Mutz 4cb06919aa qfloat16: remove IsIntegral work-around
We now assume that is_integral works for qint128 if QT_SUPPORTS_INT128
is defined, so we no longer need to roll our own version of
std::is_integral.

Amends 0d85d0a72f (which is in 6.7, but
we're only guaranteeing that std::is_integral works for qint128 since
6.8, so not picking all the way).

Task-number: QTBUG-119901
Task-number: QTBUG-117637
Change-Id: I0651f1f17c1abfe4dc2b2d08ae4304fc8dcae092
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit da580a12b10f33fcff5783ca595d1c53b5b8b7de)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-16 17:34:30 +00:00
Marc Mutz feb43b779a Switch to non-strict C++ builds so QT_SUPPORTS_INT128 is true
A previous commit disabled QT_SUPPORTS_INT128 if the Standard Library
doesn't properly specialize <type_traits> and <limits> for the 128-bit
types, like libstdc++ in strict mode. As a consequence, we now need to
compile Qt in non-strict mode so QT_SUPPORTS_INT128 is true when
building Qt, at least if the compiler supports 128-bit integers in
principle.

Statically assert that QT_SUPPORTS_INT128 is defined if the compiler
in principle supports it, to catch other problematic platforms early.

We have a few out-of-line implementations that should be built if the
compiler supports int128 in principle, so that Qt users are free to
use the types if their compiler supports them and not run into missing
support in the Qt library. This patch ensures this.

Compiling in non-strict mode removes the early warning we were getting
from it, but a) headersclean still uses strict mode, so at least our
headers are regularly checked and b) this is a cross-platform project;
if we were to use platform-specific extensions unprotected, other
platform's compilers will still complain.

Fixes: QTBUG-119901
Change-Id: I974f95ca0f26085dd0fe5ceb8bbef4f62467979a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 30e04340dac26ebd09f9bc8ceb598e873ab63ba7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-16 17:34:29 +00:00
Marc Mutz 7805b3c32f Only define QT_SUPPORTS_INT128 if type_traits work for them
It turns out that libstdc++ in -ansi mode defines __SIZEOF_INT128__,
but not the corresponding specializations of <type_traits> and
<limits>. This has caused numerous pain points over time, esp. since
is_signed doesn't work, so qt_saturate e.g. can't be used on qint128
inputs e.g.

After another such issue (cmp_equal()), we decided to require
<type_traits> and <limits> support for extended integer types in the
stdlib, or we will disable Qt's support for it, too.

So check that if QT_SUPPORTS_INT128 is defined, is_signed_v,
is_integral_v and numeric_limits work, too. Disable QT_SUPPORTS_INT128
when compiling with libstdc++ in __STRICT_ANSI__ mode (-ansi or
-std=c++NN instead of (the default) -std=gnu++NN).

[ChangeLog][Potentially Source-Incompatible Changes] Qt's support for
128-bit integers (qint128/quint128) is now conditional on support for
these types from the Standard Library, in particular <type_traits> and
<limits>. Qt no longer tries to work around missing Standard Library
support. As a consequence, e.g. GCC -ansi and GCC -std=c++NN (instead
of -std=gnu++NN, the default) builds will now no longer support these
types.

Task-number: QTBUG-119901
Change-Id: I8529e72a52a2f5da0f469bae543688e18220255f
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 9bb2ab5978625eee96f703871d5eca8e54b31386)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-16 17:34:29 +00:00