Commit Graph

65588 Commits (f45dffa8b4e5a3ddc3473203e27ebdeebfde10da)

Author SHA1 Message Date
Marc Mutz 94e122c594 QSpan: make adl_begin() etc SFINAE-friendly
The definition of iterator_t, and, therefore, of is_compatible_range
depends on this, otherwise say, 0, is being treated as a valid range
and hits a hard error in adl_begin() when trying to call begin(int&).

TIL: decltype(auto) does _not_ SFINAE.

Fix by calculating the return type manually, re-enabing SFINAE.

Pick-to: 6.7 6.6
Change-Id: Icacd70554f4050ecaeb396c9ae60bc4f21a220c9
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-01-26 23:50:57 +01:00
Kai Köhne c92de95bed Doc: Update Copyright in md4c license text
Amends c29a235833

[ChangeLog][Third-Party Code] Updated md4c (optional part of
Qt Gui) to version 6.5.1.

Pick-to: 6.2 6.5 6.6 6.6.2 6.7
Change-Id: I7c41fc65fbc92670c1fe4bd0b6d2f46674bdb435
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2024-01-26 23:06:33 +01:00
Shawn Rutledge bdfe05ecef Remove obsolete md4c patch
This was added in 1591a95987 on top of an
older version of md4c, but those casts now exist in upstream code,
which we upgraded to in c29a235833

Pick-to: 6.7 6.6 6.5 6.2
Change-Id: Ia1a939ed69bcd52ac8afd91dbd574767b59032d6
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
2024-01-26 15:06:33 -07:00
Ahmad Samir 83e5d74864 QFileSystemModel: respect dir filters
Given a dir A that has some files and a subdir B, when a model is set to
only show files, setting the root path to A, the filters are initially
respected. Setting the root path to B then back to A, the filters would
be ignored and B would be visible in the model.

Traversing the path elements in node() led to dir B getting added to
the bypassFilters hash table, which made filtersAcceptNode() bypass the
filters.

I couldn't find a commit explaining the logic behind using bypassFilters
(the trail goes cold at the 'Qt 4.5' mega commit). The only clue I found
was the "// always accept drives" comment in the code, which hints at
this being useful only on Windows(?).

Fixes: QTBUG-74471
Pick-to: 6.7 6.6 6.5
Change-Id: Icb9055524a28990c591e924634a63e29a49835aa
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-01-26 20:19:23 +00:00
Marc Mutz 5e237f1af2 QTest: DRY test function invocation
Wrap the QMetaMethod::invoke() calls in a helper function in
preparation of filtering execeptions as part of QTBUG-66320. Rename
the existing helper function to make the old documentation comment
redundant.

Pick this back to LTS branch in order to avoid needless code
divergence going forward.

Pick-to: 6.7 6.6 6.5
Change-Id: I34ae24bf23ea21d7063016257908f925fc087298
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2024-01-26 21:04:15 +01:00
Tomasz Kozłowski 09a21c73a0 Add required network libs for VxWorks
It is needed for proper inet socket address working
on this platform.

Pick-to: 6.7
Task-number: QTBUG-115777
Change-Id: Icde7ff7baf257762339f5f72a783c92f6b297a46
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-01-26 18:48:38 +00:00
Ivan Solovev b9c8c57e3f tst_manualqdatastream: fix gcc error
GCC has a bug [1] that does not allow to specialize templates
outside of a namespace.
An attempt to build the test results in the following error:

 tst_manualqdatastream.cpp:18:15: error: explicit specialization in
 non-namespace scope ‘class tst_QDataStream’

Fix it by converting the template specializations into simple function
overloads.

[1]: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85282

Pick-to: 6.7
Change-Id: I7803cce1687ca8ae992f1a57394346eb6fc90c8b
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2024-01-26 15:10:22 +01:00
Ivan Solovev beebf6450c tst_manualqdatastream.cpp: update the license
The file was added in fd48ce0b73
by a TQtC employee, so the header should mention The Qt Company Ltd.

