65539 Commits

Author SHA1 Message Date
Ahmad Samir
1753af3841 QFileSystemModel: don't crash with setIconProvider(nullptr)
The method takes a pointer, so the code shouldn't crash when passed a
nullptr.

QFileInfoGatherer::getInfo() still needs to generate a descriptive
string for the file, so we refactor QAbstractFileIconProvider::type()
to put the implementation into a reusable static function
QAbstractFileIconProviderPrivate::getFileType(const QFileInfo &info).
This unfortunately involves constructing a QMimeDatabase on the fly,
but the docs say that is fine.

Drive-by change: use nullptr instead of `0` for pointers.

Pick-to: 6.6 6.5
Fixes: QTBUG-99178
Change-Id: Ia32ea0a26701d593e74fbecced7be8d9e0aa0f52
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit 2a8b27bf6c523de6f3f466f8062279c093940a60)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-05 23:15:07 +00:00
Tor Arne Vestbø
8543be7355 iOS: Guard traitCollectionDidChange against lack of QGuiApplication
During shutdown we may get traitCollectionDidChange for our QUIWindow,
as it may outlive the QGuiApplication and the QWindows due to hanging
around in an auto-release pool.

Pick-to: 6.6 6.5
Change-Id: Ifc6471b933fb1b4d1e83e9b734aac31044dce03e
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 4dbc267945df841508a217fbdb6faf15c6f457fc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-05 23:15:07 +00:00
Ivan Solovev
6e269fe18e Implement QCborContainerPrivate::compact()
... and use it in QCborContainerPrivate::replaceAt_complex() to avoid
unconstrained memory growth in certain scenarios.

Remove the `reserved` parameter, because it was referring to the
elements array, not to the byte data, so it cannot really be used
in the implementation.

Fixes: QTBUG-109073
Change-Id: I2e8fe7e4a4bf7a0ce06c87ca657f2bc01bae0341
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 83f0796192d9f0ed3bc005dbcf68b98de62955b8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-05 23:15:07 +00:00
Tor Arne Vestbø
f0bc5cac4f iOS: Guard against displayLayer after platform window is gone
During shutdown the UIView might outlive its QIOSWindow platform
window. If we receive displayLayer calls, we need to bail out,
to avoid crashing when trying to send the expose event.

Pick-to: 6.6 6.5
Change-Id: I2f36a4dd825e91b348bc57a06e6aa6b1a12fd249
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 483523ad9f9807e84ab6aa0f48712df0524dbe28)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-05 23:15:06 +00:00
Jaishree Vyas
97a39fb8f6 Doc: QDomDocument doc refers to QXmlQuery which doesn't exist in Qt6
Remove QXmlQuery from the docs

Fixes: QTBUG-120530
Pick-to: 6.6 6.5
Change-Id: Ic7927375701fbcdf106f90fbea8ea3aac2df8f5a
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 6be61763a0d2477d47031116381ec37704d155a7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-05 23:15:06 +00:00
Tor Arne Vestbø
34e3bdcb5e iOS: Remove QUIView from superview on QIOSWindow destruction
Unlike on macOS, our UIViews are children of a QIOSDesktopManagerView
that we use to do window management, so we need to remove the view
from its superview, even if represents a top level QWindow.

The only exception is top level foreign windows, which are used to
represent a native UIView for the purpose of containing a Qt view
hierarchy within. As we don't know anything about the foreign view's
superview hiearchy we shouldn't touch it.

