Commit Graph

79 Commits

Author SHA1 Message Date
Juha Vuolle 9be52337fd Skip sax autotests if XML is disabled
Qt lite configurations may disable XML altogether (-no-feature-xml).
Sax autotests link and rely on XML => disable tests when XML is
disabled.

Fixes: QTBUG-136673
Change-Id: Idd837781651d2b834a28ee8cd52516886a95b744
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2025-05-13 11:48:42 +03:00
Matthias Rauter 1f135d43e4 Remove debug flag from benchmark
If debug symbols are needed, then pass the respective flag to the
configure script.

Pick-to: 6.9 6.8
Change-Id: I70f8cad624d2e5cfae255a24c9f82010c0c868d9
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2025-03-28 11:09:23 +00:00
Marc Mutz 2d8df31902 Fix QFile::open() Easter Egg
Fix the delayed marking of QFile::open() as [[nodiscard]] in this
module, too.

Pick-to: 6.9 6.8 6.5
Change-Id: I7b1d76cc23c2ce1dfb8c03ca945dcecb6c54988f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2025-01-24 06:24:07 +00:00
Marc Mutz 6b5138b2a8 tst_qutf8: port from QScopedPointer to std::unique_ptr
In preparation of introducing QT_NO_SCOPED_POINTER.

Pick-to: 6.9 6.8
Task-number: QTBUG-132215
Change-Id: I2d85fde7ee153bd165709c3e11976531d23da343
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2024-12-18 13:30:20 +01:00
Marc Mutz 34d8bc2c92 tst_QStringRef: protect QASV{QSR} test from all except GCC
QNX, too believes that QASV{QStringRef} is still ambiguous, even after
qtbase/a0e65398483729259cf58781949133c6055fdc7c and
qt5compat/5f94627eda523112116917ca08e6d0ab281bd5ea. Comment the test
out for all compilers except non-QNX GCC for now.

Task-number: QTBUG-122797
Pick-to: 6.9 6.8 6.5
Change-Id: I8563d48015babdbb79e107e7f5bfc063cc3dbc06
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-12-18 10:11:33 +00:00
Marc Mutz 9f8bfaa8cb tst_QStringRef: protect QASV{QSR} test from MSVC
MSVC believes that QASV{QStringRef} is still ambiguous, even after
qtbase/a0e65398483729259cf58781949133c6055fdc7c and
qt5compat/5f94627eda523112116917ca08e6d0ab281bd5ea. Comment the test
out for MSVCfor now.

Reopens: QTBUG-122797
Pick-to: 6.9 6.8 6.5
Change-Id: I1be144b15bc6245fb36a3bd9abac6685844fd7d5
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-12-17 11:46:44 +01:00
Marc Mutz 5f94627eda QStringRef: preserve null-ness when converting to QAnyStringView
Like for the conversion to QStringView, the conversion to
QAnyStringView was hitting the QASV{container} ctor, which doesn't
deal with QString(Ref)'s funny isNull()-but-data()-!=-nullptr
bug^Wpolicy, leading to null-ness being lost in the conversion.

At some point, it didn't even compile (cf. QTBUG-122797), though this
author could not reproduce the issue after fixing QTBUG-122798.

Fix by providing an implicit conversion operator to
QAnyStringView. This fixes the issue for conversion, but if a user
forces construction (e.g. using QAnyStringView{sr}), then the
QASV{container} ctor is still chosen, and still breaks
null-less. QStringView has the same problem, at the moment.

Fixing that requires changes in QtBase, so guard dependent code with
a macro that a fixed QtCore will set, incl. in QStringRef::operator
QASV() itself.

[ChangeLog][QtCore5Compat][QStringRef] Fixed missing conversion to
QAnyStringView.

