Commit Graph

67828 Commits (eb208a6bb555a2e2de0e5f89db9beb1ce726cdcb)

Author SHA1 Message Date
Mårten Nordheim eb208a6bb5 compressEvents: simplify TimerEvent compression
While better in some benchmarks, it turns out to be less efficient to
first find an event to the receiver, and then checking the event-ptr
and -type in other benchmarks, compared to just iterating the list and
checking these values.

Partially reverts 3e6b42ae9d

Fixes: QTBUG-126394
Pick-to: 6.7
Change-Id: I748bda3d31350aea6e87db9bd57359ab17cf5d67
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: YAMAMOTO Atsushi - Signal Slot <atsushi.yamamoto@signal-slot.co.jp>
(cherry picked from commit b039d2251a14281947a43e226bae6c6fbae7312a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-19 08:15:39 +00:00
Morten Sørvig e7cf150caa wasm: move MODULARIZE to EXPORT_NAME finalizer
This avoids a "must set EXPORT_NAME when using MODULARIZE
with pthreads" error when linking libQtGui.so.

Both settings only apply for the final executable since
they affect how the wasm module is loaded from JS;
setting them together here makes sense.

Change-Id: Ibebeeee38203486675c43b416cb674e8ece9c147
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
(cherry picked from commit 9768d8e1ba21adace1f590420791e6924a9fad8c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-19 08:15:39 +00:00
Christian Ehrlicher 7a67ed7705 QIcon::addFile() delay-load icons when a proper size is given
Delay-load the icon within QPixmapEngine::addFile() when a proper size
is given - this speeds up QIcon creation and also allows to let
QIcon::actualSize() return the correct size of an QIcon instead the
given one. This is especially useful e.g. when a 32x32 icon has a
smaller width or height and it should be centered during painting.
Also add an optimization for multi-image formats to check for the
correct size without decoding the image.

Task-number: QTBUG-59621
Change-Id: I7ed930ae3f65a8b3a272f70bcc2958980f9f02f2
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 94a3a492f52398eb1c08ea910fbd007b31228525)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-19 05:30:05 +00:00
Ahmad Samir 3640aa18d9 QFSFileEngine: remove redundant entryList() override
It just called QAbstractFileEngine::entryList().

Change-Id: Iae154c8aba8c48488f525cc3543bb24467e85088
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit b9c486ed8cd6120a1c60e39325cecd497f26265d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-19 05:30:05 +00:00
Ahmad Samir 8b84c45762 QFileSystemIterator: add constructor that takes QFileSystemEntry only
This is in preparation to adding constructors that take
QDirListing::IteratorFlags, I would have had to add an init() private
method to deduplicate the code, so instead add a constructor that can be
delegated to.

Task-number: QTBUG-125859
Change-Id: Idbc76fcba50f9d0016e4ddba03b2f532a33231bd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit c203c41109e41d03de8145a541ff5c8fbe976492)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-19 05:30:04 +00:00
Volker Hilsheimer 38f08eec14 QTableView: optimize selection when spans are present
If a span is selected, we used to assume that rows and columns might be
moved, and made a selection with a range for each cell in the span. This
resulted in very large selection models.

We already had optimized the case that we didn't have any moved rows or
columns, skipping the mapping for the respective (or, usually, both)
directions and just making a single range. Apply that same optimization
for the case where a span exists and intersects with the selection area.

Avoid code duplication by only updating the top/left/bottom/right values
depending on the configuration of the table, and then create the
selection based on those.

Adapt the test case; we now get a single range, even when a span is
present, and the range includes all cells included in the span. Add a
debug streaming operator in the test case, as there is none implemented
in QTableWidgetSelectionRange, to ease debugging. That operator can
become a hidden friend of QTableWidgetSelectionRange in a follow-up
commit.

Pick-to: 6.7 6.5
Fixes: QTBUG-119076
Change-Id: If699463944ca2abaed8f93a2cd3ea30f33b79145
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 57d209c4fdea4766f24479a1f20c2975d34a1a0f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-19 02:40:18 +00:00
Volker Hilsheimer 208ad426b4 Fix indentation in QTableView's selection handling code
Makes the follow up patch clean to review.

