mirror of
https://github.com/mappu/miqt.git
synced 2025-04-22 21:30:21 +00:00
genbindings/intermediate: add Void() helper method
This commit is contained in:
parent
4fbf4c702a
commit
5a3c3556a1
@ -171,7 +171,7 @@ func AllowClass(className string) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func AllowSignal(mm CppMethod) bool {
|
func AllowSignal(mm CppMethod) bool {
|
||||||
if mm.ReturnType.ParameterType != "void" {
|
if !mm.ReturnType.Void() {
|
||||||
// This affects how we cast the signal function pointer for connect
|
// This affects how we cast the signal function pointer for connect
|
||||||
// It would be fixable, but, real signals always have void return types anyway
|
// It would be fixable, but, real signals always have void return types anyway
|
||||||
return false
|
return false
|
||||||
|
@ -343,7 +343,7 @@ func emitAssignCppToCabi(assignExpression string, p CppParameter, rvalue string)
|
|||||||
|
|
||||||
namePrefix := makeNamePrefix(p.ParameterName)
|
namePrefix := makeNamePrefix(p.ParameterName)
|
||||||
|
|
||||||
if p.ParameterType == "void" && !p.Pointer {
|
if p.Void() {
|
||||||
shouldReturn = ""
|
shouldReturn = ""
|
||||||
|
|
||||||
} else if p.ParameterType == "QString" {
|
} else if p.ParameterType == "QString" {
|
||||||
|
@ -404,7 +404,7 @@ func (gfs *goFileState) emitCabiToGo(assignExpr string, rt CppParameter, rvalue
|
|||||||
afterword := ""
|
afterword := ""
|
||||||
namePrefix := makeNamePrefix(rt.ParameterName)
|
namePrefix := makeNamePrefix(rt.ParameterName)
|
||||||
|
|
||||||
if rt.ParameterType == "void" && !rt.Pointer {
|
if rt.Void() {
|
||||||
shouldReturn = ""
|
shouldReturn = ""
|
||||||
return shouldReturn + " " + rvalue + "\n" + afterword
|
return shouldReturn + " " + rvalue + "\n" + afterword
|
||||||
|
|
||||||
|
@ -207,6 +207,10 @@ func (p CppParameter) IntType() bool {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (p CppParameter) Void() bool {
|
||||||
|
return p.ParameterType == "void" && !p.Pointer
|
||||||
|
}
|
||||||
|
|
||||||
type CppProperty struct {
|
type CppProperty struct {
|
||||||
PropertyName string
|
PropertyName string
|
||||||
PropertyType string
|
PropertyType string
|
||||||
|
Loading…
x
Reference in New Issue
Block a user