Task-number: QTBUG-122797
Pick-to: 6.9 6.8 6.5
Change-Id: Ic848332e8f9e052d1359fa4532131e93e1b5c13c
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2024-12-15 13:41:17 +00:00
Marc Mutz 63add2fdd8 QStringRef: fix lost null-ness when converting to QStringView
When QStringRef was moved out of QtCore, QStringRef (which needs the
same special isNull() handling that QString also needs, due to the
never-nullptr data() bug^Wpolicy) was dropped from QStringView's
if_qstring_like constraint, and the replacement QStringRef::operator
QStringView() didn't take the issue into account for all cases:

A QStringRef with a nullptr string() will create a null QStringView,
but a likewise isNull() QStringRef constructed over an isNull()
QString will create a non-null QStringView (over
QStringRef::data()::_empty).

Fix by checking for QStringRef::isNull() instead of just !m_string in
operator QStringView().

Amends 80ffb97660.

[ChangeLog][QtCore5Compat][QStringRef] Fixed a Qt 6 regression where
conversion to QStringView would no longer preserve nullness.

Task-number: QTBUG-122798
Pick-to: 6.9 6.8 6.5
Change-Id: Ie28e02c6553271a2cb6e8e6816de8c79b8c84b31
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2024-12-12 15:43:17 +01:00
Marc Mutz 6d80b76e9e tst_QStringRef: check that QStringRef->QStringView preserves nullness
It did, in Qt 5, but the test, if ever there was one, got lost when
QStringRef moved out of QtCore. Subsequently, the property was
broken.

Task-number: QTBUG-122798
Pick-to: 6.9 6.8 6.5
Change-Id: I517307c5f999457e353b9cf7200158d99fecd3ac
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2024-12-12 14:45:22 +01:00
Thiago Macieira 464c9761e2 tst_QTextCodec::utf32Codec: Split the Chakma digits into multiple rows
So it's easier to see what the error is.

Drive-by make it compile with Qt 5.

Pick-to: 6.8
Change-Id: I2fe31a7ad762bdd38ca3fffd9f903b5e64da4691
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2024-11-11 19:49:51 -07:00
Thiago Macieira 9da7af533d tst_QTextCodec: add the missing "e" to Negative Length
Brian Kernigham said the one thing he'd do differently in Unix if he had
the chance to do it all over again was to add the "e" to creat().

Change-Id: Ifa343726f2065e2fb4bafffd1c7a96a741c664da
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2024-09-18 21:52:07 +02:00
Thiago Macieira 69a761a2cc QTextCodec: use DefaultConversion too
Complements dd0ddad631 and makes
QTextCodec::{to,from}Unicode also use the flag. Same reasoning as that
commit.

The changes to the tests are to make it compatible with what QTextCodec
did in Qt 5: the stateless fromUnicode() conversion did add BOMs, so we
match Qt 5's behavior here. That includes conversions of empty strings,
which QStringView() on a null pointer is.

In fact, I think commit 3695cd090b is
wrong in returning an empty QByteArray(). It went in because:
 a) the BOM behavior was different until the fix in this commit and in
    commit dd0ddad631
 b) the test was not backported to Qt 5, which would have identified the
    difference in behavior

I'm not fixing that difference in behavior because there's no Qt 5 code
to be compatible with, as Qt 5 crashed when attempting to convert null
pointers. The behavior of converting an empty QStringView() remains the
same (just no longer tested).

[ChangeLog][Qt5CoreCompat][QTextCodec] Fixed a bug that caused
QTextCodec not to write the Byte Order Mark for UTF codecs. QTextCodec
now has the same behavior as Qt 5.x.

Task-number: QTBUG-122795
Pick-to: 6.5 6.7 6.8
Change-Id: If05cb740b64f42eba21efffd17d13d0145f74945
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-09-18 11:55:13 -07:00
Edward Welbourne 3804246fe9 Remove second parameter being passed to QSKIP()
Prior to Qt 5, QSKIP() accepted a scope parameter, either SkipAll or
SkipSingle. This has been ignored since 5.0.0, so remove all surviving
uses of it.

