summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2015-02-02 16:55:20 +0100
committerFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2015-02-02 18:59:22 +0000
commitf8a14f150aaa783a790aad9a2dcfe2f47a2fe09c (patch)
treefc2b74b7098dd7cbce8eedcb2b89652c5c67af13 /tools
parent968110d27a7844362b15155aa353077bf27578a3 (diff)
downloadqtactiveqt-f8a14f150aaa783a790aad9a2dcfe2f47a2fe09c.tar.gz
dumpcpp: Add Q_DECLARE_OPAQUE_POINTER() for referenced types.
Fix errors occurring for forward-declared types in the generated header like: qmetatype.h(1354) : error C2027: use of undefined type 'stdole::Font' vcgantt.h(26) : see declaration of 'stdole::Font' qmetatype.h(1539) : see reference to class template instantiation 'QtPrivate::IsPointerToTypeDerivedFromQObject<T>' being compiled with [ T=stdole::Font * ] qmetatype.h(1546) : see reference to class template instantiation 'QMetaTypeId<T>' being compiled with [ T=stdole::Font * ] \vcgantt.h(33401) : see reference to class template instantiation 'QMetaTypeId2<T>' being compiled with [ T=stdole::Font * ] qmetatype.h(1354) : error C2338: Type argument of Q_DECLARE_METATYPE(T*) must be fully defined Task-number: QTBUG-26587 Change-Id: I9e6c87551b462bc27f94d8e8bd36497075dac8d3 Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/dumpcpp/main.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/dumpcpp/main.cpp b/tools/dumpcpp/main.cpp
index 3ef55db..2775249 100644
--- a/tools/dumpcpp/main.cpp
+++ b/tools/dumpcpp/main.cpp
@@ -984,6 +984,7 @@ bool generateTypeLibrary(QString typeLibFile, QString outname,
UINT typeCount = typelib->GetTypeInfoCount();
if (declFile.isOpen()) {
+ QByteArrayList opaquePointerTypes;
declOut << endl;
declOut << "// Referenced namespace" << endl;
for (UINT index = 0; index < typeCount; ++index) {
@@ -1082,6 +1083,7 @@ bool generateTypeLibrary(QString typeLibFile, QString outname,
namespaceForType.insert(className.mid(className.indexOf(' ') + 1), nspace);
} else {
declOut << " class " << className << ';' << endl;
+ opaquePointerTypes.append(nspace + "::" + className);
namespaceForType.insert(className, nspace);
namespaceForType.insert(className + '*', nspace);
namespaceForType.insert(className + "**", nspace);
@@ -1090,7 +1092,8 @@ bool generateTypeLibrary(QString typeLibFile, QString outname,
declOut << '}' << endl << endl;
}
}
-
+ foreach (const QByteArray &opaquePointerType, opaquePointerTypes)
+ declOut << "Q_DECLARE_OPAQUE_POINTER(" << opaquePointerType << "*)" << endl;
declOut << endl;
}
generateNameSpace(declOut, namespaceObject, libName.toLatin1());