Pick-to: 6.7
Change-Id: Ib191d2d63656c42f783db87de489814d387dfbca
Reviewed-by: Øystein Heskestad <oystein.heskestad@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2024-01-26 15:10:19 +01:00
Ivan Solovev 36cc9fc54a QDataStream: add a new SizeLimitExceeded status code
This status is supposed to be used when the stream tries to read
or write more data than it is supported by the current platform.
For example, reading more than 2 GiB of data on a 32-bit platform will
result into this status, but it will work fine on a 64-bit platform.

This patch uses the new status in read operations.

Amends fd48ce0b73

Found in 6.7 API review

Pick-to: 6.7
Change-Id: I675b1ee25fafba174ce8f94c3470dbb7893d6d9e
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-01-26 15:10:16 +01:00
Marc Mutz 61130d73d4 QHttpHeaders: make default ctor non-allocating
... by allowing d == nullptr to mean the empty state.

Needed to add a few guards and specialize QESDP::detach() to be able
to detach from nullptr.

This also gets rid of the partially-formed moved-from state. It's now
guaranteed to be empty.

Pick-to: 6.7
Change-Id: If874d7c69d91eb4babe667ae577f261610d52fd3
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2024-01-26 14:51:36 +01:00
Fabian Kosmale ac001bef79 moc/QMetaProperty: Remove limitation on non-own-class notify signals
The moc generated code does a sanity check that NOTIFY signals actually
exist in the parent class when they cannot be found in the class moc
currently runs on.
The logic there was however too simplistic, and couldn't deal with
signals taking a parameter.
Fix this, and take the opportunity to use a proper static_assert instead
of generating a "normal" compile error.

We do not do any checks for the presence of QPrivateSignal, as the whole
point of QPrivateSignal is that it should be private (and not e.g.
protected).

Moreover, we adjust QMetaProperty::notifySignalIndex to take
single-argument notify methods into consideration as well when
encontering an unresolved notify index.

Fixes: QTBUG-115989
Pick-to: 6.7
Change-Id: I8a056a15777f3132691e207b4b9ab6c2c9b2126d
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2024-01-26 14:51:35 +01:00
Aurélien Brooke 941afac108 QRhi: fix a bad variable name in documentation example
Change-Id: I127dcaebc4d4a9d00e0cec924b0a4168a3970a71
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2024-01-26 14:51:35 +01:00
Volker Hilsheimer 3042d40be7 Simplify new QIcon ThemeIcon constants and API
Originally we thought that exposing the string literal through the API
would be useful for people that want to know what icon they will get
when using a specific constant. But since the mapping from platform
independent icon name to platform specific icon name is anyway hidden
in the engine implementation, this is no longer useful.

Based on header review comments, simplify this by making the ThemeIcon
list of constants a scoped enum.

If it's really useful for e.g. designers to know which exact icon they
get on a specific platform, then we could, in a future release, add a
static QIcon::themeIconName API that returns the platform specific icon
string for a ThemeIcon constant.

Pick-to: 6.7
Change-Id: I231eb98fefb4ac82d38209b4e1257bb3caadeb08
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2024-01-26 14:51:35 +01:00
Joerg Bornemann 3a4397af2e CMake: Fix *-metatypes.json creation for non-Ninja generators
This amends commit db9009721a, which fixed
the *-metatypes.json creation for Makefile generators. User feedback and
the comments in the underlying CMake issue #19005 suggest that all
non-Ninja generators are affected.

Fix this by activating the work-around for all non-Ninja generators.

Pick-to: 6.5 6.6 6.7
Fixes: QTBUG-120317
Change-Id: I537ff7be9c658b7053f7f5df6cbced460be43270
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-01-26 14:51:35 +01:00
Alexandru Croitor 49902cc6ce CMake: Simplify default CMAKE_BUILD_TYPE logic
Previously we had four-ish locations where the CMAKE_BUILD_TYPE was
force set.
Twice in QtBuildInternalsExtra.cmake via
qt_internal_force_set_cmake_build_type_conditionally(), depending on
some conditions. This was executed right at
 find_package(Qt6 COMPONENTS BuildInternals)
time.

And twice in qt_internal_set_default_build_type() via
qt_build_repo_begin() / qt_prepare_standalone_project() that goes
through QtSetup.cmake. This was executed only if the relevant functions
were called, rather than directly at find_package() time.

