Commit Graph

66104 Commits (210f2004dffae149c857d8d79d51eb996643ad4a)

Author SHA1 Message Date
Eirik Aavitsland 210f2004df Update bundled libpng to version 1.6.43
[ChangeLog][Third-Party Code] libpng was updated to version 1.6.43

Pick-to: 6.7 6.6 6.5 6.2 5.15
Fixes: QTBUG-122989
Change-Id: Id439e64010bc3f6752f5589d663827a91f009173
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2024-03-06 23:40:12 +01:00
Thiago Macieira c0ac143114 Doc: fix warning "class Qt::TimerId' specified with '\enum'"
Amends 4bc0834bc1.

Change-Id: I6818d78a57394e37857bfffd17ba0f3897b2a5f5
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2024-03-06 05:42:21 -08:00
Volker Hilsheimer 10afa38aa4 JNI: Fix error with overload resolution when passing string types
The variadic templates are supposed to be removed from the
overload set when any of the parameters is a literal string type,
as otherwise we get conflicts with the legacy overload taking
class names and signatures as const char *. The detection of
a literal string types was missing a few specializations, so that
we ended up with the wrong overload being called, and class
names getting interpreted as method names instead.

Add the missing specializations, and add more test coverage
for using the old overloads.

Task-number: QTBUG-122235
Pick-to: 6.7
Change-Id: I5488f2009c8f62d74fac6754844f57cf64011414
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Lauri Pohjanheimo <lauri.pohjanheimo@qt.io>
2024-03-06 13:00:19 +00:00
Rym Bouabid 8103d29e94 QUrl: Use new comparison helper macros
The class had operator==(), operator!=() and operator <() defined as
public member functions, so use QT_CORE_REMOVED_SINCE and
removed_api.cpp to get rid of these methods and replace them with hidden
friends.

Use QT_TEST_ALL_EQUALITY_OPS macro in unit-tests.

Use new \compares command in the documentation to describe the
comparison operators provided by QUrl.

Task-number: QTBUG-120303
Change-Id: Ic4fa2335292cc4b75ad2373832c0b89d768f529c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-03-06 11:09:21 +01:00
Thiago Macieira 907e9a8b29 Move qAbort from qglobal.cpp to qassert.cpp
It makes more sense there, as all the other functions in that file are
about early termination. This allows us to remove qglobal.cpp from the
bootstrap library, because qglobal.cpp now only has the callback tables.

Amends 8f13af5d7b.

Change-Id: I01ec3c774d9943adb903fffd17b7ea92404bdbd3
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2024-03-06 02:09:16 -08:00
Thiago Macieira 1560e0161a QtPrivate::equalStrings(): enforce matching size where applicable
Commit 8a7b74f6e7 added these functions
and already placed the checking for the size in the inline code. Aside
from the operators==, the only other place that calls equalStrings()
directly is QAnyStringView::equal() and that also checks the size for
the non-UTF-8 string views do match. Unfortunately, the size checking
for UTF-8 was only added in 52e0a91fbc.

This reverts commit e0eb93d9a2
("QLatin1StringView: delegate operator== to QByteArrayView") because
that would compare the sizes again.

Change-Id: I83dda2d36c904517b3c0fffd17b38e422b5e2c25
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2024-03-06 02:09:16 -08:00
Thiago Macieira a6a5681470 QLibrary: remove the unnecessary parentheses around dlerror()
We don't need a message like:

"Cannot load library nosuchlib: (nosuchlib: cannot open shared object file: No such file or directory)"

Pick-to: 6.7
Change-Id: I01ec3c774d9943adb903fffd17b76599cea47502
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2024-03-06 04:09:16 -06:00
Thiago Macieira 24245d2a85 tst_toolsupport: make the i386 case really about i386
Specifically, don't use it for either of the x86-64 ABIs (LP64 and
ILP32). The generic case below should work for everyone.

Fixes: QTBUG-122720
Pick-to: 6.7
Change-Id: I01ec3c774d9943adb903fffd17b75fc79095e089
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2024-03-06 11:09:16 +01:00
Marc Mutz ff7e5987ec Revert "QStringView: simplify the constructor from QString"
This reverts commit 7d18ad49a3.