Pick-to: 6.6
Fixes: QTBUG-120369
Change-Id: I6a43bb0a4e72d0d1525a7cc33d572ea7477215b3
Reviewed-by: Doris Verria <doris.verria@qt.io>
(cherry picked from commit bc7e728fcfd2cfdbff29fa9d1b0f8dae718a0f8c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-05 23:15:06 +00:00
Eirik Aavitsland
27625a33c5 Update bundled libjpeg-turbo to version 3.0.2
[ChangeLog][Third-Party Code] libjpeg-turbo was updated to version 3.0.2

Fixes: QTBUG-121737
Pick-to: 6.6 6.6.2 6.5 6.2 5.15
Change-Id: I0085f0f859dd9c95ed203fd22bd9702fd1e9d721
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
(cherry picked from commit 972bd4ed46be6ad905f2cd8bd84776cf3f1f3220)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-05 20:02:10 +00:00
Jarek Kobus
c160f3340e QObject: fix installEventFilterOrder() test flakiness
Don't rely on timer precision and use int counter instead.

Amends 1fe88bf4cd919d4b5cadb4be2cf0193525c54673

Pick-to: 6.6 6.5 6.2 5.15
Change-Id: I057b4dd51014784ec9b244301b43583f3de6ddd1
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 0d0810e2dcc8a9ee28935af5daadc2ef36ed25a2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-05 20:02:10 +00:00
Edward Welbourne
f48faee770 Make TEST_CTOR macros use the "do { ... } while (false)" pattern
They were expanding as simple blocks, so their uses didn't end in
semicolon, which looks wrong when reading the code.

Pick-to: 6.6 6.5
Change-Id: Ibea7b01ac165045604b6eb7a838765b2061c368a
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 5d451d514cc35402b04288372483223d6c893c47)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-05 20:02:10 +00:00
Edward Welbourne
41c786781a Update QLocale and calendar data to CLDR v44.1
(This turns out to be identical to v44, for our purposes.)

The CLDR license has been revised at v44 to "UNICODE LICENSE V3",
which is now included (as LICENSES/UNICODE-3.0.txt) in addition to the
old license (still in use, presumably, by UCD - at least until its
next update). Some new QLocale::Language entries are needed. There is
no change to the time-zone data.

Some tests needed changes:
* Various Arabic locales now use U+0623 (Arabic letter aleph with
  hamza above) in exponent separator, replacing plain U+0627 (Arabic
  letter aleph); it is still followed by U+0633 (Arabic letter seen).
* Where likely sub-tags used to fill in world, 001, as territory for a
  language, they now (e.g. for Prussian and Yiddish) give specific
  countries.
* Tamil locales now have something of a mix of inherited and localized
  forms for AM/PM, which looks a lot like a mistake in CLDR.

Conflict resolution at 6.7: a test fixed in dev is not present in 6.7,
as it wasn't reworked or given the new test-case, so that's omitted.

[ChangeLog][Third-Party Code] Updated QLocale's data extracted from
the Unicode Common Locale Data Repository (CLDR) to v44.1. The license
changed to Unicode License V3.

Pick-to: 6.6 6.5
Fixes: QTBUG-121485
Task-number: QTBUG-121325
Change-Id: Ide1a68016129526d7a5aa3fc67f1a674858696bc
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 063026cc503e0c02af781caf920f5abfa0416268)
2024-02-05 21:02:10 +01:00
Tor Arne Vestbø
64f6664f5c Don't set ExplicitShowHide on children when showing parent widget
As a result of using QWidget::setVisible to show the child widgets we
would end up also setting ExplicitShowHide. This is not in line with
the intent of ExplicitShowHide, which is to flag a widget as explicitly
shown/hidden by the developer, which in turn prevents Qt Widgets from
toggling WState_Hidden when the widget is reparented.

By using QWidgetPrivate::setVisible instead, we can show the child
without setting ExplicitShowHide.

As side effect of this is that we no longer reset WA_WState_Hidden
from QWidgetWindowPrivate::setVisible(). This is an issue when the
setVisible call comes as a result of destroying the QWidgetWindow,
as that is an implicit hide, and should not result in the widget
having WA_WState_Hidden. QWidget handles this case in hideChildren
by not calling QWidgetPrivate::setVisible -- instead doing its own
reset of WA_WState_Visible. We don't want to untangle this just yet,
so as a workaround we detect that the widget is already !isVisible(),
thanks to hideChildren having hidden it, and then skip the call
to QWidgetPrivate::setVisible that results from QWindow::destroy().

