-g4 was deprecated in Emscripten 2.0.17, and since we are well past
that version we can safely use -gsource-map instead.
Change-Id: I497155619d6320661f6be0e220b52fa7d6ca0b8e
Reviewed-by: David Skoland <david.skoland@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Especially static inline variables. This greatly reduces the amount of
code that existed in macros, moving them to templates.
Additionally, this removes one level of indirection from
Q_APPLICATION_STATIC by removing the std::unique_ptr. We now directly
manage the object's storage.
Change-Id: I2cffe62afda945079b63fffd16bcc825cc04334e
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Large amount of threads is unstable and do not finish in given time
Pick-to: 6.2
Change-Id: I0ce4c8cd278d6611c9e9da7326048279ccc458fd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Also change usage of QDir::currentPath to QDir::tempPath
instead as QNX tests are run on CI at qemu over NFS.
Pick-to: 6.2
Change-Id: I2e1d6629299acd125117bcce90320c70eeb4a1a5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Modify similar like is used for Windows
Pick-to: 6.2
Change-Id: I133a8dde2e78cc66aa9544246cd750a6543b4883
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Filter out the last argument of type QPrivateSignal from the signal's
arguments passed to QtFuture::connect().
Pick-to: 6.2
Fixes: QTBUG-92501
Change-Id: Idcd6baba1f01fcc94fa64b1c7030a629d01ed7a1
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Avoids a lot of overhead. Could be even simpler, but we don't need to
duplicate QFileSystemEntry.
Pick-to: 6.2
Change-Id: Ib42b3adc93bf4d43bd55fffd16beda971e4b2ae7
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Igor Kushnir <igorkuo@gmail.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
They're not atomic anyway. But it does make it possible to use
QAtomicInteger in both bootstrapped and non-bootstrapped code.
Change-Id: I2cffe62afda945079b63fffd16bcc67e082d92ae
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
We already checked that the two iterators, indvidually, are valid, but
we didn't check that the range formed by them is valid, namely that
the end iterator is reachable from the start iterator.
Add an assert, because if the range isn't valid, we run into UB in the
std::move() algorithm two lines later.
Qt 5.15 uses std::copy() here, which has the same precondition, so the
assertion would make sense there, too.
Pick-to: 6.2 5.15
Change-Id: I90b7e846455ff86383a8971bea908036684961d8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
A previous attempt to make qHash() a hidden friend ran into an ICE on
Clang, so to simplify the implementation, QVLABase::hash() is public
for now.
Use QtPrivate::QNothrowHashable_v to simplify the noexcept clauses.
Fixes: QTBUG-84785
Change-Id: Ibb520bde7b1d6dc45846bd8e1fa27c39c401b96a
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Also added a QVLABase::resize_impl() because insert(it, n, v) was the
only function moved down into QVLABase to call resize().
Task-number: QTBUG-84785
Change-Id: I5dd0092216d73b28b957a01845325d744a5c0ba9
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Moving emplace() takes care of the bulk of insert()-like operations in
QVarLengthArray. What's missing now is just the pseudo-ranged
insert(i, n, x) and append(ptr, n) operations.
Task-number: QTBUG-84785
Change-Id: I8be7f50ecab3de79b617436c46d3feec065b4f88
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Implement erase()/erase_if() using removeAll()/removeIf()
These functions are now on QVLABase, so we no longer instantiate a
different sequential_erase{,_if}() per Prealloc.
Task-number: QTBUG-84785
Change-Id: I339759bc02b0e3104f7d1273ce6d5e09b493610c
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Move emplace_back() down from QVarLengthArray to QVLABase.
Task-number: QTBUG-84785
Change-Id: I29020737007f245c3b52fd7960369262510c0d52
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This is the core of QVarLengthArray. To move it down into QVLABase, we
need to pass Prealloc and this->array as additional function
arguments.
Task-number: QTBUG-84785
Change-Id: I082fa4ef957fcde7b8fcc3ca421621aa01ba5d59
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Remove some reinterpret_casts that became useless when we ported
'ptr' to be a 'void*'.
Task-number: QTBUG-84785
Change-Id: I886304da50e18152abc664d2adf094617c37887f
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
It turns out that some functionality (most prominently, the verify()
function that contains the asserts), depends on nothing but the size
member, so Extract QVLABaseBase, a non-template class, to hold the data
members, and the size()- and capacity()-related member functions.
Task-number: QTBUG-84785
Change-Id: Ic21855fd6147b67507c122b6f091b44a3ba997f5
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Move the remaining methods to the QVLABase base class that can be moved,
being those which do not depend on QVLAStorage::array.
Include the relational operators this time around.
Task-number: QTBUG-84785
Change-Id: I0f22b076791496833cba033c1be2a69ec8b129a1
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Move all methods to the QVLABase base class that can be moved, being
those which do not depend on QVLAStorage::array.
Skip relational operators for the time being, but move the methods
which are defined out-of-line now.
Task-number: QTBUG-84785
Change-Id: I355c0581f74d79d9bae37861b32d795ddcb2fb69
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Move all methods to the QVLABase base class that can be moved, being
those which do not depend on QVLAStorage::array.
Skip relational operators for the time being, as well as the methods
which are defined out-of-line.
Keep the old definitions around as long as qdoc cannot, yet, associate
derived-class \fn with base-class definitions, via using-declarations.
We don't want to export the QVLABase class in the docs.
Task-number: QTBUG-84785
Change-Id: Ic61e6029e07faca5be99d7e2e197d5bc7fe74c4e
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
All Qt 6 containers have "fast" prepend these days. Except
QVLA. Instead of enabling "fast" prepend for QVLA, slowing down
idiomatic QVLA use, simply deprecate prepend().
There appear to be no users of this function in qtbase outside tests.
[ChangeLog][QtCore][Deprecation Notices][QVarLengthArray] Deprecated
prepend() because QVarLengthArray is the only Qt container without a
"fast" prepend. If you require that functionality, even though it's a
linear operation, then use insert(cbegin(), ~~~) instead.
Change-Id: I39ff1dd7d4de7fc08d5380a5a7450dd8c8996fe2
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Amends 71aaf831d1, which wrongly assumed
that dragMoveEvent will be called and update the dragged position as we
scroll the viewport. This is not the case, so we have to do so manually
when the view is in DraggingState.
Since dragMoveEvent cannot be faked, and since we cannot fake a
mouseMoveEvent (it would throw off the drag'n'drop state machine),
calculate the new draggedPosition based on old position and the new
offset.
As with all drag'n'drop, we cannot test this using an auto test.
Task-number: QTBUG-96124
Fixes: QTBUG-98961
Change-Id: Ifcfc1a11aa7258ec4610a548a276b4dd4a814590
Reviewed-by: Zhang Hao <zhanghao@uniontech.com>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
After 7369c31ca1f446e81eda1c93ba13767ffcd83efe, unaccepted touch points
were not grabbed anymore in calls to activateImplicitTouchGrab. However,
gesture recognition relies that widgets for which a gesture has been
partially recognized grab also unaccepted touch points.
Add a parameter to allow the implicit grabbing to take place also for
unaccepted event points.
Add test case that replays touch events similar to what Squish is doing,
and fails without this fix.
Pick-to: 6.2
Change-Id: Idb0b20301b1827be57a03013a59043d97c2ee7b6
Reviewed-by: Stefan Gehn <stefan.gehn@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
QFileSystemEntry::QFileSystemEntry(const QString &filePath) already
calls this function. Calling it repeatedly changes nothing but wastes
CPU time. Neither the line modified in this commit nor the
QFileSystemEntry's constructor have been changed since 2011's commit
"Initial import from the monolithic Qt." Other constructor overloads of
QFileInfoPrivate don't call QDir::fromNativeSeparators().
Change-Id: I01e54662efd96e87c4a686369dc0b265b47e5938
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
In f761ad3cd9 we added a cross-platform
consistent approach to vertical spacing of text. However, this has
created problem on macOS, as some of the default fonts on the system
have inconsistent metrics. Specifically, Monaco is missing the
typographical metrics flag in its OS/2 table, and the alternative
metrics in the table are about 30% larger than the typographical
metrics (which match what is used natively). As a result, the fonts
look the same on macOS as on other platforms now, but different from
when the same fonts are used in native apps.
We can't have fonts look wrong on their native platform, so we
revert this change for CoreText, trusting the metrics we get from
the system instead. We keep the consistent approach for the FreeType
engine, as its main use case is cross-platform consistent text
rendering.
[ChangeLog][macOS][Text] Fixed an issue where certain fonts, such as
Monaco, would have a different line spacing than expected.
Pick-to: 6.2
Fixes: QTBUG-97818
Change-Id: I0a3dbe4636d67779935e645066b1e51c1517dc6d
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
It's a bit weird that the (counted-)range-append() allows n < 0, but
requires p != nullptr even when n == 0.
Fix by allowing p == nullptr iff n == 0.
[ChangeLog][QtCore][QVarLengthArray] The counted-range-append()
function (append(ptr, n)) now accepts ptr == nullptr, provided n == 0,
too (was: triggered assertion).
Pick-to: 6.2
Change-Id: Ifb97170a930e97cb8f4194282cada0faf820cc53
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Unlike the shader resource binding lists that automatically recognize
in setShaderResources() when a referenced QRhiResource has been rebuilt
in the meantime (create() was called i.e. there may be completely
different native objects underneath), QRhiTextureRenderTarget has no
such thing. This leads to an asymmetric API and requires also rebuilding
the rt whenever an attachment is rebuilt:
rt = rhi->newTextureRenderTarget({ { texture } })
rt->create()
cb->beginPass(rt, ...)
texture->setPixelSize(...)
texture->create()
rt->create() // this should not be needed
cb->beginPass(rt, ...)
Avoid having to do that second rt->create().
Change-Id: If14eaa7aac3530950498bbdf834324d0741a7c4d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Remove scaffolding in the test again.
[ChangeLog][QtCore][QList] Fixed a regression that caused the range
constructor to fail for pure input_iterator's.
Pick-to: 6.2
Fixes: QTBUG-99036
Change-Id: I72d01a9c44c3862c335d96538f26a453b4c7c554
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Also consolidate several find_package(Qt6 ...) calls in one call.
Task-number: QTBUG-98867
Change-Id: Idfd5e71f46d4489fac7411cbfadb84437a0658f3
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
When the range-erase() function is called with an empty, valid range,
it passed equal iterators to both the first and the last arguments of
std::move(f, l, d) (the algorithm, not the cast). This is UB, since it
violates the algorithm's precondition that d ∉ [f,l). For non-empty
ranges, f > d, thus d < f, hence d ∉ [f,l), so everything is ok
_there_.
Fix the empty range case by returning early.
Reviewers may question the precondition, expecting that std::move(f,
l, f) just be a no-op, but the algorithm, as specified, performs
self-move-assignments in that case, which need not be supported. In
fact, the Hinnant criterion, itself only applicable if one calls for
self-swap-safety, asks for self-move-assignment-safety only for
objects in the moved-from state. QVarLengthArray, itself, meets only
the Hinnant criterion; self-move-assignment of non-empty QVLAs invokes
UB.
So, the UB here is real.
Qt 5.15 uses std::copy() here, which has the same precondition as
std::move(), and the same fix applies there, too.
[ChangeLog][QtCore][QVarLengthArray] Fixed a bug where range-erase()
could invoke undefined behavior when called with an empty range.
Pick-to: 6.2 5.15
Change-Id: I656aa09d025168d6d9ef088ad4c6954d216f0d54
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
In this first patch of the series, we move the fields (a, s, ptr) and
(array) into each their base class, separating concerns: The QVLABase
class is independent of Prealloc, while the QVLAStorage class is
independent of T (only depends on Prealloc, alignof(T) and sizeof(T),
and that can probably be reduced even further in later patches, since
we ought to need only alignof(T) and sizeof(T) * Prealloc, and
alignment can be substituted with std::max_align_t).
Doing so while keeping all member functions on QVLA, however, means we
need to sprinkle 'this->' in front of every data member access. C'est
la vie.
Task-number: QTBUG-84785
Change-Id: Iafbf97f41b9743b6dc2bfc13f3486d73e854b7cf
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Using REQUIRED as a prefix instead of suffix works better with
OPTIONAL_COMPONENTS, and is also the order in the CMake manual.
Task-number: QTBUG-98867
Pick-to: 6.2
Change-Id: I1ab68408b95d8edf06272a3b9fceccd8d8e597fc
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
No need to wrap the QLatin1String in a QString() to get at arg now.
Change-Id: Iac90e052b88077b9c2bd3e7eca6bc31935baa4b8
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
After we've checked m_wasExpectedFail, we might as well set it
promptly, since one of our earlier checks is on the same
condition. Explain what that check is about, fix a typo in another
comment and make the local ok variable const, since it can be.
Change-Id: Ie04c0ad4248e47b116d3e22046116d39cf2ac6df
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
If an incident has an empty description we produced output with a
dangling space. Avoid triggering the inanity 'bot with those.
Reorganise the code to save some duplication.
Change-Id: I1dc29fa8ad4449a4584f11dddcf002e405cd9238
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The subclass's code can refer to the base's public enums without
needing the (long) class prefix.
Change-Id: I4824440d216695aee9345776faba2e510130425e
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The rationale for skipping pass after XFail is "to emit a single test
point for" the test; emitting several XFails violates that aim.
Task-number: QTBUG-96844
Change-Id: Ia8626dfc2dded234b3aa530fc2dc2324f1e28400
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
It makes no sense to include output for a blacklisted test that would
have been excluded had it not been blacklisted.
Task-number: QTBUG-96844
Change-Id: I164e0c26a921101cbf8986904851260d181be00f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Skip ends the test (albeit inconclusively). Rearrange the enums in
the abstract logger, move code to handle skip between relevant
function and tidy up various things that became simpler as a result.
Also reorder the message enum, and its switches, to separate testlib's
internals from the usual Qt messages, and put each group in ascending
order of severity.
Task-number: QTBUG-96844
Change-Id: I2c7a634b9f849830d64eafa750155e66e244b729
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The actual files present for expected data, the test function that
selected which tests to skip and the python function to select which
to not generate data for weren't in sync with one another.
The test-code's reason for omitting three tests was that we lacked
data files for them. So generate those and skip that exception. The
generator script's code to decide which to generate didn't exclude
anything like as many, so update it to match the test-code. In the
process, save repeating a startswith test that was used both
positively and negatively, unifying two conditions.
Extend the generator script's handling of its --skip-callgrind option
by auto-setting that option if valgrind isn't available, to match the
driver program's similar skipping.
The generated data included many files for tests we skip and, as
mentioned already, lacked files for some tests we only skipped because
we lacked them. Remove the unused files, add the lacking ones.
Change-Id: If91696cdd95b7b0d5f3d686bff839f1bf15e121b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
A comment in the existing implementation encouraged doing so, but for
a bug in GCC 6. We no longer care.
Change-Id: Ia8cb2bc5e184510e3d756e8bbfe6bc0e852e6830
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
A comment on QTRY_IMPL() helpfully mentioned the bug number of the
issue that prevented us from using qWaitFor; and MSVC < 2017 are no
longer supported so it looked possible to make the change suggested.
However, the implementation has, in the mean time, grown some features
not (currently) provided by qWaitFor(), so update the comment.
In the process, fix one minor error in QTRY_TIMEOUT_DEBUG_IMPL() where
parentheses enclosed the wrong text; (2 * timeoutValue) would not
produce the intended result if timeoutValue were 1 + 500, for
example. The macro parameter should be enclosed, not the expression
using it as parameter to a further macro.
Task-number: QTBUG-59096
Change-Id: Ie16e297def9d1f983cd5964bc628b2c3c0aaecda
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The various variants duplicated some rather complex code around
varying setup in the middle. Rework in terms of a macro that defines
main() and takes the setup code as a parameter. That setup code also
had some common structure, so package that in a setup macro that takes
the class to be used.
Reworked various testlib selftests that were using QTEST_MAIN_IMPL();
change to use the new QTEST_MAIN_WRAPPER() and TEST_MAIN_SETUP().
These might be better dealt with by supporting a second form of the
initMain() test-setup function in the test classes, that takes
references for argc and argv, to let a test massage its command-line
options.
Change-Id: I7fb16b38d51c80ba2f5c9c82f3b7a37ffc636795
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>