Fixing qtmoc not handling pointer to object in QT signal properly: the callback is returning the value of the pointer instead of the pointer

This commit is contained in:
StarAurryon 2020-07-30 23:50:37 +02:00
parent 7f61353ee7
commit 959859c19a

View file

@ -364,7 +364,11 @@ func goFunctionBody(function *parser.Function) string {
if !strings.HasSuffix(function.Name, "Changed") { //TODO: check if property instead
fmt.Fprintf(bb, "qt.UnregisterTemp(unsafe.Pointer(uintptr(%v)))\n", parser.CleanName(p.Name, p.Value))
}
if strings.HasPrefix(p.PureGoType, "*") {
fmt.Fprintf(bb, "%[1]vD = (%v)(%[1]vI)\n", parser.CleanName(p.Name, p.Value), p.PureGoType)
} else {
fmt.Fprintf(bb, "%[1]vD = (*(*%v)(%[1]vI))\n", parser.CleanName(p.Name, p.Value), p.PureGoType)
}
fmt.Fprint(bb, "}\n")
}
}