Task-number: QTBUG-121398
Change-Id: Ib5b4d9c84f0569124c5f3ca2169cabff18934e2d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 5ba0982b2879a1a4c13bf97467b8e5ad296e57a2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-05 20:02:10 +00:00
Tor Arne Vestbø
c8a543e3ec Simplify tst_QWidget::closeAndShowWithNativeChild
The nativeHiddenChild is not used for anything, and shouldn't be
needed to trigger the failure condition.

That said, I was not able to reproduce the test failure on macOS
14 with the test neither pre or post patch, nor with any of the
test cases mentioned in 51300566ffe2ece2455e1d0479a556c5dbb3bb8e,
nor with 51300566ffe2ece2455e1d0479a556c5dbb3bb8e itself, so this
has seemingly been fixed or worked around some other way in the
meantime.

Task-number: QTBUG-121398
Change-Id: I299e7f4b71ebdb17870348a3d5b0c49a93228c8b
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit f85c988980f73398762d4bd5c1a8a1799d182bdd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-05 20:02:09 +00:00
Tor Arne Vestbø
0b76a0b322 Add logging, clarifications, and tests for QWidget show/hide behavior
Task-number: QTBUG-121398
Change-Id: I94b4c90c3bd515279417c88497d7b9bd5a362eae
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit b393b26c70cc40c37173cba8c22d66484041087c)
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2024-02-05 20:02:09 +00:00
Tor Arne Vestbø
527b5f6ff4 Don't rely on QRasterWindow::resizeEvent for marking window dirty
The de-virtualization gotcha might result in client code not calling
QRasterWindow::resizeEvent, which we use for dirty state management
after e0eb2818face4ffb7dafd87464f355d4654b7be0.

In practice this wasn't an issue, because QPaintDeviceWindow handles
paint events by calling markWindowAsDirty first, but we should not
rely on this.

Instead plumb the resize event to QPaintDeviceWindowPrivate, which
QRasterWindow implements and can override the behavior of.

Pick-to: 6.6 6.5
Change-Id: I5c0747da10f0275b77f56be32690d796fa48cdb4
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 6cb497c1570ee427460962b2c0abe3b6dd8c4ae6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-05 15:51:24 +00:00
Liang Qi
3e563542b3 QGenericUnixServices: make sure the picker returns a color
This amends b646c7b76c7787cff57bca0fde04d9f58abdfbb8 .

Pick-to: 6.6 6.5
Change-Id: Ic7183c06a93085d65b31c86380889b78c714548b
Reviewed-by: David Edmundson <davidedmundson@kde.org>
(cherry picked from commit f07d8309d6c61397677703cfa195927aee0cd50e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-03 20:40:23 +00:00
Thiago Macieira
e32853b75d qHash: provide the long double overload on Darwin systems
Commit c0791ac76ec7cfdc3945efa67a6f72ee3623413c didn't explain why it
was #ifdef'ed out. It's just an alias for double. Maybe compilers at the
time used to complain if you used it, but I can't make Apple's clang
produce a warning now.

Change-Id: I664b9f014ffc48cbb49bfffd17b02293403e9571
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit c5f22c54cbff8c31ab9e5111e74faae4e188e99b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-03 18:08:37 +00:00
Ahmad Samir
6b4805333f QMetaObject: clean up includes
Remove duplicate ones and regroup them.

Add a comment explaining why qthread(_p).h isn't guarded by an
`#if QT_CONFIG(thread)`; thanks to Fabian Kosmale for the explanation.

Change-Id: I9b13fd62ab92fa6d2ffc4d004d77e95e95f5fb08
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 28db390ce686ec8af70334e80ceae5ee2ebf87df)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-03 11:48:27 +00:00
Volker Hilsheimer
bd179a8d2f Fix usage of std::enable_if_t to SFINAE out QProperty APIs
Declare an IfUntypedPropertyData alias and use that consistently.

Amends 311f8896322bcd39d33369c8311a8c89ccdad449.

