diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2021-10-06 10:26:23 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2021-10-07 12:54:10 +0200 |
commit | 5d174877234477a59eb29818d3cfb99fedc3e704 (patch) | |
tree | 6131169395c5c33f3633ee21b5c13dc28435620b /tests/auto/widgets/kernel | |
parent | 1453f048f535d98ea2454462875eed77a966bcde (diff) |
Return a plain QMetaObject* from toDynamicMetaObject()
The only place where we use it, we swiftly cast it to QMetaObject*
anyway. Generating an object with virtual methods, only to then cast to
its non-virtual base type is dangerous. Also, if we are required to
return a QAbstractDynamicMetaObject from a method of
QDynamicMetaObjectData, we cannot implement QDynamicMetaObjectData
without also implementing QAbstractDynamicMetaObject. This indirectly
forces us to copy metaobjects around as we cannot wrap an existing
metaobject into a QDynamicMetaObjectData subclass.
Copying metaobjects around makes QMetaObject::inherits() unusable
because inherits() assumes identity is determined by identity of the
pointer.
Change-Id: Icbe697efa6fd66649eef3c91260c95cda62e3c90
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tests/auto/widgets/kernel')
0 files changed, 0 insertions, 0 deletions