Pick-to: 6.7 6.5
Task-number: QTBUG-119076
Change-Id: I38c2b02876af93ce668ade7bce97b32a9ec2cef0
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 71d0ea7d042d61e8d42e9cf2700c439d4337345b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-19 02:40:13 +00:00
Thiago Macieira e3b0d2f93c QLibrary/Unix: fix mojibake of dlerror()
Amends a6a5681470 where I replaced a
function that correctly did QString::fromLocal8Bit() with
QLatin1StringView.

Pick-to: 6.7
Change-Id: Ic0adfa808d28487a8303fffd17d9ec0817eda3e8
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit 0a1a8355f313ac951e3e615f47aca40f421fc4bc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-19 00:57:44 +00:00
Volker Hilsheimer 63aece5ae7 Clean up QAccessible based on header review comments
Fix the change of the InvalidEvent value to be the same as in Qt 6.7,
where AcceleratorChanged was the last valid event.
Add trailing comma and Q_ENUM. Remove superfluous inline, make
QAccessibleAnnouncementEvent constructor explicit, declare destructor as
override.

Amends 010952a55e and
9ec1de2528 based on header review.

Change-Id: I96f00871acd2bb340ac7fc762a7fca8ac2f61dc9
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
(cherry picked from commit 902dfd08a03b86cb65bfb5da55faad671f7dad20)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-18 21:12:25 +00:00
Volker Hilsheimer 5cb79f8850 QAccessible: rename AnnouncementPriority to AnnouncementPoliteness
Better name given the value names, as discussed during header review.
Keep AnnouncementPriority as an alias until dependencies are updated.

Change-Id: I7b60c429fb60fc30378a9560da12abb87499225f
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
(cherry picked from commit bb305e63ff856a8c6f9649a27a5eabfb31df8aa7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-18 21:12:18 +00:00
Volker Hilsheimer b2f8a7b6a8 JNI: make it safe to iterate over or convert an invalid QJniArray
This is expected behavior for default-constructed containers.

Also add the missing isEmpty() member function to QJniArrayBase.

Change-Id: I23111f6906ef5476567272cb23746fec962afa35
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit e5516191b25d70ee9d6e87246d932fa559ef0b59)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-18 21:12:12 +00:00
Juha Vuolle 78784065a8 Accept QASV for multipart 'name' field
And adjust the encoding of 'name' parameter to  always
use UTF-8 / ASCII. This aligns with how other frameworks
behave. Also amended docs to recommend ASCII for 'name'.

Found in API review.

Change-Id: I54d1148bf95dece54b75c76914c49985da05e0b2
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 6b23a3c5e4316c5f889ea5e9bbfd785b78716268)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-18 17:08:34 +00:00
Juha Vuolle b5dde79bc4 Adjust multipart 'filename' parameter encoding
The RFCs around these encodings are loose and allow
several ways for dealing with non-ASCII characters.
The encoding introduced in this commit should be
interoperable and aligns with other frameworks
(checked Curl, JS FormData, Postman, and Python
requests).

This consists of several adjustments:

1. Enclose the filename attribute in double quotes
2. If filename contains only ASCII characters, use them as-is
3. If filename contains characters beyond ASCII:
3.1. Encode them directly as raw UTF-8 to filename=
3.2. Set an additional filename*= parameter with
     percent encoded UTF-8. This is a legacy encoding
     for compatibility.

Task-number: QTBUG-125985
Change-Id: I5a6ad5388e4bb69e142caa7f6de7127526f441ad
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 8c8a0c06d4f77ba8a707ec0a101b423543bf30f0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-18 17:08:31 +00:00
Mate Barany 0a57b0e542 Refactor test cases in tst_qformdatabuilder
Hide the construction details of QFormDataPartBuilder, change
the verification to be QString based instead of QByteArray based,
and use raw string literals (where useful) for readability.

Task-number: QTBUG-114647
Change-Id: I16fb6c943cf6fd7385e78bbffe3b2780ab0a6ac8
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit cb8abb718da4e18232de525ef1bb611f3a5dd929)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-18 17:08:21 +00:00
Tor Arne Vestbø b14c1c1824 tst_QPlugin: Be specific when looking for plugins
The pattern "*debug*" also matches libinvalidplugin_debug.dylib
on macOS. As the CMake target for the plugins include the 'plugin'
part, let's look for that as well when finding matching plugins.