The exact logic of which build type ended up being set was very
confusing.

Refactor the code to decide the build type in one single location
when qt_build_repo_begin() / qt_prepare_standalone_project() are
called, rather than directly at find_package() time.

The actual logic when we override the build type depends on many
factors:
- when an explicit CMAKE_BUILD_TYPE is given, honor it, unless it's
  a multi-config build
- when it's a multi-config build, don't set any CMAKE_BUILD_TYPE,
  use the value of CMAKE_CONFIGURATION_TYPES
- when it's a qtbase build, compute a default unless an explicit value
  was given
  - the default is Debug if FEATURE_developer_build is ON
  - otherwise the default is Release
- when it's a top-level build, only choose a build type for qtbase
- when it's another repo build, use the original build type unless
  another was given explicitly (including in a top-level build)
- when it's a standalone tests build
   - if qt is multi-config, the tests will be single config, due to
     various CI failure reasons, this hasn't changed
   - if qt is single config, use the original unless an explicit
     value was given
- when it's a single standalone test build, use the original unless
  an explicit value was given

To determine when an explicit CMAKE_BUILD_TYPE was given in contrast
to when it was default initialized, we now have one single function
that uses a few heuristics.
The heuristics are needed because we can't reliably determine an
explicitly given 'Debug' build on Windows, because CMake default
initializes to that.

The heuristics include:
- checking whether CMAKE_BUILD_TYPE_INIT is different from
  CMAKE_BUILD_TYPE
- checking what the CMAKE_BUILD_TYPE was before the first project()
  call when CMake default initializes
  - we save the previous value in the qt.toolchain.cmake file
  - also in QtAutoDetect during qtbase configuration
  - also when building the sqldrivers project
- honoring the value of QT_NO_FORCE_SET_CMAKE_BUILD_TYPE

As a result of the above changes, the build type will be set exactly
zero or one times, for a particular build directory.

Note that the configure script also has some logic on which
CMAKE_BUILD_TYPE / CMAKE_CONFIGURATION_TYPES to pass to CMake
depending on whether -debug / -release / -debug-and-release /
-force-debug-info were passed. But once the values are passed,
CMake will honor them.

Amends 48841c34d2
Amends 8c912cddeb

Pick-to: 6.7
Task-number: QTBUG-114958
Task-number: QTBUG-120436
Change-Id: I30db14d1e8e9ff9bd2d7ea1d2256cdeb9493ca0d
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2024-01-26 14:51:35 +01:00
Ievgenii Meshcheriakov 783c6c7f87 QUrl IDNA: Fix typo
Change-Id: I5188e00f515486ef27a38c1181490bcb7c4695ec
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-01-26 10:48:11 +01:00
Marc Mutz f5056a0b53 QHttpHeaders: Self-Encapsulate Field d->headers
Use QHttpHeaders::reserve() and QHttpHeaders::isEmpty() instead of
going directly to d->headers. Will help in enabling a nullptr d.

Pick-to: 6.7
Change-Id: Id530f8922b17058ec47530523ed43e08927c3ce3
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
2024-01-26 07:11:06 +01:00
Marc Mutz 119a6b5186 QHttpHeaders: add a missing detach()
Before calling a mutable member function (in this case,
QList::reserve()) on one of the Private members, we need to ensure
exclusive ownership of our external state, otherwise we have a Data
Race, because QList::reserve() is not thread-safe (only re-entrant).

Pick-to: 6.7
Change-Id: I1249de9449865cbf6ab519b0d38b3bf4e743f16d
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
2024-01-26 07:10:52 +01:00
Marc Mutz 55ee5481bc QHttpHeaders: move verify() into public class
Prepares for d == nullptr.

Pick-to: 6.7
Change-Id: Ie338f1635d64076d2d2b387fe0de8b3b1a8d0386
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
2024-01-26 07:10:34 +01:00
Wang Chuan 466f003865 rhi: d3d: Ensure dcomp content does not obscure child windows
According to the documentation for DirectComposition, there are four layers
associated with each window:

