Commit Graph

68075 Commits (9f331f89ea3af80dbac8fe4295cefd8fc2d45d80)

Author SHA1 Message Date
Alexandru Croitor 9f331f89ea CMake: Fix SBOM error for corelib
The siphash qt_attribution.json file was moved to the 3rd party
directory out of corelib, without adjusting the attribution file dir
path.

Amends da2d3e914c1b3f9da17c40502c8e7c1463d35612

Change-Id: I25cf9b9f19bc596898d51449ef9561eb9882a046
Reviewed-by: Orkun Tokdemir <orkun.tokdemir@qt.io>
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 0b0b30f7cf900ea0463f4073f0e82d014920fd1d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-10 12:45:12 +00:00
Alexey Edelev ee1e1b2aae Ensure that we make case-insensitive comparison of CMAKE_SYSTEM_PROCESSOR
In windows CMAKE_SYSTEM_PROCESSOR can be set to both arm64 and ARM64.
Make the comparison case-insensitive when defining mkspec.

Pick-to: 6.7 6.5
Fixes: QTBUG-127044
Change-Id: Id0c8f04bc0ec6b70993e400f9c285168d4c1499b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 7ae19cee1c782fadfbd0c617568fdad8aba9a493)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-10 12:45:12 +00:00
Kai Köhne 5b2fda4357 Doc: Replace mentioning of non-existing Qt permissions API
\l is your friend to detect incorrect links.

Pick-to: 6.7
Change-Id: I347cb3c80664c89183523b683d3f988a1f4ab978
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit d05399c9932e3f00a2f4137a373552b1e781102d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-10 09:53:33 +00:00
Marc Mutz 1c53afb774 tst_QThread: add a test for self-cancellation
Doesn't test anything, just that it doesn't crash.

Turns out we have a race between thread cancellation and normal exit
(filed as QTBUG-127008). Worked around by adding an infinite loop to
run(), after terminate().

Android doesn't support cancellation at all, and our Windows
implementation hits QTBUG-127050, so skip the test on those
platforms.

Pick-to: 6.7 6.5 6.2 5.15
Change-Id: I47a635a31caaf116d3688f31b9b5c5875e9765f5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit a9f7e75a2647732ff998f1c0d112682dbd5c4e28)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-10 07:37:03 +00:00
Volker Hilsheimer 0d7b42d92b HTTP2: refactor setting of temporary key chain into helper
Remove duplicated comment and code that sets and resets the environment
variable. As a side effect, restore the environment variable to the
value that was set before overwriting it, instead of un-setting it
bluntly.

Pick-to: 6.7 6.5
Change-Id: Ife0b2631aff27dbcb23079c2162ffed797b351dc
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit f984a6ab7a99ace65e0d73c3f37ef6ad79dd0aa0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-10 01:50:21 +00:00
Volker Hilsheimer e25f619663 HTTP2: use temporary keychain in the abortOnEncrypted test function
On macOS with secure transport, set QT_SSL_USE_TEMPORARY_KEYCHAIN
environment variable to avoid the permission UI, which fails the test.

Amends b1e75376cc3adfc7da5502a277dfe9711f3e0536, and makes the test pass
reliably on a local machine.

Pick-to: 6.7 6.5 6.2 5.15 5.12
Change-Id: Id70ceaecfa523d5183236464fe6cfaf4cdbadf4a
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 14a61026216d20eb3a2893420b7d51374e820b44)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-10 01:50:17 +00:00
Thiago Macieira 1ef5911d28 QPluginLoader: set an errorString if resolving qt_plugin_instance fails
We're getting load() == false but errorString() == "Unknown error".

Not backporting past 6.8 because of a new translatable string.

Change-Id: Ic0adfa808d28487a8303fffd17d9ee19ce074e4b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 2be44b57da951007ecab4d6c9e4bc2f3b5cd067a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-09 14:24:35 +00:00
Volker Hilsheimer d383391990 Rename target of the BSTR test in QtCore to avoid conflict
ActiveQt already has a tst_bstr, so configure fails for top-level builds
with both Core and ActiveQt.

Amends 93686386c078e2be03fb8bc42dee60a9e36fc23f.

