65727 Commits

Author SHA1 Message Date
Mårten Nordheim
000cb2dadc Bench QSet::unite
It was shown to have poor performance compared to contains() and
insert().

Pick-to: 6.7 6.6 6.5
Change-Id: I61cfbc8c34e325d677d7954118ef68057df640cb
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2024-02-01 00:43:23 +01:00
Mårten Nordheim
45c137d797 QHash: improve perf when detaching with potential growth
By not assuming we will have resized.
reserve(size() + 1) will have suffered a bit from this, but
that is probably not very common.

Change-Id: I8750d430f532a72729ed06e67c0f315707a916d6
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
2024-01-31 22:44:03 +01:00
Yifan Zhu
86e92972dd qxkbcommon: map XKB_KEY_XF86Calculator to Qt::Key_Calculator
cfd935fe6c26800befc10889afc0aebde311acca removed the erroneous mapping
from XKB_KEY_XF86Calculator to Qt::Key_Launch1, leaving it unmapped.
It should be mapped to Qt::Key_Calculator, just like
XKB_KEY_XF86Calculater.

Fixes: QTBUG-121713
Pick-to: 6.7 6.6 6.5
Change-Id: Iaa28e38792f43a7950a3c38397869a6ffed332d1
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Liang Qi <liang.qi@qt.io>
2024-01-31 13:44:03 -08:00
Marc Mutz
4af3cf275f [docs] Fix C'n'P error in QTRY_VERIFY2 example
It's not the _WITH_TIMEOUT variant (the timeout is missing).

Amends a change preceding b24bb12f6a93b98e9bc44c99e151b995eb7cea71,
the commit that moved all the documentation into qtestcase.qdoc in the
first place. I didn't track the change back further than that.

Pick-to: 6.7 6.6 6.5 6.2 5.15
Change-Id: I79ccd84a5dbed20012fa1a2d3561945f8a7638d5
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2024-01-31 21:46:49 +01:00
Volker Hilsheimer
ddc67dcc5a JNI: fix declaration of ElementType in QJniArray::makeObjectArray
List might be a reference type, in which case it won't have any members.

Pick-to: 6.7
Change-Id: Iac2c08c42f31ebc67b31be157f73ae318d328a18
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2024-01-31 21:18:48 +01:00
Volker Hilsheimer
43f66e6191 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.

Pick-to: 6.7
Change-Id: I6fed9b202be3c6a265117684fecd51d03ccbb534
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2024-01-31 21:18:48 +01:00
Volker Hilsheimer
76cf922980 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.

Pick-to: 6.7
Task-number: QTBUG-119952
Change-Id: I7cd206c6b372c2ec62a10feb5f9253f5607f01a9
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2024-01-31 21:18:48 +01:00
Volker Hilsheimer
72f5b35b3d 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.7 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>
2024-01-31 21:18:48 +01:00
Joerg Bornemann
62bea90207 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.

Pick-to: 6.7
Change-Id: I53e5920d39f87162c418fb3f4cff7927ec9b5488
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2024-01-31 21:18:48 +01:00
Marc Mutz
2188ca2c5d QVersionNumber: make iterable
Since QVersionNumber doesn't have an existing way to modify individual
segments, provide only const_iterator.

[ChangeLog][QtCore][QVersionNumber] Added (const) iterators over
segments (begin()/end(), incl. c- and r- variants).

Change-Id: Ia9af70c2a9c59f630123894ad2c9f38031ef5b8f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-01-31 20:18:48 +00:00
Marc Mutz
900d4bd29f Add QtPrivate::ArrowProxy
... use it in QKeyValueIterator.

This is somewhat simpler than the old QKeyValueIterator::pointer.

I don't think the pointer::operator*() could have ever worked, because
it returns value_type&, but is const.

