qt5base-lts/tests/auto/gui
Marc Mutz da0f72ebb8 QEvent: start to de-inline copy ctor and clone() of all subclasses
There's no advantage to them being inline: Absent de-virtualisation,
clone() is only supposed to be called through the vtable, and the copy
ctor is only supposed to be used in the implementation of clone().

And when the compiler de-virtualises, we don't want the code
duplication associated with inlining.

Enforce this by introducing new macros to hide the boilerplate.

This fixes missing out-of-line dtors in:
- QSinglePointEvent
- QApplicationStateChangeEvent
- QFutureCallOutEvent

Wrong covariant return in:
- QFutureCallOutEvent

And missing clone() reimplementations in:
- QCloseEvent
- QIconDragEvent
- QShowEvent
- QHideEvent
- QDragEnterEvent
- QDragLeaveEvent

While these don't carry extra data or members, a dynamic_cast of the
result of clone() as well as using the expected covariant return value
would fail:

   QShowEvent *e = ~~~;
   QShowEvent *e2 = e->clone(); // ERROR: converting QEvent* to QShowEvent*

Check that reimplementing clone() is binary compatible (covariant
returns may change the numerical pointer value returned, cf.
https://community.kde.org/Policies/Binary_Compatibility_Issues_With_C%2B%2B).

The copy-assignment operator stays inline for the time being, as the
goal is to = delete it in the future.

This patch covers, roughly, QtCore and QtGui.

[ChangeLog][QtGui][QEvent subclasses] Fixed missing clone()
reimplementations on QCloseEvent, QIconDragEvent, QShowEvent,
QHideEvent, QDragEnterEvent, and QDragLeaveEvent.

Task-number: QTBUG-45582
Task-number: QTBUG-97601
Change-Id: Ib8a0519dbe85a7a8da61050d48be338004dfa69a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-04-14 19:07:16 +02:00
..
image Tests: Do not depend on transitive includes 2022-03-17 17:14:37 +01:00
itemmodels Replace uses of _qs with _s in tests 2022-04-07 19:30:17 +02:00
kernel QEvent: start to de-inline copy ctor and clone() of all subclasses 2022-04-14 19:07:16 +02:00
math3d QtGui/math3d: Fix QQuaternion::getEulerAngles for GimbalLock cases 2022-01-16 01:12:15 +01:00
painting QColor: deprecate isValidColor, setNamedColor, string-ish ctors 2022-03-15 10:36:09 +00:00
platform tests: skip tst_QX11Info on Wayland 2022-02-17 00:34:50 +01:00
qopengl tst_qopengl: set surfaceType explicitly 2022-03-18 13:02:11 +02:00
qopenglconfig Remove the qmake project files 2021-01-07 15:32:28 +01:00
qvulkan Tests: Do not depend on transitive includes 2022-03-17 17:14:37 +01:00
rhi rhi: Add explicit subclass for RTs from swapchains 2022-04-05 19:40:17 +02:00
text Replace uses of _qs with _s in tests 2022-04-07 19:30:17 +02:00
util Replace uses of _qs with _s in tests 2022-04-07 19:30:17 +02:00
CMakeLists.txt Move QtX11Extras into QtGui as private API 2021-05-10 21:19:46 +00:00