summaryrefslogtreecommitdiffstats
path: root/tools/dumpcpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/dumpcpp')
-rw-r--r--tools/dumpcpp/main.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/tools/dumpcpp/main.cpp b/tools/dumpcpp/main.cpp
index 215f541..0d9afc1 100644
--- a/tools/dumpcpp/main.cpp
+++ b/tools/dumpcpp/main.cpp
@@ -83,6 +83,9 @@ void writeHeader(QTextStream &out, const QString &nameSpace, const QString &outF
out << "#include <qaxwidget.h>" << Qt::endl;
out << "#include <qdatetime.h>" << Qt::endl;
out << "#include <qpixmap.h>" << Qt::endl;
+ out << "#include <qpoint.h>" << Qt::endl;
+ out << "#include <qrect.h>" << Qt::endl;
+ out << "#include <qsize.h>" << Qt::endl;
out << Qt::endl;
out << "struct IDispatch;" << Qt::endl;
out << Qt::endl;
@@ -211,6 +214,14 @@ static const QSet<QByteArray> cSharpTypes = {
"IList", "ISerializable", "_Attribute"
};
+// Return true if the passed string is one of the Qt type names that we re-defined in IDL files.
+static bool isQtTypeName(QByteArrayView s)
+{
+ return s == "struct QPoint"
+ || s == "struct QRect"
+ || s == "struct QSize";
+}
+
void generateClassDecl(QTextStream &out, const QMetaObject *mo,
const QByteArray &className, const QByteArray &nameSpace,
ObjectCategories category)
@@ -788,6 +799,8 @@ bool generateTypeLibrary(QString typeLibFile, QString outname,
if (nspIt != namespaces.constEnd() && !nspIt.value().isEmpty()) {
declOut << "// forward declarations" << Qt::endl;
for (const auto &className : nspIt.value()) {
+ if (isQtTypeName(className))
+ continue;
if (className.contains(' ')) {
declOut << " " << className << ';' << Qt::endl;
namespaceForType.insert(className.mid(className.indexOf(' ') + 1), libNameBa);