qt5base-lts/tests/auto/tools/moc
Giuseppe D'Angelo f66c1db16c Introduce Q_NAMESPACE_EXPORT
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>
2019-06-28 06:47:29 +02: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
cxx11-final-classes.h
cxx17-namespaces.h
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
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 Introduce Q_NAMESPACE_EXPORT 2019-06-28 06:47:29 +02:00
unterminated-function-macro.h
using-namespaces.h
warn-on-multiple-qobject-subclasses.h
warn-on-property-without-read.h
win-newlines.h