1. The contents drawn directly to the window handle (this is the bottommost layer).
2. An optional DirectComposition visual tree.
3. The contents of all child windows, if any.
4. Another optional DirectComposition visual tree (this is the topmost layer).

Creating an IDCompositionTarget as the topmost layer can cause the DirectComposition
content to cover all child windows. This results in child windows becoming invisible,
which is particularly problematic when a user embeds an external window into a
QML-created round rectangle window.

Fixes: QTBUG-121403
Change-Id: I6807ea578276a9518b57afea1c21ca89239deeaf
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2024-01-26 04:16:34 +00:00
Ahmad Samir ec849cd269 QAbstractFileEngine: remove forward declarations of non-existent classes
Amends 7bbe79fe5f, which dropped
QAbstractFileEngine from the public API.

Change-Id: I1877eb32a61c0457d2fa0d4dadf3a98cb78c78ef
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-01-26 06:16:33 +02:00
Ahmad Samir 5ae4e1a293 QFileInfo: de-duplicate docs wrt. fetching info of a symlink's target
Not the symlink itself.

Drive-by change: fix a typo, `treats` not `threats` :)

Pick-to: 6.7 6.6 6.5
Change-Id: Iac793cf80bdd17e6424e877de780fce0b28236bb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2024-01-26 05:14:20 +02:00
Orgad Shaneh 1026e2c98c Build: Use sh instead of ls for ELF configuration
On RHEL variants, if coreutils-single is installed, ls is a script
that contains:

#!/usr/bin/coreutils --coreutils-prog-shebang=ls

Replace ls with sh, which is supposed to be a binary (or a symlink
to one) everywhere.

Pick-to: 6.7 6.6
Change-Id: I2a43ac9e3332a470951bbf3335f2fdf3ae5c698c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-01-25 21:47:46 +00:00
Wladimir Leuschner f1d690ccff QWindows11Style: Disable Animations for inactive QRadioButton
Fixes: QTBUG-120264
Change-Id: I18b55b8e26a132b8e6dca2c669c7cec8c5f82e69
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2024-01-25 20:40:26 +01:00
Morten Sørvig 50a5744460 wasm: make EventCallback use addEventListener()
EventCallback would previously set the on<Event> property
on the event target, which is a singleton property where
there can be only one event handler.

This was OK if the event target was owned by Qt, for
example the canvas element, where we could guarantee
that there was only one event handler.

However this approach fell through when registering
event handlers for global event targets, such as for
window.onLanguageChange, where setting a singleton event
handler may conflict with other users.

Fix this by using the addEventListener() API instead,
which has a variant which takes an event listener object,
which gives us the ability to provide C++ context for
the listener. 

The C++ context in this case is a std::function that
contains the event handler callback. Attempts to pass
this type to JavaScript was met with some resistance
from Emscripten, so as a late night hack pass it as
a uintptr_t for now.

Change-Id: I1a547b49af467882ae4f57f8d909ffdff0be6b51

Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2024-01-25 18:37:49 +01:00
Mårten Nordheim ffe0271a21 Http2: fix 401 authentication required w/o challenge
The code did not handle the path where we didn't have a challenge.
We cannot recover from that so we just have to fail the request.

Amends fe1b668861

Pick-to: 6.7 6.6 6.6.2 6.5 6.2
Fixes: QTBUG-121515
Change-Id: Ie39a92e7439785a09cad28e8f81599a51de5e27f
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2024-01-25 18:37:48 +01:00
Ievgenii Meshcheriakov 1e7f1e5b73 Update Unicode data version string
This amends c4e550703c. The data version
update was just forgotten when updating to Unicode 15.0.

Pick-to: 6.5 6.6 6.7
Change-Id: Ibb3e9cb81e9bbcb5d4aaf4e4df6231485531c128
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2024-01-25 17:37:48 +00:00
Ahmad Samir 9fc8bd0096 QFileInfo: de-duplicate docs wrt. QResource paths
Pick-to: 6.7 6.6 6.5
Change-Id: I8a99a3aacc68bf43da21e1101c838154d06aef6e
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-01-25 19:37:48 +02:00
Axel Spoerl 4cd2baae9a QMessageBox: Move enum static assertions to cpp file
Move static assertions for StandardButton and ButtonRole enums from
header to cpp file.

