65539 Commits

Author SHA1 Message Date
Joerg Bornemann
564e3ed628 CMake: Warn if DEPLOY_TOOL_OPTIONS is used on Linux
...or rather when it's used with the generic deployment tool.

Task-number: QTBUG-121708
Change-Id: I161564923a43c82150f581874ba20a9ad6de310f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit e39d13bc873a651007d45b23e1d87a676224cba2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-01 03:24:54 +00:00
Marc Mutz
ce5b1750fd update_public_suffix_list.sh: print suggested topic:
This was in the 6.2 and 5.15 versions of the script, but not in dev,
6.7, 6.6, 6.5, and so was promptly forgotten.

Pick-to: 6.6 6.5
Change-Id: Ic0a1708a29eccd7efe41aa4670ea55f1edb6be0b
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 324fe120ba405f0eeca0b1a00cc5aee0ea99f76f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-01 03:24:51 +00:00
Marc Mutz
d61a333705 QBitArray: fix potential truncation in QDataStream op>>()
In Qt 5, a QBitArray could not contain more than INT_MAX bits, because
the then-size_type, int, cannot represent more, even if the underlying
storage could hold 8x as much, and the serialisation format, using
unsigned int, could represent 2x.

Therefore, reject old formats with sizes that exceed INT_MAX elements
as corrupt.

Likewise, the Qt 6 serialisation format unconditionally uses 64-bit
sizes, but 32-bit platforms still cannot represent more than
numeric_limits<qsizetype>::max() (= INT_MAX) bits in memory. This is a
valid stream for 64-bit platforms, though, so ideally, this should be
using SizeLimitsExeeded, which, however, is only available from Qt
6.7. So, for now, and until we have SizeLimitsExeeded, mark the stream
as corrupt here, too.

[ChangeLog][QtCore][QBitArray] Fixed undetected overflows in the
deserialisation (opertor>>()) from QDataStream.

Pick-to: 6.6 6.5 6.2 5.15
Change-Id: Ib24cf9218c06a3a05185723c77d4313611c2dd40
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 0808beace332631f8100b5700577f10f63e4630c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-01 03:24:48 +00:00
Tinja Paavoseppä
c86002f7ab Android: Set up style also when using QtEmbeddedLoader
Embedded loader was missing style set up, leading to a crash
when platform theme style data was loaded. As a drive by, change
the style set up to use Context instead of Activity, since it doesn't
require Activity.

Fixes: QTBUG-119532
Change-Id: I434233e173cc2c90d981bbf2aa0044117a20b17f
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit bd5ae42cf86857fa08c2607eb8c9e434317374f6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-01 03:24:45 +00:00
Tor Arne Vestbø
f57539d4f5 Add QWidgetPrivate::isExplicitlyHidden() helper function
To aid readability.

Task-number: QTBUG-121398
Change-Id: I3cb231584c2b7aee72e9f01c669fed1e01fbe475
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 4634fbf34e1674846e1666bcdb3055f82e3096b0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-01 03:24:42 +00:00
Eirik Aavitsland
03bf71b7ff Update bundled libpng to version 1.6.41
[ChangeLog][Third-Party Code] libpng was updated to version 1.6.41

Pick-to: 6.6 6.6.2 6.5 6.2 5.15
Change-Id: I3285bfa11f61c571ffda1b365011a5c6a798ca68
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit 528032c02771ddc35d054ff8d414b382904b607e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-01 03:24:39 +00:00
Volker Hilsheimer
5e04fb478a JNI: fix declaration of ElementType in QJniArray::makeObjectArray
List might be a reference type, in which case it won't have any members.

Change-Id: Iac2c08c42f31ebc67b31be157f73ae318d328a18
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit ddc67dcc5a270a3739514c23b88ed8612f0ae1f0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-01 03:24:37 +00:00
Volker Hilsheimer
53497c0a01 JNI: pass POD parameters by value
All calls to the fromVarArg() conversion helper are made with JNI types
from a va_arg list, so they have to be either primitive types, or a pointer
(jobject, which internally is a _jobject *). There's no benefit from
moving those or passing them by reference; the most efficient convention
is to pass them by value.

