qt5base-lts/tests/auto/gui/kernel
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
..
noqteventloop Allow QWindowsPipe{Reader|Writer} to work with foreign event loops, take 2 2021-03-02 22:53:06 +02:00
qaction Remove the qmake project files 2021-01-07 15:32:28 +01:00
qactiongroup Remove the qmake project files 2021-01-07 15:32:28 +01:00
qaddpostroutine Remove the qmake project files 2021-01-07 15:32:28 +01:00
qbackingstore Expand tst_QBackingStore auto test 2022-01-12 18:13:51 +01:00
qclipboard Compile autotests for Integrity 2021-09-20 17:29:04 +03:00
qcursor Remove the qmake project files 2021-01-07 15:32:28 +01:00
qdrag Remove the qmake project files 2021-01-07 15:32:28 +01:00
qevent QEvent: start to de-inline copy ctor and clone() of all subclasses 2022-04-14 19:07:16 +02:00
qfileopenevent Fix a few compiler warnings in tests 2021-02-02 12:06:05 +01:00
qguiapplication QGuiApplication: use translation-based layout direction unless explicitly set 2022-02-24 19:46:01 +01:00
qguieventdispatcher Remove the qmake project files 2021-01-07 15:32:28 +01:00
qguieventloop Remove .prev_CMakeLists.txt files 2021-01-12 20:59:13 +01:00
qguimetatype Remove the qmake project files 2021-01-07 15:32:28 +01:00
qguitimer Remove the qmake project files 2021-01-07 15:32:28 +01:00
qguivariant Replace deprecated QColor::fromString in tests and documentation 2022-03-21 20:41:23 +01:00
qhighdpi QJsonObject: use QJsonValueConstRef 2022-02-15 17:00:03 -08:00
qinputdevice gui: return first default device when seatName isNull 2022-03-13 22:08:16 +01:00
qinputmethod Remove the qmake project files 2021-01-07 15:32:28 +01:00
qkeyevent Android: unblock passing tests 2021-04-27 21:12:50 +03:00
qkeysequence CMake: Add BUILTIN_TESTDATA option to qt_internal_add_test 2022-02-11 21:54:44 +01:00
qmouseevent Revert "Add grabber context pointers" 2021-04-29 16:49:57 +02:00
qmouseevent_modal Remove the qmake project files 2021-01-07 15:32:28 +01:00
qopenglwindow Remove the qmake project files 2021-01-07 15:32:28 +01:00
qpalette Don't change resolve mask when setting brush doesn't change palette 2021-12-03 21:07:09 +01:00
qpixelformat Remove the qmake project files 2021-01-07 15:32:28 +01:00
qrasterwindow Remove the qmake project files 2021-01-07 15:32:28 +01:00
qscreen Android: enable tst_QScreen::grabWindow 2022-03-31 11:48:54 +01:00
qshortcut Make tst_shortcut pass on Wayland 2021-03-11 11:59:14 +01:00
qsurfaceformat Remove the qmake project files 2021-01-07 15:32:28 +01:00
qtouchevent Tests: Do not depend on transitive includes 2022-03-17 17:14:37 +01:00
qwindow tests: XFAIL 4 tests in tst_QWindow on Wayland 2022-02-17 00:34:50 +01:00
CMakeLists.txt CMake: Add BUILTIN_TESTDATA option to qt_internal_add_test 2022-02-11 21:54:44 +01:00