That leaves the defaulted copy and move SMFs as a difference (ArrowProxy
is using aggregate initialization, so doesn't need any), and the fact
that operator->() is const.

Change-Id: I80b9c5f696de6ae30f3939166b205b9213eac57e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-01-31 20:18:47 +00:00
Marc Mutz
324fe120ba 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.7 6.6 6.5
Change-Id: Ic0a1708a29eccd7efe41aa4670ea55f1edb6be0b
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-01-31 21:18:47 +01:00
Marc Mutz
7081531173 QBitArray: apply Rule Of Zero
Can't do it now, because this non-polymorphic class is exported
wholesale, so removing the SMFs would be BiC. But pre-program for
Qt 7, so we don't forget again.

Change-Id: I36420dbaeda53391d304cf6832167f6157c22e35
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2024-01-31 21:18:47 +01:00
Marc Mutz
0808beace3 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.7 6.6 6.5 6.2 5.15
Change-Id: Ib24cf9218c06a3a05185723c77d4313611c2dd40
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-01-31 21:18:47 +01:00
Kai Köhne
40a87ca1b4 SQLite: Update SQLite to v3.45.1
[ChangeLog][Third-Party Code] Updated SQLite to v3.45.1

Pick-to: 5.15 6.2 6.5 6.6 6.6.2 6.7
Change-Id: I8083d0750e52b1035919821c25cef9855afea2f9
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-01-31 19:58:51 +01:00
Alexey Edelev
161c2f9544 Add the the implicit promotion to global for Qt platform targets
Bundled 3rdparty libraries link Qt platform targets implicitly, which
lead to the dependency resolution when the library is used by another
targets. For qtbase this works just fine since all platform targets
are not imported and they are used from a build tree. But in case if
3rdparty library is built as part of Qt repo different from qtbase
platform targets are imported and trigger the global promotion in
CMake. Usually qt_find_package for the 3rdparty libraries is called
somewhere in src/... directory and since Qt::Platform* targets are
already created in the top-level repo CMakeLists.txt by the
find_package(Qt ...) call, this leads to an error.

The propsed fix forces the global promotion of Qt platform targets
as soon as they created by the one of the initial find_package(Qt ...)
calls.

Change-Id: Iceb53f9ecccbdc438f9bc3bcc836583cfd4de535
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2024-01-31 19:20:06 +01:00
Alexey Edelev
180afc7321 Change the way we detect the need of adding Qt<Module>Plugins.cmake
Currently we assume that only modules that have plugins built in the
current build tree need to generate and install the
Qt<Module>Plugins.cmake file. This approach is weak since other Qt
modules might still want to provide the plugins of the certain types,
even if the module that the plugin type belongs too didn't have plugins
initially.

The fix unblocks the formally 3rd-party plugin installation and loading
chain.

Pick-to: 6.2 6.5 6.6 6.7
Fixes: QAA-2266
Change-Id: Ifc616e26a00674371c8e2fe2ca12237d153e5707
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2024-01-31 19:20:06 +01:00
Samuel Gaist
9785ffe943 xml: add parameter name to toString and toByteArray for PySide6
This change will allow Shiboken to generate proper bindings as otherwise
the python code will get an anonymous parameter which is not really
helpful for understanding the role of the parameter nor explicitly set
it.

Fixes: QTBUG-121468
Change-Id: I02943223eef99d815ef68e9603736cc064843fb0
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2024-01-31 18:02:43 +01:00
Tinja Paavoseppä
bd5ae42cf8 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
Pick-to: 6.7
Change-Id: I434233e173cc2c90d981bbf2aa0044117a20b17f
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2024-01-31 17:55:34 +02:00
Ahmad Samir
4488dad13b tst_qdiriterator: cleanup
- Match QCOMPARE logic when printing stringlists that don't match, it's
  "actual" then "expected"
- Use row tag names that don't interfere with the shell; e.g. using
  `tst_qdiriterator iterateResouce:':/testdata'` doesn't work for some
  reason, so just add a qrc prefix

Change-Id: I3d556b83ec34f2dab15ea3178273af10fb2c62e6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-01-31 17:55:33 +02:00
Eskil Abrahamsen Blomfeldt
b492582b9c freetype: Fix scaling layouts with bitmap fonts
The FreeType font engine would wrongly claim to support scaling
transforms for bitmap fonts, despite ignoring the transform
later. We do support this for color fonts through special casing,
but for other bitmap fonts, we should return false and let the
paint engine handle the scaling instead.

Fixes: QTBUG-111796
Change-Id: I31732b909ef6e0c1afbf01ed4de1f67e994934c3
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2024-01-31 16:09:12 +01:00
Edward Welbourne
534e836b69 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.

Pick-to: 6.7
Fixes: QTBUG-121528
Change-Id: Ib10ced67a2398108a31c7e95d5e865b7959bed4d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-01-31 15:19:50 +01:00
Joerg Bornemann
609a9bc939 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.

Pick-to: 6.7
Task-number: 121708
Change-Id: Id31aece7ae7685ea5f4940e6c4adf62ae8216528
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2024-01-31 15:19:50 +01:00
Joerg Bornemann
5d1ddee4cc Doc: Address qt_generate_deploy_app_script issues from API review
Pick-to: 6.7
Task-number: QTBUG-121708
Change-Id: Id0beb7c3045513e1665bd4062f7236243898b7c1
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2024-01-31 15:19:50 +01:00
Joerg Bornemann
313b7c56bd 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.

Pick-to: 6.7
Task-number: QTBUG-121708
Change-Id: I9421bdc692b0df45dc356c17fb90da8799d18ef9
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2024-01-31 15:19:50 +01:00
Joerg Bornemann
b8a78054cf Doc: Address QT_DEPLOY_LIBEXEC_DIR issues from API review
Pick-to: 6.7
Task-number: QTBUG-121708
Change-Id: I25a05fc26e9950a8b84770347dbcea1912832990
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2024-01-31 15:19:50 +01:00
Joerg Bornemann
1902f98a9d Doc: Address qt_deploy_runtime_dependencies issues from API review
Pick-to: 6.7
Task-number: QTBUG-121708
Change-Id: I8b7b3a7d03ab757f3cb6e55f27f0e4ba0e4a5bbd
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2024-01-31 15:19:49 +01:00
Joerg Bornemann
e39d13bc87 CMake: Warn if DEPLOY_TOOL_OPTIONS is used on Linux
...or rather when it's used with the generic deployment tool.

Pick-to: 6.7
Task-number: QTBUG-121708
Change-Id: I161564923a43c82150f581874ba20a9ad6de310f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2024-01-31 15:19:49 +01:00
Eirik Aavitsland
528032c027 Update bundled libpng to version 1.6.41
[ChangeLog][Third-Party Code] libpng was updated to version 1.6.41

Pick-to: 6.7 6.6 6.6.2 6.5 6.2 5.15
Change-Id: I3285bfa11f61c571ffda1b365011a5c6a798ca68
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
2024-01-31 14:19:49 +00:00
Tor Arne Vestbø
4634fbf34e Add QWidgetPrivate::isExplicitlyHidden() helper function
To aid readability.

Task-number: QTBUG-121398
Pick-to: 6.7
Change-Id: I3cb231584c2b7aee72e9f01c669fed1e01fbe475
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-01-31 15:19:49 +01:00
Krzysztof Sommerfeld
6efc95b699 Exclude test from compilation without qprocess
Change-Id: Iea3a28b25bdb828b0eb2ae0381489aa207f348fd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-01-31 13:21:55 +01:00
Krzysztof Sommerfeld
e566447e6b Exclude VxWorks from cxx 23 mode compilation of qcomparehelpers
Change-Id: Ia217a76ad96851a3ad9dedae4ab3ff1c2b3b92c6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-01-31 13:21:55 +01:00
Krzysztof Sommerfeld
ac6a9f9bfa Add cxx11_future in QPromise tests and disable it for VxWorks
cxx11_future flag should be disabled for VxWorks. VxWorks still does
have some bugs related to this std features and some parts of code needs
to be excluded. At least till the 24.03 VxWorks release as for now this
is the expected release that should contain fixes.

Task-number: QTBUG-115777
Change-Id: Ic652403697d727f4ae05ae7287ff8285075d3802
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-01-31 12:21:55 +00:00
Simo Fält
d4568bcfdb COIN: Enable setting Debian target distro with env variable
Pick-to: 6.7
Change-Id: I8cc0e9127ee7dd1e810812688ad32e759510cbe9
Reviewed-by: Toni Saario <toni.saario@qt.io>
2024-01-31 11:28:42 +00:00
Ghenady Kuznetsov
4725bbb3ee 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.7 6.6
Change-Id: I25e2fe4e73b920baf4c678b6b0e758d1da7cf632
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2024-01-31 10:50:37 +00:00
Marc Mutz
e57f7b1b01 Bootstrap: remove QBitArray
It appears to be used only in qlalr, which is, however, not
bootstrapped.

Pick-to: 6.7 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>
2024-01-31 11:50:37 +01:00
Łukasz Matysiak
4b4a6f6d8e 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
Pick-to: 6.7
Change-Id: I46f3b4ebd937dc4ca2511381dd58451434e6a2fc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-01-31 07:04:37 +01:00
Aleix Pol
ba9e57d65f 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.5 6.6 6.7
Change-Id: Ifde8a570eff01be573f780655d8cedbb96f5ba2b
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2024-01-31 01:29:40 +01:00
Ahmad Samir
23d2aaa4f8 QFileSystemModel: blacklist a flaky unittest on macos
Task-number: QTBUG-74471
Pick-to: 6.7 6.6 6.5
Change-Id: I4cda7794300c1a9d941e1543ee66b37efb0dea15
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2024-01-30 21:28:19 +00:00
Noah Davis
a4f44e0698 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.7 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>
2024-01-30 21:28:19 +00:00
Marc Mutz
c6aa399d06 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.7 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>
2024-01-30 22:28:19 +01:00
Thiago Macieira
4d7b64cd2f tst_QHostInfo: enable the IPv6 reverse lookups in more systems
I've noticed that on some Windows systems, the resolver refuses to
resolve IPv6-only addresses. But it can still do reverse resolution from
IPv6.

Change-Id: I5dd50a1a7ca5424d9e7afffd17adfe739ded932e
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-01-30 13:28:19 -08:00
Thiago Macieira
7b981a4f1a 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.

Pick-to: 6.7
Change-Id: I5dd50a1a7ca5424d9e7afffd17adfc830386306f
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-01-30 13:28:19 -08:00
Thiago Macieira
133c918650 tst_QHostInfo: reorganize the #includes
Pick-to: 6.7
Change-Id: I5dd50a1a7ca5424d9e7afffd17adfb5d0bb9a54c
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-01-30 13:28:19 -08:00
Tinja Paavoseppä
702c420f51 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

Pick-to: 6.7
Task-number: QTBUG-118872
Change-Id: I94a5f9b4f904c05cc6368cf20f273fcf10d31f17
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2024-01-30 20:01:29 +02:00
Ahmad Samir
b3441b4127 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).

