Commit Graph

63322 Commits

Author SHA1 Message Date
Ahmad Samir
0ce51dee0e tst_QDnsLookup: fix typo in CMakeListst.txt
There was an extra `q` before dnslookup.

Found while trying to build tst_qdnslookup, the target wasn't seen by
CMake/Ninja.

Pick-to: 6.6
Change-Id: Id594aab30dc9081fc269541561e0f2db5e615657
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-09-04 14:17:12 -07:00
Ilya Fedin
d524f0a756 QGenericUnixServices: ensure xdg activation token callback is called
The callback doesn't get called if the signal is emitted immediately
or if hitting the early returns

Fixes: QTBUG-113995
Pick-to: 6.6 6.5
Change-Id: Ib3e1d324a2becd8148cd76b4441fce5c4cc725e8
Reviewed-by: David Redondo <qt@david-redondo.de>
Reviewed-by: David Edmundson <davidedmundson@kde.org>
2023-09-05 00:57:47 +04:00
Ahmad Samir
9b40272562 tst_QDnsLookup: skip a unittest on Windows
See code review 496440 on Gerrit for the details.

Change-Id: Ibd32a44cf7e2e07f36687cc2f0eeaf3008f64e73
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-09-04 22:40:35 +03:00
Ahmad Samir
909893344c tst_qeventdispatcher: port to QDeadlineTimer
Easier logic for these use-cases.

Change-Id: I97a18c45d9bd8cfcfee5d379d271366276d5a435
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-09-04 22:40:35 +03:00
Anton Kudryavtsev
6d4385b697 qplatformpixmap: use rvalue overload more
to reuse internal buffers

Change-Id: I7cfd6b599912cc38f796356197748f97da3eb47d
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2023-09-04 18:16:47 +03:00
Anton Kudryavtsev
470fab51fb Tidy up QAuthenticatorPrivate::calculateResponse
call toBase64() with temp value

Change-Id: Idedfd91f60900ec51923803a6bb9ed6631e64d94
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2023-09-04 18:16:28 +03:00
Anton Kudryavtsev
b4f6399a51 qauthenticator: use QBAV more
Change-Id: Iaa208785f6e1dc8eb5f32ab5e099c8df277bb2f1
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-09-04 18:16:11 +03:00
Anton Kudryavtsev
50fa7996d0 qhttpnetworkconnection: extract method makeAcceptLanguage
and micro optimize it:
- avoid allocation in case of C locale
- don't call replace in case of C locale

Change-Id: I9afefd53b673e5f1236afdb3130d77779614acc7
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-09-04 18:16:08 +03:00
Anton Kudryavtsev
43d15dd572 qhttpnetworkconnection: cache acceptedEncoding header
Encodings are configured at compile time, so no need to re-create acceptedEncoding header for every request, just cache it.

Change-Id: Ibfaf7cdec0504cf90c4b6a59848e7c945d060ebe
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-09-04 18:16:06 +03:00
Anton Kudryavtsev
5f032cdeff QDecompressHelper: port some methods to QBAV
Change-Id: I907019f19cbf4f6086fd6480ea9e01f5ab63b004
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-09-04 18:16:03 +03:00
Anton Kudryavtsev
d9620f0660 qnetworkcookie: reduce allocations
Use CaseInsensitive compare more.
While touching code, replcace QBA literal with QBAV

Change-Id: Iecd2740c995f1e24b4285440b9440e4745f93208
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-09-04 18:16:00 +03:00
Anton Kudryavtsev
4ee081c2f7 qauthenticator: reduce allocations in parseHttpResponse
by QBAV usage. While touching code, port index based loop to range based

Change-Id: I06a784b94678b901d1074cca224c926e8534bd8e
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-09-04 18:15:48 +03:00
Ievgenii Meshcheriakov
a296f091c5 QDBusConnectionPrivate: Remove duplicated public sections
Seeing a public keyword may make the reader mistakenly
believe that the section above is not public.

Change-Id: I074d54ed5f6a5b5911d4c6038d33e14d2c58abe0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-09-04 12:03:07 +02:00
Mårten Nordheim
6577242adf tst_QString: deduplicate datatags
By saying what's special about some of them

Pick-to: 6.6 6.5
Change-Id: I17bf2e12a27bf55f621020ddf3819ee9e606847d
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-09-04 12:00:48 +02:00
Laszlo Agocs
7fbccd1900 QOpenGLWidget: Call glClear in the default paintGL implementation
Amends 8cc8bbb466.