Reason for revert: This changes the constructor from being a template
to being a normal function, so changes overload resolution. The commit
message gave no indication on why this is safe. Since it's just a nice
to have, revert instead of running the risk of breaking code.

Pick-to: 6.7
Change-Id: Icd506e7221bb50c99f276f6a43c15403ec0be7a9
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2024-03-06 11:09:16 +01:00
Giuseppe D'Angelo 7f7b5ff3a1 QSpan: add construction from initializer_list
P2447 has been merged in C++26, backport the same functionality.

This makes QSpan<const T> a proper replacement for a const QList<T>&
parameter, because now both can be built via a braced-init-list.

  // void f(const QList<int> &l); // old
  void f(QSpan<const int>);       // new

  f({1, 2, 3});                   // now OK

This is, technically speaking, SiC: in the presence of both `f`
overloads, the code above would have called the QList one. Now instead
the call is ambiguous.

We've been there already -- this is QString and QStringView all over
again, and the solution is the same: get rid of the owning container
overload. I'd rather have this construction *sooner* rather than *later*
in order to minimize the fallout.

And just like QString vs QStringView, there's nothing really doable to
prevent instant-dangling situations:

  QStringView v = getString();    // dangles
  QSpan<const int> s = {1, 2, 3}; // ditto

except for using QSpan (QStringView) as a *parameter type only*.

Note that QSpan with dynamic extent was already convertible from
std::initializer_list through its ranged constructor. However this fact
alone doesn't unlock the above syntax. QSpan with a static extent was
also convertible for the same reason. (This is non-standard:
std::span's range constructor for static extents is explicit, but QSpan
doesn't follow that design choice and makes the constructors implicit
instead.)

Found in API-review.

Pick-to: 6.7
Change-Id: I160ab5b292b0c2568cd9a7ad1b4430085f475c29
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2024-03-06 08:44:46 +00:00
Juha Vuolle a83248dd9f Add include for QT_CONFIG
To not rely on transitive includes.

Pick-to: 6.7
Change-Id: I116483f94bba4a6edb0a78941da676b1a3e6e1bd
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2024-03-06 06:41:11 +02:00
Juha Vuolle 033b52c0ad Add QT_CONFIG(signaling_NaN) around the signaling_NaN limit function
Amends: 398a51686e

Found in API-review.

Pick-to: 6.7
Change-Id: Ia9be5bc5bdcf7aa2960e9c88f961bf8168435a70
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2024-03-06 06:41:07 +02:00
Shawn Rutledge d14eec536d QTextMarkdownImporter::import(): don't crash if file has only yaml
If a markdown file has FrontMatter, we look for the end of the newlines
after the `---` marker to begin parsing the actual markdown. But check
bounds in case the file contains only front matter and not markdown.

Fixes: QTBUG-122982
Change-Id: I09c4ae90c47ebd84877738aecc1d1cad0b0bfca2
Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-03-05 16:12:33 -07:00
Shawn Rutledge 81f174d796 Add categorized log message in QTextMarkdownWriter::writeFrontMatter()
There is logging in QTextMarkdownImporter::import(); in case something
goes wrong, it's useful to compare the size during reading and writing.
Amends bffddc6a99

Task-number: QTBUG-120722
Change-Id: I5f60305ca84d48f91bbb18e9c10ea4010005b356
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-03-05 16:12:23 -07:00
Nodir Temirkhodjaev 1e836fff18 QFutureInterface: Rename "interface" variables to "iface"
On Windows the "interface" is defined as "struct".
Do not #undef it to fix a unity build.

Task-number:  QTBUG-122980
Pick-to: 6.7
Change-Id: I9379c996d8b67b16a8b825af0ff3469111533291
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-03-05 19:58:15 +03:00
David Redondo 986de654b8 Map drag event positions to global during dock/toolbar drag
Drag event positions are window relatives, QMainWindowLayout::hover
expects global coordinates however.

Fixes: QTBUG-122949
Pick-to: 6.7 6.6
Change-Id: I28469ba1b5ef88661e744d4cf87f6acab3eb2c72
Reviewed-by: David Edmundson <davidedmundson@kde.org>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-03-05 17:58:15 +01:00
David Redondo d7fe948fdb Handle drag leave when performing platform drag of docks or toolbars
The existing widget machinery works through mouse positions. In order to
correctly update state  when a drag moves outside of a window it needs
to see a move outside of the window. When the platform drag leaves the
window a move to the outside of the window is now faked to not keep the
layout in the hovered state of the last move event.