Change-Id: If36ef8e2f9ce25e0ffe7b4b448c31ea5866acfc3
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 216af5d7f9675a408e22167b097f221beeeb88db)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-02 23:48:31 +00:00
Volker Hilsheimer
78e2a49a48 Reapply: Remove const/ref debug operator for QDockWidget
QObjects are usually passed by pointer, so we leave the override
taking a pointer.

This amends bbeff2a3350dd3396400865525d509b784c2d93e, and reverts
the previous revert in b148a362c36a9b34b0c21c60530353d6bf6b92cb.
Now that we have removed the incorrectly added operators from the
6.6 branches entirely, we can remove the unnecessary const/ref
operator from 6.7.

Task-number: QTBUG-119952
Change-Id: Id196367ddf3ffb443db44194002f850dcfec5d79
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 4b64df56509dd770002ec083ee64f3ec23a8b682)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-02 23:48:29 +00:00
Giuseppe D'Angelo
43362244a1 QLineEdit: disable cursor blinking on hide
QLineEdit activates the blinking cursor timer when it's shown,
but never deactivates it, resulting in constant wakeups even for
hidden line edits.

Note that this is a workaround. Qt is supposed to send a focus out
event to line edits that get hidden. In some corner cases, it
doesn't, and only a hide event is sent.

Change-Id: Ic0645512051466ca9b1e84c54cef34c22287338b
Task-number: QTBUG-52021
Pick-to: 6.6 6.5
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit e35dcba5bb8cdcf578a514ad6e03ae64002c2c3a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-02 22:52:19 +00:00
Tasuku Suzuki
eeede2d800 Fix build with -no-feature-animation
This amends 8eaf01ef818c1b980e2bbce1e8ddd2de638f5028

Change-Id: I8e30f232b732b0acb0b6c7070ecfa216fabd64da
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit 2b8a604c40814fb25db3e02f9a7776cde9bc1c7e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-02 22:52:19 +00:00
Ghenady Kuznetsov
43de61139e Fusion style: add right side indent to groupbox title
Add right side indent to the title if groupbox alignment is set to
Qt::AlignRight | Qt::AlignVCenter.

Fixes: QTBUG-121049
Pick-to: 6.6
Change-Id: I9aac295c824ad774410efd679f59075e4251b611
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit 3aa9388056f56b65b33cd2929a690584e21a02b2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-02 22:52:19 +00:00
Wladimir Leuschner
e64861d416 QWindows11Style: Draw MDI SubWindows in Windows 11 style
Fixes: QTBUG-120633
Change-Id: I6ad4052ca45f7c90cd52a9d2440b508730d3685d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit a1f12273b2e355033ab2a9478d1e9702210a0733)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-02 22:52:19 +00:00
Alexandru Croitor
cfdffa17a5 CMake: Fix configuring a standalone test on Apple platforms
Configuring a test as standalone would fail with the following error:
 Invalid max SDK version: It should be a major version number,
 without minor

This happened because _qt_internal_check_apple_sdk_and_xcode_versions
expects QT_SUPPORTED_MAX_MACOS_SDK_VERSION to be available, but it is
not yet set due to Qt6 package not being found yet.

Avoid the issue by exporting the version requirements into both
Qt6ConfigExtras.cmake and Qt6BuildInternalsConfigExtra.cmake.

Make sure to assign the variables only once.

Amends a29bff3d80219f54d0837b0e6e0577192011dea1
Amends a0bdd2195f24d8a7d880ba506afc16b41337218e

