70238 Commits

Author SHA1 Message Date
Assam Boudjelthia
2eeb35539c Android: fix warnings in runner script
Remove f-format prints that uses no placeholders.

Check if logcat_process is initialized before accessing it.

Remove unused import.

Pick-to: 6.8
Change-Id: I72cc34666460300b3b6b58174b3c7cefac27da7d
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2024-12-03 20:18:21 +00:00
Assam Boudjelthia
df3f5d88d3 Android: add option to run app detached to runner script
Allow the script to install, deploy and start the app without
waiting for the logs.

Pick-to: 6.8
Change-Id: Id852d827f627b902a75d1ed8101892552bd4202d
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2024-12-03 20:18:21 +00:00
Alexandru Croitor
df30953228 CMake: Fix standalone build of sqldrivers with SBOM
The standalone build of the sqldrivers plugin never called the SBOM
project begin and end functions.
This cause an error in qt_internal_add_plugin which tried to read the
SBOM project name.

Replace the calls to qt_prepare_standalone_project and
qt_print_feature_summary with qt_build_repo_begin and
qt_build_repo_end.
This ensures the SBOM project is setup, as well as many other
behaviors that a standalone internal build of a module is expected to
have.

Additionally we need to tell the SBOM project where to find the
licenses for the standalone build. This is done by setting the new
QT_SBOM_LICENSE_DIRS variable to the qtbase license directory.

Pick-to: 6.8
Fixes: QTBUG-131799
Change-Id: I2e31ecffdff28561d1c4a6b8fbcd8125188d2c48
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2024-12-03 21:18:21 +01:00
Volker Hilsheimer
9bb9016b80 QThread: document the QualityOfService enum
It's new in Qt 6.9, and used in the setter and getter APIs.

Change-Id: Iefdd7d9256f8c4b465416967b8bdd71e9bb5941c
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-12-03 19:48:19 +01:00
Edward Welbourne
54c2d6ded7 Fix TZ backend to include CLDR-known zones by territory
As previously noted, this backend uses the legacy zone.tab file, which
only gives one territory for each entry, where zone1970.tab gives
several. Until we switch to using the latter, we thus don't know all
the territories in which an IANA ID is used. However, we do have such
data from CLDR and deploy it in the default backend to filter the list
of all available IDs. As a result, the TZ backend lacks some results
of filtering by territory that the base-class would get for it,
because the CLDR data associates more territories with some IDs.

It implements the overload because its lookups in a hash are
potentially more efficient than generating its full list in order to
iterate it while intersecting with a CLDR-derived list of candidates.
Leverage that hash also to do efficient intersecting with the
CLDR-derived list, which lets us avoid duplicates almost for free, to
make the subsequent union with the directly-derived entries from
zone.tab efficient. This incidentally resolves a TODO about handling
of QLocale::AnyTerritory. In the process, add more notes to the
zone{1970,}.tab details.

Restructure the base-class implementations of filtered available IDs
to separate their generation of a CLDR-derived list of candidates from
the intersection of that with the available IDs. For the territory
overload, this lets the TZ backend share the CLDR-derived list; for
symmetry, do the same to the offset-filter, too. (This also makes each
function responsible for fewer things.) Similar treatment may also be
needed for the ICU and chrono::tzdb backends, since the former also
overloads the territory filter and both overload the offset filter.
However, leave those for now (with comments added on the possibility)
until we have evidence they actually do need this.

Pick-to: 6.8
Task-number: QTBUG-130877
Task-number: QTBUG-64941
Change-Id: Ibb347df88dd14b55f8f580bb4c9e37e5c56a533a
Reviewed-by: Mate Barany <mate.barany@qt.io>
2024-12-03 19:48:19 +01:00
Mårten Nordheim
d9ad2251d9 Add QHash::tryEmplace/try_emplace
Like QHash::emplace, but since it returns a bool (inserted/not inserted)
we finally have a way to avoid the
size(), emplace()/insert()/op[], size() pattern.

We also provide try_emplace (also with the hint argument overloads even
though we completely ignore the hint), for general compatibility with
the rest of the standard library. And for that reason it must also use
key_value_iterator instead of our usual iterator.