Fixes: QTBUG-122944
Pick-to: 6.7 6.6
Change-Id: I348f5281a200b78e6be4f11b3c25339d052783a5
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-03-05 16:58:14 +00:00
Even Oscar Andersen d8a6a9bfcb wasm: Make sure we can add screen after releaseRequestUpdateHold has been called
Before this fix, such screens would not render due to requestUpdateHold
is initialized to true and never reset.
 The fix is to change the requestUpdateHold member to be a static
variable, so that it can be read by screens added after
requestUpdateHold has been called.

Also, add a test that would fail without this fix

Change-Id: Idf2ac916766a03480272cd550f9d1ab7fc5c5158
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2024-03-05 17:58:14 +01:00
Marc Mutz e06c67d448 Revert "Fix export of QDeferredDeleteEvent, should be Q_CORE_EXPORT"
This reverts commit bc3b18764a.

Reason for revert: QDeferredDeleteEvent changed the size in 6.7. It is
more important to protect the casual user that relied on the mention of
the otherwise undocumented class in the QEvent::Type::DeferredDelete
documentation than to be convenient for one tool, developed by experts
who know how to replace their dynamic_cast with a type() check and a
static_cast and/or extract information from an unexported class.

In fact, not even the autotest-export is needed, as there are no
mentions of the class outside of comments outside QtCore. 

Found in API-review.

[ChangeLog][QtCore][QDeferredDeleteEvent] Made this undocumented class
private and unexported. You will still be able to see the definition in
qcoreevent_p.h, but you won't be able to create objects of the class
anymore.

Change-Id: I8a47c69d356a0bef260e7987bc4eab96430e8072
Pick-to: 6.7
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-03-05 15:14:51 +00:00
Øystein Heskestad 18620ef85f QLocalServer: add protected addPendingConnection function
Add addPendingConnection for subclasses to add socket to queue
of incoming connection for use with newConnection,
hasPendingConnection, and nextPendingConnection.

Task-number: QTBUG-75081
Change-Id: Id242a0c3573ee511b403d18af25864add9a3b684
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-03-05 14:43:29 +00:00
Laszlo Agocs 818f8de64a drm: Fix having more than window over the screen's lifetime
...when not using atomic.

On the non-atmic path the fb is passed in to drmModeSetCrtc.
Here we need a new call to it if a new QWindow gets created
after the previous one is destroyed. Previously this was
not done, so it ended up with Device busy errors. Atomic
does not need this since there the flip commit always
contains framebufferPropertyId.

Change-Id: Ie68152cad50438807ef45adfba65e74c8f30c956
Fixes: QTBUG-122663
Pick-to: 6.7 6.6 6.5
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2024-03-05 15:43:29 +01:00
Laszlo Agocs 0a3b5042a5 drm: atomic: Avoid device busy when flipping after creating a new window
Task-number: QTBUG-122663
Change-Id: I168930428e8d09a9a042401460d678e20f3b82d5
Pick-to: 6.7 6.6 6.5
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2024-03-05 15:43:29 +01:00
Timothée Keller 82e8f9e457 Windows QPA: Include custom margins in atypical margins
When calculating atypical margins that are used with
ExtendsContentIntoTitleBar, the margins were checked against
systemmargins, and then custom margins were added later. Instead, add
the custom margins immediately and take them into account during
calculations.

Pick-to: 6.7 6.6 6.5
Change-Id: I44af663c85b8bdf080d769e3b38431cbe5df64f3
Reviewed-by: David Faure <david.faure@kdab.com>
2024-03-05 15:43:29 +01:00
Wladimir Leuschner c785d56ae0 QWindows11Style: Draw frames HighDPI aware
Draw frames and lines on sub-pixel coordinates to be HighDPI aware.

Pick-to: 6.7
Change-Id: Ie4eed73b3e5780216fad0b6a919cbe18391f2b79
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-03-05 15:43:29 +01:00
Axel Spoerl 46502f9705 Revert "QAndroidPlatformInputContext: send composition text and cursor jointly"
This reverts commit be3b9b2ab1.

Reason for revert: Caused QTBUG-121561