Pick-to: 6.6
Task-number: QTBUG-119490
Change-Id: Ic297eeaabf22c8c42ded1a766906f88fdb91fd3d
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit cec2e42052a04cd2481c20bd4be5de2ba5ccaec2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-02 22:52:18 +00:00
Shawn Rutledge
7fa10ab76e QMovie non-anim: use QImageReader::imageCount but not nextImageDelay
Since 3f4d6279c4b0d04422efff478a5e2fb36259dbaa (khansen 2005) QMovie
calls QImageReader::read() until QImageReader::canRead() returns false.
That's apparently to support animated image formats in which the
frame count is not known at the beginnning (i.e. not specified in
the image format's metadata). But non-animated multi-frame formats
are expected to return valid values from QImageReader::imageCount();
and those also tend to keep returning true from canRead() regardless
of how many frames have been read (the interpretation of canRead()
is "does the file have the expected format?" rather than "are we
about to read too many frames?"). So, when a multi-frame image is abused
as an animation, QMovie was able to keep reading the same frame
repeatedly and pretend that the frame sequence goes on forever.
It also tended to read frames as fast as they could be decoded,
because nextImageDelay() is not usually provided, because multi-frame
image formats don't specify a frame rate in their metadata.

So now we change QMovie's behavior for image formats where
QImageIOHandler::supportsOption(Animation) returns false:
trust imageCount(), but not do not trust nextImageDelay().

But to actually jump to the next frame in this case, we also need to
call QImageReader::jumpToNextImage().

Altogether, this makes QMovie support "flipbook" animation for
multi-frame image formats, such as tiff and pdf.

Added "read frame x of c" logging in qt.gui.imageio category.

For testing, we use a pre-existing multi-frame Obj_N2_Internal_Mem.ico
file, to avoid depending on the tiff plugin.

[ChangeLog][QtGui][QMovie] QMovie now handles non-animated multi-frame
image formats (such as tiff): QImageIOHandler::imageCount() is observed,
and the default frame rate is 1 FPS.

Pick-to: 6.6 6.5
Fixes: QTBUG-117429
Change-Id: I6dad2a684e12c78a68288402e223a59427bf649e
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 7c313f18654d18fe253e1f1c55d6f4d92660888a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-02 22:52:18 +00:00
Shawn Rutledge
ff8928d3cb Update md4c to 0.5.2
Followup to c29a235833410fde4cb4d502f89129bccd7403f0

[ChangeLog][Third-Party Code] md4c was updated to 0.5.2.

Task-number: QTBUG-121442
Pick-to: 6.6 6.6.2 6.5 6.2
Change-Id: I097d9aa5f54c59c301a91fb824adf949daae3af2
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit 16bcdba8e7adae79729c6347e711bd0a976dbbe7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-02 22:52:18 +00:00
Ahmad Samir
2e6e0c6bb4 QObject: add unittest to check the order of eventFilter() calls
installEventFilter() prepends new objects to the eventList, so that
events that are posted while processing events are left to the next
round of event processing.

This is a baseline test to check that subsequent commits preserve the
current behavior.

QCOMPARE_GT is available since Qt6.4, so make the check backportable to
older releases too.

Pick-to: 6.6 6.5 6.2 5.15
Task-number: QTBUG-120779
Change-Id: I5ed5e9c2917a9be62de4af19c3b72889399b4fe6
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
(cherry picked from commit 1fe88bf4cd919d4b5cadb4be2cf0193525c54673)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-02 19:50:50 +00:00
Alexey Edelev
fa6f2783ae Use separate property to store implicitly detected QT_QML_ROOT_PATHs
Use _qt_internal_qml_root_path when collecting the qml root paths using
_qt_internal_collect_qml_root_paths. The property is only applicable for
Android builds. This suppresses the QTP0002 warning for the cases when
android application has both QML executable and QML library modules.

Amends 575b8a7fa289a2e27984a6c322069f9e1b499024

Pick-to: 6.6
Change-Id: Iccadbe1f6ed697a94dba11af3dd054baec8daf9e
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit d954d53c1ddcffda394c4f44663b4c86a61ed452)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-02 15:28:34 +00:00
Lucie Gérard
98d5d291e7 Change configure license
According to QUIP-18 [1], all build system files should be
BSD-3-Clause

[1]: https://contribute.qt-project.org/quips/18

Task-number: QTBUG-121787
Change-Id: I88e3640b32e6b4bd83c49c14df6aecd7c824aef7
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 35fbb6561028a59702b12d6ff5e7cf310202ed0e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-02 15:28:34 +00:00
Volker Hilsheimer
6925dcbf79 JNI: Don't use forwarding reference in ranged for
The elements we iterate over are always jobjects, i.e. POD, so iterating
over values is at least as efficient, and less unnecessarily clever.

Change-Id: I6142dab84f3d37d82613ecf27cc03dde7810e541
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
(cherry picked from commit 9f0dc59cd62f7afd18b36e6064f2d4b8ff2a7c6c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-02 15:28:34 +00:00
Marc Mutz
ac399ca897 StreamStateSaver: disable copy/move
The class has a user-defined destructor, so it mustn't be copied or
moved (which here is the same as copying).

Amends 3c93286f08a80b6e1821d7d63d361742b25c6578.

Pick-to: 6.6 6.5
Change-Id: I1b23588309654f34aedc0269e1d1c9511ddda2bb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 1b3c8d6e95a81d307a9f7bb556aabcf7fea04588)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-02 15:28:34 +00:00
Joerg Bornemann
907497b87d CMake: Fix *-metatypes.json creation, take III
Use the work-around for CMake issue #19005 for Makefile generators
and Visual Studio projects.

Pick-to: 6.6 6.5
Fixes: QTBUG-120317
Change-Id: I3d15f23937133a5dd4d1c2a88af0fc34d5608a77
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 654f3c5634ac9efc2257177351c8dea7c8d8875a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-02 15:28:33 +00:00
Tim Blechmann
d5134f2123 kernel: silence -Wextra-semi
silencing gcc's `-Wextra-semi`

Pick-to: 6.6 6.5
Change-Id: I0e70465585be5ba4d90c691cd0fbd43e1288e694
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit 6fc93f9765201de19b52823a4c0fd661711aa971)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-02 11:15:26 +00:00
Edward Welbourne
5bff9b1ec0 Documentation tweaks in QDate(Time)?::toString()
Include the \since markers they need, plus changes in past versions.
Purge a stray blank line.