[ChangeLog][QtCore][QHash] Added tryEmplace().

[ChangeLog][QtCore][QHash] Added try_emplace() for compatibility with
the standard library.

Fixes: QTBUG-130258
Change-Id: Ie14786591ad6e9805e120e11fa01f69349ed4528
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2024-12-03 16:35:22 +01:00
David Boddie
7a473ca322 doc: Fix auto-linking to network classes
Added a qdoc dependency on the qtnetwork module to resolve links to
QNetworkAccessManager.

Pick-to: 6.8
Change-Id: If625c63fc0a2ecc9cfea9f467796bf8388478c1c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-12-03 15:35:22 +00:00
David Boddie
d2c9982a56 doc: Fix QString::slice() code example
The snippet referred to had a duplicate identifier to an earlier snippet
in the snippet file, causing that one to be quoted instead.

Change-Id: Id46f6da807806f874291cd5d4c25b8884e511cfc
Pick-to: 6.8
Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
2024-12-03 15:35:22 +00:00
David Boddie
e409947113 doc: Fix links to OpenGL functions
Pick-to: 6.8
Change-Id: I0192aed6b26c1b90fe7c92845212cbd4246b5892
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2024-12-03 16:27:28 +01:00
Tinja Paavoseppä
c95426619f Android: Remove redundant JavaVM reference
Task-number: QTBUG-130610
Pick-to: 6.8
Change-Id: I788a3789b5a5b178b97b5a2c9b7568a7d925e1a8
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2024-12-03 17:27:28 +02:00
Tinja Paavoseppä
1a6efa0728 Android: Remove unused ClassLoader reference
Task-number: QTBUG-130610
Pick-to: 6.8
Change-Id: Ide5d1539f6c608a6d031d28d1942b55b0e9b5407
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2024-12-03 17:27:27 +02:00
Juha Vuolle
a3e2f34abd Document that QNetworkRequest::setRawHeader() lowercases header names
Pick-to: 6.8
Fixes: QTBUG-131474
Change-Id: I3637fb989000cdb991969aa46b9552e52dacad49
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-12-03 17:27:27 +02:00
Assam Boudjelthia
0abcb9bef8 Android: improve fullscreen and maximized states handling
Rework fullscreen and maximized/expanded states handling
by simplifying and re-organizing the code, removing some
unnecessary code. Also, use newer APIs and handling the
cutout regions.

For expanded mode, use transparent instead of translucent
so that the user can decide what color to use if needed,
and in any case using the translucent flags is deprecated.

You might still notice some artifacts as in QTBUG-88676,
a fix for that is outside the scope of this patch.

When going off of fullscreen mode one some cases you might
notice a white/black black at the bottom and that's because
QtRootLayout.onSizeChanged() is reporting wrong available
size which is also an existing issue and outside of this
scope.

Fixes: QTBUG-96105
Fixes: QTBUG-101968
Fixes: QTBUG-127394
Fixes: QTBUG-121820
Task-number: QTBUG-109878
Task-number: QTBUG-119594
Change-Id: I586775a1d0414ec0adbc968d50b9c1a1ce466422
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2024-12-03 17:27:27 +02:00
Assam Boudjelthia
a2385e5c9d Android: move setSystemUiVisibility() to QAndroidPlatformWindow
Move calls for handling system UI visibility to QAndroidPlatformWindow
where they belongs.

Change-Id: I3802cf9d205ee6678f71b787c5ea4804d3aaeb29
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2024-12-03 17:27:27 +02:00
Assam Boudjelthia
5c37d3f06b Android: rename and move updateWindow native method to QtWindow
That method is related to window management so move it to
QtWindow where it belongs, and any related C++ code from
androidjnimain.cpp to QAndroidPlatformWindow.

Rename the method to updateWindows since it's operating on all
windows and not one window.