Change-Id: I6fed9b202be3c6a265117684fecd51d03ccbb534
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 43f66e619176e4903aa62a30dc5ae2122e22f13a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-01 03:24:34 +00:00
Volker Hilsheimer
db5e112419 JNI: simplify implementation of native function wrappers
When declaring native callback functions with the JNI type system, then
we actually register a helper function with variadic arguments, and
implement that to forward the arguments to the declared function, which
then might use higher-level types as arguments. We deduce those
higher-level types through a variadic template, and use std::tuple as
well as std::apply to generate the calls.

Simplify the implementation by using std::make_tuple, and replace
q20:remove_cvref_t with std::decay_t; this is what std::make_tuple uses,
and we don't need to maintain functions and arrays as such.

Found during 6.7 header review.

Task-number: QTBUG-119952
Change-Id: I7cd206c6b372c2ec62a10feb5f9253f5607f01a9
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 76cf922980cf0cde7cb03f4bec8f17eab94a5767)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-01 03:24:30 +00:00
Volker Hilsheimer
e20f2a6c8b Stabilize tst_QFileSystemModel::showFilesOnly test case
Amends 83e5d74864a8780445db4b34e406afc53b331039.

A model index returned by QFileSystemModel might become invalid when
events get processed, so don't store the result of setRootPath to re-use
it in a QTRY_COMPARE function. Instead, always ask for a fresh model
index.

Also, use std::chrono::duration::count correctly; it returns the "tick",
not the corresponding milliseconds, so (10s).count() returns 10 instead
of 10000. Explicitly use 10000ms here.

Un-blacklist the test on macOS again.

Task-number: QTBUG-74471
Pick-to: 6.6 6.5
Change-Id: Ic98bb53c696441131bbc1055b64822faf2aec96f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 72f5b35b3d7704db6ef16e4c60751ed8444363be)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-01 03:24:27 +00:00
Joerg Bornemann
108990dc13 qt6_deploy_translations: Don't deploy the "qt" meta-catalog
The "qt" meta-catalog is some relic from the past that pulls in the
translations for qtbase and qtmultimedia. The qtbase translations are
deployed by default, and the qtmultimedia translations are deployed if
qtmultimedia is used by the project.

Change-Id: I53e5920d39f87162c418fb3f4cff7927ec9b5488
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 62bea90207b6fde116ef6fbb926565b648708d57)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-01 03:24:24 +00:00
Joerg Bornemann
b09c637c49 Doc: Add table for *_DIR parameters of qt_deploy_runtime_dependencies
The tables allows us to show how the parameters correspond to variables,
and it gives us the ability to add notes.

Add the note that LIBEXEC_DIR is available since 6.7.

Task-number: QTBUG-121708
Change-Id: I9421bdc692b0df45dc356c17fb90da8799d18ef9
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 313b7c56bd4f2053483c1addea89d8e293bc433b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-01 03:24:20 +00:00
Joerg Bornemann
01a0b81998 Doc: Address qt_generate_deploy_app_script issues from API review
Task-number: QTBUG-121708
Change-Id: Id0beb7c3045513e1665bd4062f7236243898b7c1
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 5d1ddee4cc38f684ed635a2b917c61db80a27ff6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-01 03:24:16 +00:00
Joerg Bornemann
cbfc5a0a95 Doc: Add note to deployment variables
...that mentions that they're only needed for advanced use cases that
aren't covered by the higher level deployment commands.

Task-number: 121708
Change-Id: Id31aece7ae7685ea5f4940e6c4adf62ae8216528
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 609a9bc93967403726d0139bbf63162cb61d3fa2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-01 03:24:13 +00:00
Joerg Bornemann
7ffe548334 Doc: Address qt_deploy_runtime_dependencies issues from API review
Task-number: QTBUG-121708
Change-Id: I8b7b3a7d03ab757f3cb6e55f27f0e4ba0e4a5bbd
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 1902f98a9d02d576d38059081a395d9cf6a342af)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-01 03:24:10 +00:00
Edward Welbourne
e0746c52bd QDate(Time)?::toString(): eliminate QCalendar() defaults
Since QCalendar is non-trivial, parameters of this type should not
have a default in the declaration; better to have an overload set with
the calendar-less overload out-of-line passing the default.