Pick-to: 6.6 6.5 6.2
Change-Id: I4edaa0ffaf59323e0af6412727f2a85866813ab8
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit 8c178a540faf27fdab6977b13507d94735f89e21)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-02 11:15:24 +00:00
Lucie Gérard
d754b96c4e Change license of .qdoc files
According to QUIP-18 [1], all .qdoc files should be
LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only

[1]: https://contribute.qt-project.org/quips/18

Change-Id: I4559af21fc9069efa9bf0cbd29c5e86cfdac9082
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit 865d0133fcb54c0e22f53dde71ebbca9cbcaf78e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-02 09:47:31 +00:00
Friedemann Kleint
8a762c8857 Menu example: Use theme icons
Change-Id: I7f77457b439919e7a7882f23e21e648d8965859a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 4aa2e594ff055e46c56734a2c0838c214c6bce88)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-02 08:48:31 +00:00
Jøger Hansegård
e2fbb431cb Deploy FFmpeg dlls with windeployqt
When we add support for dynamically linked FFmpeg, some FFmpeg libraries
will be available in the bin directory. windeployqt should then copy
these libraries to the application directory if the ffmpeg media backend
is included.

This patch extends windeployqt with support for deploying these FFmpeg
libraries.

Potential issues:

1. This patch hard codes the FFmpeg library names that we currently
   depend on, such as 'avcodec' or 'swresample'.
2. We don't take version number of the FFmpeg libs into account. This is
   done to reduce the maintenance burden when we upgrade FFmpeg, and
   should not be a problem as long as we have a single version of FFmpeg
   in the online installer.
3. Finding the library names is a bit quadratic in complexity, bound by
   the number of libraries in the bin folder, but should not be too
   slow.
4. We need to update windeployqt if we add or remove ffmpeg libraries.

An alternative would be to identify all dlls that the ffmpeg media
plugin depends on, and then deploy all files that exists in the bin
directory instead of hard-coding library names. This would, however be a
bit more fragile because we would not be able to warn if a library was
missing.

Note that this patch is a workaround. It is needed because Qt does not
properly support CMake's runtime dependency features with platform
plugins. Even if we added FFmpeg binaries to the dependencies set, they
would not be visible at install time.