Change-Id: I91e729b0749b6a8168b7126f9140d79c542b23d3
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2024-12-03 17:27:27 +02:00
Assam Boudjelthia
10805e7d8a Android: check Qt::ExpandedClientAreaHint when setting size
No need to also check for Qt::WindowMaximized, if we're using
Qt::ExpandedClientAreaHint, we would expect the full size to
be used.

Change-Id: I52db0224aa96409a8f2d984e01192001f9b42440
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2024-12-03 17:27:27 +02:00
Assam Boudjelthia
50603fddc5 Android: fix tst_android::testFullScreenDimensions()
The test was reporting wrong app size values and then
expecting a wrong height after subtracting the system
bar heights. This was happening because an older API
was still being used, using newer APIs fixes that.

Fixes: QTBUG-131338
Pick-to: 6.8 6.5
Change-Id: I7306ce62d9c683f84069cc19086a6cd28abf5441
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2024-12-03 17:27:27 +02:00
Volker Hilsheimer
f401142d32 QIcon: document the support for icon fonts
Add a C++ snippet that shows how to use a named glyph from an icon font,
and add a QML snippet file that shows how to change the icon based on
the state of a tool button.

[ChangeLog][Gui][QIcon] QIcon can now generate icons from the named
glyphs of an icon font.

Change-Id: I1179ed93774c2c209094fffb910b2e06cbe2f572
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2024-12-03 10:11:37 +01:00
Antti Määttä
f6d67ed9b7 Fix creating multisampled pipeline on dx12 backend
Use the depthStencil format to check multisample support when the
pipeline doesn't have color attachments.

Fixes: QTBUG-131505
Pick-to: 6.8
Change-Id: I8fec8383ed854a581586213e3dbd401bb457cefc
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2024-12-03 08:05:04 +02:00
Alexandru Croitor
9cb0d48aae CMake: Fix unescaped path MATCH condition in QtPublicSbomHelpers
Use string(FIND) instead of if(MATCH) since paths containing special
regex symbols like "+", can either cause an invalid MATCH result or it
can lead to regex compilation errors like
 RegularExpression::compile(): Nested *?+.
 RegularExpression::compile(): Error in compile.

Amends 6e7f871edfd35174b40c7eb7386282bfe019f276

Pick-to: 6.8
Fixes: QTBUG-131782
Task-number: QTBUG-122899
Task-number: QTBUG-130557
Change-Id: I59a2c3e4fe2431303c7cbca8fd54360f254da90f
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2024-12-02 20:32:04 +01:00
Morten Sørvig
5e288c513b wasm: Disable 4GB memory when JSPI is enabled
This triggers an Emscripten compatibility issue.

Change-Id: I6cfe92d1c0d31e9aac27f0b91af2d2bd85d192ee
Reviewed-by: Lorn Potter <lorn.potter@qt.io>
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
2024-12-02 19:45:19 +01:00
Morten Sørvig
16fdbbf444 wasm: add macro for for emscritpen::async()
emscritpen:async() needs to be passed to embind exported
functions, if that function might suspend, and if JSPI
is enabled (and only if JSPI is enabled):

  emscripten::function("fn", &fn, emscritpen:async());

Add QT_WASM_EMSCRIPTEN_ASYNC macro which evaluates
to ",emscritpen::async()" (note comma) if JSPI is enabled,
and to nothing if not.

   emscripten::function("fn", &fn QT_WASM_EMSCRIPTEN_ASYNC);

This way we can configure Qt for either JSPI and non-jspi
builds. Incidentally the emscritpen::async() requirement
makes JSPI a Qt configure time feature, instead of an
app link time feature like for the current ASYNCIFY (1)
support.

Task-number: QTBUG-129749
Change-Id: I5bf820242c19a26018f4a3e06ee570e2d36ed993
Reviewed-by: Lorn Potter <lorn.potter@qt.io>
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
2024-12-02 19:45:19 +01:00
Morten Sørvig
92ad0f1f01 wasm: add configure option for asyncify JSPI
Make this a proper Qt configure feature: 

 -feature-wasm-jspi

Using the JSPI name matches the updated Emscripten naming
as well, which as moved from "asyncify 2".