This actually restores signatures that existed previously, but that
were merged with the QCalendar-taking overloads at Qt 6.

Fixes: QTBUG-121528
Change-Id: Ib10ced67a2398108a31c7e95d5e865b7959bed4d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 534e836b69b2f8c5f779b66b05c01bb00b9233f1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-01 03:24:07 +00:00
Joerg Bornemann
101846afa9 Doc: Address QT_DEPLOY_LIBEXEC_DIR issues from API review
Task-number: QTBUG-121708
Change-Id: I25a05fc26e9950a8b84770347dbcea1912832990
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit b8a78054cf540f082766b1a4d76e42426c1edff9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-01 03:24:05 +00:00
Simo Fält
0869134212 COIN: Enable setting Debian target distro with env variable
Change-Id: I8cc0e9127ee7dd1e810812688ad32e759510cbe9
Reviewed-by: Toni Saario <toni.saario@qt.io>
(cherry picked from commit d4568bcfdbf17866436eae8d96ceb7ae035ecf5d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-31 11:36:58 +00:00
Ghenady Kuznetsov
3154bf2a7b Fusion style: add indent to groupbox title
Add indent to the title if groupbox alignment is set to Qt::AlignLeft |
Qt::AlignVCenter.

Fixes: QTBUG-121049
Pick-to: 6.6
Change-Id: I25e2fe4e73b920baf4c678b6b0e758d1da7cf632
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit 4725bbb3ee41ced9f97d42d73505b2513ff9c576)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-31 11:36:57 +00:00
Marc Mutz
1c1ce73699 Bootstrap: remove QBitArray
It appears to be used only in qlalr, which is, however, not
bootstrapped.

Pick-to: 6.6 6.5 6.2
Change-Id: Idc16d957bf687238c7b0ee603d8b092e2048ef18
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit e57f7b1b01b9b34a51a4ee3f898ef7f1fb013f17)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-31 11:36:57 +00:00
Aleix Pol
9483d87ef3 QOpenGLFramebufferObject: Avoid illegal call to glTexImage2D
According to the documentation:
GL_INVALID_OPERATION is generated if the combination of internalFormat, format and type is not one of those in the tables above.
https://registry.khronos.org/OpenGL-Refpages/es3.0/html/glTexImage2D.xhtml

We were allowing the RGB values be passed as RGBA, after this change we
don't do so anymore.
This would result for KWin in:
Mesa: User error: GL_INVALID_OPERATION in glTexImage2D(format = GL_RGBA, type = GL_UNSIGNED_BYTE, internalformat = GL_RGB8)

Pick-to: 6.6 6.5
Change-Id: Ifde8a570eff01be573f780655d8cedbb96f5ba2b
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit ba9e57d65f15c935632b0ad22db0bead9a7d5f90)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-31 11:36:57 +00:00
Ievgenii Meshcheriakov
e42e26d689 Update Unicode data version string
This amends c4e550703c2bdc1ee710507b8df9c0c9a118402e. The data version
update was just forgotten when updating to Unicode 15.0.

Pick-to: 6.6 6.5
Change-Id: Ibb3e9cb81e9bbcb5d4aaf4e4df6231485531c128
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 1e7f1e5b73b931931178bc884d3469439adf8c5c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-31 11:36:57 +00:00
Alexandru Croitor
6aed870919 Revert "CMake: Fix *-metatypes.json creation for non-Ninja generators"
This reverts commit ab6950acab5f799e5b3f097a87300e7c1dd1cf04.

Reason for revert: It breaks test_qml_app_deployment test in qtdeclarative for iOS and Xcode

