Commit Graph

67394 Commits (112e554cbf787fa6b093354d75889f520307c33e)

Author SHA1 Message Date
Assam Boudjelthia 112e554cbf Android: update AGP to version 8.2.2
This works better with the current Gradle 8.3 and supports
Android api 34 builds.

Task-number: QTBUG-106907
Change-Id: I816a1aa163a9aee0a5859872129cff62f81a2dea
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
2024-05-19 00:34:42 +03:00
Toni Saario 8d5e7d50d8 Coin: sign only x86 packages
Coin is currently missing support for arm64 signing. Drop the signing
on arm64 for time being to allow packaging flag to be added to export
arm64 builds.

Change-Id: If684fa4d787fccb99ac9a0ebad56ec723faba354
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
2024-05-17 14:36:27 +03:00
Michał Łoś e82b79d382 Don't rely on TLS to call QThread::finish on VxW
On VxWorks, its pthread implementation fails on call to
`pthead_setspecific` which is made by first `QObject` constructor during
`QThreadPrivate::finish()`. This causes call to `QThreadData::current`,
since `QObject` doesn't have parent, and since the pthread is already
removed, it tries to set `QThreadData` for current pthread key, which
crashes.

The aforementioned `QObject`'s instances are created in multiple places
during `QThreadPrivate::finish` method, first one in during call to
`qCDebug()`.

The sequence currently leading to call to `QThreadData::current` starts
with `qCDebug` call in `QThreadPrivate::finish`, which:
 - creates `QDebug` object, which
 - creates `Stream`, which
 - creates `QTextStream`, which
 - creates `QTextStreamPrivate`, which
 - creates `QDeviceClosedNotifier`, which
 - is a `QObject`, which
 - calls `QThreadData::current()` because its `parent` is nullptr.

Even ignoring debug print, next line calls
`QCoreApplication::sendPostedEvents` which calls `QThreadData::current`
directly.

Pick-to: 6.7
Task-number: QTBUG-115777
Change-Id: I4d405eebdff0c63c6cd66fba4eaa95c3818ceaea
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-05-17 09:23:51 +02:00
André Klitzing 0beaa63d4a Bump androix dependency to 1.13.1
This avoids linter warning like in
5dc9692e48ea15ab3da4283997547a2849f1944e:
       Obsolete Gradle Dependency

Brings back the commit 3bae65e7d6
that was reverted earlier.

Pick-to: 6.7
Task-number: QTBUG-106907
Change-Id: Ia1e3362853b5d43299acf21d5f3ac099a478b396
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
2024-05-17 04:35:52 +03:00
Christian Ehrlicher f6fdd91941 Tests/QWidget: fix hoverPosition test for openSUSE
On some xcb platforms the xcb_configure_notify_event_t is sent after the
window is fully exposed which leads to a wrong position for
QWidget::mapToGlobal(). In this case this results in a wrong position
for QCursor::setPos() which lets the test fail.
Fix it by waiting for a move event with a position != 0,0 before calling
mapToParent/Global().

Pick-to: 6.7 6.5 6.2
Fixes: QTBUG-123998
Change-Id: Ic5e989c4497ccf3ed720a521f9d7e73632b4b1fc
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-05-16 22:18:53 +02:00
Christian Ehrlicher a8011cbe2a QDialogButtonBox: use QFlatMap instead QHash
Use QFlatMap for standardButtonMap and hiddenButtons - these two
container normally don't hold more than 5 elements so QFlatMap suits
much better.

Change-Id: I70f1a0471ec3cb118120805973bab28568d48317
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-05-16 20:18:34 +00:00
Michał Łoś 062c538781 Exclude VxWorks from qstorageinfo tests
VxWorks doesn't have implementation of QStorageInfo and uses stub.
Remove tests of it from building and running, since these can't work.

Pick-to: 6.7
Task-number: QTBUG-115777
Change-Id: Idd63d20c2dda1ae09838a7d371ae5b713180cb96
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-05-16 21:36:03 +02:00
Tor Arne Vestbø 35cdd8abf6 Widgets: Don't assume layout handles safe area margins if widget opts out
As an optimization when calculating the safe area margins for child
widgets we look at the parent hierarchy, and if we find a widget that
is in a layout, and that layout respects the widget's contents rect,
we assume the safe area margins are accounted for already.