Task-number: QTBUG-126530
Change-Id: I4a3d67d72be14202fe487f241ecd3d7c97936e29
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Pavel Dubsky <pavel.dubsky@qt.io>
(cherry picked from commit 43a54cbe82a59a32ae666ddd0cc54e5edd0ccf50)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-09 14:10:16 +00:00
Ivan Solovev 0c3ebbc037 QUuid: extend test coverage for version() and variant()
... to make sure that the follow-up patch does not change the behavior.

Pick-to: 6.7
Change-Id: I4a1898ce0987940622ff38fd70819a83d62515db
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 27fe14cf430980b133694bc86d1224bd56e3faeb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-09 12:32:35 +00:00
Edward Welbourne eaa78fb2b1 Fix sameLocale() assertions in qlocale.cpp
The assertion is about entries at the same index having matching
language, script and territory tags. I forgot that the system locale
has its m_index set to match the closest-matching CLDR data table, so
might not have the same tags as the locale_data[] entry at its given
index.

Fixes: QTBUG-126390
Change-Id: Icb8cc09cc2a9d66a0af301a300f44923d7400ce9
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 1df1c0b6fdc40a3cb9e89c4d07adc89c37c7582b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-09 10:13:08 +00:00
Giuseppe D'Angelo 159d63edb5 PDF: add a way to customize the output intent
PDF/A-1 and PDF/X-4 require the use of an output intent. Insofar this
has been hardcoded to be sRGB. Instead, expose the relevant setting so
that the user can choose another colorspace, and set the metadata
about the intent.

This work has been kindly sponsored by the QGIS project
(https://qgis.org/).

[ChangeLog][QtGui][QPdfOutputIntent] New class.

Change-Id: Ib3f0620477ddcc8b294a7039c120e89cc318f513
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit e8fcdf9bb6318e75d64179a6682481154cdef14f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-09 07:58:24 +00:00
Kai Köhne e309f0b013 Core: Move SipHash implementation into separate file
Isolate the code inspired by the SipHash reference C implementation
in a separate file. This makes it clearer what code is available
under the CC0 license, and which not.

[ChangeLog][Third-Party Code] Adapted copyright information for the
SipHash Algorithm (used in Qt Core).

Change-Id: I9b8fc27a4e791c0f1ccbdfa6244d4fa47c7a219b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit da2d3e914c1b3f9da17c40502c8e7c1463d35612)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-09 07:58:23 +00:00
Friedemann Kleint 0925c2d80a uic: Relax property name checks
Use an approximation of the "Unicode Standard Annex #31"
for checking the property names and enumerations.

Remove check for dynamic properties and use character literal
formatting for them instead, which will escape offending characters.

As a drive-by, use QStringView parameters for the check function.

Amends 53c8d1fe7c59f3462b85193b688d02ff353b51d5.

