qt5base-lts/tests/auto/tools/moc
Thiago Macieira 9b8493314d Qt6: Fix uninitialized meta objects on Windows
Windows has a problem relating to cross-DLL variable relocations: they
are not supported. Since QMetaObject's link to the parent class is done
via a pointer, every QMetaObject in a DLL or in the EXE that derives
from a class from another DLL (such as QObject) will be dynamically
initialized.

This commit changes the meta object pointers in QMetaObject::d from raw
pointers to a wrapper class SuperData, which is almost entirely source-
compatible with the pointer itself. On all systems except for Windows
with Qt 6, it's binary compatible with the current implementation.

But for Windows with Qt 6, this commit will store both the raw pointer
and a pointer to a function that returns the QMetaObject, with one of
them non-null only. For all meta objects constructed by moc, we store
the function pointer, which allows the staticMetaObject to be statically
intialized. For dynamic meta objects (QMetaObjectBuilder, QtDBus, QtQml,
ActiveQt), we'll store the actual raw pointer.

[ChangeLog][QtCore][QMetaObject] Some internal members of the
QMetaObject class have changed types. Those members are not public API
and thus should not cause source incompatibilities.

The macro QT_NO_DATA_RELOCATION existed in Qt 4 but was called
Q_NO_DATA_RELOCATION and only applied to Symbian. It was removed in
commit 24a72c4efa ("qglobal: Remove
symbian specific features").

Task-number: QTBUG-38876
Fixes: QTBUG-69963
Change-Id: Id92f4a61915b49ddaee6fffd14ae1cf615525e92
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-07-16 18:34:41 -07:00
..
subdir
task71021
Test.framework/Headers
testproject
.gitattributes
.gitignore
assign-namespace.h
backslash-newlines.h
c-comments.h
cstyle-enums.h
cxx11-enums.h Remove handling of missing Q_COMPILER_CLASS_ENUM 2019-04-06 16:19:14 +00:00
cxx11-explicit-override-control.h Replace Q_DECL_OVERRIDE with override where possible 2017-09-19 11:53:42 +00:00
cxx11-final-classes.h
cxx17-namespaces.h tst_moc: fix include guards 2017-03-25 12:53:09 +00:00
cxx-attributes.h moc: Fix parsing of [[deprecated]] enum values 2019-03-11 14:11:33 +00:00
dir-in-include-path.h
dollars.h
error-on-wrong-notify.h moc: Allow NOTIFY signals defined in parent classes 2017-05-23 11:11:52 +00:00
escapes-in-string-literals.h
extraqualification.h
forgotten-qinterface.h
forward-declared-param.h
function-with-attributes.h
gadgetwithnoenums.h
grand-parent-gadget-class.h
Header
interface-from-framework.h
interface-from-include.h
macro-on-cmdline.h
moc.pro Add support for C++ functions attributes in moc 2019-03-07 06:53:21 +00:00
namespace_no_merge.h
namespace.h moc: Don't error our when parsing "using namespace __identifier(...)" 2018-03-05 06:54:06 +00:00
namespaced-flags.h
no-keywords.h Clean up the moc "no-keywords" test 2018-03-21 10:31:20 +00:00
non-gadget-parent-class.h
oldstyle-casts.h
os9-newlines.h
parse-boost.h
parse-defines.h Remove handling of missing very old compiler feature check 2019-04-06 13:27:15 +00:00
plugin_metadata.h
pp-dollar-signs.h
pure-virtual-signals.h
qinvokable.h
qprivateslots.h
qtbug-35657-gadget.h
related-metaobjects-in-gadget.h
related-metaobjects-in-namespaces.h
related-metaobjects-name-conflict.h
single_function_keyword.h
single-quote-digit-separator-n3781.h
slots-with-void-template.h
task87883.h
task189996.h
task192552.h
task234909.h
task240368.h
template-gtgt.h
trigraphs.h
tst_moc.cpp Qt6: Fix uninitialized meta objects on Windows 2019-07-16 18:34:41 -07:00
unterminated-function-macro.h
using-namespaces.h
warn-on-multiple-qobject-subclasses.h
warn-on-property-without-read.h
win-newlines.h