From 10d3ed8ca961773c079fe337a3e3507eadb36934 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 17 Feb 2012 11:01:26 +0100 Subject: [PATCH] Qt 5 plugin system: Fix handling of namespaced plugin classes. - Add 'using namespace' to moc code as was the case in 4.8. Change-Id: I26cba9ad74bf05eecc5205714c32c3176695e3b4 Reviewed-by: Lars Knoll --- src/tools/moc/generator.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/tools/moc/generator.cpp b/src/tools/moc/generator.cpp index 8242fb45ec..f3a2b4a39b 100644 --- a/src/tools/moc/generator.cpp +++ b/src/tools/moc/generator.cpp @@ -1096,6 +1096,10 @@ void Generator::generatePluginMetaData() } fprintf(out, " 0x%02x\n};\n", (uchar)binary.at(binary.size() - 1)); #endif + // 'Use' all namespaces. + int pos = cdef->qualified.indexOf("::"); + for ( ; pos != -1 ; pos = cdef->qualified.indexOf("::", pos + 2) ) + fprintf(out, "using namespace %s;\n", cdef->qualified.left(pos).constData()); fprintf(out, "QT_MOC_EXPORT_PLUGIN(%s)\n\n", cdef->classname.constData()); }