Pick-to: 6.5
Change-Id: I4b23e50429d16e8487bf43ce9982ff37d02ffbe2
Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
(cherry picked from commit 138eebcc099e5e95ce04315ac7e1899f59399ca1)
2024-02-01 13:51:24 +00:00
Volker Hilsheimer
ed07354be6 JNI: Fix QJniObject::callback test case
Don't call the native function directly, call the Java function that
calls the native function.

Change-Id: Icdcf250313a38f6e4bc2b90fb7b0adbfa5a890fb
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
(cherry picked from commit cfcd56a78fae5d4f4c79f9e76d6bcd57f8a3cde2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-01 13:51:24 +00:00
Alexey Edelev
bf6b4167bc Introduce QTP0003 which controls the BUILD_SHARED_LIBS impact on user projects
Since 6.7 we consider the BUILD_SHARED_LIBS when creating libraries
using Qt CMake API. This change may affect the user projects that rely
on the old strategy of selecting the default library type. To preserve
the old behavior this change introduces the QTP0003 policy that allows
user to control whether the BUILD_SHARED_LIBS should or shouldn't be
considered in library creation process.

The policy doesn't affect Qt repos, we assume that we want the NEW
behavior by default.

Fixes: QTBUG-121707
Change-Id: I4bcfbd8966839731624e3f7ef9e0d6bb2782ac50
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
(cherry picked from commit 31b75303d7f9126dcc9bb0e94f0ea4ef1b9c0a71)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-01 09:14:36 +00:00
Topi Reinio
55f56b9dd1 Doc: Fix argument names in QRgbaFloat::fromRgba64() \fn signature
Fixes the following documentation warnings:

(qdoc) warning: Undocumented parameter 'r' in QRgbaFloat::fromRgba64()
(qdoc) warning: No such parameter 'red' in QRgbaFloat::fromRgba64()

(Which repeat for green, blue, and alpha.)

Change-Id: I22d281b716865eec649b9fb63f2113f982fdf8ea
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit 92dc4c5c9451f70060bf379742b91c8cacbb7df6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-01 09:14:36 +00:00
Topi Reinio
2e5a5e23fc Doc: Fix undocumented parameter in QFlags::operator=()
Fixes a documentation warning:
  (qdoc) warning: Undocumented parameter 'other' in QFlags::operator=()

This warning is reported by the latest version of QDoc, but fixing
it causes another warning in the currently-provisioned QDoc.
Therefore, raise the warning limit temporarily to pass the
documentation check in CI.

Change-Id: I14863baebf712cda6f4da6d989e3ab83ffea7f85
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
(cherry picked from commit d76828a1c73ecb5858142f63bea4bb4ea8bf2a25)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-01 09:14:35 +00:00
Mårten Nordheim
482962ffca Bench QSet::unite
It was shown to have poor performance compared to contains() and
insert().

Pick-to: 6.6 6.5
Change-Id: I61cfbc8c34e325d677d7954118ef68057df640cb
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 000cb2dadc16e5bd585da459de44f1902943ea56)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-01 09:14:35 +00:00
Marc Mutz
a06a78bb04 [docs] Fix C'n'P error in QTRY_VERIFY2 example
It's not the _WITH_TIMEOUT variant (the timeout is missing).

Amends a change preceding b24bb12f6a93b98e9bc44c99e151b995eb7cea71,
the commit that moved all the documentation into qtestcase.qdoc in the
first place. I didn't track the change back further than that.

Pick-to: 6.6 6.5 6.2 5.15
Change-Id: I79ccd84a5dbed20012fa1a2d3561945f8a7638d5
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 4af3cf275fc9f5e721fab6b05fc05cf7bdbe5c99)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-01 09:14:35 +00:00
Yifan Zhu
91d4dd50fa qxkbcommon: map XKB_KEY_XF86Calculator to Qt::Key_Calculator
cfd935fe6c26800befc10889afc0aebde311acca removed the erroneous mapping
from XKB_KEY_XF86Calculator to Qt::Key_Launch1, leaving it unmapped.
It should be mapped to Qt::Key_Calculator, just like
XKB_KEY_XF86Calculater.