Task-number: QTBUG-126265
Task-number: QTBUG-126860
Pick-to: 6.7 6.5 6.2 5.15
Change-Id: I90fe555e64327e4164a17c1af0a734e4b1d834db
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
(cherry picked from commit aae20da52a11e0ebb8c4f5fcfb95ce6744f659a3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-09 05:41:05 +00:00
Edward Welbourne bc28d6d48c Kludge round macOS 15 knowing more about offsets than transitions
Darwin turns out to know about offset changes a million years into the
future, but to not admit to there being any transitions more than (a
bit over) half a million years into the future. It thus failed the
non-ShortData part of tst_QDateTime::timeZones(), thanks to using
correct offsets that showed there must be a transition in the
interval, but not believing in that transition.

The discrepancy leads to QTimeZonePrivate::stateAtZoneTime() getting
valid data for before and after the transition, with different
offsets, so amend its "no later transitions" early return to check the
offsets do in fact match. If they don't fall back on the code that
handles the case where we don't know about transitions but do have
offset data.

Pick-to: 6.7
Fixes: QTBUG-126391
Change-Id: Iefda439377ebc3025f2b754e2ec686fcc6361a1b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit cb870adad612018e7007f4a1b6066b49d0f2dc4a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-08 20:19:08 +00:00
Tor Arne Vestbø 1407e54f34 qmake: Use utimensat on macOS when propagating mtime during install
macOS only claims to conform to POSIX.1-2001, but has had utimensat
since macOS 10.13.

By enabling the utimensat code path, using stat.st_mtimespec as input,
we get nanosecond precision when qmake installs files.

Without this the tst_qmake::install_files tests fails due to the source
file having a sub second timestamp -- 2023-07-31 15:58:12.468 -- while the
installed does not: 2023-07-31 15:58:12.000.

The reason this test passes in the CI right now is probably because
the source file archive we use to pass test sources to the test
machines does not support the same level of precision.

Change-Id: I6ca7a2a2f9e71981814cbf496aa55717b3a3f74f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit a2779192eec649a15b909cd9becade7eb0bda34e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-08 20:19:07 +00:00
Giuseppe D'Angelo 9cc291fe94 PDF: code tidies: sort includes
Change-Id: I78764e2517b39d0ca7ec8fdb41f8344ed876ee27
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit d69a1e8e626c33d9e8eb5c62fc13ead51ceb49bf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-08 19:44:38 +00:00
Giuseppe D'Angelo a30591603b PDF: add support for PDF/X-4
PDF/X-4 is a subset of PDF 1.6, aimed at printing fidelity. We can
support it with a few refactorings of the existing code in
QPdfEngine.

* Add the new PDF version to QPagedPaintDevice / QPdfEngine.

* Always write the XMP metadata, no matter what's the PDF version
  used. XMP used to be written only for PDF/A-1b, but it's supported
  by PDF 1.4 and 1.6 so there's little reason not to write it.

* While at it, ditch the search&replace approach for the metadata
  and use QXmlStreamWriter instead, since it gives us extra
  flexibility that we need (emit different tags depending on the
  PDF version in use).

* The old code had a bug where the timestamps in the XMP metadata
  and the document information dictionary could fall out of sync.
  Just use one datetime object in both places.

* Add /ModDate and xmp:ModifyDate (required).

* Add the required attributes in the xmpMM namespace.

* Add a way to set the document ID to a custom UUID, and use it
  in the XMP metadata as well as in the /ID in the trailer. Emit
  the ID unconditionally, as it's been available since PDF 1.1.

* Emit the output intent for both PDF/A-1b and /X-4. This will be
  amended in a future commit to let the user choose the colorspace.

The only missing bit is §6.5.4 of the PDF/X-4 spec. This imposes that
all symbolic TrueType fonts shall *not* specify an Encoding, and have
exactly one encoding in the cmap table. This is basically requiring what
§5.5.5 in PDF 1.6 only suggests (page 400). However it seems that we are
not embedding a cmap table when extracting a font subset, and that's
already violating PDF/A-1b anyhow. This is tracked by QTBUG-125405.

This work has been kindly sponsored by the QGIS project
(https://qgis.org/).

[ChangeLog][QtGui][QPdfWriter] Support for PDF/X-4 has been
added.

Task-number: QTBUG-125405
Change-Id: Ia81f29b07b819eca5767c9f17692d92a3010f5ad
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 2fbece8a73cb2d2692c78c38e1576c0c9c62fce7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-08 12:46:00 +00:00
Tor Arne Vestbø 5397e0ddd1 Blacklist tst_Http2::duplicateRequestsWithAborts on macOS ARM
Task-number: QTBUG-119616
Change-Id: Ic02d423ef8a0cb9ab71d293428cb7d66ced19cdf
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit c4249b0f1477597c0ae9b56df5f893bd1b337d83)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-08 11:30:37 +00:00
Marc Mutz 19fbb338b8 Long live Q_DECLARE_SHARED_NS!
We used to mark Q_DECLARE_SHARED all our value classes in Qt 4 times,
but since many Qt types these days live in nested namespaces that
macro, which only works in the QT_NAMESPACE, has become less useful.

As we use it in more and more places and eventually add more
responsibilities to it, we don't want every module to define its
version by hand, like QT3D_DECLARE_SHARED did in 2016 already.

So add two namespace-aware versions of Q_DECLARE_SHARED, to be used
inside or outside nested namespaces.

Extend the test.

Despite the name, this is not a public macro.

Found missing Q_D_S in API-review, so picking this to 6.8 to aid with
fixing the 6.8 API.

Change-Id: I367ca0d5b005b64090de44f7b7541d8639f9a4e0
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 37b2b2ea4ef3cf494d23885de186a9519763e744)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-08 11:29:50 +00:00
Joerg Bornemann dc3b7d2203 configure: Fix --foo=bar arguments
Commit ae64c54f8c broke configure
arguments like
    --webengine-jumbo-build=20.

