Commit Graph

49499 Commits

Author SHA1 Message Date
Alexandru Croitor
f9dcade5e7 CMake: Fix resource objects story in static prl files
The CMake build of Qt intends to improve the developer experience in
regards to static Qt builds and Qt resource files. Specifically with a
CMake build of Qt, Qt developers don't have to manually call
Q_INIT_RESOURCE anymore.

For details see the following commits
e343affd63
e817ac3d68
4ab5432081

The last commit's implementation is incomplete though.
To ensure successful linking, each target's prl file should contain
not only the resource object files that are assigned to the target,
but also all resource object files of the target's dependencies.

To achieve that, qt_collect_libs will now recursively collect all
resource object files assigned to the QT_RCC_OBJECTS property of each
dependency.

Note this implementation is still incomplete. We do not export rcc
object file information in the CMake Targets files.

That means that when configuring qtdeclarative in a
non-top-level build, the generated Qml prl file will not
contain references to Core's mimetypes resource object file, etc.

So with the current change, only the object files that are part of the
current CMake configuration build are tracked.
Exporting the resource object files locations proves in a format
usable for prl files proves to be difficult (due to CMake not
supporting exporting genexes in random properties) and will have to be
addressed in a separate change.

Amends 4ab5432081

Task-number: QTBUG-88425
Change-Id: I546655bdfdf7aa86a8df9aadfc054fa415130a33
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-11-19 06:28:53 +01:00
Alexandru Croitor
5533eeeb01 CMake: Refactor parts of qt_internal_walk_libs
Refactor the function in preparation of processing rcc object files.

Introduce 2 new functions to get and set values in the memoization
dictionary used by qt_internal_walk_libs.

Modify qt_internal_add_target_aliases to assign the alias names it
creates as properties on the target.

Extract these aliases when available to assign memoized values not
only for the initial library name, but also for its aliases.

When recursively calling qt_internal_walk_libs, make sure to provide a
unique out_var name based on the outer target name, and not just
lib_libs. Otherwise the out_var values would be polluted from
previous recursion runs.

Make sure to check for -NOTFOUND in if() checks so that we reuse
memoized values that are the empty string.

Change-Id: I8fd8e2b0ae14d0ba8f502bc5a764d6e01095001a
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-11-19 06:28:41 +01:00
Joerg Bornemann
e0d709d8d3 CMake: Fix missing dependencies in *Depends headers
In qt_internal_create_module_depends_file we're checking the target
property INTERFACE_MODULE_HAS_HEADERS. However, this property is not
exported, and in per-repo builds we do not have access to this.

As we cannot export INTERFACE_* properties, we export another one,
called _qt_module_has_headers.

This amends commit 598e873c84.

Fixes: QTBUG-88503
Change-Id: I04b3e24add6e95b577a049c80683b7361ff72f59
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-11-19 06:28:10 +01:00
Karsten Heimrich
d41eed01a4 Doc: Remove wrong \obsolete doc comments
Change-Id: I541f12fab128493235716fb73d65f4ab0a62bb82
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-11-19 06:27:48 +01:00
Giuseppe D'Angelo
4d19303654 QChar: use =delete instead of private
Use the idiomatic way to block access to some functions.

Change-Id: I6760dac6ce18910bf30b527b313882e394049349
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-11-19 04:16:49 +01:00
Volker Hilsheimer
19f9b0d5f5 Disable copying and assigning of QEvent
Polymorphic classes should not be copied.

However, we do rely on event copying in our propagation logic. So, make the
members protected, don't delete them, using a dedicated macro.

This way, QMutable*Event classes can be used to make copies.

Remove some last usage of copying of QInputMethod(Query)Events.

Change-Id: Ia0a8ae4ca9de97dcd7788ca3c6ed930b6460c43a
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-11-19 03:16:48 +00:00
Giuseppe D'Angelo
c149fd232d QXmlStream: sanitize input before building a QChar
The result of getChar() may be a combination of a token category
and a code unit, like `((LETTER << 16) | c)`. Constructing a
QChar out of it requires masking the category out. This was already
done in a few code paths but missing in others.

