diff options
author | BogDan Vatra <bogdan@kdab.com> | 2016-08-23 22:32:11 +0300 |
---|---|---|
committer | BogDan Vatra <bogdan@kdab.com> | 2016-09-06 10:29:21 +0000 |
commit | 21b7661a797ecf77fbcad4380e6dcb2ade929a18 (patch) | |
tree | 0536792e237d686e3cae1b35ebd0ad4dca834393 /tests | |
parent | 23ef3b04ebfc0c7a87800b4ff09444c854e31fdb (diff) |
Parse namespaces only for current file, add Q_NAMESPACE support to qmake
Parsing the other files will (re)generate the same metaobject info in two places
Change-Id: I8984ed30751a7587de870f55dd427f067d1b2495
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/tools/moc/moc.pro | 3 | ||||
-rw-r--r-- | tests/auto/tools/moc/namespace.h | 7 | ||||
-rw-r--r-- | tests/auto/tools/moc/tst_moc.cpp | 1 |
3 files changed, 10 insertions, 1 deletions
diff --git a/tests/auto/tools/moc/moc.pro b/tests/auto/tools/moc/moc.pro index 688799048f..d2b750bdc5 100644 --- a/tests/auto/tools/moc/moc.pro +++ b/tests/auto/tools/moc/moc.pro @@ -28,7 +28,8 @@ HEADERS += using-namespaces.h no-keywords.h task87883.h c-comments.h backslash-n qtbug-35657-gadget.h \ non-gadget-parent-class.h grand-parent-gadget-class.h \ related-metaobjects-in-gadget.h \ - related-metaobjects-name-conflict.h + related-metaobjects-name-conflict.h \ + namespace.h if(*-g++*|*-icc*|*-clang*|*-llvm):!irix-*:!win32-*: HEADERS += os9-newlines.h win-newlines.h diff --git a/tests/auto/tools/moc/namespace.h b/tests/auto/tools/moc/namespace.h new file mode 100644 index 0000000000..2bb1d8e958 --- /dev/null +++ b/tests/auto/tools/moc/namespace.h @@ -0,0 +1,7 @@ +#pragma once + +#include <QObject> + +namespace FooNamespace { + Q_NAMESPACE +} diff --git a/tests/auto/tools/moc/tst_moc.cpp b/tests/auto/tools/moc/tst_moc.cpp index 714ae19a10..56d6939102 100644 --- a/tests/auto/tools/moc/tst_moc.cpp +++ b/tests/auto/tools/moc/tst_moc.cpp @@ -69,6 +69,7 @@ #include "non-gadget-parent-class.h" #include "grand-parent-gadget-class.h" +#include "namespace.h" #ifdef Q_MOC_RUN // check that moc can parse these constructs, they are being used in Windows winsock2.h header |