But this relies on the widget the layout is operating on to not opt out
of the safe area margins affecting the contents rect. If it does, the
layout can't help us, and we need to fall back to computing the child
widget's safe area margins.

Task-number: QTBUG-125345
Change-Id: I2e2f7d292d2b2c3ecd2e2e95316c4d72b92db5d6
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-05-16 20:17:06 +02:00
Mårten Nordheim 68ceb847d6 QNetworkReply: Add a separate test for self-contained tests
Nothing there should rely on the network testing server.
Part of this will also be testing the local/unix domain socket support.

Task-number: QTBUG-102855
Change-Id: Icf3b0bd9370ec62e003862caf4cd3ed38d875bac
Reviewed-by: Mate Barany <mate.barany@qt.io>
2024-05-16 19:40:03 +02:00
Allan Sandfeld Jensen abed1a41e1 Merge two color conversion methods
We can do both conversions with the logic from
applyElementListTransform with a few simple changes.

Change-Id: I560a2954b3a4c1acfee57813fa0caa418b1fc5d6
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2024-05-16 19:40:03 +02:00
Ilya Fedin 7dbf070dd1 Make the high dpi downscaling work with Wayland
Wayland provides fractional device pixel ratio without using QHighDpiScaling
so it should work when QHighDpiScaling::isActive returns false.

There are also invalidation adjustments given that high dpi backing
store's device pixel ratio could lead to different native sizes
depending on platform's device pixel ratio.

Fixes: QTBUG-115462
Change-Id: Ib799272cd0108af6a5886496874349ff04352333
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2024-05-16 21:40:03 +04:00
Morten Sørvig b8bcf6b883 wasm: handle unable to determine emcc versiopn
It can happen that we are not able to determine which
Emscripten version Qt is built with, for example if
the detection code runs at a time when qconfig.h has
not been created yet.

In that case skip printing a warning since we are not
able to offer a sensible recommendation.

This fixes Qt configure when building for shared libraries,
where we would previously print this warning several
times:

  Qt Wasm built with Emscripten version:
  You are using Emscripten version: 3.1.50
  The recommended version of Emscripten for this Qt is: 3.1.50
  This may not work correctly

Change-Id: Ie15300e89c0e4b6f22650e662dd30fd32828e60c
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2024-05-16 18:49:25 +02:00
Lena Biliaieva a246286c46 Http2: Export configurationToSettingsFrame(const QHttp2Configuration &)
Q_AUTOTEST_EXPORT to access it from tests

Task-number: QTBUG-122312
Change-Id: I4f7b93d476ac9cdb4b9d8338680cd681c949b039
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-05-16 18:06:57 +02:00
Marc Mutz 672afb13ca QSignalSpy: make sig member const
Previously, the sig member was used to indicate successful
construction of the QSignalSpy (incl. successful connection to the
monitored signal), so it was set only after all other initialization
had taken place, preventing it from being marked as const, which would
indicate that accesses to it need not be protected by the mutex.

Now that we have it, we can instead use the d_ptr's value to indicate
success, and mark sig const.

[ChangeLog][QtTest][Important Behavior Changes][QSignalSpy] The
signal() method no longer necessarily returns an empty byte array when
the connection failed. Use the existing isValid() method to determine
whether a given QSignalSpy object listens to a valid signal on a valid
object.

Change-Id: Ia08fe3b383681f3f203cf1a121c0e1ce08ad268b
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2024-05-16 17:12:14 +02:00
Edward Welbourne bd01008bca Decouple the TZ and ICU backends for timezone data
The TZ backend was instantiating an ICU backend to look up display
names, which entailed locking of the lazy-evaluated ICU
member. Instead, break out how ICU looks up display names into the new
timezone_locale feature's code, so that it can be shared between the
two backends. Linux thus only needs to build one backend.

Task-number: QTBUG-115158
Change-Id: I37ebc9a30f1c0ab6fd32d45dffa9f21355fb868d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-05-16 16:51:15 +02:00
Edward Welbourne e813acbb02 Rework QTZP::displayName() to use locale and data() more
We should only use the isoOffsetFormat() version of offset name for
QLocale::C - while other locales may coincide with it, we don't know
so shouldn't just assume. Add a query for whether a locale is the one
used by the backend for the abbreviation in its data() and, when it
is, use that abbreviation as short name. The TZ backend was searching
its transitions for help with the abbreviation; we can do that also in
the base-class, so introduce a data(TimeType) that will search
transition history (if available) for a suitable transition from which
to take the abbreviation (when appropriate).

