diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2022-06-15 16:08:54 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2022-06-16 11:57:10 +0200 |
commit | 1c55f40705ad60113941691d0d5490bea99227f4 (patch) | |
tree | 638797cd217737db5cbeb856a45ab757cd43985f /tools | |
parent | 02299b76c92648189192be1351c527558359b23e (diff) | |
download | qtactiveqt-1c55f40705ad60113941691d0d5490bea99227f4.tar.gz |
dumpcpp: Do not generate constructors with C#-only classes
Add a hard-coded exclusion list.
Pick-to: 6.4 6.3
Fixes: QTBUG-100332
Change-Id: I009e202349e5f1fae13bc481e998fb494d7f997c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'tools')
-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 f028705..58e58ef 100644 --- a/tools/dumpcpp/main.cpp +++ b/tools/dumpcpp/main.cpp @@ -190,6 +190,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) @@ -220,6 +226,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; |