Pick-to: 6.5 6.6 dev
Fixes: QTBUG-121729
Task-number: QTBUG-120317
Change-Id: I356882a97f63534aa17133a4fbbb1db90295dfba
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
2024-01-31 11:36:57 +00:00
Juha Vuolle
4518717dec Take QJsonDocument as a parameter
Instead of separate QJsonObject and QJsonArray types.

Resulted from API-review

Change-Id: I977d692d3709a8c3aa872683ddda54a143c25e67
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 26993046283605a806f34ba604e7dcef20f34ba5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-31 11:36:56 +00:00
Juha Vuolle
7f50c19152 Rename QRestReply data accessors as read* functions
This naming should make it clearer that (successful) calls to
readJson(), readBody(), and readText() consume the data received
so far.

Resulted from API-review

Change-Id: I09ca9eac598f8fc83eecb72c22431ac35b966bf5
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit bd78ff024599d33cfcb411ff17727a0f4447bc7e)
2024-01-31 13:36:56 +02:00
Łukasz Matysiak
94d61feb83 Skip compilation of tst_QLocalSocket::verifyListenWithDescriptor on VxWorks
This test uses socketpair which is not available on vxworks, so it fails
to compile.

Task-number: QTBUG-115777
Change-Id: I46f3b4ebd937dc4ca2511381dd58451434e6a2fc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 4b4a6f6d8e3111f0d9e78285e5951bd89ae37812)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-31 11:36:56 +00:00
Akira TAGOH
1b90474986 Support the named instances of Variable Fonts
In the fontconfig, the fonts will be populated with the variable font
and the named instance from the variable font. In this patch, it will
skip the variable font, and populate the named instances from the variable font.
The FcFontMatch function ignores the FC_INDEX when match the font,
changed the code to match the FC_INDEX by iterate the font list.

[ChangeLog][Fonts] Added support for the named instances from the variable fonts.

Fixes: QTBUG-111994
Fixes: QTBUG-112136
Co-authored-by: Peng Wu <alexepico@gmail.com>
Change-Id: Ic598d69a1e76109958fafa1226ea927656092319
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 185add27b2f7a4aa477e7988260bfaccb930f95c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-31 11:36:56 +00:00
Marc Mutz
3b8de80dfe QJsonArray: symmetrize QDataStream op>>/<<
In operator<<(), stream the QJsonDocument directly, instead of
toJson(Compact).

This is how QJsonDocument operator<<() also does things, but that
knowledge should be need-to-know, and QJsonArray doesn't, seeing as
operator>>() just streams a QJsonDocument, and then calls toArray().

Pick-to: 6.6 6.5
Change-Id: Ia378bf0fb04ce33e3af24a2ce67778e89c41e31a
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 264d54953e8b53f2454fbf8361b851923b8115a5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-31 06:51:41 +00:00
Marc Mutz
1dfbb919db Http2: don't barf on > 4GiB cumulative headers
The only user of the vector passes begin()/end() to BitIStream, which
appears to be 64-bit-clean.

Change-Id: I4ad0b9e9547008fecc4c816cc92ff9db4b2066e3
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 297341396203c5afed6420fa3789485c0996f846)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-31 06:51:35 +00:00
Tinja Paavoseppä
7aaa351742 Android: Add classes to embed QML into native Android
Add classes that make it possible to add QML as a View into
a native Android app:

QtView: Base class for QtQuickView, handles non-Quick dependent
operations. In essence a Java ViewGroup class which loads a
QWindow and embeds it into itself.

QtEmbeddedLoader: Extends QtLoader for embedded case, creates the
embedded version of QtActivityDelegate and provides an embedded-specific
path to loading Qt libraries (Mostly just allows users to set the name
of the main lib)

QtAndroidWindowEmbedding namespace: Deals with calls from
QtEmbeddedDelegate to create/destroy QWindow and from QtView to
show the window.

Take the QtEmbeddedDelegate introduced in an earlier commit
into use, and add functionality for loading QWindows for
QtViews and managing QtViews into it.

