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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>