Task-number: QTBUG-129748
Change-Id: Idfc372f831d1db5c79109c97a00e30e58713f9f6
Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
2024-12-02 19:45:19 +01:00
Morten Sørvig
00ef435571 wasm: Don't hardcode ASYNCIFY 1
Build for the "default" config only, which can be
asyncyfy 0,1, or 2 depending on Qt build configuration.

Change-Id: I29d9a11b30325491151fc4e621272e5390681fa7
Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
Reviewed-by: Lorn Potter <lorn.potter@qt.io>
2024-12-02 19:45:18 +01:00
Morten Sørvig
2e334c1395 wasm: move socket notifier impl to separate file
This is not core event dispatcher functionality, and
can live in separate implementation files.

Change-Id: I56202d59f57e8dd221f39b3b2ed34d57aacb89aa
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2024-12-02 19:45:18 +01:00
Morten Sørvig
9a2370e434 wasm: unifiy eventdispatcher asyncify code paths
There is no difference between these as far as the suspend/resume
functions go; the exiting difference is due to using a more
modern API for the jspi implementation.

Replace EM_JS() usage with EM_ASYNC_JS(). This allows using
await Promise() instead of Asyncify.handleSleep(), and also
removes the need for setting ASYNCIFY_IMPORTS.

Remove the useJspi() function and the duplicate code paths.

Task-number: QTBUG-129746
Change-Id: Id914089868763a1a3d5d575043c29845889f6624
Reviewed-by: Lorn Potter <lorn.potter@qt.io>
Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
2024-12-02 19:45:18 +01:00
Eskil Abrahamsen Blomfeldt
40e364172f Fix assert in certain cases of missing glyph in a string
If a substring for a fallback engine spanned multiple characters,
we would only assign the first of the characters to a glyph in
log clusters. This could cause the log clusters array to become
non-monotonic (you could get an array like [0, 1, 2, 0, 3, 4]).
In turn, this would confuse the text layout algorithm which
depends on the indexes always increasing, and we would sometimes
hit an assert in addNextCluster() if we were unlucky.

To rectify this, make sure all characters in the substring are
mapped to the same cluster.

Fixes: QTBUG-131731
Pick-to: 5.15 6.5 6.8
Change-Id: I93415a58351349ead6eb7a016b32b09f274e6fe4
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
2024-12-02 19:09:13 +01:00
Axel Spoerl
cbd2f56c14 QDockWidget: add Q_PROPERTY dockWidgetArea
Implement dockLocation Q_PROPERTY. Use dockLocationChanged signal.
Ensure the signal is only emitted on changes.
Add and document getter and setter.
Modify tst_QDockWidget::dockLocationChanged() to cover new API.

[ChangeLog][QtWidgets][QDockWidget] Added dockLocation Q_PROPERTY
with new dockLocation() and setDockLocation() API.

Fixes: QTBUG-117834
Change-Id: I85cfb613ae932f9e0dd42f8e7b20fee91a4201e6
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2024-12-02 18:48:34 +01:00
Laszlo Agocs
da61af8065 rhi: Make DXGI HDR query usable with Vulkan
Also moves the relevant code into one place, that is usable internally
from other places in the future. (the interface might change still)

Most importantly, this now makes the Vulkan backend to report the same
information as the D3D11/12 ones, as long as the Vulkan implementation
reports the deviceLUID in the extended physical device properties.

Change-Id: I6aa8adaf40bbc3199959019d323910abd27ec473
Reviewed-by: Kristoffer Skau <kristoffer.skau@qt.io>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2024-12-02 17:43:50 +01:00
Laszlo Agocs
950c61d48b rhi: Do not lose track of swapchains on manual destroy-create
Pick-to: 6.8
Change-Id: Ieb1c06c881dff3e1dbd0cff470d5a7c264a20d1d
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2024-12-02 17:43:50 +01:00
Rym Bouabid
c39c3fe0cb QIODevice: Add overloads of QIODevice::readLineInto() that takes QSpan
The existing QIODevice::readLineInto takes a QByteArray *, so it's
dependent on a QByteArray and therefore needs at least one (initial)
allocation.
Add QIODevice::readLineInto() that takes a QSpan, allowing the user to
provide a buffer to write into and returns a QByteArrayView.