Change-Id: I186fb01973a1badd425b3a6811843d8a40b13a6a
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-11-18 23:24:02 +01:00
Thiago Macieira
be0f1af3f1 CBOR: remove the X11 True and False for good
I don't care if you still need X11 headers. If you do, you know your
workarounds.

Pick-to: 5.15
Fixes: QTBUG-88591
Change-Id: If51855da004b4f3fbf43fffd1648a357eab2d865
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2020-11-18 14:24:02 -08:00
Lorn Potter
d91edd21d6 wasm: fix showing tooltips
Change-Id: I4c82ccc2bfa1019ef105ccf20982786097c126b9
Fixes: QTBUG-87227
Pick-to: 5.15
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2020-11-19 05:59:37 +10:00
Wang ChunLin
8455bfee76 Fix QSFPM not emitting dataChanged when source model is set
QSortFilterProxyModel did not emit dataChanged when calling
setSourceModel() after modifying the source model.
QSortFilterProxyModel::setSourceModel and
QSortFilterProxyModelPrivate::_q_sourceReset(), _q_clearMapping
is called to delete the source_index_mapping. They also need to
call create_mapping function to re-create it.

Fixes: QTBUG-87781
Pick-to: 5.15
Change-Id: Idbe34696c9d3a2fbf354b653c870bac61378811d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-11-18 20:57:48 +01:00
Christophe Giboudeaux
8a6f52bf83 Remove obsolete warnings
The libproxy issue was fixed 4 years ago and the related
Qt and libproxy bug reports were also closed long ago.

Change-Id: I5af18f1eaaffb8d33556ab94ca1759959a2c272d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-11-18 18:21:23 +01:00
Alexander Volkov
86b8c5c3f3 xcb: Avoid use-after-free in QXcbConnection::initializeScreens()
Extend the scope of the resources variable to avoid its
destruction while it's still in use.

Fixes: QTBUG-88512
Pick-to: 5.15 5.12
Change-Id: I3298aabc871ff455bd1203ec276e7600d3e151ef
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-11-18 13:41:03 +00:00
David Redondo
36b1d37cef Ensure that QMenu is polished before setting the screen in popup()
Some styles alter the widget that will influence the underlying platform
window. An example is when a style would want to draw the menu with some
transparency and sets the Qt::WA_TranslucentBackground attribute. This
needs to happen before the platform window is created. However calling
QWidgetPrivate::setScreen will end up creating the window and the
surface format will be fixed at this point.

Pick-to: 5.15
Change-Id: I707cf1de5c1614382cffbea1aae8cdb01f7de44a
Reviewed-by: Nate Graham
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2020-11-18 12:03:27 +01:00
Giuseppe D'Angelo
4e7013033f QChar: get rid of some redundant comments
We have a proper tag now.

Change-Id: Ia5279a82e078d27aa5e09a427f36cf355d959e1f
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-11-18 09:38:20 +01:00
Giuseppe D'Angelo
29942dcbb1 Centralize the wchar_t == char16_t check on Windows
Don't push it onto every TU that includes QChar (... approx.
everything that uses Qt).

Change-Id: I4a07ce9e38a347b45315db93b0c5b90c20bacdbc
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-11-18 09:38:09 +01:00
Florian Bruhin
befa3729db Fix x-height name in stylesheet docs
The *height* of an x being called "ex width" makes no sense.

Also, it seems like this measurement is typically called "x-height"
rather than "ex height", see e.g. https://en.wikipedia.org/wiki/X-height

Pick-to: 5.15 5.12
Change-Id: Id8e2c1aa9be1a4a60e667a076486777d34f1e76d
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-11-17 23:00:43 +01:00
Zhang Yu
4df5f93018 Fix QGraphicsItem crash if click right button of mouse
In this case, the 'parent' is QGraphicsTextItem which isn't a object
inheriting from QWidget. Converting QGraphicsTextItem to QWidget
by static_cast and using it as QWidget leads to crash.