Change-Id: Icf3177d42c104829890a8c404a6b9782bf190bb4
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 087ace615a6399f6bf7a020bce07365689bd4784)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-18 09:28:46 +00:00
Marc Mutz 34ac282a1e tst_QProcess: silence -Wunused-result
We can't do anything about a failed write at these code locations. In
particular, we can't QVERIFY() their success, so suppress the warning
with the idiomatic cast to void.

Amends 13a1995e9d,
bd32c7d705 and
c5221f6be0.

Pick-to: 6.7
Change-Id: Ia7ef57f01eeb8608079a12724c0b4f03a59081c9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 97f31a68795e1d492f98a9942cce5228cbe64cf8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-18 08:09:23 +00:00
Marc Mutz beabc63598 tst_QGlobal: fix -Wmaybe-uninitialized
GCC 14 doesn't understand that neither q_check_ptr() nor
qCompare<int*> dereference the pointer.

Since the missing initialization isn't part of the test (except,
maybe, to provoke this warning if the implementation indeed changed to
dereference the pointer), fix by initializing the int, like we do for
the string a few lines below.

Amends the start of the public history.

Pick-to: 6.7 6.5 6.2 5.15
Change-Id: I6033e026f041b03821b776daa8e65586b8054136
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 8e914e07fbac8b40e51d0e6da764fa13a6af8181)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-18 08:09:17 +00:00
Marc Mutz 2ec36e7ebe tst_QEventDispatcher: port to QTEST_THROW_ON_FAIL
Dogfooding the new QtTest 6.8 feature.

Change-Id: I4ded1fabac25fb283eb26b5eef341892b4459e96
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 7a93e815d2489b97510a1ab7aaf6a140e2e2c587)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-18 08:09:13 +00:00
Marc Mutz 161996d1da tst_QDir: fix -Wunused-result
We've been ignoring the result of symlink(2) and GCC 14 complained.

Fix by QCOMPARE()ing to 0, ie. verifying sucesss.

Amends 23d08ce2ed.

Pick-to: 6.7 6.5 6.2 5.15
Change-Id: If58267e3883c77cd62aa72a42410c837b32d9c0b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit c880a3867a85c0efdc6773ad6b446a318198585a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-18 08:09:11 +00:00
Marc Mutz f3007e8624 tst_moc: fix 'inline function used but never defined' GCC warning
GCC doesn't have a specific warning flag for this warning, so we can't
add a GCC case to the existing Clang suppression in the header.

Hovever, the issue can be fixed by including the moc file into
tst_moc.cpp, so that the compiler sees the definition of the inline
signal provided by the said moc file. This means we can also drop the
Clang warning suppressions.

To prevent duplicate definition linker errors, remove the header file
from JSON_FILES, and the forced separate compilation that entails.

I'm pretty sure that some cmake magic could preserve the JSON test
coverage, but a) the file doesn't emit anything special in its json
(certainly nothing about the inline'ness of the signals) and b) the
presence of mySlot() and mySignal() as slot and signal on these
classes is already tested by singleFunctionKeywordSignalAndSlot().

Amends the start of the public history, but not picking back far,
because a) a prequel commit to this commit wasn't picked further,
either, and b) this has been such a long-standing issue that it's
clear no-one cares and so it's just not worth the risk, however small
that may be, to backport.

On GCC, the only remaining warnings thrown by tst_moc are now
moc-generated ones.

Task-number: QTBUG-119042
Change-Id: Icde1eee6c97bd48d72e15461b6ec80c50c044eaa
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit b1b3af02c0fb8084d2eb984b1f7ae68f1861f9a4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-18 08:09:09 +00:00
Mate Barany db1c747c35 Add a static get to QHttpMultiPartPrivate
Needed for the tests of the move semantics of QFormDataBuilder.

