Skip to content

Commit

Permalink
Fixing qtmoc not handling pointer to object in QT signal properly: th…
Browse files Browse the repository at this point in the history
…e callback is returning the value of the pointer instead of the pointer
  • Loading branch information
StarAurryon committed Jul 30, 2020
1 parent 7f61353 commit 959859c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/binding/templater/function_go.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
fmt.Fprintf(bb, "%[1]vD = (*(*%v)(%[1]vI))\n", parser.CleanName(p.Name, p.Value), p.PureGoType)
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")
}
}
Expand Down

0 comments on commit 959859c

Please sign in to comment.