QBAV and QSpan are not null terminated. Make null termination optional
when reading using QIODevicePrivate::readLine(). Extend the function to
accept a ReadLineOption enum parameter with a default value of
"NullTerminated"  to preserve old calls. Do the same to
QRingBufferRef::readLine().
Add QRingBuffer::readLineWithoutTerminatingNull().

[ChangeLog][QtCore][QIODevice] Added overloads of
QIODevice::readLineInto() taking QSpan and returnig a QByteArrayView.

Task-number: QTBUG-126574
Change-Id: I278a42cef4c9aa64ed884027f79105b5b7d44813
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-12-02 16:43:50 +00:00
Edward Welbourne
e23dc7c420 Correct handling of World in mapping MS's zone IDs to IANA ones
The AnyTerritory entries in the zoneDataTable are derived from
territory="ZZ" entries in the upstream CLDR data; the World ones from
territory="001". The latter give the default IANA ID for each MS ID,
the former give an (often legacy) IANA ID for the MS ID, that is not
based on geography. Some of these are being removed at CLDR v46.

The documentation said the ZZ entries have "no known territorial
association", hinting that there may be some (unknown) territorial
association; however, CLDR's inclusion of them is as entries with a
known non-territorial association, so revise the phrasing to reflect
this.

Also document that windowsIdToDefaultIanaId() returns empty when
there is no territory-specific value, and callers can use the
territory-neutral call to get a suitable value in that case. (They
may, however, wish to distinguish this case, to treat it differently,
so I decided not to just return that in place of empty in any case.)

The upstream CLDR tables do have entries for territory 001, so we
should report these if asked for World as territory. Amend the
available zone ID lookup and mapping from MS to IANA functions that
take a territory to duly handle World via the default-data that was
derived from 001 data in CLDR, instead of from the territory-varying
table, from which those were effectively filtered out when generating
the two tables. Update docs to mention this handling of World, for
contrast with that of AnyTerritory.

In the process remove a spurious split-on-space from the MS to default
IANA lookup, asserting there is no space (in a field now stored in the
table for single IANA ID entries, instead of the one for space-joined
lists of them in which it used to be stored, before I noticed it's
always only one ID). There is a matching assertion in the cldr.py code
that extracts the data. Added an assertion to this last, that each
default IANA ID given by CLDR's MS data does in fact also appear as
one of the IANA IDs for at least one territory (potentially ZZ), and
comment in C++ code on why this means we don't need to scan the
windowsDataTable in a few places, where it would just produce
duplicate entries.

[ChangeLog][QtCore][QTimeZone] Corrected handling of QLocale::World
and clarified in docs how QLocale::AnyTerritory is handled when
QTimeZone selects zones by territory.

Pick-to: 6.8
Task-number: QTBUG-130877
Change-Id: I861c777c68b0cb73a194138fe23fbff839df49e6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-12-02 17:43:50 +01:00
Edward Welbourne
79a74aa768 Make checks on a constexpr use if constexpr
It only saves test binary size, but we might as well take the free
saving.

Change-Id: I8b66834c127721816937a47087ade980c1106bd3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-12-02 17:43:50 +01:00
Patryk Stachniak
ebe9a6ca4b Removal of generic stylesheet rule for dropdown
The generic stylesheet rule (* { border: none; })
was overriding specific styles for
the menu-indicator, causing the dropdown arrow
to appear larger than intended. This rule was
removed to restore default or explicitly set
styles for the arrow, ensuring consistent
visual appearance

Task-number: QTBUG-120604
Pick-to: 6.8 6.5
Change-Id: If93de1e1595a2155e9a76644a3c615bd432bf53f
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2024-12-02 17:43:50 +01:00
Dimitrios Apostolou
8df072fc80 Mark some security sensitive files in corelib
Mark some files in corelib that possibly parse untrusted data, following
acceptance of QUIP-23.