That commit transforms the argument to
    -webengine-jumbo-build=20
but single-hyphen arguments take values without an equal sign.

We need to store the unaltered argument (with the two hyphens) for
further handling instead of the single-hyphen variant.

Fixes: QTBUG-126872
Change-Id: I243eb072dfe5535a648bd78bb3aeb3b9e0e4ede0
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 76d5bceba7f1c553b02def689f2010db671ec60f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-08 09:02:35 +00:00
Nicolas Fella f57d5c492d FileChooser portal: Store directory as QUrl instead of QString
Otherwise we lose the scheme when reading it back as QUrl

Pick-to: 6.7 6.5
Change-Id: Ice6e083611c93641ef33f00fa48f1b32dc25f718
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 46ffca13fb0705c54ad05bc2c1a37f7d5fb5132d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-07 23:00:39 +00:00
Tor Arne Vestbø 79370e0b4c qmake: Don't `_debug`-suffix libraries in single config framework builds
On Apple platforms we no longer _debug suffix libraries (and plugins)
in single config framework builds. This is a follow-up for logic in
qmake that didn't get adjusted in d3be87ff1d558f05309b1f29f7e71f291498584f.

Change-Id: I6461fca9da5c3ac1382ffc46e63409ef0150ad46
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 20d89a2710488ca5f9f6674c4c6d167f3a193383)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-07 11:32:24 +00:00
Tor Arne Vestbø 705dbea2a9 Call QWidget::setVisible, not QWidgetPrivate, when showing children
As part of 5ba0982b28 we started calling
QWidgetPrivate::setVisible instead of QWidget::setVisible when showing
children, to avoid setting ExplicitShowHide.

Unfortunately some widget subclasses wrongly override setVisible to do
initialization, which resulted in these widgets not running their init
code. The documentation clearly specifies to use showEvent or Polish
for this use case, but to avoid a regression we temporarily set a flag
that prevents QWidget::setVisible from setting the ExplicitShowHide
attribute.

We can not rely on simply unsetting ExplicitShowHide after our call
to QWidget::setVisible, as the call might recurse into logic that
checks ExplicitShowHide and wrongly determines that the show is
explicit.

Fixes: QTBUG-126721
Fixes: QTBUG-126218
Pick-to: 6.7
Change-Id: Ibf88340b68cb4fcb20ce3d8ec5b76de0fd2d2551
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit fc4c6fb5f6bd6bd63b13f1f8b5b7a7289a5fd230)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-07 09:03:17 +00:00
Tor Arne Vestbø 7b53e87bd7 tst_QWindow: Remove data for positioning test
We no longer support fake fullscreen mode on macOS, and haven't for
a long time.

Pick-to: 6.7 6.5
Change-Id: Ic2eb6065239c4e5be5ab2011a6da50272c77460a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 4079ecfb9b3dc794212a81154e18145256741cfd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-07 09:03:07 +00:00
Tor Arne Vestbø f31e7385c1 macOS: Respect QWindow frame positioning on first show
When the QCocoaWindow is created it picks up the QWindow geometry,
and applies that to the NSWindow it creates. But since we haven't
created an NSWindow yet for the first step, our logic to adjust the
window geometry when the positionPolicy is WindowFrameInclusive is
a noop. As a result the NSWindow gets a client geometry corresponding
to what the user requested as the frame geometry.

To fix this we hook into [QNSWindow setContentView:], where we apply
QWindow properties to the NSWindow after creation.

The tst_QWindow::positioning test has been split out into a separate
framePositioning test.

Pick-to: 6.7 6.5
Change-Id: I85fe6ad10aee8346202de3d55d6b2cd89915c5df
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 31ec108dd08d6381a15e49b6fbec9337705c3b2a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-07 09:02:39 +00:00
Friedemann Kleint 8fc29f208b uic: Fix some clang-tidy warnings
- Repeated return types
- Make member functions static
- narrowing int conversions
- Use auto *
- Use list.isEmpty()
- Use modern includes
- Remove redundant access specifiers
- minor fixes

Change-Id: I14ddf1add667536739fbb5fabb357dbaa7ef35c3
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
(cherry picked from commit 6346c5b426935a767575ea758e99749bc6544f54)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-06 11:53:00 +00:00
Marc Mutz 03f2dfca7c QString: de-pessmize QString(QLatin1StringView)
Instead of default-construction followed by move-assignment, delegate
to the move ctor instead.