With the referenced patch framebuffer invalidation is preferred
over clearing with a wider range of OpenGL implementations.
This is good and is in line with the documentation. If an existing
application does not do glClear() in their reimplemented paintGL(),
that we cannot fix, and the docs never actually promised that a
glClear() is done automatically.

However, there is a special case: when one does not reimplement
paintGL(). A QOpenGLWidget is expected to be usable without
reimplementing any of its virtuals (i.e., QOpenGLWidget is
constructible as-is without subclassing). It is then ideal
if this does not lead to showing rendering artifacts due to
having potentially random content in the (invalidated,
not cleared) color buffer. This problem was never encountered
before due to hitting the invalidate-instead-of-clear code path
on a limited set of platforms (like with OpenGL ES) only.

Do a glClear() in paintGL(). This won't effect the vast majority
of applications, that reimplement this function, but plays nice
for when it is not.

It is in fact also in line with Qt 4's QGLWidget: that also used to
do a glClear() in the default paintGL() implementation.

Change-Id: I117ce1d3340f6d4d82cde1f52769a3b13ce367fb
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2023-09-04 11:46:29 +02:00
Laszlo Agocs
9505305c40 Use linear filtering again when QT_WIDGETS_HIGHDPI_DOWNSCALE
In ec27b99c2a the filtering mode is
changed from Linear to Nearest since users encountered obscure cases,
in particular when multisampling with large sample counts got enabled,
where the different filtering mode becomes noticeable. (Qt 5 and Qt 6
up until 6.4 uses Nearest, whereas the OpenGL -> QRhi migration
introduced using Linear in 6.4)

Meanwhile, the as of now undocumented high DPI downscaling feature
got introduced, and that prefers linear filtering. (since that's
definitely not a 1:1 mapping when it comes to texture size and the
on-screen quad) To reconcile the differences, add support for both
kind of samplers, and choose based on the sizes.

This should have no effect when not running with the env.var.
QT_WIDGETS_RHI=1 QT_WIDGETS_HIGHDPI_DOWNSCALE=1 set, but should
restore the pre-6.5.2 look when they are set.

Pick-to: 6.6 6.5
Fixes: QTBUG-115461
Change-Id: I42eb8526cb7f74236b5550e26c4570771d2fbfb4
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2023-09-04 11:46:13 +02:00
Thiago Macieira
961620824c QArrayData: make calculateBlockSize() account for the extra null element
Instead of adding it after the block size was calculated. This makes no
difference for non-growing (exact) blocks. For growing blocks, this
means we take that extra element into account before rounding to the
next power of two, instead of after. That results in a change of the
thresholds of when a block grows and also what capacity it will
contain.

For example, for a QString growing to 22-25 elements:

      Request     |       Previously        |           Now           |
elements |  bytes | malloc()ed | capacity() | malloc()ed | capacity() |
    22   |    44  |        66  |        24  |        64  |        23  |
    23   |    46  |        66  |        24  |        64  |        23  |
    24   |    48  |        66  |        24  |       128  |        55  |
    25   |    50  |       130  |        56  |       128  |        55  |

To avoid wasting elementSize - 2 bytes in this footer, we only include
this footer if elementSize <= 2. Thus, for a QList<int> growing to 11-13
elements:

      Request     |       Previously        |           Now           |
elements |  bytes | malloc()ed | capacity() | malloc()ed | capacity() |
    11   |    44  |        66  |        12  |        64  |        12  |
    12   |    48  |        66  |        12  |       128  |        28  |
    13   |    52  |       130  |        28  |       128  |        28  |

In both cases, we now only allocate powers of two while growing, which
may be beneficial to some allocators.

Pick-to: 6.6
Change-Id: Ifa1111900d6945ea8e05fffd177dcb96e251d0a1
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-09-03 17:43:24 -07:00
Ivan Solovev
d752da1857 QAnyStringView: fix construction from QL1SV for bootstrapped builds
The SizeShift was not taken into account when constructing QASV from
QL1SV. This is not an issue in normal Qt builds, because SizeShift == 0
there.
But in bootstrapped case (and in future Qt 7) SizeShift changes to 2,
and the bug becomes visible.

The added test-cases do not really reveal the issue, because we do
not run tests in bootstrapped builds, but at least they will help
to prevent the issues in Qt 7.

Pick-to: 6.6 6.5 6.2
Change-Id: I337b37b5230323a5357f48fd1c9bf799ca507d52
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-09-03 18:22:06 +02:00
Ivan Solovev
d85663ced8 QDBusServiceWatcher: fix binding loops
This class has two bindable properties - watchedServices and watchMode.
What makes this class non-trivial is the fact that these properties
depend on each other - setWatchedServices() need an up-to-date
watchMode to set up the services, and setWatchMode() needs an
up-to-date list of services in order to update the mode on them.