Add a factory for creating instances of QtEmbeddedDelegate.
The factory holds a map of QtEmbeddedDelegate objects and
creates them, with the Activity as the key. This is to make
it so that the same delegate can be used by multiple views
which share the same Context.

Known issues left:
* keyboard focus not working, as with other child windows

Task-number: QTBUG-118872
Change-Id: I94a5f9b4f904c05cc6368cf20f273fcf10d31f17
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 702c420f51d9d56ca056315387f224ec2dba3ff3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-30 22:07:35 +00:00
Thiago Macieira
3ad47fadb9 tst_QHostInfo: remove QProcess dependency
Our ideal scenario was to run python to run its getnameinfo()... so just
use getnameinfo() directly. This also avoids the problem of Python not
being present and our falling back to nslookup.

Change-Id: I5dd50a1a7ca5424d9e7afffd17adfc830386306f
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 7b981a4f1a60d8bda22f7f1d21cb2c72ec843ea0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-30 22:07:31 +00:00
Thiago Macieira
672c1f87b0 tst_QHostInfo: reorganize the #includes
Change-Id: I5dd50a1a7ca5424d9e7afffd17adfb5d0bb9a54c
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 133c91865067a390d05376fc4073556d3fd3a083)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-30 22:07:31 +00:00
Ahmad Samir
e8f42cf3ec QFileSystemModel: blacklist a flaky unittest on macos
Task-number: QTBUG-74471
Pick-to: 6.6 6.5
Change-Id: I4cda7794300c1a9d941e1543ee66b37efb0dea15
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 23d2aaa4f8aefdc395d18162c28493e520e209fc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-30 22:07:31 +00:00
Marc Mutz
3d182679b4 QBitArray: avoid overflow in size-to-storage calculations
Unlike other containers, a QBitArray's size() is not limited by
storage, but, esp. on 32-bit platforms, its size_type: A INT_MAX
size() QBitArray only requires 256MiB of storage.

So we can't rely on "won't happen in practice" here and need to avoid
the potential UB (signed overflow) in the (size + 7) / 8
logical-to-storage-size calculation by using unsigned arithmetic.