Fixes: QTBUG-88309
Pick-to: 5.15
Change-Id: I3c583f43125eb36841848434d1fa9a135b0e9f57
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-11-18 05:56:27 +08:00
Allan Sandfeld Jensen
34304e3100 Get rid of Q_COMPILER_CONSTEXPR checks
Is required now.

Change-Id: I62e95929d1649ea1390392230b619bd56d2a0349
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-11-17 21:28:11 +01:00
Alex Trotsenko
1e9dc3ec2f CMake: fix QLocalSocket benchmark to use new qt_internal_ API
Amends ee122077b.

Change-Id: I9b750eb88ac9c83da26da4e5921cb147716c5eb6
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2020-11-17 21:34:04 +02:00
Jerome Pasion
d4b3989818 Update landing pages and module pages in qtbase
-Qt SQL, Qt D-BUS, Qt GUI, Qt OpenGL, Qt Widgets,
 Qt Test, Qt Concurrent, Qt XML, Qt Network, Qt Core
-language edits for consistency, add links

Task-number: QTBUG-87155
Change-Id: Ic61350c9fa15090c802a42d8e9116219591eba73
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-11-17 20:16:12 +01:00
Timur Pocheptsov
4f6c5d83d0 Network self-test: make it work with docker/containers
Fixes: QTBUG-87740
Pick-to: 5.15
Change-Id: Idfe73708784774188afd40048f81406aa720a554
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-11-17 19:56:06 +01:00
Volker Hilsheimer
781ae0b9f1 Document that ANGLE is gone from QtGui
Text taken out of the source-breaks.qdoc file, which will be
removed.

Task-number: QTBUG-88152
Change-Id: Ibe5fe5328151358873c26d8f1eacc30027c2ced9
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2020-11-17 19:55:05 +01:00
Edward Welbourne
26e41291bb Test QTimer's isSingleShot() and timerType()
Previously neglected in testing.

Task-number: QTBUG-88183
Change-Id: Iacfca6f8c590af6dccb126cf3e43387ed50dbf06
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-11-17 19:55:05 +01:00
Edward Welbourne
06c898d7a9 Add some tests for various qmath.h functions
Previously untested.

Task-number: QTBUG-88183
Change-Id: I9e94308471651e447f35a21329e43a363fb23961
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-11-17 19:55:04 +01:00
Edward Welbourne
c0829d6131 Improve qFloatDistance() test coverage
Four code-paths that weren't tested are simply those with the
parameters swapped from code-paths we did test.  In any case, the
float-distance between values should be symmetric, so test that.

Task-number: QTBUG-88183
Change-Id: I2060eb77b1abada5b0fd5f4557dbb1761c5cfd02
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-11-17 19:55:04 +01:00
Edward Welbourne
17701a95f8 QLocale: simplify currency display name lookup
We were extracting several candidate display names from CLDR for each
currency, joining them with semicolons, storing in a table, then using
only the first entry from the list - where we should probably have
used the first non-empty entry in any case.

So instead extract the first non-empty candidate name from CLDR and
store that simply, saving the need for semicolon-joining or parsing
out the first entry from the thus-joined list. This significantly
reduces the size of the currency name data table.

Change-Id: I201d0528348d5fcb9eceb5df86211b9c77de3485
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-11-17 19:55:04 +01:00
Edward Welbourne
7c28fa7717 Inline QLocale's QString overloads via QStringView
Make declarations use same parameter name as implementation and
documentation, in the process. Fixed indent of some doc comments.

Change-Id: Ibaa3a5f6316a16c5b65f6ea6e0034f4eb2864b98
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-11-17 19:55:04 +01:00
Edward Welbourne
e71aafcb65 String-view-ify qt_splitLocaleName() and simplify its callers
Two of its callers didn't even care about the fragments it was
returning, one only cared about two of them. The parsing could be more
straightforward and less verbose. Parsing into QStringView saves the
need to allocate copies of the substrings parsed.  Cleaned up around
the code that called it.

Change-Id: Ie65d2b1b3eb891c20bc82275d7a0da00c30d7b8d
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-11-17 19:55:04 +01:00
Edward Welbourne
1721b80e10 Export QLocaleId::fromName() so qttools can use it
This shall replace QLocalePrivate::getLangAndCountry()'s use by qttools.