Change-Id: Idc2354edb7d2a94d0267dbb3398b9ab6e3a48525
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
2024-12-02 16:43:33 +01:00
Dimitrios Apostolou
750f812812 Mark some security sensitive files in http2
Following acceptance of QUIP-23.

Done-with: Mårten Nordheim <marten.nordheim@qt.io>
Change-Id: Ib0e5f8d8cfbd6443186648d98276e7afd26cab40
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-12-02 16:43:33 +01:00
Dimitrios Apostolou
94df2e8132 Mark some security sensitive files in network
Following acceptance of QUIP-23.

Done-with: Mårten Nordheim <marten.nordheim@qt.io>
Change-Id: I0d5c816d6e3c2d25b2c6ad5384aba1f533ce0288
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-12-02 16:43:32 +01:00
Alexandru Croitor
cecff9ec41 CMake: Add missing SBOM attribution entries
Add entries for the cmake 3rd party files, as well as mimetypes
and gradient gen.

Pick-to: 6.8
Task-number: QTBUG-122899
Task-number: QTBUG-131477
Change-Id: I22f243798d66422a0b52aa37532eba2b3210c98d
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2024-12-02 16:43:32 +01:00
Dheerendra Purohit
2ebca8cde1 Add widgetAdded signal for QStackedWidget and QStackedLayout
Currently, there is no signal provided when a widget is added
or inserted into QStackedWidget or QStackedLayout.

Emit a signal whenever a widget is added or inserted into
QStackedWidget or QStackedLayout.

[ChangeLog][QtWidgets][QStackedWidget] The widgetAdded() signal
emits whenever a widget is added or inserted into QStackedWidget
or QStackedLayout.

Fixes: QTBUG-122748
Change-Id: I3bf658346a5881665214a8d8f77975aa10e497c0
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-12-02 15:43:32 +00:00
Tor Arne Vestbø
ea1409afc1 macOS: Update safe area margins via KVO on NSView.safeAreaInsets
We still need to check if the margins need update on geometry change,
as we also take the screen safe area margins into account, which
NSView.safeAreaInsets does not.

Change-Id: I193544966f983744bb798cece9c4eaf17cd858f3
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2024-12-02 16:01:44 +01:00
Alexandru Croitor
d14addfd45 CMake: Increase minimum required CMake version to 3.22
For both building and using Qt.

The Linux distributions that Qt 6.9 aims to support have the following
CMake versions in their official package repositories:

rhel   8.10        ships 3.26.5
rhel   9.4         ships 3.26.5
opensuse 15.6      ships 3.28.3
ubuntu 24.04       ships 3.28.3
debian 11.6        ships 3.24
debian 12          ships 3.25
yocto 4.0 kirstone ships 3.22
suse enterprise is similar to opensuse

Windows and macOS don't ship cmake, developers on those
platforms always have to manually download / install cmake from
somewhere, thus they can use most newer versions.

The lowest common version on Linux is 3.26.
The lowest common version on Linux including yocto 4.0 is 3.22.

Until we clarify whether we need to support the yocto version or not,
the safe assumption is that we need to.

Hence the minimum required version will be 3.22.
We might revisit this later.

The minimum and maximum cmake policy version are left at
the existing 3.16 and 3.21 respectively, because changing those would
require more work than just bumping the minimum.

[ChangeLog][Build Systems] Building and using Qt now requires at least
CMake version 3.22.

Task-number: QTBUG-131169
Change-Id: I319cc61f4099bd8d3fae04e8c270340ab09ff8a8
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2024-12-02 16:01:44 +01:00
Alexandru Croitor
5803af38aa CMake: Temporarily allow using any version in Qt's CI
So we can raise the minimum CMake version, without having to wait for
that CMake version to be provisioned in qt5.git.

This change will be reverted later, once the provisioning is done.

Task-number: QTBUG-131169
Change-Id: I1ebdc40abcc4a72617bb7742e8dca9bcc16fee94
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2024-12-02 16:01:43 +01:00
Alexandru Croitor
df7091d9f4 CMake: Add more unsupported options to allow using any CMake for Qt
Currently we have two options that allow overriding the minimum CMake
version required to either build or use Qt:
- QT_FORCE_MIN_CMAKE_VERSION_FOR_BUILDING_QT
- QT_FORCE_MIN_CMAKE_VERSION_FOR_USING_QT