This shall make displayName() return an empty string in various cases
where it did not, before; this is more honest than returning a string
that's inappropriate for the locale for which it was meant to be
answering.

Task-number: QTBUG-114914
Task-number: QTBUG-115158
Task-number: QTBUG-122448
Change-Id: I523229def63aafcd2009b8406b2c3d13f7c01d9c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-05-16 16:51:15 +02:00
Samuli Piippo f3bf304de7 CMake: Allow force use of builtin testdata
Builtin testdata packages all test files into resources. This is used
on mobile platforms by default, but it can be useful on other platforms
as well. Add CMake option to force this on other platforms.

Change-Id: I67c82bc735960be53b351ed16526cbfacfbe9bb6
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2024-05-16 17:51:15 +03:00
Assam Boudjelthia 8473b9ad19 JNI: fix docs snippet typo in QJniObject
Pick-to: 6.7
Task-number: QTBUG-125287
Change-Id: Ie0f2f26400d2e055d1de7a2307c9905d12891828
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
2024-05-16 16:40:55 +03:00
Assam Boudjelthia fbb35cdb0b Android:CMake: Add QT_ANDROID_PACKAGE_NAME property
Allow setting the package name directly from CMake properties.
If the package name is not set manually under AndroidManifest.xml
nor build.gradle, then the value set by this property is used.
The value is passed to build.gradle as "namespace" which is the
way to set the package name after AGP 7.4 instead of
AndroidManifest.xml "package" attribute.

Task-number: QTBUG-106907
Change-Id: I94bd73c294d751eabfd96c0a10a6b3ff270d8137
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
2024-05-16 16:40:55 +03:00
Tuomas Vaarala c9ddc4b8e1 [QNX] Use QRhiBackingstore for non-raster surface windows
Since the change to use compose render-to-texture widgets through QRhi,
the RasterGLSurface is not existing anymore and it was used in QNX QPA
to check the support for using backingstore with non-raster windows.
With the use of QRhiBackingstore the QNX QPA now supports
render-to-texture widgets for non-raster surface windows.

Fixes: QTBUG-114938
Task-number: QTBUG-114938
Pick-to: 6.5 6.6 6.7
Change-Id: I01d4a34efe4902a527051776b0460ccf22e5d232
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Marianne Yrjänä <marianne.yrjana@qt.io>
2024-05-16 16:40:55 +03:00
Kai Köhne 5e699c2a8b Replace 'Qt Designer' and 'Qt Widgets Designer' in code
Use new term in examples, code comments, error messages and and mime types.

Task-number: QTBUG-122253
Change-Id: I355452d6eb02a7a0ffbb20acf82ddb8ebbfa4837
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2024-05-16 13:04:41 +01:00
Michał Łoś 7678edebba Limit size of large files test for VxWorks
VxWorks doesn't allow mapping file beyond EOF, adjust tests to encompass
that.

Additionally, for testing on VxWorks we use use builtin /tmp which is a
RAM disk (in case of VxWorks-supported imx.6 bord which have 1GB of
RAM), set max size of tested large file to 256MB, 28 bits.

Pick-to: 6.7
Task-number: QTBUG-115777
Change-Id: I73cbe112331b7cb95d80bb44b792578a1eb88a07
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-05-16 14:04:41 +02:00
Łukasz Matysiak 88cb405514 Make tst_QFileInfo::setFileTimes more robust
There are some systems that do not support millisecond resolution in
timestamps.

An example of such system is VxWorks.

POSIX2008 demands that `stat` contains an `st_mtim` field of type `timespec`.
That field holds modification time with a nanosecond resolution.

VxWorks reports _POSIX_VERSION as 200112.
The `stat` struct does not contain `st_mtim`, but rather an `st_mtime` which
holds a `time_t` which contains seconds.
This leads to setFileTimes failing, because the test tries to
save the current datetime as the modification time of a file, but the ms
part is cut off.

Fix the problem by checking if the timestamp read back from the
filesystem contains milliseconds and only check it if it's not zero.

Pick-to: 6.7
Task-number: QTBUG-115777
Change-Id: I8c8a3b1c8e97955f13f059bcebf66d1b5af174fe
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-05-16 08:51:53 +02:00
Marc Mutz 785a5e6eb4 moc: port to RAII handling of fopen()ed FILE*s
Similar to what we did for androiddeployqt, port moc's output file
handling from raw FILE* to unique_ptr<FILE> with an fclose() "deleter".