Pick-to: 6.7
Change-Id: I4a279653d1941faeafd95dde7a8c741009c00c72
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-01-30 19:41:48 +02:00
Tinja Paavoseppä
8df46c8890 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.

Pick-to: 6.7
Task-number: QTBUG-116187
Change-Id: If1ed1983f5d6ba56e625148ee6a61771234a2aa1
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2024-01-30 17:41:48 +00:00
Juha Vuolle
8feb41e446 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

Pick-to: 6.7
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>
2024-01-30 18:43:40 +02:00
Edward Welbourne
f4f35fe84a Add expect-fail test-cases for und_US, und_GB to tst_QLocale::ctor()
These exhibit the problem described by a recent bug report.

Task-number: QTBUG-121485
Change-Id: Ia09acfa22e687ba096091a73f30df1ffd22a6e32
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2024-01-30 14:48:17 +01:00
Edward Welbourne
4fe7e8e51a Rework tst_QLocale::ctor() - split up and make data-driven
There were three things going on in this test (itself a sufficient
reason to split it up):
* Some reporting and checking of the default locale; the reporting is
  duplicated in defaulted_ctor() and the check fitted more naturally
  there.
* Checks that various combinations of language, script and territory
  got resolved according to likely-subtag rules. These were handled
  via a macro and natural candidates to become data-driven.
* A test that territory is preserved when it's the only given tag
  (with a few known exceptions); broken out as a steparate test.

In the process, give the data-rows of the likely-subtag parts names
that let me extend their testing to also test construction from
string. The territory-only cases can't support that, as QLocale
doesn't support und_* forms of tags for unspecified language.

Change-Id: Id9f0fc46f30eb887b47931bad1619255acb44266
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-01-30 14:48:17 +01:00