mirror of
https://github.com/mappu/miqt.git
synced 2025-01-21 06:00:38 +00:00
genbindings: more exceptions
This commit is contained in:
parent
7e78b73517
commit
306abe1fb6
@ -266,6 +266,11 @@ nextMethod:
|
||||
}
|
||||
}
|
||||
|
||||
if ret.ClassName == "QDebug" && len(mm.Parameters) == 1 && mm.Parameters[0].ParameterType == "QString" && mm.Parameters[0].Pointer {
|
||||
log.Printf("Skipping ctor taking QString pointer")
|
||||
continue nextMethod
|
||||
}
|
||||
|
||||
ret.Ctors = append(ret.Ctors, mm)
|
||||
|
||||
case "CXXDestructorDecl":
|
||||
@ -338,6 +343,12 @@ nextMethod:
|
||||
continue nextMethod
|
||||
}
|
||||
|
||||
if ret.ClassName == "QFile" && mm.MethodName == "moveToTrash" && len(mm.Parameters) == 2 && mm.Parameters[1].ParameterType == "QString" && mm.Parameters[1].Pointer {
|
||||
// @ref https://doc.qt.io/qt-6/qfile.html#moveToTrash-1
|
||||
log.Printf("Skipping method %q using complex return type by pointer argument", mm.MethodName) // TODO support this
|
||||
continue nextMethod
|
||||
}
|
||||
|
||||
ret.Methods = append(ret.Methods, mm)
|
||||
|
||||
default:
|
||||
@ -566,18 +577,15 @@ func parseSingleTypeString(p string) CppParameter {
|
||||
insert.TypeAlias = tok
|
||||
insert.ParameterType += " uintptr_t"
|
||||
|
||||
} else if tok == "QStringList" {
|
||||
insert.ParameterType += " QList<QString>"
|
||||
|
||||
} else if len(tok) > 4 && strings.HasSuffix(tok, "List") {
|
||||
// Classes ending in --List are usually better represented as a QList
|
||||
// type directly, so that the binding uses proper Go slices
|
||||
// Typedef e.g. QObjectList
|
||||
insert.TypeAlias = tok
|
||||
switch tok {
|
||||
case "QModelIndexList":
|
||||
case "QStringList", "QModelIndexList", "QVariantList", "QFileInfoList":
|
||||
// These types are defined as a QList of values
|
||||
insert.ParameterType += " QList<QModelIndex>"
|
||||
insert.ParameterType += " QList<" + tok[0:len(tok)-4] + ">"
|
||||
case "QTextList":
|
||||
// This is really a custom class, preserve as-is
|
||||
insert.ParameterType += " " + tok
|
||||
|
@ -18,8 +18,7 @@ func AllowHeader(fullpath string) bool {
|
||||
}
|
||||
|
||||
switch fname {
|
||||
case // QtCore
|
||||
"qatomic_bootstrap.h",
|
||||
case "qatomic_bootstrap.h",
|
||||
"qatomic_cxx11.h",
|
||||
"qatomic_msvc.h",
|
||||
"qgenericatomic.h", // Clang error
|
||||
@ -129,6 +128,13 @@ func CheckComplexity(p CppParameter) error {
|
||||
"QXmlStreamNotationDeclarations", // e.g. qxmlstream.h. As above
|
||||
"QVariantMap", // e.g. qcbormap.h
|
||||
"QVariantHash", // e.g. qcbormap.h
|
||||
"QCborTag", // e.g. qcborstreamreader.h.TODO Needs support for enums
|
||||
"QCborSimpleType", // e.g. qcborstreamreader.h TODO Needs support for enums
|
||||
"QCborKnownTags", // e.g. qcborstreamreader.h TODO Needs support for enums
|
||||
"QCborNegativeInteger", // e.g. qcborstreamreader.h TODO Needs support for enums
|
||||
"QtMsgType", // e.g. qdebug.h TODO Needs support for enums
|
||||
"QTextStreamFunction", // e.g. qdebug.h
|
||||
"QFactoryInterface", // qfactoryinterface.h
|
||||
"QPlatformPixmap", // e.g. qpixmap.h. as below
|
||||
"QPlatformScreen", // e.g. qscreen.h. as below
|
||||
"QPlatformSurface", // e.g. qsurface.h. as below
|
||||
|
Loading…
x
Reference in New Issue
Block a user