We can't expect the optimizer to do this transformation for us, since
fromLatin1() is out-of-line and compilers are not, yet, known for
optimizing atomics (ref-count) around out-of-line function calls.

Amends 6abdbb65e5.

Pick-to: 6.7 6.5
Change-Id: I75b747c4d5269ae125bf12cda57a1f718aa7a467
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit f7853680ef68ce2495662ffc7c7a933655436f22)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-06 11:52:57 +00:00
Marc Mutz 8a17835180 Long live QT_DEFINE_TAG(_STRUCT)!
We seem to be using more and more of these, and their definition is a
bit subtle (need to have an explicit default ctor to avoid {} being
an initializer for the type).

Port the existing tag structs over to the new macro and add a test,
even though we found two users of QT_DEFINE_TAG in QtBase alone, one
of which is actually widely used (Disambiguated_t). There are more in
other modules.

Change-Id: I046bb2b70a2c7e79be2315d91c43e5fd2f0968a0
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 74a87a329498422db0dea3e469fb84704accbb2b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-06 10:17:55 +00:00
Marc Mutz 377b4df13b [doc] Q(Persistent)ModelIndex: document behavior of data() on invalid Q(P)MIs
We return a default-constructed QVariant. What else could we possibly
return? Right: nothing else.

So document it and add a test.

Pick-to: 6.7 6.5 6.2 5.15
Change-Id: If9808703b8ddfd15ceb013996741af8cd4efea12
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit d1a5e602df5978cee6bd263db77745f8047e508e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-06 10:17:53 +00:00
Marc Mutz 072316ccc4 tst_QGlobal: add a check for Q_DECLARE_SHARED
Check that it marks types are Q_RELOCATABLE_TYPE and adds the ADL
swap().

Pick-to: 6.7 6.5
Change-Id: Ibde0f4ad594e4a6b3636357da2fd211507293b60
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 91a96ea8fb100fca08b37eb3ba644083b3316e6d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-06 10:17:51 +00:00
Marc Mutz 9ef785082a tst_QtConcurrentThreadEngine: fix UB (uninitialized boolean)
Says ubsan:

    tst_qtconcurrentthreadengine.cpp:96:17: runtime error: load of value 190, which is not a valid value for type 'bool'
    PASS   : tst_QtConcurrentThreadEngine::stresstest()

Initialize the variable using NSDMI.

Amends the start of the public history.

Reported-by: Even Oscar Andersen <even.oscar.andersen@qt.io>
Pick-to: 6.7 6.5 6.2 5.15
Task-number: QTBUG-115264
Change-Id: Ie55bc0a697a71074066294d64821c8a7a0d1f467
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Even Oscar Andersen <even.oscar.andersen@qt.io>
(cherry picked from commit 32442c2b52381f5e4164ae217453a8e8391d9349)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-06 10:17:50 +00:00
Marc Mutz 056c89e95d QRestAccessManager: don't leak slot objects when no QNAM was set
We try to pass QSlotObjectBase as raw pointer through the ABI
boundary, because we hope to have the template-wrapper tail-call the
out-of-line helper¹. But that means that the out-of-line helper needs
to ensure that it deletes the slot object on every possible exit from
the function. The old code didn't do that e.g. when the qnam check
failed, or, theoretically, if requestOperation() threw an exception.

The new code places the slot object under SlotObjUniquePtr guard as
soon as possible (but, due to amount of callers, not before
executeRequest()). Port createActiveRequest() to receive the slot
object already in a smart pointer. Tail-calling isn't required here,
because caller and callee are part of the same TU so the optimizer can
do whatever it wants. Unique_ptr passing shouldn't be that hard to
optimize.

¹ If we were to pass by SlotObjUniquePtr, tail-calling would be
  impossible due to the need to run the unique_ptr's dtor after he
  call to the helper.

Amends 9ba5c7ff6a, but
e560adef21 already had the
requestOperation() problem.

Pick-to: 6.7
Change-Id: I2ab5eadb35625393f274e3391d7b7c393ed8f08a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 11725d46344105325a1dec8628708ab88483ca12)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-06 10:17:48 +00:00
Ahmad Samir e37832cc37 QDirListing: const_iterator: mark the relational operators noexcept
Pointed out in code review.

