Commit Graph

49230 Commits

Author SHA1 Message Date
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
Lars Knoll
f1db4d6e38 Fix moveAppend() implementation
When appending multiple items, we are fine with providing
weak exception safety only. This implies that we can simplify
the moveAppend() code and avoid having to potentiall
call destructors in there.

Change-Id: I31cef0e8589e28f3d3521c54db3f7910628e686f
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:46:57 +01:00
Lars Knoll
07c7cbf1a0 Don't implement copyAppend() through insert()
We've been expanding to a lot more code than we need to, and
the code was slower than it needed to.

Change-Id: I79e49fefd8b3fedb26a32a8d4c80e71b2c0c4041
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-11-17 11:46:52 +01:00
Lars Knoll
590d4b3443 Use std::destroy() instead if handwritten loop
Change-Id: Ia75296abf804332bb6f53dbb9a2eed8600b6e8b4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-11-17 11:46:46 +01:00
Lars Knoll
0b1ca7c001 Clean up QCommonArrayOps
Remove methods that were just calling the base implementation.

Change-Id: I4011e1b7f4f2baad98bc2af2d4ddb134a66e1be2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2020-11-17 11:46:41 +01:00
Lars Knoll
d3db51ef4a Cleanup QArrayDataOps::erase()
Move the implementation into the different specializations, and
simplify the implementation. This can be done since we know
that destructors will not throw exceptions for types stored in
our containers.

Change-Id: I9556cd384ef99a623b5b8723b65f16eb9e1df767
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-11-17 11:46:35 +01:00
Lars Knoll
621c05e3b1 Don't allow storing types that throw in the destructor in our containers
Types that throw in their destructors are strongly discouraged in C++,
and even the STL doesn't define what happens if such types are stored
in their containers.

Make this more explicit for Qt and disallow storing those types in our
containers. This will hopefully preempty any potential future bug
reports about us not handling such a case. It also helps simplify
some code in QList and other cases and makes it possible to explicitly
mark more methods as noexcept.

Some care needs to be taken where to add the static asserts, so that
we don't disallow forward declarations of types stored in containers.
Place the static assert into the destructor of the container where
possible or otherwise into the templated d-pointer.

Change-Id: If3aa40888f668d0f1b6c6b3ad4862b169d31280e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-11-17 11:46:28 +01:00
Lars Knoll
872f18bbd6 Smaller cleanup
Get rid of the createInPlace() method. It was just a wraper around
a placement new call.

Change-Id: I672cd41896c8531b474531aad656be79a1a63e6b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2020-11-17 11:46:22 +01:00
Lars Knoll
21116d6017 Add a couple of noexcept where we can't throw exceptions
Change-Id: I4fd40ea9f6258827cce8bf94ac4fd3067bdafc19
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2020-11-17 11:46:17 +01:00
Lars Knoll
fed055790a Simplify code in QExceptionSafetyPrimitives
QExceptionSafetyPrimitives::Destructor doesn't need an additional
template argument, and the freeze() method was unused.

Some methods of the Constructor class could also be simplified.

Change-Id: Iacf35bc8634f402519a8bd875b5efea7841f9db5
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-11-17 11:46:12 +01:00
Lars Knoll
b6d6b3108b Remove some unused methods
Change-Id: If19e5b4521bb3a535d9fb848829783f74427b554
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2020-11-17 11:46:04 +01:00
Lars Knoll
4ee3c4a546 Move emplaceFront/Back() implementation into QArrayDataOps
This simplifies and clean up the code.

Change-Id: I4cbfa69bda95187f97daf814eb3d44d90c502d92
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2020-11-17 11:45:58 +01:00
Lars Knoll
fc172c4313 Simplify the code for QList::emplace()
Unify it with the code in QArrayDataOps and only have one
emplace method there that handles it all.

Adjust autotests to API changes in QArrayDataOps and fix a
wrong test case (that just happened to pass by chance before).

