f66c1db16c
A recurring problem with the Q_NAMESPACE macro is that it declares an object (staticMetaObject) in the surrounding namespace. That object lacks any export/import qualification to make it usable with shared libraries. Introduce therefore another macro to work around this issue, allowing the user to prefix the object with an exporting macro, f.i. like this: Q_NAMESPACE_EXPORT(Q_CORE_EXPORT) The old macro can simply then be rewritten in terms of this new one, supplying an empty export macro. Note that NOT passing an argument to a macro expecting one is well defined behavior in C99 -- the macro will expand an empty token. Of course, MSVC doesn't like this and emits warnings. As a workaround, use a variadic macro. [ChangeLog][QtCore] Added the new Q_NAMESPACE_EXPORT macro. It can be used just like Q_NAMESPACE to add meta-object information to a namespace; however it also supports exporting of such information from shared libraries. [ChangeLog][Potentially Source-Incompatible Changes] Prefixing Q_NAMESPACE with an export macro may no longer work. Use the new Q_NAMESPACE_EXPORT macro for that use case. Fixes: QTBUG-68014 Change-Id: Ib044a555ace1f77ae8e0244d824ec473550f3d8e Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: BogDan Vatra <bogdan@kdab.com> |
||
---|---|---|
.. | ||
subdir | ||
task71021 | ||
Test.framework/Headers | ||
testproject | ||
.gitattributes | ||
.gitignore | ||
assign-namespace.h | ||
backslash-newlines.h | ||
c-comments.h | ||
cstyle-enums.h | ||
cxx11-enums.h | ||
cxx11-explicit-override-control.h | ||
cxx11-final-classes.h | ||
cxx17-namespaces.h | ||
cxx-attributes.h | ||
dir-in-include-path.h | ||
dollars.h | ||
error-on-wrong-notify.h | ||
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 | ||
namespace_no_merge.h | ||
namespace.h | ||
namespaced-flags.h | ||
no-keywords.h | ||
non-gadget-parent-class.h | ||
oldstyle-casts.h | ||
os9-newlines.h | ||
parse-boost.h | ||
parse-defines.h | ||
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 | ||
unterminated-function-macro.h | ||
using-namespaces.h | ||
warn-on-multiple-qobject-subclasses.h | ||
warn-on-property-without-read.h | ||
win-newlines.h |