Fixes: QTBUG-121561
Pick-to: 6.7 6.6 6.5 6.2
Change-Id: I4b59d97ede6c50d2575a7d7cebbe2291983dd19f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2024-03-05 14:29:20 +00:00
Allan Sandfeld Jensen e9f5bb7cbe Improve QColorTrc::isLinear and rename it isIdentity
Pick-to: 6.7
Change-Id: Id697fa3844610606c202e3fa717d631a3621e774
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2024-03-05 15:29:20 +01:00
Morten Sørvig cee8a11d73 wasm: remove DISABLE_EXCEPTION_CATCHING workaround
Qt no longer sets DISABLE_EXCEPTION_CATCHING and can
use the common logic here.

Task-number: QTBUG-121822
Change-Id: If02feafe9eeac49fa2861d2357b358a19e756438
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2024-03-05 14:29:20 +00:00
Lucie Gérard 8741e4a60c Correct license for files
According to QUIP-18 [1], all tests file should be
LicenseRef-Qt-Commercial OR GPL-3.0-only

[1]: https://contribute.qt-project.org/quips/18

Task-number: QTBUG-121787
Change-Id: Iee9f4fca676e77ab9d8ed485a28ce5ea8803be15
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
2024-03-05 14:39:33 +01:00
Lucie Gérard bf1e76408e Change license for .in files
According to QUIP-18 [1], all build system files
should be BSD-3-Clause.
The files in this patch are part of the build system.

[1]: https://contribute.qt-project.org/quips/18

Pick-to: 6.7
Task-number: QTBUG-121787
Change-Id: Ibc6a60a9b009fab0c953e8e3269533c121e4511e
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
2024-03-05 12:59:21 +01:00
Alexandru Croitor aacc31815d CMake: Fix assignment in internal_get_build_vars_for_external_projects
The check and variable name were incorrect after a refactoring.

Amends ba96238600

Pick-to: 6.6 6.7
Task-number: QTBUG-84884
Task-number: QTBUG-90820
Change-Id: I33b6b81695a6352c7869ef6186e00881b47bd6f3
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2024-03-05 12:59:21 +01:00
Alexandru Croitor 375f386930 CMake: Don't add default rpaths to qt qml plugins when requested
qt_add_qml_plugin has code to set a sensible install rpath for user
project qml plugins.

If Qt was configured without rpath support, we should not add any
rpaths to qt qml plugins:
- qt-computed rpaths added by qt_apply_rpaths
- user-project rpaths added by qt_add_qml_plugin

This is done by setting QT_NO_QML_PLUGIN_RPATH to TRUE as part of
QtSetup, effectively applying the option to any qml plugin that is
built by internal qt api.

User projects will still be able to use the default rpaths added
by qt_add_qml_plugin, even if qt itself was configured with no rpath
support.

Pick-to: 6.7
Fixes: QTBUG-122687
Change-Id: I8178b527553dd00436d0abb3b44061ea16edc121
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2024-03-05 12:59:21 +01:00
Joerg Bornemann 110f656da9 configure: Translate only boolean options to features
This amends commit be009c6857.

The configure option -no-opengl was mistakenly translated to the CMake
argument -DFEATURE_opengl=no. The command line option "opengl" however
is defined as
    qt_commandline_option(opengl
        TYPE optionalString
        VALUES no yes desktop es2 dynamic
    )
which is not boolean. And only boolean command-line options may
automagically control features of the same name. It just happens that
the values "no" and "yes" look boolean.

Setting FEATURE_opengl instead of INPUT_opengl broke feature conditions
that check the INPUT_opengl value.

Fix this by checking the type of the corresponding command line option
instead of guessing the type from the INPUT_* value.

An option (e.g. force-asserts) can be diverted to a differently named
input (e.g. force_asserts) with the NAME argument of
qt_commandline_option. In this case, we cannot deduce the option name
from the input's name. To handle this, we store the input's type in
commandline_input_${name}_type and read it when translating feature
values.

Fixes: QTBUG-122914
Change-Id: Ibb4b0633b6635bd2ef6f26ed8f4b19d239bf5854
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2024-03-05 12:59:21 +01:00
Alexandru Croitor c88b86fcc4 CMake: Document -init-submodules option of the super configure script
And mention the init-repository --help section for additional options
that can be passed to adjust the cloning process.