Introduce a openFileForWrite() helper function to abstract away the
difference between Unixoid and Windows FILE handling.

Keep the actual type of the unique_ptr instantiation local to
openFileForWrite() function so that creation and destruction are
defined close together, notwithstanding the occasional need to spell
out the type of the return value in callers.

NB: The moc copy in qtscxml does not contain this code.

Pick-to: 6.7 6.5
Change-Id: I0c9bca0bf3e29c137c02cc563098c5f2e2708cf3
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2024-05-15 19:23:16 +00:00
Kirikaze Chiyuki 4431ffa8b9 Fix separator in QLocale::uiLanguages()
Since commit 91e70f23 introduced separator to uiLanguages(), the system
locale id still does not respect the separator parameter and hardcodes
dash as separator. Fixing this should make the format consistent.

Pick-to: 6.7
Change-Id: I1ab8edfa49117bdc9c4353228e73c2d1e5becffc
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Moody Liu <mooodyhunter@outlook.com>
2024-05-16 01:57:04 +08:00
Lucie Gérard e185ff2c12 Add reuse ignore
Task-number: QTBUG-124453
Change-Id: I6cffb2dbd856b3acd7dabb09772451e942c5febc
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2024-05-15 18:39:47 +02:00
Marc Mutz d31054c314 QMetaType: make sequence, pair adapters SCARY
Extract (non-template) Methods from template functions and pull them
behind the ABI boundary to avoid re-compiling the same code multiple
times ("SCARY").

In this particular case, the extracted code contains
QMetaType::fromType() calls, which, taken together, were responsible
for at least 91s of the ~8250s total time for a qt5.git-wide
headersclean_check (1.1%):

Says Clang -ftime-trace:

  $ grep fromType hc*.txt
  hc-00-baseline.txt: 32122 ms: QMetaType::fromType<QIterable<QMetaAssociation>> (1240 times, avg 25 ms)
  hc-00-baseline.txt: 31717 ms: QMetaType::fromType<QIterable<QMetaSequence>> (1240 times, avg 25 ms)
  hc-00-baseline.txt: 23531 ms: QMetaType::fromType<QtMetaTypePrivate::QPairVariantInterfaceImpl> (1240 times, avg 18 ms)
  hc-00-baseline.txt: 91143 ms: QMetaType::fromType<$> (6440 times, avg 14 ms)
  # QIterable<QMetaSequence> out-of-lined:
  hc-01-meta-seq.txt: 29869 ms: QMetaType::fromType<QIterable<QMetaAssociation>> (1240 times, avg 24 ms)
  hc-01-meta-seq.txt: 21618 ms: QMetaType::fromType<QtMetaTypePrivate::QPairVariantInterfaceImpl> (1240 times, avg 17 ms)
  hc-01-meta-seq.txt: 55029 ms: QMetaType::fromType<$> (5025 times, avg 10 ms)
  # QIterable<QMetaAssociation> out-of-lined:
  hc-02-meta-ass.txt: 21689 ms: QMetaType::fromType<QtMetaTypePrivate::QPairVariantInterfaceImpl> (1240 times, avg 17 ms)
  hc-02-meta-ass.txt: 25224 ms: QMetaType::fromType<$> (3799 times, avg 6 ms)
  # QPairVariantInterfaceImpl out-of-lined:
  <crickets>

Amends 01fb843af8 (sequences),
87e27eb870 (associations),
b88b09fb16 (pairs).

Task-number: QTBUG-97601
Change-Id: If34cf94703a203bc231f1bac656d2f5278bbd8f8
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2024-05-15 18:22:39 +02:00
Marc Mutz bf96c45f94 QDesktopServices: clean up pre-Qt-6.6 code
Remove the code that was already commented out by
37a25fce94 for Qt versions ≥ 6.6.

Pick-to: 6.7
Change-Id: I40a3e974430add17b52307781d092bd4f58c0c35
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-05-15 18:22:39 +02:00
Marc Mutz 46e53117c5 QSignalSpy: make makeArgs() file-static
Now that the private ctor that calls this function is finally
out-of-line, this function need no longer be part of the ABI.