Change-Id: Ib686a3769bd38c477d7fbad50cf494ee8a0b1c00
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-11-17 19:55:04 +01:00
Volker Hilsheimer
63f03f5e2d Make QPageRanges::detach public, add data stream operators
As per QUIP-19 discussion, value types should have streaming operators,
and detach should be public.

detach() is still documented as \internal, like other public detach
methods in value types.

Change-Id: I30451909ad5226088fb05206f83983dda5b0c6b5
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-11-17 19:55:04 +01:00
Shawn Rutledge
f5010c49a3 QTest: don't wait before sending mouse event: increment the timestamp
Tests can run faster now, but we still expect calculations based on
the timestamp (such as QEventPoint::velocity()) to be correct.

Change-Id: Ie962604c9ebd139384dcd89a157de66b4b773cc9
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-11-17 19:55:04 +01:00
Ivan Solovev
1d8dd9a02c Track progress range in QFutureInterface::setProgressValue
Previously QFutureInterface::setProgressValue was silently ignoring
the progress range and allowed to set any progress value.
Also no checks were performed in QFutureInterface::setProgressRange,
which allowed the user to set minimum > maximum.

Add checking of the current progress range, when settings the
progress value.
Add checks for minimum and maximum values while setting the progress
range.
The implementation of the checks is mostly based on the logic
that is used in QProgressBar.
- If maximum is smaller than minimum, minimum becomes the only legal
value.
- If the current progress value falls outside the new range, the
progress value is set to be minimum.
- If both progressMinimum() and progressMaximum() return 0, the
current progress range is considered to be unused, and any progress
value can be set.
- When setting the value using setProgressValue(), if the value falls
out of the progress range, the method has no effect.

Task-number: QTBUG-84729
Change-Id: I29cf4f94b8e98e1af30dd46fbdba39c421cf66bf
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2020-11-17 16:16:31 +01:00
Ivan Solovev
e0248ddc5c Extend tests for QLogging
Add tests for QMessageLogger class to explicitly cover all
overloads of logging methods.

Task-number: QTBUG-88183
Change-Id: I8d551f4b066cc285101646230bd9a17869ada3c1
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
2020-11-17 16:16:10 +01:00
Elvis Lee
0decd926ad Correct headers to build with eglfs modules
To build with eglfs module and gbm device integration module,
some headers should consider global path, not local.

This covers eglfs_kms and eglfs_kms_egldeivce device integration.
Other device integrations might be future work if needed.

Task-number: QTBUG-85268
Change-Id: I1bad5fbac99aa79d146e90f88b53519b09254e13
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Elvis Lee <kwangwoong.lee@lge.com>
2020-11-17 22:11:08 +09:00
Volker Hilsheimer
2e3b8b36f7 Consolidate static_asserts for event sizes
The assertion for size of QMouseEvent and Q(Mutable)SinglePointEvent being
equal was previously in QtDeclarative; qtbase should already fail to build
if they ever diverge.

Having the checks in a single translation unit is enough, qevent.cpp is the
obvious choice.

Change-Id: I80ad24273738dfde8b165323ac1e790c320c707c
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-11-17 11:48:28 +01:00
Piotr Mikolajczyk
f92e195369 Android: Ensure windows always have a geometry on creation
A QWindow created without an explicit geometry needs to pick up
a default geometry in the platform plugin. If the window has a
maximized of fullscreen window state, it will fill the entire
available geometry of the parent window (or the screen if there's
not parent window).

Fixes: QTBUG-69159
Fixes: QTBUG-69156
Fixes: QTBUG-69154
Pick-to: 5.15
Change-Id: If8565d92a97bb4b3fa44757e68969d54d0bc7ebe
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-11-17 10:48:05 +00:00
Lars Knoll
f6f68409a4 Don't initialize POD types with memset(0)
This is dangerous as at least pointers to member objects/data
are not always zero initialized.

Change-Id: I1250e101ab73cd816694315fc9130f4d486b9feb
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-11-17 11:47:57 +01:00
Lars Knoll
7fc302520b Move the iterator from QTypedArrayData to QList
The low level implementation does not use it at all, so there's no
point having the iterator in QTypedArrayData. Having it in QList removes
and indirection and will lead to clearer error messages.