Update the setters in such way that they remove the bindings from
the updated property, and at the same time trigger the re-evaluation
of the property they depend on.
This includes refactoring of the helper setConnection() method in such
way that it does not cause property re-evaluation, and also update
of the {add,remove}Service() helper functions to take the watchMode as
an input parameter.

The public {add,remove}WatchedService() methods were updated similarly.
The logic of the removeWatchedService() method was additionally
updated to do some changes to the properties only if the
service-to-be-removed actually existed in the list.

Task-number: QTBUG-116346
Pick-to: 6.6 6.5
Change-Id: If46cf926c7ace9dc4893d8daaef088f61e41c21a
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2023-09-03 18:21:18 +02:00
Ivan Solovev
1ad424aed5 QLocal{Socket,Server}: extend the test coverage for property bindings
The pre-existing test for QLocalServer was testing only a minor subset
of cases, so replace it with the call to
QTestPrivate::testReadWritePropertyBasics.

The test for QLocalSocket's bindable properties was missing, so add
it.

The new tests didn't reveal any problems.

Task-number: QTBUG-116346
Pick-to: 6.6 6.5
Change-Id: I695bb050d39eeae9ffb84c097c36601a4ca89af6
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2023-09-03 18:20:59 +02:00
Ivan Solovev
96a62cd1f5 tst_QDnsLookup: extend test coverage for property bindings
The pre-existing tests were not using the QTestPrivate helpers, so
extend them with the call to QTestPrivate::testReadWritePropertyBasics.

The updated test didn't reveal any problems with binding loops, so no
other action is required for now.

Task-number: QTBUG-116346
Pick-to: 6.6 6.5
Change-Id: I51a17974a7f5bec3c969fcb55b6f28e3e9218eb5
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-09-03 18:20:56 +02:00
Ivan Solovev
ac59fcdab8 QStandardItemModel: extend the test coverage for property bindings
The pre-existing tests were not using the QTestPrivate helpers, so
extend them with the call to QTestPrivate::testReadWritePropertyBasics.

The updated test didn't reveal any problems with binding loops, so no
other action is required for now.

Task-number: QTBUG-116346
Pick-to: 6.6 6.5
Change-Id: I360614a40fe2bacb796051607ed67e7e666b4f22
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2023-09-03 18:20:54 +02:00
Ivan Solovev
7d70edd31c QTimer: extend property tests and fix binding loop
The bindable property tests were not using the QTestPrivate helpers, so
add a new test which uses them.

The new tests revealed a binding loop for the interval property.
Fix it in a usual way by explicitly removing the binding and using
{set}ValueBypassingBindings() in the setter.

Task-number: QTBUG-116346
Pick-to: 6.6 6.5
Change-Id: If94f57938da449a68e3527aead5ebd55ba410adb
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2023-09-03 18:20:51 +02:00
Ivan Solovev
cdb50edc98 tst_QMovie: extend the test coverage for property bindings
The old tests were not using the test methods from QTestPrivate, so
add another test case.

Task-number: QTBUG-116346
Pick-to: 6.6 6.5
Change-Id: I291ede26461e79a615630f1decad2ad7549b4dd8
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2023-09-03 18:20:48 +02:00
Ivan Solovev
2ef65f895b QSortFilterProxyModel: fix binding loops
... by using valueBypassingBindings() when accessing the properties
from the setters.

Task-number: QTBUG-116346
Pick-to: 6.6 6.5
Change-Id: Ibbad552fa1e611f4bb704b4e47667df5f328f152
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2023-09-03 18:20:45 +02:00
Ivan Solovev
6a873778b9 QAbstractProxyModel: fix binding loops
... by using valueBypassingBindings() when accessing the properties
from the setters.

This commit is mostly trivial.
Had to change the template parameters in the unit-test, because the
updated QTestPrivate::testReadWritePropertyBasics() creates an instance
of the TestedClass, and QAbstractProxyModel cannot be instantiated,
since it has pure virtual methods.

Task-number: QTBUG-116346
Pick-to: 6.6 6.5
Change-Id: I0cae29263ea9bb92c9de06891b0ba8633fb9fd72
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2023-09-03 18:20:33 +02:00
Ivan Solovev
47d2788e0b QTimeLine: fix binding loops
... by using valueBypassingBindings() when accessing the properties
from the setters.

The most complicated case here is the currentTime property, because
its setter was calling the public currentValue() and currentFrame()
methods. Both methods are reading the same currentTime property.