Change-Id: If4ea9a0d50addbbeaed1262517b58e7da82c0883
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 2fb79421ee22649eab4ebf6a76d2835022ce43c8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-18 04:53:47 +00:00
Juha Vuolle 34f6210bb6 Relax QHttpHeaders value field checks to allow UTF-8
UTF-8 doesn't per se contain illegal characters from
an HTTP header RFC point of view. UTF-8 is the dominant
character encoding outside of ASCII, and is used
directly at least with HTTP multipart headers.

[ChangeLog][QtNetwork][QHttpHeaders] Allows UTF-8 in header
values now.

Task-number: QTBUG-125985
Pick-to: 6.7
Change-Id: I2d8d8f00855c96c1d2ba190f2e27e2d48fcd4975
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit f39b39b8c72b5c3428396d5e74cf15cafd5bbc42)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-18 04:53:43 +00:00
Ahmad Samir 41009cade5 QTemporaryDir: clarify path/filePath() API docs
QTemporaryDir(const QString &templatePath) API docs say the path is
relative or absolute depending on whether `templatePath` is relative or
absolute.

Pick-to: 6.7
Change-Id: If77f9b378158235a68344689ded6756ac3f083cc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 9dc189e632bd5b6921361af786cf54434d2adf45)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-18 02:23:40 +00:00
Tor Arne Vestbø 7580f42606 iOS: Don't send focus out event when resigning responder without qGuiApp
During shutdown of the app the QUIView may hang around longer than the
QIOSWindow or QGuiApplication, at which point we can't deliver the
resigned responder status to QGuiApp as a focus out event.

Fixes: QTBUG-123018
Change-Id: If377f037c3fb4c2026a2d8d757011f12171e8dd4
Reviewed-by: Doris Verria <doris.verria@qt.io>
(cherry picked from commit a40d546496462e5366c24115707e43a0c8598dd3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-18 01:34:51 +00:00
Tor Arne Vestbø f399eff35e tst_qt_cmake_create: Skip test if CMake is not found
Change-Id: Ifd84135c756d5140bea1952e069f82854afe1ecd
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 4cb492e14a31b6497b81bfbbcbec09f94595698a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-18 01:34:51 +00:00
Michał Łoś 4afbfa8626 Exclude VxWorks from test for leaking objects
tst_QCoreApplication test fails due to leaking object. Investigation
about the reason of this issues was started, but no conclusion was made
and reason for object leak is still unknown. To prevent this test from
crashing exclude this check for VxWorks as well.

Pick-to: 6.7
Task-number: QTBUG-115777
Change-Id: I2c543a3b8320e2d96b2e7cd7e14c1980e500ce0d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 92e420aefb373c2dc1dd39a05ff43037edb2a145)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-18 01:34:51 +00:00
Marc Mutz f7f19961c4 tst_QCompareHelpers: port to QTEST_THROW_ON_FAIL
Dogfooding the new QtTest 6.8 feature.

Removes a lot of manual currentTestFailed() calls.

Change-Id: Id8bb0bad9b90b0a51315e9a9677d7009ebc090e4
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 561a1cae9df85a7a03f73ce77948ef235fff7c5d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-17 23:17:50 +00:00
Marc Mutz 6f3d68e590 tst_QCborStreamReader: port to QTEST_THROW_ON_FAIL
Dogfooding the new QtTest 6.8 feature.

Change-Id: I381af59b005433453fe8dbd982fe44ab93b9417d
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit f8cef74aeee5eb6852a32a69a36fea8dc945f2b1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-17 23:17:50 +00:00
Marc Mutz 2b8cf058f1 Fix misspelled QTEST_THROW_ON_FAILURE
Amends e769cf026e.

Reported-by: Ahmad Samir <a.samirh78@gmail.com>
Task-number: QTBUG-66320
Change-Id: Ib731acf6b7e56c848aa79772488186efdd856c71
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 45e9f5f2e5f0701ad4dffbe532206b791d698953)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-17 23:17:50 +00:00
Marc Mutz 9d89e28f1c tst_moc: fix -Wvolatile
Suppress the warning. Found that moc doesn't like QT_WARNING macros in
Q_SIGNALS section and filed QTBUG-126395 to track the issue.

Amends the start of the public history, but not picking back far,
since older GCC could reject the suppression, and it's such a
long-standing issue that fixing it in LTS branches is not worth the
risk of breaking compilation.