Use the opportunity to Extract Methods storage_size() and
allocation_size(), which differ by one (d[[0] contains the size() mod
8), making it clear what's what.

[ChangeLog][QtCore][QBitArray] Fixed a bug with QBitArrays whose
size() came within 7 of the size_type's maximum.

Pick-to: 6.6 6.5 6.2 5.15
Change-Id: I5d94bae9c9c210ba1e36f8cf03609125c81bd15d
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit c6aa399d062c8b31c2ab88acf564a24cdff7b3c8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-30 22:07:31 +00:00
Noah Davis
327dcc078d QPainterPath: Fix boundingRect and controlPointRect ignoring start point
The boundingRect and controlPointRect did not use the start point from
the `QPainterPath(const QPointF &startPoint)` constructor until the
`dirtyBounds` or `dirtyControlBounds` member variables were set to true.
Those two are false on construction. This bug was fixed by adding a new
constructor for QPainterPathPrivate that initializes the `elements`,
`bounds` and `controlBounds` member variables with the start point from
the constructor.

There is also an autotest to verify that the top left of the
boundingRect and controlPointRect are at the same position as
elementAt(0) when the start point constructor is used.

[ChangeLog][QtGui][QPainterPath] boundingRect() and controlPointRect()
now use the start point from QPainterPath(const QPointF &startPoint).

Pick-to: 6.6 6.5
Change-Id: I7bf30364406c14ed60f75d24b78a9a5535f75d93
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit a4f44e06988e91c21c85e0e9f29d656d61f9c68e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-30 22:07:30 +00:00
Tinja Paavoseppä
4f6cbed4db Android: Create QtWindow layout and set parent in the calling thread
In the QtWindow constructor, creation of the layout and setting
the parent window were posted on the Android UI thread, leading
to them being called at a later point. If QAndroidPlatformWindow
did not have a parent at the point it was created in, but
setParent() was called shortly after, the QtWindow.setParent()
call with the actual intended parent got invoked before the
Runnable posted in the constructor got ran, leading to the
parent being overwritten with the null one passed to the
constructor, essentially leaving the QtWindow as a top level
one, while the QAndroidPlatformWindow was a child window.

The above would happen more often with foreign child windows,
sometimes causing hang ups when the parent of the foreign
child window was shown.

Creating the QtLayout outside of the Android UI thread seems
to be safe, as long as we only modify its view hierarchy inside
it.

Task-number: QTBUG-116187
Change-Id: If1ed1983f5d6ba56e625148ee6a61771234a2aa1
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 8df46c8890a843a651c86d198540d6318dbaa9a1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-30 18:52:30 +00:00
Ahmad Samir
a114fd524e QMetaObject: revert adding QMetaObject::indexOfEnumerator(QBAV)
This partially reverts 4ecbe42ff44ace881ed4962744e9cd6c8fa65dab .

The discussion is still ongoing to decide whether the new overload
should take a QBAV or QAnySV. See
https://codereview.qt-project.org/c/qt/qtbase/+/514588 for the details.
For the time being remove the new overload from the API so that this can
be backported to 6.7 (while keeping both dev and 6.7 in sync to ease
future backports).

Change-Id: I4a279653d1941faeafd95dde7a8c741009c00c72
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit b3441b4127813148a701b7d538453bfdbe2315a4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-30 18:52:30 +00:00
Juha Vuolle
4eba2323f9 Change QNetworkRequest/Reply rawHeader functions to take QASV
QHttpHeaders uses QASV for the header name field, and this aligns
these functions with that. Furthermore having QASV as a parameter
will allow a wider range of string types to be passed as a
parameter (convenience).

Resulted from API-review

Amends: 56bb4ac484adb544925b6d7b58e4fd1d77d49503

Change-Id: Iff42b75393b6470a2c34a1913dbe615bf21238db
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 8feb41e4462c9879a831d1c753d4200c3287e557)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-30 18:52:30 +00:00
Thiago Macieira
34d1d7a858 QT_C_STYLE_CAST: move the parentheses to the macro, in C mode
Amends 104a0a9ecdb18d65e4d9075d87e8860c6c9d8335.

Right now it's no problem for the only two places we use it, but it
could be a problem if someone accidentally forgot when using the macro.

Pick-to: 6.6
Change-Id: I5dd50a1a7ca5424d9e7afffd17ae0a09dc7dd8c1
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit c1266c36353629e2253aa897dfc96d4fbbc8c5a3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-30 18:52:30 +00:00
Axel Spoerl
f477c78577 QDialogButtonBox: Fix focus chain and default button assignment
QDialogButtonBox::layoutButtons() rebuilds the focus chain based on the
button layout. It relied on the fact that the last button in the layout
would point back to the first button. That is not the case, if
- a focus frame gets inserted in the chain, and
- the default button is not at the layout's first (=left) position.
In that case, the chain stops at the button left of the default button.
The default button can not be reached by tabbing forward. Back-tabbing
still worked.

By not "closing" the focus chain, the focus proxy was set to the first
button found in the layout. That is wrong, whenever the default button
is not at the first layout position. When the box got focus for the
first time, pressing "Enter" could lead to a non-default button being
triggered. A Yes/No message box would have No as its default button.
On Linux, it would pop up with "No" being highlighted, but "Yes" having
focus. Pressing Enter would trigger Yes, instead of No.

tst_QMessageBox::staticSourceCompat() heuristically defines the
button expected to be triggered by Enter. On Linux/KDE, it would pass,
when the wrong button was fired.

=> Always "close" the focus chain, by linking the last and first
buttons.
=> Make the default button the button box's focus proxy.
=> Change tst_QMessageBox::staticSourceCompat() to always expect No
being fired by Enter in a Yes/No box.

[ChangeLog][QtWidgets][QDialogButtonBox] Default button becomes
focus proxy of a QDialogButtonBox. This ensures that Enter triggers
the default button, instead of the first button in the layout.

