Before searching, foldCase the first up to 256 characters, and use this
buffer to compare against the haystack. If the needle is larger than the
buffer, compare the rest of the needle against the rest of the haystack
for every potential match. The buffer is placed on the stack and must be
refolded for each search, but this change does not break the API.
This is faster than the old implementation, except if the needle is long
and it is found near the beginning of the haystack, or if the needle is
long and it is not found in a short haystack where few comparisons are
done and hence few case foldings were needed in the old implementation.
Benchmarking using tst_bench_qstringtokenizer tokenize_qstring_qstring
shows an improvement for the the total testcase and usually for each
individual test.
Fixes: QTBUG-100239
Change-Id: Ie61342eb5c19f32de3c1ba0a51dbb0db503bdf3a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit addresses a comment from the review of QTBUG-98434.
QL1S has its own arg()s, replace QStringLiteral("...").arg with
"..."_L1.arg.
Task-number: QTBUG-103100
Change-Id: I5313783e36101a9a65c7d5a2344ca46614658b80
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Inserting the same key repeatedly with QMultiHash will not
test rehashing behavior because in Qt6 those entries all
end up in a linked list.
Pick-to: 6.4
Change-Id: I78c45eed0f35a13af6d6da75d7189a6933750f13
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
It seems all the others have had this treatment, but one got missed or
added while the others were being fixed.
Change-Id: If47e2c6bf939b7a55f2c38b029c1df3a901e8bfc
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
The QTRY_* macros and QTestEventLoop have (since 6.3) been exiting
their loops early if the test has failed. Where that was appropriate,
they should also have been exiting early on skip.
[ChangeLog][QtTest] Added QTest::currentTestResolved(), which is true
if the test has failed or skipped. The QTRY_*() macros and
QTestEventLoop now use this, rather than QTest::currentTestFailed(),
to test whether they should stop looping, so that they also do so on a
skip.
Task-number: QTBUG-104441
Change-Id: Ibf3d5a095b35e6670bc3daf756f05b66f7f3ef9b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Jason McDonald <macadder1@gmail.com>
And don't decompress the data
Pick-to: 6.4
Fixes: QTBUG-106689
Change-Id: I93a96be8178e24ff0b0bb8647276828161445cf5
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
While it's being picked into 6.3, it's not present in 6.3.[01], so
I've left it out of QDoc's sight (even though it's still \internal)
for the version picked to 6.3, but let's include it in internal docs
as "from 6.4" since that's the first minor release to contain it.
Pick-to: 6.4
Change-Id: I1704a1ca4ba1231d0213e9ca236ef8401a59ddd0
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
The QTRY_* macros and QTestEventLoop exit early if the test has
resolved; however, in the cleanup phase of a test, even if the test
has failed, these loops should continue as normal.
[ChangeLog][QtTest] During the cleanup() phase of a test, the QTRY_*
macros and QTestEventLoop now ignore the test resolution, in contrast
to when they are used from the test itself, which (since 6.3.0) exits
the loops early if the test has failed.
Pick-to: 6.4 6.3
Fixes: QTBUG-104441
Change-Id: I2673161967cbbc57815155af698a9338ab98a686
Reviewed-by: Jason McDonald <macadder1@gmail.com>
The regex used a greedy .+ to match an actual dot and a space,
preceding an open parenthesis, with the result that if the message
contained any parentheses that .+ swallowed everything up to the last
of them. Correct the regex so that recently-added tests' error
messages show up correctly.
Change-Id: I6e52c9b2a6e7959335fcddbb4266f65b589eba68
Reviewed-by: Jason McDonald <macadder1@gmail.com>
The recently added test for QTestEventLoop produced a message which
the TAP test-logger mis-parses. Since that message shall soon go away
(when I fix the bug the new test exists to verify), modify one of
cmptest's QVERIFY2() messages to trip up the same bug, so we can spot
any regressions on this in future (after the imminent fix to this TAP
issue).
Change-Id: Ibbe9931c01c75df529c9571e2bbdbd34010dd9ec
Reviewed-by: Jason McDonald <macadder1@gmail.com>
Setting QT_QPA_EGLFS_KMS_NO_EVENT_READER_THREAD=1 makes it operate
like it did before 5.12.7: just calling drmhandleEvent (guarded by
a mutex) on the current (main or render, depending on the QQ render
loop) thread.
This should not be needed and is discouraged (will certainly cause
deadlocks in multiscreen setups + QQ threaded render loop on certain
embedded systems), but it seems necessary to provide a way to revert
back to the old way of functioning as there are reports about
problems with screen cloning when the dedicated event reading thread
is used.
Task-number: QTBUG-91882
Pick-to: 6.4 6.3 6.2 5.15
Change-Id: I4cddcd09149dcab9e135467b6ef0e047a2a0ecff
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
... and use it to remove the associated magic number 4 from the code
base.
As a drive-by, replace a naked qWarning() with the existing
invalidCompressedData() helper function, and a C-style cast with
reinterpret_cast.
Pick-to: 6.4 6.3 6.2
Task-number: QTBUG-106542
Change-Id: I35004757e01bfc0747f7cc65bdf6eb243225caad
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This is good enough for a hash value and brings a not
insignificant boost to cases when this is used heavily.
In qmlbench with delegates_shadereffect.qml this improves
the results in my runs 386->405.
Pick-to: 6.4
Change-Id: I3dbb9ffabf5986c5ff6b69928b3f073e944450ee
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
This commit addresses a comment from the review of QTBUG-98434.
Replace the index based for loop with a range based for loop.
Task-number: QTBUG-103100
Change-Id: Iaf92382f07172b254486882beb67f1927ad89be5
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
- Use qsizetype
- Use new string literals instead of deprecated QLatin1String()
- Streamline some code
- Remove unused member variable
- Remove module include
Pick-to: 6.4
Change-Id: Ia96424a23f3ae10e57db942de49949ce3aef8876
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
QDockWidgetLayoutState::itemRect() has been used to calculate a dock
widget's size when unplugging from the main window. This method is meant
to calculate the size of the rubber band, showing the dock widget's
dock area.
The rubber band is by QDockAreaLayout::sep wider (top or bottom dock)
or higher (left or right dock) than the respective dock widget. This is
to make sure the rubber band is never fully covered by the dock widget.
By wrongly using itemRect() also for the dock widget's size after
unplugging, the dock widget grows in size each time it is unplugged.
This patch passes an invalid QRect to QDockWidgetPrivate::unplug(), in
order to prevent resizing.
tst_QDockWidget::unplugAndResize() is extended to check size
consistency after unplugging (corrected for frame margins).
Fixes: QTBUG-106531
Pick-to: 6.4 6.2
Change-Id: I1cf9f695691b0e165a5cb2881781602426e5d587
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Amends 2d0c31e7d9. We were using
MetaTypeDecay in qTryMetaTypeInterfaceForType; but that is not used by
moc when complete types are enforced. Change qt_metaTypeArray to also
use qTryMetaTypeInterfaceForType, so that the code path for "force
complete types"[0] and the normal one do not diverge.
[0] Most easily enabled by using one of the QML type registration
macros.
Fixes: QTBUG-106672
Pick-to: 6.4 6.4.0
Change-Id: I9bf14873d1d0c4127a676643f7e8eb77f6e42dc8
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Avoid the 'file' command shadowing by a variable and use file name when
filtering header files by type.
Amends 8539e641f6
Task-number: QTBUG-103196
Change-Id: If012975efafaf119cffbd89baf84df334bc057ac
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Detect appearance and reimplement QPlatformTheme::appearance() in
KDE and Gnome themes.
Task-number: QTBUG-106381
Change-Id: Id65ea1e47696fbfb87db5ed194300d652e0bbe66
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This commit addresses a comment from the review of QTBUG-98434.
Introduce a static const QString array for the name filters and create
the filtering QStringList from this array.
Task-number: QTBUG-103100
Change-Id: I7e07ea1083d802340c943f4a67eb4a831be4516a
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
This commit addresses a comment from the review of QTBUG-98434.
Use isEmpty() to check whether the string is empty or not.
Task-number: QTBUG-103100
Change-Id: Ia7c298bc4436d974b0369e178a370764c1dbe051
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
- Move the docs for functions from qnumeric.h from qglobal.cpp to
qnumeric.cpp.
- Update the '\relates' commands to refer to QtNumeric
instead of QtGlobal.
- Add overview page.
Task-number: QTBUG-106154
Change-Id: Id39f2508415995a4c7a9dcc0a323447dbe348978
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
If QT_HOST_PATH_CMAKE_DIR is set it also needs to be used by multi-ABI
external projects. Add it to a list of cmake arguments.
Pick-to: 6.3 6.4 6.4.0
Fixes: QTBUG-106616
Change-Id: I5b12f72cabdad86846851fb3605e5388896e5abf
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit addresses some comments from the review of QTBUG-98434.
Some strings were initialized with incorrect literal types - fix the
mismatches between the string types and string literals.
Task-number: QTBUG-103100
Change-Id: I5f9f8a2c1583c21711f7b9ff177917f20690b5a3
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Use PARSE_ARGV signature of the cmake_parse_arguments function to avoid
escaping of semicolons when passing arguments to the
qt_internal_add_configure_time_tool and
qt_internal_add_configure_time_executable function.
Amends ac74b60c9c
Task-number: QTBUG-87480
Change-Id: I343abbd75107e56aaccab6e388db8dbda0525af3
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
The function does the same as the original one but respects semicolons
in CONTENT argument due to the use of the cmake_parse_arguments variant
with PARSE_ARGV.
Change-Id: I263662dc18e411a735b586995b82791fc6b888ea
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
We already have:
a, a timeout as part of QtTest. By default it lets each test function
run for 5 minutes. This timeout can be configured using
QTEST_FUNCTION_TIMEOUT.
b, maxTimeBetweenOutput in the CI. The CI will kill the process if too
much time passes between individual output lines of a test.
c, maxTimeInSeconds in the CI. This does exactly the same as the
androidtestrunner timeout.
The CI timeouts can be centrally tuned per platform and Qt module. This
is preferable over a special timeout just for android.
As other people may be using androidtestrunner for unrelated projects,
don't delete the timeout, but simply disable it from CMake by setting
it to -1.
Task-number: QTBUG-106479
Task-number: QTBUG-101596
Task-number: QTBUG-100242
Change-Id: If4ce00948e204182bb12ac4859d3b0dd193de7ad
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Dimitrios Apostolou <jimis@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
These were copied from *.qdoc files by a mistake.
Change-Id: I2379422c2c8558bd8c2111170d0c1d97f06797da
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
[ChangeLog][QtCore][QAtomic] Documented new overloads of testAndSet()
that were originally added for 5.3.
Fixes: QTBUG-103008
Pick-to: 6.4 6.3 6.2 5.15
Change-Id: I96c7b5828dc284651e6514389f405d7670d6784b
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
To support cancellation of continuations attached via the parent future,
for each future returned by a continuation we store a pointer to its
parent (i.e. future the continuation is attached to). Later, before
executing a continuation, we go through chain of parents and check if
any of them is cancelled. However, if one of the parents is destroyed
while the chain is executing, the next continuations' parent pointers
will become invalid. So storing the parent pointers isn't safe.
This commit changes the logic of handling the cancelled continuation
chain in the following way:
- Instead of storing a parent pointer in the continuation future's data,
we do the opposite: we store a pointer to continuation's future in the
parent.
- When a future is cancelled, we mark all continuation futures in the
chain with a flag indicating that the chain is cancelled.
- To guarantee that the pointers to continuation future's data don't
become invalid, we clean the continuation (that stores a copy of its
future's data and keeps it alive) only when the associated promise
is destructed, instead of cleaning it after the continuation is run.
Fixes: QTBUG-105182
Fixes: QTBUG-106083
Pick-to: 6.2 6.3 6.4
Change-Id: I48afa98152672c0fc737112be4ca3b1b42f6ed30
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
With the introduction of Qt:Appearance, its predecessor in
QPlatformTheme has become redundant.
This patch replaces all occurrences of QPlatformTheme::Appearance with
the new enum class.
Task-number: QTBUG-106381
Change-Id: I5406f1b7c19f68571f074617c681318c96a6517e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Calling commit() in the QTouchEventWidgetSequence destructor bypasses
the vtable. This causes a compiler warning.
This patch eliminates the warning by explicitly calling
QTouchEventWidgetSequence::commit().
Pick-to: 6.4
Change-Id: I1354aa22d2a85a609adc307338d118c5789df93f
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Keep the line short. While at it, also mention Intel, because
that's where the technology is available at (and searching for
Intel CET will lead you to the right places).
Change-Id: Iefe0d735a814880d49fbe82cfd3a790af656377e
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>