Task-number: QTBUG-123544
Change-Id: Ia4656bf8bfd4d68d6925f93ef150593cd2de6ddf
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2024-05-15 18:22:39 +02:00
Łukasz Matysiak 7fad4df8df Fix tst_QFileSysteMWatcher::basicTest on VxWorks
POSIX2008 demands that `stat` contains an `st_mtim` field of type `timespec`.
That field holds modification time with a nanosecond resolution.

VxWorks reports _POSIX_VERSION as 200112.
The `stat` struct does not contain `st_mtim`, but rather an `st_mtime` which
holds a `time_t` which contains seconds.

Because of that, when the test creates and modifies a file within one
second, the polling watcher does not detect any changes.

Fix the problem by postponing the watcher by 1s.

Pick-to: 6.7
Task-number: QTBUG-115777
Change-Id: Idfc1d7b2e111967a42c93c0adaffaa7d28ee20a7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-05-15 18:22:39 +02:00
Mårten Nordheim cb8e5e0dd9 Http: Support unix+http: scheme in http backend
[ChangeLog][QtNetwork][QNetworkAccessManager] QNetworkAccessManager now
supports local connections using the uri schemes unix+http: or
local+http:.

Fixes: QTBUG-102855
Change-Id: I1f47b74ab42b51d97b3c555cc3afd6ccd272e1ed
Reviewed-by: Mate Barany <mate.barany@qt.io>
2024-05-15 16:06:46 +02:00
Mårten Nordheim 956795bda8 Http connection( channel)?: support local socket
Task-number: QTBUG-102855
Change-Id: Idcf571498b7a18792cf7843a826d78672e264a73
Reviewed-by: Mate Barany <mate.barany@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2024-05-15 16:06:46 +02:00
Eirik Aavitsland c9a1e8d306 Update bundled libjpeg-turbo to version 3.0.3
[ChangeLog][Third-Party Code] libjpeg-turbo was updated to version 3.0.3

Pick-to: 6.7 6.5 6.2 5.15
Change-Id: I1f7184959d84bc3b486f495d782755fd6f9cbaa4
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
2024-05-15 14:31:57 +02:00
Allan Sandfeld Jensen f5cafb6f1c Make minimal tag size more accepting
Accept tags between 8 and 12 bytes long, and move the check for 12
bytes to where it is needed.

Pick-to: 6.7 6.5
Fixes: QTBUG-125241
Change-Id: I1a46852a9ab60e7c63f8d74de1809d731912ab5b
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2024-05-15 14:23:19 +02:00
Marc Mutz 81a0753299 QDir: replace a QScopedArrayPointer with a QVLA
QDirSortItem contains three implicitly-shared members (two QStrings
and one QFileInfo), so the mere default-initialization of the
QDirSortItem[n] array with which we initialize the QScopedArrayPointer
will take quite some time.

Using QVarLengthArray, OTOH, delays construction until we have the
data to initialize the sort items, saving n default constructor and n
move assignment operator calls, plus the memory allocation for the
case where we have less than 65 elements to sort.

This code precedes the start of the public history, but the
emplacement won't work before 905bc62933
introduced the QDirSortItem ctor, so not picking back further than
that.

Pick-to: 6.7
Change-Id: I262217eabaded2a6aef08b87fc6369812bc8958a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-05-15 11:34:08 +02:00
Soheil Armin 28b3848989 Android: Refactor packagePath() in androiddeployqt
Make the method handle all the different possible
paths in a more clean way.

Task-number: QTBUG-116955
Task-number: QTBUG-65567
Change-Id: If0ed1b529011b942c0fb67d0ad7a940896e03c85
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2024-05-15 12:34:08 +03:00
Soheil Armin 79f3fe7040 Android: Add facilities to build AAR packages
This adds new aar target, as we do with apk targets, and an option
to androiddeployqt, --build-aar, which builds an AAR instead of APK.

AndroidManifest.xml of an AAR does not include application or activity
nodes, so we add an AAR specific manifest. Also the plugin type in
build.gradle will be com.android.library when choosing to build an
AAR.

Task-number: QTBUG-116955
Task-number: QTBUG-65567
Change-Id: Id33ac236f44038a8411ebfecdcc4e404c976e277
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2024-05-15 12:34:08 +03:00
Tinja Paavoseppä e59f310061 androiddeployqt: Add a placeholder for plugin type in build.gradle
This allows to later change the plugin type based on the options
provided for the androiddeployqt, such as when building an AAR.

