qt5base-lts/tests/auto
Fabian Kosmale cb43aaca11 Introduce QMetaObject::metaType
This function returns the metatype corresponding to the metaobject, or
an invalid metatype for namespaces.

This works as follows: First we increment the metaobject revision for
new metaobjects. Metaobjects with older revisions are handled by doing a
lookup by name. That fallback is also used for dynamic metaobjects (from
QtDBUS and those created by QMetaObjectBuilder).
For new metaobjects, we store the metatype in its metatype array, behind
the property metatypes. This avoids any changes to the property and
method metatype extraction logic: For properties, the metatype access
does not change, as the new metatype is after their metatypes. For
method metatypes, we already have an indirection layer (using offsets),
so by adjusting those offsets by one, the same logic keeps working.

To distinguish between namespaces and dynamic metaobjects, namespaces
store the metatypeinterface pointer for void in the metatype array,
whereas dynamic metaobjects store a nullptr.

One nice additional benefit is that this simplifies the generator logic
in moc, as the metatype array is now never empty.

Task-number: QTBUG-92077
Change-Id: Id3f920f28553f12032a71a1a87dad29e5374dbe7
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2021-03-25 17:33:07 +01:00
..
cmake Rework the failure macros in the Qt CTest kit 2021-03-17 13:34:39 +01:00
concurrent Fix a few compiler warnings in tests 2021-02-02 12:06:05 +01:00
corelib Introduce QMetaObject::metaType 2021-03-25 17:33:07 +01:00
dbus dbus: Fix missing QVersionNumber include 2021-01-25 12:09:17 +01:00
gui Fix alpha handling of QImage::setPixel 2021-03-22 14:29:14 +01:00
guiapplauncher Move QStateMachine from QtCore to QtScxml 2020-08-24 20:10:25 +02:00
network QHostAddress: prepare moving NetworkLayerProtocol from QAbstractSocket 2021-03-18 19:54:01 -08:00
opengl Remove the qmake project files 2021-01-07 15:32:28 +01:00
other Make it even more obvious on what to do when tst_toolsupport fails 2021-03-22 09:56:51 +01:00
printsupport Remove the qmake project files 2021-01-07 15:32:28 +01:00
shared Remove false Q_UNREACHABLE from shaping code 2021-02-03 09:44:44 +01:00
sql QSqlQuery: make it a move only type 2021-03-21 10:16:56 +01:00
testlib Adapt Catch2 to Apple Silicon 2021-03-25 12:06:31 +01:00
tools Move build tools to libexec instead of the bin dir 2021-02-23 17:02:30 +01:00
widgets Fix invalid pointer return with QGridLayout::itemAt(-1) 2021-03-22 18:47:36 +08:00
xml tst_qdom: clean-up the code enabled only before Qt 6 2021-01-15 15:22:08 +01:00
CMakeLists.txt CMake: Fix building with -DQT_FEATURE_gui=OFF 2020-09-15 20:05:32 +02:00
network-settings.h Replace QtTest headers with QTest 2020-12-22 15:20:30 +01:00