Change-Id: I9776dae48604ccdbda7728017b25eb18c52975af
Reviewed-by: Jason McDonald <macadder1@gmail.com>
2024-08-13 15:46:25 +02:00
Ari Parkkila ad4af460ab tests: Fix tst_qtextcodec to start echo_helper from test directory
Task-number: QTBUG-118680
Change-Id: I80f7b78143de8ae6347b0b3b74456c3de899b779
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-07-11 06:11:53 +03:00
Ari Parkkila cdc7024627 tests: Fix tst_QtJson to bundle resources for builtin testdata
Task-number: QTBUG-118680
Change-Id: I1ab3546ecdb33623420a4fbef77f66d5a4d57297
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2024-07-10 12:08:54 +03:00
Lucie Gérard 9d6805017c Correct license for test files
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: I96d027035cd43d3244fb2c2b89fdcff406d7d801
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
2024-03-15 14:44:31 +01:00
Marc Mutz 322b7f92e7 tst_QStringRef: ensure QStringRef implicitly converts to QStringView
It did, in Qt 5, but the test, if ever there was one, was lost when
QStringRef moved out of QtCore.

Pick-to: 6.7 6.6 6.5 6.2
Change-Id: I3440074eb8678adaf317ff888c9f11d1a1e4c8ec
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2024-03-01 09:46:23 +01:00
Ievgenii Meshcheriakov 9893a60d9b tst_qxmlinputsource: Use case-insensitive match for a HTTP header
Change-Id: Ie2326e15ddf54cf32576255ecad188bd436d19be
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Lena Biliaieva <lena.biliaieva@qt.io>
2024-02-07 13:50:20 +01:00
Joerg Bornemann 74d9177fc6 Add CMake autotest
Task-number: QTBUG-84884
Change-Id: I6b694d25ffd5fc96bc7b0899a6cba6ae4a9b1565
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-01-29 09:24:43 +01:00
Volker Hilsheimer fc89bba579 QTextCodec: retain input's nullness on {to,from}Unicode
Bring back compatibility with Qt 5.15; return a null result if the
input is null, and an empty result otherwise. Amends
3695cd090b, which returned a null-
result even if the input was an empty string of zero length.

Add test coverage; running this test case against Qt 5.15 results
in the test passing, with expected failures for the case of a
nullptr input. These are objectively wrong if the goal is to retain
nullness symmetrically, but the Qt5Compat library's purpose is to
provide behavior that is identical to Qt 5.15, so leave those
expected failures unfixed.

Fixes: QTBUG-116981
Pick-to: 6.6
Change-Id: I8fa0f10258752446966055ad4ce8b99688b66104
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-11-07 05:19:10 +01:00
Alexandru Croitor 4539e101f7 CMake: Make qt5compat tests standalone projects
Add the boilerplate standalone test prelude to each test, so that they
can be opened with an IDE without the qt-cmake-standalone-test script,
but directly with qt-cmake or cmake.

Boilerplate was added using the following scripts:
https://git.qt.io/alcroito/cmake_refactor

Manual adjustments were made where the code was inserted in the wrong
location.

Task-number: QTBUG-93020
Change-Id: Ice9b3de2d3e1d5829c810c68067960a28bb1da1f
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2023-07-06 16:18:36 +02:00
Marc Mutz 39ae81b4d5 QStringRef: test it works as QString::arg() argument
This broke in 5.15, so add a test.

Don't pick to 5.15, as the test has already been added there in
qtbase.

Pick-to: 6.5 6.4 6.2
Task-number: QTBUG-109723
Change-Id: I2eb2ae09d5052bd68548c4d7691d09ac9cf96579
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-01-02 14:12:07 +01:00
Marc Mutz 2431bba5bb Port from container::count() and length() to size()
This is a semantic patch using ClangTidyTransformator as in
qtbase/df9d882d41b741fef7c5beeddb0abe9d904443d8:

  auto QtContainerClass = expr(hasType(namedDecl(hasAnyName(<classes>)))).bind(o)
  makeRule(cxxMemberCallExpr(on(QtContainerClass),
                             callee(cxxMethodDecl(hasAnyName({"count", "length"),
                                                  parameterCountIs(0))))),
           changeTo(cat(access(o, cat("size"), "()"))),
           cat("use 'size()' instead of 'count()/length()'"))