Task-number: QTBUG-116955
Task-number: QTBUG-65567
Change-Id: I6314c8ab9edccbf953ae48543d5a002a9f807581
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2024-05-15 12:34:08 +03:00
Assam Boudjelthia b740cd1f38 Android: account for namespace in build.gradle instead of manifest
AGP version 7.4 deprecated the use of "package" attribute in the
manifest to specify the unique package name, it's instead been
moved to build.gradle file and set using "namespace" property.
This patch adds support of that to androiddeployqt.

Removing the "package" attribute from the default manifest would
break Qt Creator 13 and below because Qt Creator would fail to
deploy apps without such attribute in the manifest. For that reason
we'll defer removing it until a later version, for example Qt 6.10,
to allow some buffer for a Qt Creator that can handle that to be
adopted by users to reduce breakage.

[ChangeLog][Android] Add support for namespace in build.gradle instead
of the package attribute in the manifest.

Pick-to: 6.7
Task-number: QTBUG-106907
Change-Id: Ib0f0d6a6fbb3b38f605aadfdcc497067daf90297
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
2024-05-15 12:34:08 +03:00
Marc Mutz 0a48730d08 androiddeplyqt: port to RAII handling of popen()ed FILE*s
Coverity found several FILE* leaks (since fixed) in the code, so make
sure that those can't happen anymore, by using unique_ptr to manage
the pclose() of the openProcess() FILE handles.

Keep the actual type of the unique_ptr instantiation local to
openProcess() so that creation and destruction are defined close
together, notwithstanding the occasional explicit pclose() calls to
capture the error code.

As a drive-by, port a naked popen() to openProcess(), make some
variables const and replace 0 with nullptr.

Pick-to: 6.7 6.5
Coverity-Id: 378357
Coverity-Id: 378442
Change-Id: I2b06b99cba1e4eb5b8963a9c5d2cb398eb25a8b3
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2024-05-15 07:10:46 +02:00
Tor Arne Vestbø 48cc43a1e0 Windows: Destroy display change window before unregistering window class
The QWindowsScreenManager's m_displayChangeObserver window would still
be alive at the time ~QWindowsContext would unregister window classes,
resulting in a warning that was hidden by the default verbosity of
QWindowsContext::verbose. The result was that we would get a warning
when then trying to re-register the already registered window class.

We now do what we do for m_powerNotification and m_powerDummyWindow,
which is to destroy them explicitly before unregistering their class.

Fixes: QTBUG-125058
Pick-to: 6.7 6.5
Change-Id: Id3b02237fdd81f734a58a2314a157cad1289a82c
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2024-05-14 19:00:49 +00:00
Hatem ElKharashy 20521c3163 Support SVG specific stroke styling properties
SVG has special properties for stroke styling. Those are usually
supported by different browsers, because SVG documents can be
used inside HTML files. This kind of styling is already supported
by QPen and all need to be done is some plumbing to save and
retrieve those values in QTextDocument when it is stored as HTML.

Change-Id: I291efab5483ac5e852d117e762e203257c64b47f
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2024-05-14 21:48:12 +03:00
Alexey Edelev 90c2cde691 Change the -qpa configure argument logic
Parse the -qpa configure argument as list and translate it to the
QT_QPA_PLATFORMS cmake variable. This variable is new to the Qt build
procedure. The QT_QPA_DEFAULT_PLATFORM variable supposed to get
multiple values, but this didn't work at all, since the variable value
then was used in the compile definition that is expected to be a single
value QPA platfrom definition. This inconsistency forced to introduce
a new variable.

The QT_QPA_DEFAULT_PLATFORM variable now controls the first-choice QPA
plugin for the GUI applications. The new configure argument
-default-qpa is now translated to the QT_QPA_DEFAULT_PLATFORM variable
instead the of -qpa one. The -qpa configure argument is now translated
to the QT_QPA_PLATFORMS variable, which is new one as well. The
variable contains the list of QPA plugins that are "default" for this
Qt configuration. The meaning of the "default" plugins is related to
the DEFAULT_IF argument of qt_internal_add_plugin command. Plugins
that are listed in the QT_QPA_PLATFORMS variable will be treated as
default by the build system and will be deployed within user
applications when using deployment API or linked statically when using
static Qt.