Task-number: QTBUG-119042
Task-number: QTBUG-126395
Change-Id: I15ba9ed3b83cce0f4c2a1536317e5167d56f3a57
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 4111059b2ee3818ab68033198fb1dd057e6d09eb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-17 23:17:49 +00:00
Marc Mutz d9f7efba82 QUuid: rewrite compareThreeWay() in idiomatic form
A lexicographical ordering chain with 3way-compare should call op<=>
(or it's stand-in, compareThreeWay()) exactly once per element pair in
the source ranges.

First checking for != and then with <=> means we do the check
twice.

In this case, when comparing built-in types, the optimizer will
probably fold everything for us, but code like this, at this time, has
a high chance of being the source of a CnP operation, and the target
may compare QStrings this way, so use the idiomatic form to let
copy-pasters fall into the pit of success.

Amends ef964c254c.

Change-Id: Ib8344087f23435fc58740165afecd499722d1f00
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 1e6b7e08cf5f5a36fa3007e315a9282054c1a140)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-17 23:17:49 +00:00
Marc Mutz 8bc09e9db3 tst_QNetworkReply: port _WITH_TIMEOUT calls to chrono literals
Dogfooding the new 6.8 feature.

Change-Id: Ic4c371896fcab0c94cef76341a6ef97763127968
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 34089abeeac14a6437851530aa25f8b31a22acf1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-17 23:17:49 +00:00
Volker Hilsheimer d2637d2323 QFileSystemModel: only use theme icons if a theme is set
The old code checked themes first, and only went through the platform's
file-based icon resolving code if the theme didn't provide an icon. With
the added support for theme icons on macOS and Windows, this broke
standard file icons on macOS and Windows: the icon theme provides the
font-based icons, but they are significantly different from what users
expect a folder, drive, or generic file icon to look like in a file
explorer-like UI.

To fix this, we cannot simply turn the priorities around, as we get a
standard, default file icon for any file that doesn't have a specific
icon configured. The behavior needs to be different on each platform:
on Linux desktop we respect the icon theme, on other platforms we prefer
the file-type based icon.

Add a theme hint that tells the icon provider which one to prefer.
Implemented in on Linux desktop to return true, otherwise returns false.
Adapt the logic in QAbstractFileIconProvider accordingly.

Pick-to: 6.7
Fixes: QTBUG-124829
Change-Id: I9ff3f543c000aec8238bdf36b18be5c7a2349098
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit e10308769592222b97153956feeb9531863bef35)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-17 19:48:04 +00:00
Assam Boudjelthia 92228ed7f2 Android: make internal Java code for QtAndroid private
This Java code is mainly an internal implementation detail for
the Qt for Android plugin, and isn't meant to be public
in the first place.

Task-number: QTBUG-126371
Change-Id: I1155ba7912e2b89c681b57d259170087e840817f
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
(cherry picked from commit 9eed1704a1bf7cdf03825e99260e47c392213165)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-17 19:35:16 +00:00
Assam Boudjelthia ef88e293e8 Android: make internal Java code for QtAndroidNetwork private
This Java code is mainly an internal implementation detail for
the Qt for Android plugin, and isn't meant to be public
in the first place.