a.k.a qt-port-to-std-compatible-api with config Scope: 'Container',
with the extended set of container classes recognized.

Change-Id: I2b14fe7f6a317f340e306b53930db98ec8d10098
Reviewed-by: Sona Kurazyan <kurazyan.sona@gmail.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-10-05 14:59:38 +02:00
Lucie Gérard 78cced518f Change the license of all CMakeLists.txt and *.cmake files to BSD
Task-number: QTBUG-105718
Change-Id: Iab6aaba3efbb0e887673eb9523354ba78aba6520
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-08-23 15:46:30 +02:00
Ivan Solovev 6d05584e17 Use QT_DISABLE_DEPRECATED_UP_TO instead of QT_DISABLE_DEPRECATED_BEFORE
Task-number: QTBUG-104944
Change-Id: I3a7f0f7980b03e72d058a70cbdc3b7fc8eacab23
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-08-22 12:59:35 +02:00
Sona Kurazyan 43e3ef8e00 Port away from deprecated QDomDocument::setContent() overload
Task-number: QTBUG-104507
Change-Id: Ibbb4fddf37ed1b9840368542d8757654df33d1ac
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-08-15 09:42:59 +02:00
Alexandru Croitor 8c65a7f854 CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers
Change-Id: I4477f154510114928a291b7f7713f520142f572c
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2022-07-27 13:48:06 +02:00
Sona Kurazyan 13a1debfcf Prepare for usage of the new QDomDocument::setContent() overload
The new overloads will return QDomDocument::ParseResult, that is
explicitly convertible to bool, so get rid of the implicit conversion.

Task-number: QTBUG-104507
Change-Id: I3d47bc84186d7809bbf643ff6fd708f065ac28c9
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-07-21 17:30:35 +02:00
Volker Hilsheimer a7dee0935c QLinkedList: only support data streaming if contained type does
Otherwise, QTypeTraits::has_i/ostream_operator_v will incorrectly
be true for any QLinkedList, and conditionally compiled code will
result in compile errors.

Add static_asserts to the test.

Pick-to: 6.2 6.3 6.4
Change-Id: I3a14c77e9ed65223ac1020b295a468a6b92ca6c2
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-07-12 22:27:56 +02:00
Lucie Gérard 23d34d1b17 Add license headers to cmake files
CMakeLists.txt and .cmake files of significant size
(more than 2 lines according to our check in tst_license.pl)
now have the copyright and license header.

Existing copyright statements remain intact

Task-number: QTBUG-88621
Change-Id: I6037589b6cb21970616972a95b656119fda64a7e
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-07-07 17:41:38 +02:00
Marc Mutz ada2f6fd4d QRegExp benchmark: fix GCC -Wmaybe-unused
It would be nice if we could somehow communicate to the compiler
centrally that QBENCHMARK bodies will be run at least once, but I
don't see how, with the current API design, so fix the warning in the
user, with clenched teeth.

Pick-to: 6.4 6.3 6.2
Change-Id: I943ca4f5db92c3d65fa60d3bb2e1268ab8ca86d5
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2022-07-06 10:31:16 +02:00
Lucie Gérard d8ae622baf Use SPDX license identifiers
Replace the current license disclaimer in files by
a SPDX-License-Identifier.
License files are organized under LICENSES directory.

Pick-to: 6.4
Task-number: QTBUG-67283
Change-Id: I52b9410c22909f4253094d2458d309e7f6ad2620
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-06-23 08:06:40 +02:00
Marc Mutz 189e3a842f tst_qxmlinputsource: fix C++20-deprecated implicit [=]-capture of this
The variables are all members, so just capture [this].