The QT_QPA_DEFAULT_PLATFORM falls back to the QT_QPA_PLATFORMS first
value in the list if it's not set explicitly and either
'-DQT_QPA_PLATFORMS' or '-qpa' arguments are specified.

[ChangeLog][CMake] Added QT_QPA_PLATFORMS variable which controls the
list of QPA plugins that will be deployed within the applications by
default.
[ChangeLog][CMake] The '-qpa' configure argument now is mapped to the
QT_QPA_PLATFORMS variable and has different functionality. It doesn't
control the platform plugin that the GUI application is using by
default, but controls the list of QPA plugins that will be deployed
within the applications by default.
[ChangeLog][CMake] Added '-default-qpa' argument which replaces the
'-qpa' one. The argument is translated to the QT_DEFAULT_QPA_PLATFORM
CMake variable and selects the default platform that should be used
by GUI application if QT_QPA_PLATFORM environment variable is not set.

Task-number: QTBUG-124265
Task-number: QTBUG-87805
Task-number: QTBUG-124449
Change-Id: Ibcebaccc535aaed6374f15ccfeddb3e6128f5ce0
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2024-05-14 20:48:12 +02:00
Marc Mutz e227a4bfbd QMacAutoReleasePool: hold root-level object in optional<>, not QScopedPointer
The payload object is fully defined in the header file, so there's no
benefit in avoiding in-size use, which saves one memory allocation.

Amends 4a5a4245b7.

Change-Id: Iece2aed22ce525da940bd493b7009baeec6d06ba
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2024-05-14 20:48:12 +02:00
Marc Mutz c889b56901 QPropertyBinding: port QScopedPointer to std::unique_ptr
This is in preparation of adding QT_NO_SCOPED_POINTER.

Change-Id: I040e2ce66590a8a3be48d6d69bbb2493c9fc81b9
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2024-05-14 18:48:12 +00:00
Thiago Macieira fd36609064 QUrl: distinguish empty and null host/authority
We do that for the other components of the URL, to distinguish a present
host or authority that happens to be empty from an absent one. We
already had partial support for this because QUrl does distinguish
between foo:/ and foo:///.

Change-Id: Ie30a3caf09ef4176bb36fffd17cddc20c47bb1a6
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-05-14 11:00:11 -07:00
Oliver Wolff 81984807b3 windeployqt: MSVC: Add support for ARM64 hosts
Windeployqt deployed all the non Qt libraries in their x64
versions as it was not aware of the host it was running on. This
check needs to be done before any deployment happens.

Current support is limited for MSVC. mingw/clang might be done in
followup commits.

Pick-to: 6.7
Change-Id: I70fd6ad66c9cacfc6ff5b109f214a142b8b6d5f8
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2024-05-14 19:12:56 +02:00
Ivan Solovev 3ca9877f8c QSizeF: add qFuzzyCompare and qFuzzyIsNull overloads
[ChangeLog][QtCore][QSizeF] Added qFuzzyCompare and qFuzzyIsNull
overloads for QSizeF

Drop the custom qFuzzyCompare() implementation from
tst_qgraphicsgridlayout.cpp

Task-number: QTBUG-120308
Change-Id: I32d11c1c81d0503914a8168b5e960a8c6ce943d9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-05-14 14:33:21 +02:00
Tatiana Borisova c2826805de QSize(F): use comparison helper macros
Also explicitly add QSizeF vs QSize comparison. Previously such
comparison was implicitly converting QSize to QSizeF, and doing the
fuzzy comparison. We have to keep the old behavior to avoid
breaking user code, so use fuzzy comparison in the new operators
as well.

As a drive-by: put all the hidden friends in the private section.

Done-with: Ivan Solovev <ivan.solovev@qt.io>
Task-number: QTBUG-120308
Change-Id: Ia52adc97c557e475b19f5c16f9dd8c992637280e
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>
2024-05-14 14:33:21 +02:00
Mårten Nordheim 6f2ef2eacb QDecompressHelper: update the benchmark
After the zip bomb checks were added the benchmark was not
adjusted.

Also move the QByteArray creation outside the loop, to not include
the time it takes to make a heap allocation.

Pick-to: 6.7 6.5
Change-Id: Ia958d497dd27fc61e0084b6f5c11d76886bb24c4
Reviewed-by: Mate Barany <mate.barany@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-05-14 12:33:21 +00:00