Task-number: QTBUG-126371
Change-Id: I5149a583eb2695ff97203d81a059adcc5d1a69a5
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
(cherry picked from commit 900911abee41fb424312dc6675baa47b0792635a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-17 19:35:11 +00:00
Assam Boudjelthia 5888465f16 Android: make internal Java code for QtAndroidExtras private
This Java code is mainly an internal implementation detail for
the Qt for Android plugin, and isn't meant to be public
in the first place.

Task-number: QTBUG-126371
Change-Id: Ic111439a929fa5ad05aca98dd7fa024791a00883
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
(cherry picked from commit eb4e417ef64b832cddfb60fb9e20b0a04ec1ad2a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-17 19:35:05 +00:00
Assam Boudjelthia 96c7ad3590 Android: make internal Java code for QtAndroidNetworkInformation private
This Java code is mainly an internal implementation detail for
the Qt for Android plugin, and isn't meant to be public
in the first place.

Task-number: QTBUG-126371
Change-Id: If2d8386a985757b5d107ece1625bc694d7ae1272
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
(cherry picked from commit a833d431c70054260a556f2f4429dd28c6483201)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-17 19:34:58 +00:00
Thiago Macieira cb517bd2e5 QBitArray: fix read of uninitialized terminating null
Commit 54c373faa4 updated the bitwise
operations to be more efficient, bypassing QByteArray and going straight
to QByteArrayData (a.k.a. QArrayDataPointer<char>). This meant we also
bypassed the initialization of the null terminator.

This wasn't caught in our unit testing and with some runtimes because
the memory we allocated happened to be zero or contain the information
we wanted. But with Visual Studio, the debug-mode runtime initializes
all newly allocated memory with pattern 0xcd, which showed up as a
problem.

[ChangeLog][QtCore][QBitArray] Fixed a regression introduced in 6.7.0
that could cause QBitArray to report wrong bit counts after a bitwise
operation.

Pick-to: 6.7
Fixes: QTBUG-126343
Change-Id: Icdc467f26dea4b05ad90fffd17d939c3b416adca
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 8ac57ff6bc778519bb1edc4036ce79ab8f688e27)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-17 19:06:27 +00:00
Alexandru Croitor 699d50bd8f CMake: Annotate some targets with SBOM information
Task-number: QTBUG-122899
Change-Id: I2eb70ca4d52e30c8e15ca7b350df6965d93732f8
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 79f9b490e7f6e2746de36542cc4c7442dabe8315)
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-06-17 15:54:26 +02:00
Łukasz Matysiak d594fbf12a Make createDirectoryWithParents return true for existing dirs on read only fs
When the filesystem is mounted in a read only mode, Linux returns true
on an attempt to create a dir that already exists on that fs.
However not every platform behaves that way.

VxWorks is not a fully unix-like system.
It is possible to enable a component that provides a virtual root file
system (VRFS) so that devices and paths can be managed using "/" as a root.
The root itself is not an actual path that can be used like on other systems.
It is not possible to store files directly in "/".

On Linux, mkdir on "/" returns EEXIST.
On VxWorks, it returns EROFS (read only file system).

That leads to a failing test (tst_QDir::makedirReturnCode).
It also leads to a broken contract, since the doc for QDir::mkpath states that:
`If the path already exists when this function is called, it will return
true.`
The doc for createDirectoryWithParents has no such comment and it is
used by other functions that also do not promise such things, but the
implementation behaves that way anyway: when errno == EEXIST -> return
true if the target path is an existing directory.

Since the existing unix implementation already returns true for existing dirs
(without checking if it was called in the context of `mkpath` or any other
function), fix the problem by checking if errno == EROFS after a call
to mkdir and then checking if the target path already exists and is a directory

Pick-to: 6.7
Task-number: QTBUG-115777
Change-Id: I849bca56618bf675933cccc5a9d5313e0014628b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Karim Pinter <karim.pinter@qt.io>
Reviewed-by: Jarno Lämsä <jarno.lamsa@qt.io>
(cherry picked from commit 8915ae3a75c4a356d94962dd9b31e1458f2a506f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-16 21:57:12 +00:00
Ville Voutilainen 788e9d7faa Fix building qcompare code in MSVC in C++20 mode
MSVC quite incorrectly errors out saying that weak_ordering's
conversion to partial_ordering cannot access the private constructor
that takes the internal order.

The problem goes away when the types are forward-declared before they
are declared as friends.

Fixes: QTBUG-126386
Change-Id: I50ad6d08ee648eb15109dde4a9ec9c753ee18e68
Pick-to: 6.7
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit d2b4aec865bd834747cd824658e567b83bf081e6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-16 21:57:10 +00:00
Tor Arne Vestbø eb397a2ce9 Skip some build system tests if Xcode is not installed
We rely on a valid Xcode (command line tools) installation to run qmake.

Change-Id: I8d6746942507680dd585a41f32cbe4e4d34822e4
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 06b33134b38ffabdf0c0d80c2c3b9581294ff715)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-16 20:48:34 +00:00
Volker Hilsheimer 92071fc0b1 Clean up QColorSpace API based on header review comments
Pass QPointF by value (also in the private API), and mark new
constructors explicit.