Change-Id: Ia08cadebe2f74b82c31f856b1ff8a3d8dc400a3c
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-11-17 11:45:52 +01:00
Alex Trotsenko
ee122077b0 Allow QWindowsPipe{Reader,Writer} to work with foreign event loops
When a foreign event loop that does not enter an alertable wait state
is running (which is also the case when a native dialog window is
modal), pipe handlers would freeze temporarily due to their APC
callbacks not being invoked.

We address this problem by moving the I/O callbacks to the Windows
thread pool, and only posting completion events to the main loop
from there. That makes the actual I/O completely independent from
any main loop, while the signal delivery works also with foreign
loops (because Qt event delivery uses Windows messages, which foreign
loops typically handle correctly).

As a nice side effect, performance (and in particular scalability)
is improved.

Several other approaches have been tried:
1) Using QWinEventNotifier was about a quarter slower and scaled much
   worse. Additionally, it also required a rather egregious hack to
   handle the (pathological) case of a single thread talking to both
   ends of a QLocalSocket synchronously.
2) Queuing APCs from the thread pool to the main thread and also
   posting wake-up events to its event loop, and handling I/O on the
   main thread; this performed roughly like this solution , but scaled
   half as well, and the separate wake-up path was still deemed hacky.
3) Only posting wake-up events to the main thread from the thread pool,
   and still handling I/O on the main thread; this still performed
   comparably to 2), and the pathological case was not handled at all.
4) Using this approach for reads and that of 3) for writes was slightly
   faster with big amounts of data, but scaled slightly worse, and the
   diverging implementations were deemed not desirable.

Fixes: QTBUG-64443
Change-Id: I1cd87c07db39f3b46a2683ce236d7eb67b5be549
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2020-11-17 12:45:50 +02:00
Lars Knoll
6be39809b0 Simplify reallocation handling in QList
Have one generic method for detaching and reallocations.
Use that method throughout QList to avoid duplicated
instantiations of code paths that are rarely used.

Change-Id: I5b9add3be5f17b387e2d34028b72c8f52db68444
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-11-17 11:45:46 +01:00
Lars Knoll
20883c9bcc Smaller code cleanups in QList
Some cosmetics, but also some optimizations where we avoid a
temporary copy, or calling detach() twice.

Change-Id: I26803fdecf943ed9fab9baf58124091c7cebe1f3
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:45:40 +01:00
Lars Knoll
1c1c593510 QList::append(QList) doesn't require a temp copy
The method can simply forward to the append overload taking
iterators. That method is safe against the iterators being
part of the list itself.

Change-Id: I4bebd6c1118cd4a428fa9248235029b997ef60b2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2020-11-17 11:45:33 +01:00
Tony Sarajärvi
c9420aeeff Conditionally disable tests that depend on cxx11_future flag
Task-number: QTBUG-88392
Change-Id: Ic8451ca4052ec4a94f0d78307e1b32965eb18c4e
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2020-11-17 05:21:06 +00:00
Volker Hilsheimer
76dc75c5ff Allow QMutableSinglePointEvent to be copy- and default-constructed
Since QMutableSinglePointEvent is just an access-helper to QSinglePointEvent,
we can safely create one from the other. This covers QMouseEvent as well
with the right casting in place.

And by making QMSPE default constructable, we can use it in code that
needs to frequently copy event data, for example in QtQuick.

This allows us to make the copy c'tor and assignment operators for QEvent
classes protected, which prevents potentially dangerous (ie. slicing)
implicit copies.

Change-Id: I815774847cca63896f46c43df683053b3d952b61
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-11-17 06:21:05 +01:00
Volker Hilsheimer
496c977b43 Allow cloning of event objects
We have use cases for cloning of events, e.g. in the state machine and
for event propagation.
Provide the means to do so through a virtual method.

Adapt QFutureCallOutEvent::clone, which is now an override. No code
seems to be using that method.

Change-Id: I6864d6597f6de800343c4dc458a7994e84dc6fb4
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-11-17 06:21:05 +01:00