diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2022-06-15 16:08:54 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-06-16 13:22:34 +0000 |
commit | 59a7b451cc3692fd54b18bc195a60fbb2dd2a272 (patch) | |
tree | 7ce56fec9864faec109dadf32d018f8b77c1f6ee | |
parent | 1261ae2aeffba7b2df6f8cfafabf3cddbd74af0c (diff) |
dumpcpp: Do not generate constructors with C#-only classes
Add a hard-coded exclusion list.
Fixes: QTBUG-100332
Change-Id: I009e202349e5f1fae13bc481e998fb494d7f997c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 1c55f40705ad60113941691d0d5490bea99227f4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | tools/dumpcpp/main.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/dumpcpp/main.cpp b/tools/dumpcpp/main.cpp index 3142265..8dbdf3e 100644 --- a/tools/dumpcpp/main.cpp +++ b/tools/dumpcpp/main.cpp @@ -215,6 +215,12 @@ static void formatConstructorBody(QTextStream &out, const QByteArray &nameSpace, out << '}' << Qt::endl << Qt::endl; } +// Hash of C# only types. +static const QSet<QByteArray> cSharpTypes = { + "ICloneable", "ICollection", "IDisposable", "IEnumerable", + "IList", "ISerializable", "_Attribute" +}; + void generateClassDecl(QTextStream &out, const QMetaObject *mo, const QByteArray &className, const QByteArray &nameSpace, ObjectCategories category) @@ -245,6 +251,11 @@ void generateClassDecl(QTextStream &out, const QMetaObject *mo, continue; QByteArray iface_class = info.value(); + if (cSharpTypes.contains(iface_class)) { + qWarning("Skipping constructor %s(%s *) (C#-only type).", + className.constData(), iface_class.constData()); + continue; + } out << " " << className << '(' << iface_class << " *iface)" << Qt::endl; |