Use qToUnderlying instead of casting and assert types where possible.

Amends 773f9ab018.

Found in API-Review.

Change-Id: Ia52886e6e33a3b94b327d17d1453e18febe6dd50
Found-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Task-number: QTBUG-119952
Pick-to: 6.7 6.6 6.5
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2024-01-25 17:37:48 +00:00
Marc Mutz 2502e5a2cb QTestLib: prepare QVERIFY_THROWS_EXCEPTION for FAILED_ACTION = throw
We can't have a QTEST_FAILED_ACTION in a try-block if we intend to
allow QTEST_FAILED_ACTION to be a throw statement.

We could, of course, add a whitelisting catch-block for the eventual
TestFailedException, but as of now, the intent it to give users full
control over the definition of QTEST_FAILED_ACTION, and they may have
their own idea of what to throw.

So add a bool variable to record whether no exception was thrown and
use it to drag QTEST_FAILED_ACTION out of the try block. It's ok to be
in catch blocks, no action needed there.

Change-Id: I0b004e43b1db82cd8b5b12f900ed985e58a56807
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2024-01-25 18:37:48 +01:00
Marc Mutz 8d88f1282b QMetaTypeModuleHelper: fix -Wweak-vtable
The only implemented virtual function, convert(), is inline, so the
vtable and type_info for this class were duplicated in QtGui,
QtWidgets, and any other library that may use this.

Fix by exporting the class and de-inlining convert(). The vtable is
now pinned to qmetatype.cpp.

To prevent MSVC from exporting the trivial static helper function and
possibly rendering its constexpr non-functional, make it a template.

We have two macros for this purpose, with different semantics: The
Q_WEAK_OVERLOAD macro is related to overload set management, not to
keeping function out of the ABI, even though it does that, too. And we
have QT_POST_CXX17_API_IN_EXPORTED_CLASS for ABI control, but this
function is not using post-C++17 features, so since both macros need a
comment, and both don't fit 100%, I used the shorter one.

Task-number: QTBUG-45582
Pick-to: 6.7
Change-Id: I2ce4a7110e09def1a595d717c073df844213611c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-01-25 17:37:48 +00:00
Thiago Macieira 6d1b4d5740 QFile::moveToTrash: add documentation about run time and fail conditions
All of the implementations will attempt to perform a filesystem rename,
so the runtime is constant for a single file and possibly for a
directory full of files too.

The macOS and Windows implementations use the OS API so they run with
slightly elevated privileges. That means they don't fail under normal
conditions. The XDG implementation will fail if the file or dir being
trashed resides on a volume which doesn't have an existing trash
location for the current user and one such cannot be created either, or
if the hardlinking/renaming fails (usually with EXDEV).

Pick-to: 6.6 6.7
Change-Id: I76ffba14ece04f24b43efffd17abd67e20196f2b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2024-01-25 09:37:48 -08:00
Volker Hilsheimer fcaf9a476f QChildWindowEvent: make constructor explicit
Found in header review.

Pick-to: 6.7
Task-number: QTBUG-119952
Change-Id: If98415f7c5115e8d1875f5f03e399b2919bb250b
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2024-01-25 18:37:47 +01:00
Tor Arne Vestbø 3f2a9523a4 qWaitForWindowFocused: Pass timeout as QDeadlineTimer
We should avoid int-based timeouts nowadays, and prefer std::chrono,
or for timeouts where Forever is a valid state, QDeadlineTimer.

Discovered during API header review.

Pick-to: 6.7
Change-Id: Ia56a67084c7a2f989951755fed5ffc161ed8f79e
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2024-01-25 18:37:47 +01:00
Alexandru Croitor 9932f2dd47 CMake: Warn about unsupported generator for all qt submodules
Previously we only warned about unsupported cmake generators when
configuring qtbase.
Now we do it for other submodules as well.

Pick-to: 6.7 6.6 6.5
Task-number: QTBUG-120602
Change-Id: I9d78db546bcf1238604362b248d41d4516b60b2a
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-01-25 17:57:56 +01:00
Eskil Abrahamsen Blomfeldt 11344f5723 windows: Avoid infinite recursion with certain fonts
Amends 922d195020.