Change-Id: I7754f510f4cca5e9fc695a26caaf124133602f32
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 9a8768c7159869aa216b7328c69f4b80f26f467e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-05 20:22:06 +00:00
Marc Mutz e6fc32a9c5 QArrayDataOps: fix appendUninitialized()
... to be strongly exception-safe and call placement new correctly.

The old code could call user-provided overloads of new, because it
didn't cast the pointer to void* before calling placement-new. It
would also "randomly" stop when an exception was thrown. It correctly
updated the size of the container only after successful construction
of the element, but that's just weak exception-safety. There's no
reason this operation shouldn't be strongly exception-safe.

So instead of a raw loop around raw placement-new, use the
corresponding raw memory STL algorithms. They handle exceptions and
call placement-new correctly, and the code is both simpler as a
consequence, and more efficient, as it updates this->size only once.

Found in API-review.

Amends 73bf1c1a9b.

Change-Id: I535f393a3c378e1eea104bd3a05a274b9ec17964
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit f699248c0f3ad44f09a422304870f40c1998a1a5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-05 20:22:05 +00:00
Tor Arne Vestbø ea1978c7f9 visionOS: Report size of root view as screen size
Even though we've decoupled QIOSScreen from managing UIWindows, we still
have one UIWindow per screen, so we can pull out the bounds of that root
view to determine Qt's screen geometry.

Change-Id: I05993ad6d629dd2158681dd17355b7e216bfbb49
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 16483487c4e37546cf296a72e137d49d28b55e05)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-05 20:22:02 +00:00
Mate Barany 63ad52d991 Add the nodiscard qualifier to the constructor of NetlinkSocket
This is a RAII class the result of the constructor call should never be
discarded.

As a drive-by made the constructor explicit.

Task-number: QTBUG-125026
Pick-to: 6.7 6.5
Change-Id: I651dda87b5191d50e111732d11bab8d5aa58e9af
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit b9511f582a37b6dfc58d7ce9c2526565cda655c5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-05 20:12:04 +00:00
Tor Arne Vestbø 02fd2c19fd macOS: Add missing product names for QSysInfo::prettyProductName()
And restructure the logic a bit for easier maintenance in the future.

Pick-to: 6.7 6.5
Change-Id: I6ff7396378bf02e177a4fb06978683474a79ad2f
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 61b70bd7de91a2aab8609e1f878043d2aceb6bfd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-05 15:55:32 +00:00
Mate Barany 16b0042dc6 Use non static data member initialization on errorcode in QSslContext
Address the "A constructor must initialize all data members of the
class" warning.

Found by an Axivion scan.

Task-number: QTBUG-125026
Pick-to: 6.7 6.5
Change-Id: I46a7dd358d107670846fa35c0b02d2591258438d
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 69bf95e2e05fb1ded0d74a7ebc5fa112e0854a5c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-05 15:55:32 +00:00
Alexey Edelev d3e686c562 Remove the QT_KNOWN_PLUGINS property definition
It doesn't seem the property was ever used even at the times it was
introduced.

Pick-to: 6.7 6.5
Change-Id: I55d8b558e548908306178827c4149728ce35d0e8
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 3bfd1c4ded8cb4a7d1d501401a82e812fc631fc2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-05 15:55:32 +00:00
Alexey Edelev 9bf92f9a5a Use add_compile_definitions instead of add_definitions
add_compile_definitions allows having the generator expressions as
the items in the definition list. add_definitions do not support pure
$<...> without the prescending macro name with the assignment.

Pick-to: 6.7 6.5
Change-Id: I1e79f1cf395b62b1e481eb0f3c74f93c61f06381
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 032fdcbcc00380e9a181f5adf2be767194bb35d3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-05 15:55:31 +00:00
Mate Barany 16f95639a1 Initialize the ssl variable in QHttpNetworkRequestPrivate
Address the "A constructor must initialize all data members of the
class" warning.

Found by an Axivion Scan.