As a drive-by, fix clazy-connect-3arg-lambda, and remove superfluous
empty lambda argument list.

Pick-to: 6.4 6.3 6.2
Change-Id: I59d188b48d6566d886e8df960fea00e8eb41b3f4
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2022-06-21 14:03:50 +02:00
Sona Kurazyan 585b20e5d8 tst_QTextCodec::toLocal8Bit: disable the test for Android
Android doesn't allow to start a QProcess with custom binary, disable
the tst_QTextCodec::toLocal8Bit test.

Fixes: QTBUG-102254
Change-Id: I24156b974e1e672f4515a6722e73990f44f257e6
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit a3f3095ff4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2022-04-04 08:39:29 +00:00
Sona Kurazyan a742f73c31 Remove uses of deprecated QString::count()
Change-Id: I14527f21c72d61dc8acd4aa1c5aee1b706b11c7d
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-03-16 12:42:37 +01:00
Sona Kurazyan 1f3b0dc151 Don't pass 0 as nullptr when constructing a QLatin1String
Change-Id: I001c808fe7a121a96d9561fc8404451acf9fb57a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-03-08 18:35:59 +01:00
Alexey Edelev 9289516b3a Disable QT_NO_JAVA_STYLE_ITERATORS for tst_qlinkedlist
Pick-to: 6.2 6.3
Task-number: QTBUG-100295
Change-Id: I7fb85ad08c66a1c319ab4790a0765037ad8ded8f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-02-14 11:19:48 +01:00
Marc Mutz 9464b6de23 tst_QLinkedList: Unconditionally enable testing Java-style iterators
Remove the check for QT_NO_JAVA_STYLE_ITERATORS in code, because
it's unconditionally undefined in CMakeLists.txt so that we can test
them, even though we don't normally allow them in internal Qt code.

Also reverts commit 93be44c9c1
so we continue to test QLinkedList's Java-style iterators.

Task-number: QTBUG-100359
Pick-to: 6.3 6.2
Change-Id: Ib0cdfde02c49654a8587fb8058a26d7c095281ee
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2022-02-08 14:18:12 +00:00
Marc Mutz 93be44c9c1 tst_QLinkedList: compile with QT_NO_JAVA_STYLE_ITERATORS
Temporarily disable tests of Java-style iteration, as
qtbase/1d28fd7a9c4720289f3d41db2ed8e6fcb07d5a30 unconditionally
re-enabled QT_NO_JAVA_STYLE_ITERATORS, with no API to disable it,
breaking integration.

This commit disables the Java-style iterator code whereas the
next one reverts this and uses the API introduced in
qtbase/1d28fd7a9c4720289f3d41db2ed8e6fcb07d5a30 to re-disable
QT_NO_JAVA_STYLE_ITERATORS.

Fixes: QTBUG-100359
Pick-to: 6.3 6.2
Change-Id: I41ea0d50d1d94ff57891241cf11645d7450432d0
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2022-02-01 09:24:18 +01:00
Joerg Bornemann 2fd61d66d0 Remove unused .qrc files
Task-number: QTBUG-94446
Change-Id: Icb5f7aa9e86cb0efeae16dac2618547d4343e816
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2022-01-18 09:35:17 +01:00
Eskil Abrahamsen Blomfeldt 0ba059c6dc Port remaining graphical effects to Qt 6
Brings back shader effects that require runtime generation based on
parameters.

We use QTemporaryFile to temporarily store generated shaders. This
could be made more efficient if we added a way to set the generated
shader directly on the shader effect instead.

[ChangeLog][GraphicalEffects] Added back missing Qt 5 effects:
Blend, DirectionalBlur, DropShadow, GaussianBlur, Glow, InnerShadow,
MaskedBlur, RadialBlur, RecursiveBlur, and ZoomBlur.