Fix it by replacing the calls to these methods with the calls to
valueForTime() and frameForTime(). Both take an int parameter, so
the updated code can use valueBypassingBindings() to pass the current
time to these calls.

Task-number: QTBUG-116346
Pick-to: 6.6 6.5
Change-Id: I5c3a05f3e21e4c9e53ed98c9f8d1dce76e40a00d
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2023-09-03 18:20:30 +02:00
Ivan Solovev
22c2c15b27 QSequentialAnimationGroup: extend bindable property unit tests
The bindable property tests should use the helper functions from
QTestPrivate.

Task-number: QTBUG-116346
Pick-to: 6.6 6.5
Change-Id: Ie1a61ab80e6f737eac02246214c2c93129a1cf94
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2023-09-03 18:20:21 +02:00
Ivan Solovev
b64e36240b QPauseAnimation: extend tests and fix binding loop
Extend the unit-tests for bindable properties and fix the discovered
binding loop by using {set}ValueBypassingBindings() in the setter of
the duration property.

The code refactoring does not modify the setter logic, because
previously the binding was anyway implicitly removed when calling the
assignment operator. The updated code just does it explicitly.

Task-number: QTBUG-116346
Pick-to: 6.6 6.5
Change-Id: I0f339d182efb60500ee7f12e407f200d739da312
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2023-09-03 18:20:18 +02:00
Ivan Solovev
df9651c3fc QVariantAnimation: fix binding loops
Rewrite the logic of the setters to use removeBindingUnlessInWrapper()
and {set}ValueBypassingBindings() calls.

The logic of both setters didn't change, because previously the
pre-existing bindings were implicitly removed when calling the
assignment operator.
The new code just makes it explicit.

Task-number: QTBUG-116346
Pick-to: 6.6 6.5
Change-Id: I475e6cd65fc73796176f257835cb67b9e70a1e34
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2023-09-03 18:20:16 +02:00
Ivan Solovev
b6b94111c7 QPropertyAnimation: fix binding loops
... by using valueBypassingBindings() when accessing the properties
from the setters.

Task-number: QTBUG-116346
Pick-to: 6.6 6.5
Change-Id: I04abc394f4406dc0fa75c55a9093e10c27a20c30
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2023-09-03 18:20:13 +02:00
Ievgenii Meshcheriakov
5cad1d7a04 QDBusCallDeliveryEvent: Remove unused flags member
Also remove flags argument of QDBusConnectionPrivate::deliverCall().

Change-Id: Idd569f531891ffd21e6f57c17e5d03539c3fd230
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-09-03 12:38:55 +02:00
Anton Kudryavtsev
9f7c794626 qDecodeDataUrl: use QBAV more
to reduce allocations

Change-Id: Ia2d68186ee56556152254c6579a52131b246b07f
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2023-09-02 15:36:00 +03:00
Anton Kudryavtsev
28aee90093 qimagereaderwriterhelpers: deduplicate literal
Extract literal to constexpr function and reuse it

Change-Id: I0a1ec24cb67e413222c826f2f26d78e16459ff8c
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2023-09-02 12:36:00 +00:00
Anton Kudryavtsev
3e62ecbc25 qnetworkreplyhttpimpl: optimize fetchCacheMetaData
Reduce allocations by usage of case insensitive compare method

While touching code, reorder condition to use cheap int compare first

Change-Id: I01a5d18ae69658a9cd1c27b40a9cdf369231b5fe
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-09-02 15:35:59 +03:00
Alexey Edelev
3115610cfa syncqt: Close ifstream before attempt to remove file
ifstream may block the file descriptor in some operating systems.
Wrap the reading of files in staging directory with extra scope,
to make sure that ifstream closed the descriptor before the removal
attempt. Also make sure that we closed the ifstream explicitly.

Pick-to: 6.5 6.6
Change-Id: I56ef5e9925501912d5cd61e8545f664e0a0d90b8
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-09-02 10:25:55 +02:00
Ievgenii Meshcheriakov
074c664b5c QDBusConnectionPrivate: Emit newConnection signal on QDBusServer directly
Remove indirection via _q_newConnection() because the server object
may not exist anymore when this method is invoked.

This amends commit d865e3ef1d.

Task-number: QTBUG-116621
Change-Id: I5f9a667bc0e2e3cd36492c24767505031fe0e1d7
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-09-02 02:37:59 +02:00
Thiago Macieira
2b06d41b46 tst_QFileInfo: don't trigger libstdc++ std::filesystem bug
libstdc++'s std::filesystem::path implementation incorrectly assumes
that any 8-bit char input is UTF-8, when it patently isn't on Windows.

Reported at https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111244