This should only be merged after the qt5.git change is merged.

Task-number: QTBUG-120030
Change-Id: I16c36f8d5d5d75521ca3f4a476dd921537f9db9c
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-03-05 12:59:21 +01:00
Lucie Gérard 7b6289a035 Correct license for tools files
According to QUIP-18 [1], all tools file should be
LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0

[1]: https://contribute.qt-project.org/quips/18

Pick-to: 6.7
Task-number: QTBUG-121787
Change-Id: Icd5d5be2e04819617e68ff142924de1773bebbad
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
2024-03-05 12:59:21 +01:00
Joerg Bornemann 073185ad2e configure.bat: Fix errors on Windows
Since the last change to configure.bat we got two of these errors,
regardless of the arguments passed to configure:
    The system cannot find the drive specified.

This is due to the quirky semantics of the :: commenting style that's
used within an if block. Lines starting with :: might be interpreted as
starting with a drive letter.

Switch to rem for comments to avoid such behavior.

Note that we have to quote the comments, because
    rem https://www.example.com/?foo=bar
will split the command at the equal sign and complain about
'unexpected bar'.

Mind-boggling trivia:
    rem https://www.example.com/?something_without_equal
will display the help text for the REM built-in, because /? is somewhere
in the string.

Change-Id: I2ffcc6bd4312d24bdde2b7f1e336f827f503e491
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2024-03-05 11:56:24 +01:00
Lucie Gérard 4775876511 Correct license for test file
According to QUIP-18 [1], all test files should be
LicenseRef-Qt-Commercial OR GPL-3.0-only

[1]: https://contribute.qt-project.org/quips/18

Pick-to: 6.7
Task-number: QTBUG-121787
Change-Id: If06da73cecbbf718338d1b785b5eca36ac819ccb
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
2024-03-05 11:56:24 +01:00
Samuli Piippo 762c56d65b CMake: add options to not generate target wrappers
The target wrappers for qmake and qtpaths do not work on Yocto
builds and only create confusion when they are available in target.
Add option to disable their generation.

Pick-to: 6.7
Task-number: QTBUG-122420
Change-Id: Ibb829cc846ad6c470fe29e746ade42fccaa33a6f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2024-03-05 12:30:15 +02:00
Juha Vuolle b370e1b7f1 DRY QHttpHeaders::value() implementation
Pick-to: 6.7
Task-number: QTBUG-122020
Change-Id: I403d376734587d721d27f7093b3774068829a46d
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-03-05 08:10:20 +02:00
Juha Vuolle 9c0a79d323 DRY QHttpHeaders::values() implementation
Pick-to: 6.7
Task-number: QTBUG-122020
Change-Id: I7401eef86b133d33f32cd786dffe9a06c4ac7aba
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-03-05 08:10:17 +02:00
Juha Vuolle de37316160 DRY QHttpHeaders::combinedValue() implementation
Pick-to: 6.7
Task-number: QTBUG-122020
Change-Id: I6232ea725d47800a9236ed90b70004a915bc8b65
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-03-05 08:10:14 +02:00
Juha Vuolle c0e4b73743 QHttpHeaders: remove unused Header::operator==()
The QHttpHeaders comparison was dropped earlier, and the current code
no longer needs to compare both header entry 'name' and 'value'.

Pick-to: 6.7
Change-Id: I57a3003f0fd1d8ff867c970d5ec8a994a167ae88
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2024-03-05 08:10:11 +02:00
Juha Vuolle 9e26a8c082 Document QHttpHeaders::WellKnownHeaders as the recommended overloads
... from a performance point of view.

Pick-to: 6.7
Task-number: QTBUG-122020
Change-Id: I8a1558a46e74d740e330ad483454267f9922a5d5
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-03-05 08:10:09 +02:00
Juha Vuolle 0c05d2b43e Make HTTP header name a variant / union for performance
This saves memory and can speed up performance with
well-known headers.

The change consists of:
- Change the internal type of 'name' to a std::variant
  capable of holding either WellKnownHeader-enum, or a QBA.
- Accordingly, add an equality operator.
- When headers are added (append, insert, replace) then
  use WellKnownHeader as storage type when possible;
  either use the function parameter directly if a WellKnownHeader
  overload was used, or check if the provided string can
  be converted to a WellKnownHeader.
