aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2016-09-30 10:35:49 +0200
committerChristian Kandeler <christian.kandeler@qt.io>2016-09-30 10:42:28 +0200
commitbf3a7979a41b166b8dc178a3cc6a22f15a4e6ea5 (patch)
treeef02290769e610427f052a53a0e24e71b4adc9e1 /src/plugins
parentd17105376102c4cd846757c7f091b9f3cd90e4d7 (diff)
parented69ed958d6ca25cb97dc81b21322f8ab398b7df (diff)
Merge 1.6 into master
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/scanner/cpp/Token.cpp1
-rw-r--r--src/plugins/scanner/cpp/Token.h3
-rw-r--r--src/plugins/scanner/cpp/cppscanner.cpp4
3 files changed, 6 insertions, 2 deletions
diff --git a/src/plugins/scanner/cpp/Token.cpp b/src/plugins/scanner/cpp/Token.cpp
index b7126bf8a..ee125652c 100644
--- a/src/plugins/scanner/cpp/Token.cpp
+++ b/src/plugins/scanner/cpp/Token.cpp
@@ -109,6 +109,7 @@ static const char *token_names[] = {
("Q_FOREACH"), ("Q_D"), ("Q_Q"),
("Q_INVOKABLE"), ("Q_PROPERTY"), ("Q_INTERFACES"), ("Q_ENUMS"), ("Q_FLAGS"),
("Q_PRIVATE_SLOT"), ("Q_DECLARE_INTERFACE"), ("Q_OBJECT"), ("Q_GADGET"),
+ ("Q_NAMESPACE"),
};
diff --git a/src/plugins/scanner/cpp/Token.h b/src/plugins/scanner/cpp/Token.h
index 74f832674..286c71a48 100644
--- a/src/plugins/scanner/cpp/Token.h
+++ b/src/plugins/scanner/cpp/Token.h
@@ -258,7 +258,8 @@ enum Kind {
T_Q_DECLARE_INTERFACE,
T_Q_OBJECT,
T_Q_GADGET,
- T_LAST_KEYWORD = T_Q_GADGET,
+ T_Q_NAMESPACE,
+ T_LAST_KEYWORD = T_Q_NAMESPACE,
// aliases
T_OR = T_PIPE_PIPE,
diff --git a/src/plugins/scanner/cpp/cppscanner.cpp b/src/plugins/scanner/cpp/cppscanner.cpp
index 4e61fedd9..ab8454ac9 100644
--- a/src/plugins/scanner/cpp/cppscanner.cpp
+++ b/src/plugins/scanner/cpp/cppscanner.cpp
@@ -136,6 +136,7 @@ static void scanCppFile(void *opaq, Lexer &yylex, bool scanForFileTags, bool sca
const QLatin1Literal defineLiteral("define");
const QLatin1Literal qobjectLiteral("Q_OBJECT");
const QLatin1Literal qgadgetLiteral("Q_GADGET");
+ const QLatin1Literal qnamespaceLiteral("Q_NAMESPACE");
const QLatin1Literal pluginMetaDataLiteral("Q_PLUGIN_METADATA");
Opaq *opaque = static_cast<Opaq *>(opaq);
const TokenComparator tc(opaque->fileContent);
@@ -173,7 +174,8 @@ static void scanCppFile(void *opaq, Lexer &yylex, bool scanForFileTags, bool sca
// Someone was clever and redefined Q_OBJECT or Q_PLUGIN_METADATA.
// Example: iplugin.h in Qt Creator.
} else {
- if (tc.equals(tk, qobjectLiteral) || tc.equals(tk, qgadgetLiteral))
+ if (tc.equals(tk, qobjectLiteral) || tc.equals(tk, qgadgetLiteral) ||
+ tc.equals(tk, qnamespaceLiteral))
{
opaque->hasQObjectMacro = true;
} else if (opaque->fileType == Opaq::FT_HPP