Mark (const) data()/begin()/end()/size()/empty() and similar as
noexcept.
Move some trivial definitions into the class body.
Pick-to: 6.3
Change-Id: I6f3ab792264347cdc6a476dacecf065f59f16ff9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Implement getting pid by process name and enable using flock().
Pick-to: 6.2
Change-Id: I500e645b451baddea788d834374a7ae29a4d223f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
When building Qt we want to use the highest available 'target' SDK
version. If the version of the available SDK is lower than the minimum
required 'target' SDK version, we need to throw an error.
Pick-to: 6.2 6.3
Fixes: QTBUG-99165
Task-number: QTBUG-98870
Change-Id: Ib75567a6f33ac6d23d9f79e8ed8535839c08b91d
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Currently the compositor draws the Qt logo by default;
check if the window has an icon and draw that instead
if set.
Fixes: QTBUG-86052
Pick-to: 6.2 6.3
Change-Id: Ia4f9c03562c15993c86cb8717f27e47ab669353d
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
This patch installs a QAbstractItemModelTester in the
QSortFilterProxyModel tests.
Change-Id: I9bdcc21ba12f919c91c5b9514a5f4362437318c2
Reviewed-by: David Faure <david.faure@kdab.com>
We were clipping the source rect to the image, both pre and post
scrolling, but did not apply the same logic to the target position.
By computing the target position based on the already clipped source
rect we ensure that the target position is also correct.
This was causing valgrind warnings on Linux, and crashes on Windows,
when trying to test the lower level QBackingStore::scroll() function.
The reason we were not seeing this in practice was that QWidget does
its own sanitation and clipping of the arguments before passing them
on.
As a drive-by, fix the access of image to use constBits instead of a
manual cast, and rename variables to better reflect their use.
Pick-to: 6.3 6.2 5.15
Change-Id: Ibc190c2ef825e634956758f612a018f642f4202b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Currently only qtbase is being run Qt autotests
Task-number: QTBUG-99168
Pick-to: 6.2 6.3
Change-Id: Ib9678c937c91946f07b78f8141df4837fa5d4111
Reviewed-by: Toni Saario <toni.saario@qt.io>
Be smarter when allocating memory for the real data in
addStorage(). As the amount of entries in there follow
a binominal distribution, we know pretty well, how many
there will be at least and at most. This avoids most of
the reallocations of the storage when not rehashing, while
Tessil's tests show that the total memory consumption has
not changed.
Task-number: QTBUG-91739
Task-number: QTBUG-98436
Change-Id: I98854bfbde8b2a16e788bfa1890c694d38fd09b5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Change the minimum amount of buckets to be at least
128, ie. one full Span. This will simplify some assumptions
in the code.
Regeneration of rcc test-data needed because the extra buckets
causes the order of the keys to change.
Task-number: QTBUG-91739
Task-number: QTBUG-98436
Change-Id: Ic0c7da03570cc4c4e6aacc9645e536aec3667a98
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
To avoid needing a templated Span to access them
Task-number: QTBUG-98436
Change-Id: I5c3b16f9a806986b14ed794a3818990aa3ead0f7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
QHash changes some of its preconditions, so we must not call
findNode without verifying !isEmpty()
Task-number: QTBUG-91739
Task-number: QTBUG-98436
Change-Id: I2701b9a01187530f541a7c9a12db56c92f856d87
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
QGlyphRun's bounding rectangle may have zero width, e.g. when it
contains only non-printable characters. Some code, e.g.
QTextLine::glyphRuns(), may pre-calculate bounding rectangle for
QGlyphRun and store it inside via QGlyphRun::setBoundingRect().
Previously, we would ignore empty rects as an indication that no
bounding rect had been set on the QGlyphRun. This should be
checking for valid rects instead, to allow for runs containing
non-printable characters exclusively.
Fixes: QTBUG-96463
Pick-to: 6.2
Change-Id: Ia934749cfda37e60ebf98fb76536434054baa4d1
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Since switching to the plugin bases system for the network backends,
Qt again retains some QObjects after QCoreApplication shutdown.
This was previously fixed in QTBUG-84234, so make sure we destroy the
newly introduced QObjects as well.
Task-number: QTBUG-84234
Change-Id: Ibb411c2dfb716b8f2aea2a3e366253fbd9dd8f64
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Make sure configure fails early if a component cannot be found.
Task-number: QTBUG-98867
Pick-to: 6.2 6.3
Change-Id: I4baa35a84342df58ce8932601fb602be92ed5ab9
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
It was added in 5.15 when QHash could have multiple entries per key.
Pick-to: 6.2 6.3
Change-Id: Ifb855b05dd65bbc67bb64bf2567229394525b2aa
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
qt_setup_tool_path.bat did not have proper line endings on Windows with
CMake 3.19, breaking the invocation of tools that use the wrapper, for
example qmltyperegistrar.
The reason was that file(CONFIGURE) doesn't properly write line endings
with CMake 3.19. See upstream issue #21769.
Use configure_file with a proper input file to work around this issue.
Pick-to: 6.2
Fixes: QTBUG-98843
Change-Id: I2a4da15f306dc844cf83ca9721a77196c42af2ad
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
-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>