diff options
author | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2015-02-02 16:55:20 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2015-02-02 18:59:22 +0000 |
commit | f8a14f150aaa783a790aad9a2dcfe2f47a2fe09c (patch) | |
tree | fc2b74b7098dd7cbce8eedcb2b89652c5c67af13 /tools | |
parent | 968110d27a7844362b15155aa353077bf27578a3 (diff) | |
download | qtactiveqt-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.cpp | 5 |
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()); |