Fixes: QTBUG-121713
Pick-to: 6.6 6.5
Change-Id: Iaa28e38792f43a7950a3c38397869a6ffed332d1
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Liang Qi <liang.qi@qt.io>
(cherry picked from commit 86e92972dd1df463f8da859f651ba0eb76dacd50)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-01 06:06:31 +00:00
Tor Arne Vestbø
c967ee08c8 macOS: Don't condition deferred exec on specific NSAlert to be the modal window
When a QMessageBox is created with setModal(true), the user can in theory
choose to show() it, and then return back to the main event loop, instead
of calling exec(). We tried to support that case via a single shot timer,
called on the next pass of the event loop, that checked if the applications'
current modal window was the alert, and if not, showed it at that point.

That logic failed when there were more than one alert show at the same
time.

We do maintain a stack of the modal sessions and their windows in the
Cocoa event dispatcher, so we could use that to check if a modal session
had been started for the alert's window, but a similar solution is to
just check the alert window's visible state.

Fixes: QTBUG-121557
Pick-to: 6.6 6.6.2 6.5
Change-Id: I6f52a53e8f678bb8a071e334a09ab30669d95bbf
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
(cherry picked from commit 7edff3f15ae21c2310437e0711f84442a21cb6a1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-01 03:25:34 +00:00
Liang Qi
7927145625 tests: fix a crash in tst_QItemDelegate::reuseEditor() on Wayland
Pick-to: 6.6 6.5
Task-number: QTBUG-107153
Change-Id: Ic041302753bee4e2292b2afd898dd176966cf951
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 75d1db6aedfe7e627af8881dd2e3b8988af8767c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-01 03:25:31 +00:00
Topi Reinio
5a7e7942cd Doc: Qt Network: Fix references to renamed functions
As part of the API review process, in QNetworkRequestFactory:

(set|clear)Headers() were renamed to (set|clear)CommonHeaders(), and
request() was renamed to createRequest().

In addition, QHttpHeaders::has() was renamed to contains().

Update references to the old names in the documentation.

Change-Id: Ib79ae99de26be2f3af60787c8b86c3c20cb30067
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
(cherry picked from commit 711def1290439d19e7ed9068704bb2160edab968)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-01 03:25:30 +00:00
Jacek Poplawski
3340b82ee9 Make sure the sqrt value in qdrawhelper is non-negative
It's possible for the "det" variable to exceed 0 and be negative.
This scenario is already handled in one case, this change will fix second case.

Fixes: QTBUG-120907
Change-Id: Ib30213b3455b5c6f3b8b8384e78e7b43158f93b5
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit ba75e7770f7facf5f841e72ca0a4fd2a1a1fb6e1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-01 03:25:28 +00:00
Kai Köhne
2c53d990f7 SQLite: Update SQLite to v3.45.1
[ChangeLog][Third-Party Code] Updated SQLite to v3.45.1

Pick-to: 6.6 6.6.2 6.5 6.2 5.15
Change-Id: I8083d0750e52b1035919821c25cef9855afea2f9
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 40a87ca1b421457fc2a31cf385eb5a0eda83486f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-01 03:25:00 +00:00
Alexey Edelev
2d77750bf7 Change the way we detect the need of adding Qt<Module>Plugins.cmake
Currently we assume that only modules that have plugins built in the
current build tree need to generate and install the
Qt<Module>Plugins.cmake file. This approach is weak since other Qt
modules might still want to provide the plugins of the certain types,
even if the module that the plugin type belongs too didn't have plugins
initially.

The fix unblocks the formally 3rd-party plugin installation and loading
chain.

Pick-to: 6.6 6.5 6.2
Fixes: QAA-2266
Change-Id: Ifc616e26a00674371c8e2fe2ca12237d153e5707
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 180afc7321c85f7f36d085b76d1be74c99da2462)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-01 03:24:57 +00:00