genbindings: fixes for self parameters, binding building

This commit is contained in:
mappu 2024-08-24 11:46:26 +12:00
parent 0e8b48d1b8
commit b5282f31b6
3 changed files with 7 additions and 1 deletions

View File

@ -258,6 +258,10 @@ nextMethod:
return CppClass{}, err
}
// Always set IsStatic for constructors, since they can be called without
// an existing class instance
mm.IsStatic = true
// Some QFoo constructors take a QFooPrivate
for _, p := range mm.Parameters {
if strings.Contains(p.ParameterType, "Private") {

View File

@ -390,7 +390,7 @@ extern "C" {
ret.WriteString(fmt.Sprintf("%s %s_%s(%s);\n", emitReturnTypeCabi(m.ReturnType), c.ClassName, m.SafeMethodName(), emitParametersCabi(m, c.ClassName+"*")))
if m.IsSignal && !m.HasHiddenParams {
ret.WriteString(fmt.Sprintf("%s %s_connect_%s(void* slot);\n", emitReturnTypeCabi(m.ReturnType), c.ClassName, m.SafeMethodName()))
ret.WriteString(fmt.Sprintf("%s %s_connect_%s(%s* self, void* slot);\n", emitReturnTypeCabi(m.ReturnType), c.ClassName, m.SafeMethodName(), c.ClassName))
}
}

View File

@ -4,6 +4,8 @@ package qt
import (
"C"
"runtime/cgo"
"unsafe"
)
type miqtCallbackFunc func(argc C.int, args *C.void)