Another infinite recursion was found in the case of populating
font families for cases where the typographical name is different
from the populated name.

The specific font triggering this had two "preferred name" entries
in its name data. This was one for Chinese (PRC) and another for
Chinese (Taiwan). Our GDI backend does not do matching based on
locale, but will prefer the English if available, otherwise it
will just pick the first one. The font in question does not have
the English preferred name.

For this particular font, we would select the Chinese (Taiwan)
name as preferred and since it had not been populated, we would
populate this. However, on Chinese (PRC) locale, Windows would
report this according to the Chinese (PRC) name. We would once
again translate this to Chinese (Taiwan) and go into an infinite
recursion populating it.

The quick fix is to mark the preferred family as populated before
entering the recursion, so that we do not re-populate it a second
time later.

Ideally, the font database would match the preferred name based
on locale, but since we are moving away from the GDI font database
and this is already handled better with the DirectWrite database,
just fixing the recursion is sufficient here.

[ChangeLog][Windows] Fixed an issue where an infinite recursion
could occur if the system had a font with multiple preferred names
in non-English languages.

Pick-to: 5.15 6.2 6.5 6.6 6.7
Fixes: QTBUG-118238
Change-Id: I6ded369f1c908e51c0ba2ad9127538faf07e192e
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
Reviewed-by: Liang Qi <liang.qi@qt.io>
2024-01-25 17:57:55 +01:00
Mårten Nordheim 1579f19cf7 Update Zlib to 1.3.1
[ChangeLog][Third-Party Code] zlib was updated to version 1.3.1.

Task-number: QTBUG-121325
Fixes: QTBUG-121444
Pick-to: 6.7 6.6.2 6.6 6.5 6.2 5.15
Change-Id: I0a72b7966916ccb825c7a8ae251e09b2914f0cf4
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
2024-01-25 14:05:23 +00:00
Edward Welbourne 8387141363 QWinTimeZonePrivate::availableTimeZoneIds(): cache result
This follows up on commit d59e539b3a,
doing the same for one of its callers. The mapping from windows IDs to
IANA ones is hard-coded (using CLDR-generated data), so the
(now unchanging) availableWindowsIds() list shall always map to the
same list of IANA IDs.

Pick-to: 6.7 6.6 6.5
Task-number: QTBUG-120682
Change-Id: I4d610c24110064236b375cab04cde90bbe07735f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2024-01-25 15:05:23 +01:00
Eskil Abrahamsen Blomfeldt 8be3c9f486 Fix clipped text when combining multiple writing systems
When a QTextLine consists of multiple different scripts and the
fonts had negative bearing, the background for a script item could
overdraw the previous item's text, causing it to look clipped.

This was because the background and text was drawn in a single pass,
and moving the background drawing into its own pre-pass fixes the
issue.

[ChangeLog][QtGui] Fixed an issue where drawing text from different
writing systems in the same line and including a background could
cause parts of the text to be clipped.

Pick-to: 6.5 6.6 6.7
Fixes: QTBUG-121040
Change-Id: I3f79e6d33c09a2a92853bc8752dbe11a0bea2dd0
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
2024-01-25 15:05:23 +01:00
Liang Qi 75d1db6aed tests: fix a crash in tst_QItemDelegate::reuseEditor() on Wayland
Pick-to: 6.7 6.6 6.5
Task-number: QTBUG-107153
Change-Id: Ic041302753bee4e2292b2afd898dd176966cf951
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-01-25 15:05:23 +01:00
Marcin Zdunek 1d4ab5c135 Remove qfunctions_vxworks files and usage as it is no longer needed
Task-number: QTBUG-115777
Change-Id: I0d803ac7ce067737b79a39a267a2b0eb509ae0b8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-01-25 12:21:41 +01:00
Marc Mutz 557275301e QTest: replace naked returns with QTEST_{FAIL,SKIP}_ACTION macros
... defaulting to "return".

This allows customizing these actions, incl. to eventually make them
throwing exceptions instead (but that won't work for
QVERIFY_THROWS_EXCEPTION, yet).