Pick-to: 6.5 6.6
Fixes: QTBUG-116609
Change-Id: I2b24e1d3cad44897906efffd17803f2862935c9b
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-09-01 13:05:45 -07:00
Thiago Macieira
1bbd646e59 CMake: remove TEST_xlocalescanprint
It was only used to provide a CMake-time error instead of a build-time
error. That cost us 250 ms of CMake time, even if you had double-
conversion turned on. Instead, let the build fail for people who turn
off libdouble-conversion.

Change-Id: Ifbf974a4d10745b099b1fffd177757570c5575eb
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-09-01 13:05:42 -07:00
Thiago Macieira
9e8c93fac1 tst_QFileInfo: replace a portion of a macro with a lambda
It's very hard to debug a macro.

Pick-to: 6.5 6.6
Change-Id: I2b24e1d3cad44897906efffd17803b8eac9bd844
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-09-01 13:05:40 -07:00
Thiago Macieira
a15fef35ff QList/Doc: document the resize() overload taking a parameter_type
Added by commit b42a2b3c33 for 6.0, but we
forgot to document it.

Pick-to: 6.5 6.6
Change-Id: I2b24e1d3cad44897906efffd1780086b51c0e3fa
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
2023-09-01 13:05:37 -07:00
Thiago Macieira
5b9e2f31bd tst_QFileInfo::stdfilesystem: add extra Unicode string tests
Pick-to: 6.6
Change-Id: I2b24e1d3cad44897906efffd17803f70bd4d60f6
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-09-01 13:05:34 -07:00
André Klitzing
cda98280ed Fix living QLibProxyWrapper after shutdown of QCoreApplication
Pick-to: 6.6
Task-number: QTBUG-84234
Change-Id: I8f5e2947b6529a0a8871d040050205934ee60354
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-09-01 22:05:29 +02:00
Anton Kudryavtsev
0e5f60a6ca qhttpheaderparser: use algorithms more
No raw loops. Also de-duplicate functors by lambda generator

Change-Id: I053890a0a472bfe2846d7007fda8cca779d812a8
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-09-01 16:06:27 +00:00
Volker Hilsheimer
c59b34b8cf QAccessible: consistently respect rootIndex of item views
Accessibility implementations rely on correct information about the
model dimensions when operating on item views. An item view that has a
root index set needs to report it's size based on the root index, rather
than for the view's model directly.

Pass the rootIndex to all calls to QAbstractItemModel::column/rowCount.
Refactor the code to avoid excessive dereferencing of a QPointer, apply
const and fix/improve coding style in touched lines.

Emit a ModelReset notification when the root index changes, or (in the
case of QListView) when the model column changes.

Split long Q_ASSERTs into multiple lines to be able to better trace the
exact reason for an assertion, and replace the assert with an early
return of nil when it's plausible that a cached cell is no longer part
of the view (i.e. because the root index changed).

Add a test case that verifies that changing the root index changes the
dimension of the view as reported through the accessibility interface.

Pick-to: 6.6 6.5
Fixes: QTBUG-114423
Change-Id: I7897b79b2e1d10c789cc866b7f5c5dabdabe6770
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2023-09-01 18:03:29 +02:00
Anton Kudryavtsev
b770b0f8b9 imageFormatsForMimeType: port to QBAV
to reduce allocations

Change-Id: Ic48616d0627cb1dfee5f844bee263a59a430d9ba
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2023-09-01 14:47:28 +00:00
Anton Kudryavtsev
cf066f7d03 QHostInfo::localDomainName: use QBAV more
to reduce allocations

Change-Id: If75c3818333880ba34f2e58038b05869979ae14d
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-09-01 17:47:28 +03:00
Mitch Curtis
bcae883274 Note that QPalette::ColorRole must be kept in sync with QQuickColorGroup
Without adding the corresponding properties, they will not be available
in QML.

Task-number: QTBUG-116106
Pick-to: 6.6
Change-Id: I233e456ced585b9274a1724cc550bc2959757104
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-09-01 13:04:34 +00:00
David Faure
b281c7a4eb QMimeProvider: reduce scope of variable
Change-Id: I0914530b76d1a97b4d9216bc670b5a846f1eda72
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-09-01 15:04:33 +02:00
David Faure
1b39e61a77 QMimeDatabase: fix detection of pattern conflict in different prefixes
Installing a second mimetype with *.txt as glob had a different
effect depending on whether it was installed into the same prefix
or a different prefix as the one where text/plain is installed.

Pick-to: 6.6
Change-Id: I7f54b8efe22f620eb57257745c48fe5402c87626
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-09-01 15:04:33 +02:00