Change-Id: I8ce02a6c8689027258f82dd4fc20bfa39ee6cfea
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2022-01-12 12:31:48 +01:00
Edward Welbourne 216a77d83c Add QTextCodec test that triggers an assertion in QUtf32
Thiago recently replaced a bogus assertion with length control in
QUtf32::convertFromUnicode() but there was no way to test it from
qtbase's public API. However, QTextCodec still exercises the relevant
overload, so add a test for it here, which duly triggers the
assertion:

1: PASS   : tst_QTextCodec::utf32Codec(empty))
1: QFATAL : tst_QTextCodec::utf32Codec(Chakma digits) ASSERT: "end - ba.constData() == length" in file /home/eddy/work/Qt-dev/qtbase/src/corelib/text/qstringconverter.cpp, line 1030
1: FAIL!  : tst_QTextCodec::utf32Codec(Chakma digits) Received a fatal error.
1:    Loc: [/home/eddy/work/Qt-dev/qtbase/src/corelib/text/qstringconverter.cpp(1030)]

The test passes with Thiago's fix.

Pick-to: 6.2
Task-number: QTBUG-97122
Change-Id: Ib413426545892e0153bd892627e926292561b67b
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-10-13 18:35:44 +02:00
Laszlo Agocs 04a0bac665 Use correct CMake functions in graph.eff. manual test
Pick-to: 6.2
Change-Id: I3bbf516f5f583f5219a89b84994101f3368b811a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-10-06 15:09:16 +02:00
Alexandru Croitor de70cacddd CMake: Bump almost all cmake_minimum_required calls to 3.16
Needed for subsequent change that will check and error out if the
version is lower than 3.16. We do that to ensure all policies
introduced by CMake up to version 3.16 have their behavior set to
NEW.

Pick-to: 6.2
Task-number: QTBUG-95018
Change-Id: I1b3dbd4e17536e0cdd38d96eccc1a27af35d00f0
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2021-09-22 19:52:12 +02:00
Ivan Solovev 421de71a52 Fix QTextCodec::canEncode() for ICU codec
QTextCodec::canEncode() relies on the number of invalid characters
to determine if the encoding is possible or not.

By default the ICU fromUnicode converter method does not provide any
ways to track the amount of failures. However it uses callbacks to
report errors or replace unrecognized characters with substitute string.

This patch introduces a custom callback for fromUnicode conversion.
The callback just increases the invalid characters counter and then
calls the default callback, which does its usual job.

Pick-to: 6.2
Task-number: QTBUG-83081
Change-Id: Ic2c10285777128a25668551db2a0de4a1b9815a8
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-09-02 14:22:28 +02:00
Giuseppe D'Angelo 228185d461 QStringRef::lastIndexOf: adapt tests after upstream fixes
6cee204d56 and f0c2c987e3 in qtbase fixed matching at the last
position of a QString(View); QStringRef needs to follow suit.

Change-Id: I5e864a57d32763de56b0fc385fc029ff7b386930
Pick-to: 6.2
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-08-31 06:14:51 +02:00
Joerg Bornemann fd937f1a57 Remove qmake project files
Task-number: QTBUG-88742
Change-Id: Ic3ab6388c7dced499a893c3831429e1222403b96
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-05-03 14:00:36 +02:00
Volker Hilsheimer 086687deb2 Fix compiler warnings from int/size_t mismatches
Cast expliclity to int to silence compiler.

Change-Id: I29649c7da1850d7842318b0b2102ceb57659be3e
Reviewed-by: David Skoland <david.skoland@qt.io>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2021-05-03 10:00:23 +02:00
Volker Hilsheimer 9e398ce500 Fix warning from incorrect qHash signature
The qHash prototype returns a size_t, not an int.

Pick-to: 6.1
Change-Id: I4a29449b6e1cb2dbbc1a4ddd7f18bccf4457c75a
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2021-04-12 17:34:30 +02:00
Volker Hilsheimer 8a3b34786d Mark overrides in tests to fix compiler warnings
Pick-to: 6.1
Change-Id: I0b1fa2cabc014596ed45a59e0deec82b97b333dd
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2021-04-12 09:51:04 +02:00