Change-Id: I078a4ce48135bda2cf98fce78318a12d757d7aa5
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2024-01-25 11:35:52 +01:00
Topi Reinio 711def1290 Doc: Qt Network: Fix references to renamed functions
As part of the API review process, in QNetworkRequestFactory:

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

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

Update references to the old names in the documentation.

Pick-to: 6.7
Change-Id: Ib79ae99de26be2f3af60787c8b86c3c20cb30067
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
2024-01-25 06:29:09 +00:00
Timur Pocheptsov 75a918d487 QCocoaA(11)y: do not try to access an element if rowIndex == -1
This ends up in out of bounds exception.

Pick-to: 6.7 6.6 6.5 6.6.2
Fixes: QTBUG-120469
Fixes: QTBUG-121008
Change-Id: Id895f311bbb59a3734ecadd0d2472a4018332e16
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-01-25 07:05:49 +01:00
Lena Biliaieva 15b0bd69ff Network: Use QHttpHeaders in QHttpHeaderParser
QHttpHeaderParser::headers() method is changed to return QHttpHeaders.
QAuthenticatorPrivate::parseHttpResponse() method is changed to work with QHttpHeaders.
QHttpNetworkHeader::header() method is updated to return QHttpHeaders.
Tests are updated.

Task-number: QTBUG-120133
Change-Id: I20a18b509acd7a8b8d93884cff8349519d64293e
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Øystein Heskestad <oystein.heskestad@qt.io>
2024-01-25 00:48:10 +00:00
Shawn Rutledge c29a235833 Update md4c to 0.5.1
Fixes: QTBUG-121442
Change-Id: Ifa4d6d25a9ea967c520f84397906b0af5cde1722
Pick-to: 6.2 6.5 6.6 6.6.2 6.7
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2024-01-24 14:02:48 -07:00
Shawn Rutledge 3bd4c1b670 Avoid detection of heading in tst_QTextMarkdownImporter::thematicBreaks
In md4c 0.4.8, three or more hyphens immediately after text were seen as
a thematic break:

some text
---

But in 0.5.1 it makes the text into an H2 heading (even though this
style of heading would normally have the text fully "underlined" with
hyphens). The CommonMark spec 0.30 says

  If a line of dashes that meets the above conditions for being a
  thematic break could also be interpreted as the underline of a setext
  heading, the interpretation as a setext heading takes precedence.
  Thus, for example, this is a setext heading, not a paragraph followed
  by a thematic break:

  https://spec.commonmark.org/0.30/#example-59

So the new behavior seems more correct. But rather than testing so
deeply, just disambiguate by adding a newline, since Qt may be expected
to work with various versions of md4c, and such minor behavior
differences are not expected to come up often in practice.

QTextMarkdownWriter already adds a newline when writing such markdown.

Pick-to: 6.2 6.5 6.6 6.6.2 6.7
Change-Id: I5a4bf8720d994616274eb8534b4d7085399130fc
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-01-24 14:02:33 -07:00
Christian Ehrlicher 212e88889a QSqlQuery: add Q_PROPERTY
Add Q_PROPERTY to follow the current Qt style and simplify the
documentation.

Task-number: QTBUG-120566
Change-Id: I3803f5246c1814d627a16fa2569d1342b54f6adf
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
2024-01-24 21:35:09 +01:00
Christian Ehrlicher e752c77b35 QObject: Let moveToThread return succcess state
Add bool QObjectPrivate::moveToThread() which returns the success state
of the attempt to move the object to the new thread. For Qt7 the public
signature of QObject::moveToThread() should be changed to directly
return this value.

[ChangeLog][QtCore][QObject] QObject::moveToThread() now returns a
boolean success state.

Pick-to: 6.7
Change-Id: I8441c8155a76b804b473ab9c45c2be6840ef1677
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2024-01-24 21:35:09 +01:00
Christian Ehrlicher 294da15696 QSqlIndex: add Q_PROPERTY
Add Q_PROPERTY to follow the current Qt style and simplify the
documentation.

Task-number: QTBUG-120566
Change-Id: Iaf844eb6f60427dab7fba6ac20b16ffa11f217b8
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
2024-01-24 20:35:09 +00:00