Amends 05b8467304

Change-Id: I461d50d9220404746ee6d3544acdeb0f0956ee2f
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 6c2d6cb53a1dc8fb98f7f6447e08762e7e839a23)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-16 17:30:37 +00:00
Eirik Aavitsland ff5b557dfc Fix 6.8 ABI break: missing symbol QPageLayout::setBottomMargin()
This was forgotten when the other set*Margin() methods were moved to
removed_api in 6c72080f26.

Fixes: QTBUG-126374
Change-Id: I4be96c23540fac812ddb456699218bc437c4a3f7
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit ad922bbac1d65ff044c63160c73324fa27f44793)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-15 04:29:32 +00:00
Vladimir Belyavsky 0af3e3a45e rhi: metal: remove checking for legacy OS versions
Remove redundant OS version checking (via @available) and stop
supporting legacy macOS (< 11) an iOS (< 14) versions that were
already unsupported in previous 6.5 LTS.

Change-Id: I505217e0f4f4c19bbdb27b535e658d158a5bafea
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 9c199a39d228658a20c1d6650ab6a7aedfaeccf6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-14 16:57:40 +00:00
Łukasz Matysiak 45d87f7bab Skip tst_QNetworkReply::contentEncodingBigPayload on 32b arch
The test requires allocating 4GB of memory to handle a big file.
On a 32b architecture, this leads to a std::bad_alloc exception and
abort in result (tested on VxWorks 24.03 on an imx6 board).
Because of that, the test can't work properly and it can't be
blacklisted.

Work around the issue by skipping the test.

Pick-to: 6.7
Task-number: QTBUG-115777
Change-Id: I46002a27aed09706cd61d2e2c8d4bd1e12a16c36
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 4d2744e4345193cdf7ec2bbf06b0a0d169827d8b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-14 14:59:03 +00:00
Michał Łoś 3c494d4e40 Drop checks for VxWorks 6.6 in QThread
1. VxWorks 6.* and older are not supported in Qt6 due to C++17
requirement (among multiple other issues).
2. `_WRS_VXWORKS_MAJOR` and `_WRS_VXWORKS_MINOR` are defined in header
`version.h` on VxWorks 7, which is not included anywhere, causing
`QThread::idealThreadCount()` to always return 1. As a consequence,
instance of `QThreadPool` returned by `QThreadPool::globalInstance()`
have always only 1 thread. This causes failure of
`tst_QEventDispatcher::postEventFromThread` test case.

To fix that, remove VxWorks version checking from qthread_unix.cpp.

Pick-to: 6.7
Task-number: QTBUG-115777
Change-Id: I08ffc4acdb74d13dd822402407a71f5916603440
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 8fec93e9a7bf3f8cb80aafb1e2329d998552fbcc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-14 14:59:02 +00:00
Jarek Kobus 1603373bc0 AssetDownloader: Add manual test
Task-number: QTBUG-122550
Fixes: QTBUG-126020
Change-Id: Ide7c68ca46d7edd39d966f53e892bcd8b3fa88f4
Reviewed-by: Ali Kianian <ali.kianian@qt.io>
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit d0a58028daf0a33e27c1a5cfe5b8422bc6b0bc98)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-14 13:44:17 +00:00
Jarek Kobus 4285216860 AssetDownloader: Implement the downloader using TaskTree
Task-number: QTBUG-122550
Change-Id: I990d0db1c5f0246aab0d796f438b26976650dc2c
Reviewed-by: Ali Kianian <ali.kianian@qt.io>
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit 6dff842b2a55cc941e7868a12c725e0a8c6afdb1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-14 13:44:16 +00:00
Jarek Kobus 355f68bc4a AssetDownloader: Import TaskTree solution
An import from Creator 14.0 branch.

Task-number: QTBUG-122550
Fixes: QTBUG-126022
Change-Id: I7a1ce1c05cb388104c2e79a0a270adf3e4c57cd2
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit 78de81e286d89a5396b08b67ca98ccedda8a836f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-14 13:44:16 +00:00