Task-number: QTBUG-125026
Pick-to: 6.7 6.5
Change-Id: If78cde6a9c3771eb87e62729523b848f2efc2d83
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 6c755dcdd921431b26d22d499ebebb2a0b7de566)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-05 15:55:31 +00:00
Mate Barany 04787eef80 Apply the PIMPL idiom to QFormDataPartBuilder
Change QFormDataBuilderPrivate to store a vector of
QFormDataPartBuilderPrivates and pimplify QFormDataPartBuilder such that
it stores a pointer to the QFormDataBuilderPrivate and an index into the
vector. This makes it robust against QFDP::m_parts reallocations and we
can make QFDBP copyable which has the benefit that if the user wants to
"go back" to an earlier part, she can do so by storing the result of the
original part() call by value.

Found in API review.

Task-number: QTBUG-125985
Change-Id: I56e9018e539457e9494751bdb62509f84a680889
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit aca8235c753d673abe7442cdf8b628fe4e05c471)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-05 15:55:31 +00:00
Alexey Edelev ad748f4641 Manage the <module>_DEFINITIONS transformation accurately
Ensure that -D is not prepended to the special sequences like generator
expressions.

Pick-to: 6.7 6.5
Change-Id: I295c289e3d188780d697ff8c62d8c8fc2df6522c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit ff391b5c17309ca8b7bbbaef9028d8b31b847683)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-05 15:55:31 +00:00
Joerg Bornemann 11592ad3fc CMake: Fix unity build for gcc < 13
GCC 12 erroneously yields -Wsubobject-linkage in a unity build.
Un-unity qresource.cpp for GCC 12 and older.

Change-Id: Ie3aced2668ec8aae797d89ce28a3e5917a6e8f88
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit a06e54d2c88934f1511768d7254e12e6294e6336)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-05 15:55:31 +00:00
Ahmad Samir 4865577518 QTemporaryFile: de-duplicate docs wrt. file actually created on open
Change-Id: I64f87a8054d732d006599479bd6cca1be217700c
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 88b7a043cf91d8730331eb43523f1d06cae365b6)
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2024-07-05 15:55:31 +00:00
Alexey Edelev 267a559fa5 Add the missing installation and inclusion of qt base CMake properties
The file was missing from both installation and inclusion.

Pick-to: 6.7 6.5
Change-Id: I3e904071cc28f674750aca38050fbe89d75a585d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 084911a67bde29e49bcb001d593e96fca7836142)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-05 15:55:30 +00:00
Christian Ehrlicher cfb16f48f0 Tests/QSqlQuery: misc fixes for MsSQL ODBC Server
This fixes some tests for MsSQL Server.

Change-Id: I38b1ce5c8761706cafe63a4969770104e8b07bfe
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 73311fb506834d23ca52daaccaa0901327d3e6c4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-05 15:55:30 +00:00
Christian Ehrlicher 03e6f3859a SQL/ODBC: properly set SQL_ATTR_CURSOR_SCROLLABLE
Setting a query in forward-only or scrollable mode was done with
SQL_ATTR_CURSOR_TYPE in ODBCv2. Nearly all ODBCv3 drivers also honor
this value but some don't and need the ODBC v3 conformant
SQL_ATTR_CURSOR_SCROLLABLE attribute instead. Fix it by setting both
attributes.

Fixes: QTBUG-126118
Pick-to: 6.7 6.5
Change-Id: I6d974b7b3e94113b0a87f1cc7f8cff0deb53642b
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 730de6fbb09f082f32dfa355502551a0d6b8ae34)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-05 15:55:30 +00:00
Christian Ehrlicher f7f5795ec7 SQL/ODBC: ignore empty connect options
Don'tprint a warning on empty connect options/when no connect option is
set. This ammends 5a03e5c51b.

Change-Id: I83ba8a34a3c08dc596c81ccb494f50af80f9b57c
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 385c9397712b771e0f2c3f0a6322f0f624f09a8a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-05 15:55:30 +00:00
Mate Barany cd732aaf36 Initialize the isCompressed member variable in QhttpThreadDelegate
Address the "A constructor must initialize all data members of the
class" warning.

Also, move the isCompressed bool variable next to another bool variable
to save some space.

Found by an Axivion scan.

Task-number: QTBUG-125026
Pick-to: 6.7 6.5
Change-Id: I6f0e789a8188ff141ec7e4e4eb8a1823e8eea0d2
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 13a04975fdc32ead6fe8dc78522e34de065c8908)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-05 15:55:30 +00:00