These options require specifying an exact CMake version that should be
allowed, which is a bit cumbersome.

Introduce two new options that allow using any CMake version without
specifying the exact version.
- QT_FORCE_ANY_CMAKE_VERSION_FOR_BUILDING_QT
- QT_FORCE_ANY_CMAKE_VERSION_FOR_USING_QT

Also introduce a Qt CI specific check that would allow using any CMake
in Qt's CI Coin, to allow decoupling of the minimum CMake version bump
from the provisioning of the new minimum CMake version.

This check should only be enabled temporarily, and then reverted back
once the provisioning is done.

The current change has the check disabled, it will be enabled in a
follow up change, so it's easier to revert.

As usual, using any of these options is not officially supported.

Pick-to: 6.8
Task-number: QTBUG-131169
Change-Id: Icc3f51ad457ebf8f4251309be97e72a3ff4cd2e0
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2024-12-02 16:01:43 +01:00
Tim Blechmann
56106d1bd7 Testlib: improve messageHandler without loggers
When the messageHandler is called without loggers, we used to simply try
to restore the old message handler. This is not ideal and the assertion
seems to be wrong.

The situation of not having any loggers can occur during teardown, if
the message logger is called from a worker thread, while the application
thread stops logging (compare QTBUG-129722)
In this case, we simply forward the message to the original message
handler, which should simply print the message.

Pick-to: 6.8
Change-Id: Ic8147f7ab6317f1ceb4f52c79ce298464a94de30
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2024-12-02 19:01:20 +08:00
Axel Spoerl
182604ae9c Clean up tst_QWidget::saveRestoreGeometry()
Use QTRY_COMPARE_NE(a, b) instead of QTRY_VERIFY(a != b).
Add correct skip reason for macOS and add a code comment on failure
location.
Remove unnecesary string view usage.

Change-Id: If63af01e639f8e9568722a4fc685cb8057282cd5
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2024-11-30 20:17:48 +01:00
Axel Spoerl
39678d3686 Add tst_QWidget::restoreGeometryFromInvalidArray()
Remove out randomly placed testing of invalid byte arrays in
tst_QWidget::saveRestoreGeometry().
Add a separate, data driven test.

Change-Id: I14928537b2dc2b16cbba4a06e39a39d065b8bc14
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2024-11-30 20:17:46 +01:00
Christian Ehrlicher
bc80707387 Fusion style: adjust sizeFromContents() for CT_PushButton
Move the text a little bit further away from the horizontal border.

[ChangeLog][QtWidgets][Styles] PM_ButtonMargin is now respected for
QPushButton in fusion style.

Fixes: QTBUG-94860
Change-Id: I2447de0b8fca048eb2efe1a309969fad61f6bd29
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-11-30 01:51:37 +00:00
Christian Ehrlicher
f1fd15b454 QStyleSheetStyle: avoid double lookups to QRenderRule::styleHints
Avoid double lookups to QRenderRule::styleHints by simply checking if
the returned QVariant from styleHint() is default-constructed.

Pick-to: 6.8
Change-Id: I4ca657662c2af66582fb4fc7c2ed1b77258ab050
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-11-30 02:51:37 +01:00
Allan Sandfeld Jensen
11dc7e1c05 Mark max length work buffers uninitialized
Otherwise the hardening with initializing all buffers causes serious
performance regressions

Pick-to: 6.8
Change-Id: I3f7a0b7f0e0d08644b1dbb520cf1f6d5e052b270
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-11-30 01:22:47 +01:00
Volker Hilsheimer
3a825036a3 Widget styles: use palette brushes to set the painter's brush
Don't go through the brush's color just to construct a new (solid)
brush. It removes other brush information, unnecessarily constructs
a temporary QBrush object.

Change-Id: I0a02034225f8f1025c7395b31e2f32119f77a37c
Reviewed-by: Doris Verria <doris.verria@qt.io>
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2024-11-29 21:56:14 +01:00