Change-Id: I4af270c3cdb39620e5e52e835eb8fe1aa659e038
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2020-11-17 11:47:53 +01:00
Lars Knoll
cadfed83ac Remove unused method
Change-Id: I22738a3d5f1ad3dc4e5f542f4102dfac0491a241
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-11-17 11:47:49 +01:00
Lars Knoll
a1f3be3e41 Clean up QList(iterator, iterator)
Fold the two overloads into one, and distinguish the cases using
if constexpr. Do not overload QArrayOps::copyAppend(), to make it
clear which one is being used.

Change-Id: If6a894841aacb84ba190fb2209246f5f61034b42
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-11-17 11:47:45 +01:00
Lars Knoll
8c1ff78018 Only export the non inline methods of QArrayData
Change-Id: I4a66fd13ee3e6b4ceb3f5d58de4a44aa394b9e0e
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-11-17 11:47:40 +01:00
Alexey Edelev
4456ebc1e3 CMake: Make paths in qt-cmake-standalone-test relative
Make paths in qt-cmake-standalone-test relative to script's PWD.

Fixes: QTBUG-88380
Change-Id: I6ab507c31ebed391f4e85bc6fe3f7f747dd97d54
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-11-17 11:47:37 +01:00
Lars Knoll
996255baae Fix signature of QArrayDataOps::erase()
Bring it in line with the other methods that also take a
pointer and a size.

Also use truncate() in removeAll() as that's more efficient
for the use case.

Change-Id: Ib1073b7c048ceb96fb6391b308ef8feb77896866
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-11-17 11:47:36 +01:00
Lars Knoll
c0e1a38f69 Remove the special code for emplaceFront/Back again
emplace() itself now handles those cases fast enough, so there
should not be a need to add special code paths for those methods.

Change-Id: I3277eb77dd54194e46f96f24de44d7785a6f860a
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-11-17 11:47:32 +01:00
Lars Knoll
30597cfc0e Clean up emplace implementations
Avoid duplicated code paths for GrowsForward vs
GrowsBackward. Special case emplaceing at the
beginning or end  of the awrray where we can
avoid creating a temporary copy.

Change-Id: I2218ffd8d38cfa22e8faca75ebeadb79a682d3cf
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-11-17 11:47:28 +01:00
Lars Knoll
21bce89257 Add a couple of noexcept to methods that can't throw
Trivial methods that don't modify any data for the most
part.

Also mark removeFirst/Last() as noexcept. Those methods
can't throw exceptions as we require ~T() to be noexcept.

Change-Id: I8698705c6113909aa8f7ae021a932df48a224d5d
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-11-17 11:47:21 +01:00
Lars Knoll
6431565e0a Simplify QArrayDataOps::insert() for movable types
Avoid ever having to call a destructor and unify the code for
insertion at the front or at the end.

Change-Id: Ie50ae2d4a75477cfdae9d5bd4bddf268426d95b5
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-11-17 11:47:16 +01:00
Lars Knoll
faea8e2661 Remove unused code
Change-Id: I22f377c10a556fbb011ec98094d5a61ee3f63867
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-11-17 11:47:13 +01:00
Lars Knoll
39ca7d4bd1 Simplify insert() code for POD types
Change-Id: If2fba71ab690de6178fcdc0f27de08f2f8a01593
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-11-17 11:47:09 +01:00
Lars Knoll
168772fe8f Remove destructor calls from insert()
QList::insert() should never need to call a destructor. This
requires that we construct the new items in the list in order
and increment the size each time we constructed a new item.

Not having a code path that potentially calls destructors should
avoid the generation of lots of additional code for those
operations. In addition, the forward and backwards code paths
are now unified and only require somewhat different setup of
some variables at the start.

This gives us strong exception safety when appending one item,
weak exception safety in all other cases (in line with std::vector).

Change-Id: I6bf88365a34ea9e55ed1236be01a65499275d150
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-11-17 11:47:02 +01:00