Fixes: QTBUG-118489
Change-Id: Ic626d3d0fe7ba8b924c21734332e98532f11c80e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit d4f38a363251fcb5cdfb24d7a1aceb7b630f7e8f)
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2024-01-30 15:11:17 +00:00
Axel Spoerl
a8d20fe2db Pass correct default button in QMessageBox::showNewMessageBox()
showNewMessageBox() shows an "old" message box, if a default button
argument was passed and the buttons argument doesn't contain a default
button. It passed the int value of defaultButton to showOldMessageBox,
where it was interpreted as a normal button.

The StandardButton::Default flag was not set on the default button.
This relied on the QDialogButtonBox owned by QMessageBox to show the
expected default button by co-incidence. As this was not always the
case, tst_QMessageBox::staticSourceCompat() even tested wrong expected
results.

=> Add the Default flag to the default button, before passing it as an
int value.
=> As a drive-by,
- replace c-style casting with static casting.
- add braces to multi-line if clause.

Task-number: QTBUG-118489
Pick-to: 6.6 6.5
Change-Id: I9cf93c8f93d6ab80e7be5ab25e56bc59d3d6209c
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit d71b73c145a35a84547918abe4b0916a7ced6a1e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-30 16:11:12 +01:00
Juha Vuolle
0ea24c99eb Update QRestAccessManager documentation
To accommodate the deduplication and non-owning changes
in previous commit.

Resulted from API-review

Change-Id: I61eb071503d6714c7fd42b3fe533698a8dcd2e27
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Jaishree Vyas <jaishree.vyas@qt.io>
(cherry picked from commit 26d1e0e83e8467b292fd0abb0a563bb914b9b609)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-30 10:17:50 +00:00
Juha Vuolle
7fd767478a Update QRestReply documentation
To accommodate the deduplication and non-owning changes
in previous commit.

Resulted from API-review

Change-Id: Ie1c4e9959c1ba7e8ed2be6607d9f6497ae15af39
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit efa178d42c5e9e8c6dc526430f201f16a67149c3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-30 10:17:41 +00:00
Juha Vuolle
afc1f2a6cc Make QRest* APIs non-owning and non-duplicating
Note: documentation will be updated in a follow-up commit

This commit makes QRestReply and QRestAccessManager
classes lighter, non-owning wrappers. Furthermore their
APIs don't duplicate the wrapped QNetwork* APIs.

This makes it easier to use / opt-in to these helpers
in pre-existing applications which are based on
QNetworkAccessManager and QNetworkReply.

Since APIs are no longer duplicated, the QRest
classes are more obviously a convenience _wrapper_,
as opposed to being an alternative vertical stack.

In practice this change consists of:
- QRestAM never instantiates QNetworkAccessManager,
  but accepts it via constructor. It does not take
  ownership of the QNetworkAccessManager.
- QRestReply accepts QNetworkReply via constructor. It
  does not take ownership of the QNetworkReply
- Signals and most duplicated functions are removed
  from both QRestAM and QRR.
- QRestReply is no longer a QObject
- Since QRestAM doesn't have much to report anymore,
  the debug operator is dropped.

Resulted from API-review

Change-Id: Ib62d9cc2df41cac631396a84bb7ec4d2d54b0c8c
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 9ba5c7ff6aa42c5701cf950d2137467a2d178833)
2024-01-30 12:17:31 +02:00
Marc Mutz
a57f89251c QGlobalStatic: fix atomics in ~Holder
Back when we set the guard and _then_ destroyed the object, the
atomic_thread_fence was correctly placed between the guard setting and
the dtor invocation.

We know nothing about the payload type. For all we know it could be
some fancy lockless data structure. So in general we need the acquire
fence to synchronize the reads done by the dtor with stores performed
to the object in other threads. The acquire fence did that for us.

But when we reversed the two operations, the fence has moved to after
the dtor call, leaving the dtor unprotected. Move it back to before
the dtor call.

That leaves the store to the guard unordered w.r.t. the execution of
the destructor. To fix, make it a store-release instead.