- Convert other functions to use a more performant
  lookup/comparisons.

Pick-to: 6.7
Fixes: QTBUG-122020
Change-Id: If2452f6edc497547246fb4ddbace384e39c26c5e
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-03-05 08:10:05 +02:00
Juha Vuolle d3860b1b73 Move few QHttpHeaders helper functions on top
As a prequel to make subsequent diff on the followup
commit (std::variant/union) smaller

Pick-to: 6.7
Task-number: QTBUG-122020
Change-Id: Iaa5dd794dc7a9e33c2c43e459bf5dbd19afb3ba1
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-03-05 08:10:02 +02:00
Juha Vuolle dd3af7e4e2 Add sorted lookup table for QHttpHeaders name fields
This allows a more performant (O(logN)) lookup for WellKnownHeader
enum (followup commit).

The lookup table is currently crafted manually. It may in future be
generated at compile-time, but this should only be done if new headers
are appended often; we don't want to unnecessarily bloat compilation
time either.

Pick-to: 6.7
Task-number: QTBUG-122020
Change-Id: I0329902b13128f03c358796d5cda7014b1e75057
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2024-03-05 08:09:59 +02:00
JiDe Zhang 8596998cb0 Add QT_IM_MODULES env to allows specify multi IM key
Like as QT_QPA_PLATFORM, supports specifying multiple keys, and can
perform fallback operations to prioritize the use of a certain plug-in.
This is useful when using Wayland and XWayland applications at the same
time. For an example, we can set "QT_IM_MODULES=wayland;fcitx", and the
wayland application will use the wayland input context plugin, the
xwayland application will use fcitx, which can't be done without adding
a new environment variable, if we specify "QT_IM_MODULE=wayland", the
XWayland applications may not be able to use the input method.

Fixes: QTBUG-120202
Change-Id: Iac408af241963147747a2fe685f1e27bf9d9ee64
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: David Edmundson <davidedmundson@kde.org>
2024-03-05 12:26:10 +08:00
Shawn Rutledge ca4774131b QTextMarkdownWriter: escape special characters (line or word prefix)
Try to avoid writing anything that the parser would misinterpret.
Escape pre-existing backslashes, but not those that are already escaped.
Optimize maybeEscapeFirstChar() slightly and apply it to every line
of output (except in code blocks), not only to new lines created by
word-wrapping.

Since it would be hard to do this without using regular expressions,
the markdown writer feature now depends on the regex feature.

Fixes: QTBUG-96051
Fixes: QTBUG-122083
Pick-to: 6.7
Change-Id: I8d95366501fd31441829081c668f11a3a3a23fe2
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2024-03-04 21:03:51 -07:00
Thiago Macieira 5670d5f7e1 Remove unnecessary #undef about q{Debug,Info,Warning,Critical,Fatal}
The ones in qlogging.cpp were copied to it from qglobal.cpp in commit
23688d8942. They existed in qglobal.cpp
like in qdebug.cpp since the beginning of the public history. The one in
qdebug.cpp already made no sense in Qt 4 times, because qdebug.cpp was a
documentation-only source (no actual C++ code).

The #undefs from qglobal.cpp hadn't been necessary since commit
d394ca7f27, the global functions qDebug(),
qWarning(), qCritical(), etc. were replaced by member functions in
QMessageLogger whose names did not match the macros.

Pick-to: 6.7
Change-Id: I50e2158aeade4256ad1dfffd17b1c62f23eca4db
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2024-03-04 17:12:54 -08:00
Thiago Macieira a6b4ff16b9 Replace some QString::fromUtf16() with QStringView::toString()
The QStringView counterpart is somewhat faster because it doesn't go
through the UTF-16 codec in QUtf16::convertToUnicode(), which tries to
detect the BOM.

I've included QString::fromWCharArray in this because:
a) it's used extensively in Windows code
b) wide chars in memory probably don't have BOMs anyway

Change-Id: I01ec3c774d9943adb903fffd17b815be4d2ab8ba
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2024-03-04 11:31:48 -08:00
Thiago Macieira a14bba6803 Move QLocaleData::convertDoubleToFloat to qnumeric_p.h
So others can use it too.

Change-Id: I01ec3c774d9943adb903fffd17b86236d06a948c
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2024-03-04 11:31:48 -08:00