Amends e3e2674100b1ecbad7117f15c7aa13a704a7d34e.

Pick-to: 6.6 6.5
Change-Id: Ic7adbe17c8b474e82af4e84950c0109984b495d1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit b6537a9513d274866da2f46827f54e6004196097)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-30 10:07:04 +00:00
Eskil Abrahamsen Blomfeldt
3576e60992 Fix infinite loop in QTextLayout with setNumColumns()
If the line width is negative, then we might exit the layout
loop before consuming any text, and thus the loop will never
finish. This is a side effect of a change for maximumWidth:
991c056438b311566bc4ea543af0f33dfd5dffbb.

49a63d375972079ae3000c8b7d512d58d4de32bb fixed this issue for
QTextLayout::setFixedSize(), but I forgot to do the same in
the overload of QTextLayout::setNumColumns() which includes
an alignment width and therefore sets the line width in addition
to the column count.

Basically, we just make sure the line width is never negative so
that the width > line.width condition also means the width > 0.

Pick-to: 6.6 6.5
Fixes: QTBUG-115459
Change-Id: If904bfc64cd74e819a0864db55fa9555073d0781
Reviewed-by: Vladimir Belyavsky <belyavskyv@gmail.com>
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
(cherry picked from commit be6c651be4ccfa4f70009bcbb51bef39638e0fba)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-29 17:24:56 +00:00
Juha Vuolle
9f6e20a5fd Move WellKnownHeaders code to top
Small rearrangement to make diff on later variant/union commit
more readable

Task-number: QTBUG-119002
Change-Id: I3f6120b5dcd324b6493072d2eb58209866fb7dc6
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit f757662486f2b44cc7cab702c7e89edbc594f4ff)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-29 17:24:56 +00:00
Shawn Rutledge
f643656e88 Clarify that the textmarkdownwriter feature includes GitHub features
Markdown support in Qt has always been symmetrically including all the
features to the best of our ability: we can write all the same features
as we can read (including github extensions like tables and checkboxes),
except that we standardize the output (so it's not always identical to
what was read: headings always have hashes, not setext-style; code
fences and thematic breaks are regenerated, so we don't keep the same
style as the original; and so on), and we probably still have a few
bugs. And in fact QTextMarkdownWriter does not (yet) have logic to
restrict itself to CommonMark, even if it's requested by means of the
QTextDocument::MarkdownFeatures ctor argument. (Of course if
QTextMarkdownImporter reads a document with CommonMark-only restriction
applied, and then you rewrite the document with QTextMarkdownWriter,
presumably you would not have any GitHub features in the output.)
So the existing output from configure -list-features was misleading:

texthtmlparser ........... Kernel: Provides a parser for HTML.
textmarkdownreader ....... Kernel: Provides a Markdown (CommonMark and GitHub) reader
textmarkdownwriter ....... Kernel: Provides a Markdown (CommonMark) writer
textodfwriter ............ Kernel: Provides an ODF writer.

Amends e4079eca49adce16e31dac2a18d49d7a55817891

Change-Id: Ic2d9664388bbf17cef41ca0eaad600485a1bb7ec
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 3bcfd55cb3bc45c92345cc69b361030534ddb140)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-29 17:24:56 +00:00
Volker Hilsheimer
0dbe271b9c QJniArray: make reverse-iterable
Add rbeing/rend overload, relevant typedefs, and decrement operators.
As a drive-by, add noexcept to begin/end functions.

Found during header review.

Task-number: QTBUG-119952
Change-Id: I32d9a7d50a1f03550944c2247516c455d4822fe7
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit cc5251ed59ea6ecf0cc666ae5321be6de5383e90)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-29 17:24:56 +00:00
Volker Hilsheimer
7ff956c426 QJniArray: add missing post-increment operator
Augment test case. Found during header review.

Task-number: QTBUG-119952
Change-Id: I326395397167edb05ff1f45f7151614c02b7e7eb
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit e5074cd3540e165f771aa5bfea36d09553eadc77)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-29 17:24:55 +00:00