本文整理汇总了Golang中github.com/therecipe/qt/internal/binding/parser.Function.SignalMode方法的典型用法代码示例。如果您正苦于以下问题:Golang Function.SignalMode方法的具体用法?Golang Function.SignalMode怎么用?Golang Function.SignalMode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/therecipe/qt/internal/binding/parser.Function
的用法示例。
在下文中一共展示了Function.SignalMode方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: goFunction
func goFunction(f *parser.Function) string {
if f.Meta == "signal" && !f.Overload {
var tmp string
for _, signalMode := range []string{"Connect", "Disconnect", "callback"} {
f.SignalMode = signalMode
if signalMode == "callback" {
tmp += fmt.Sprintf("//export callback%v%v\n", f.Class(), strings.Title(f.Name))
}
tmp += fmt.Sprintf("%v{\n%v\n}\n\n", goFunctionHeader(f), goFunctionBody(f))
}
f.SignalMode = ""
return tmp
}
return fmt.Sprintf("%v{\n%v\n}", goFunctionHeader(f), goFunctionBody(f))
}
示例2: goFunction
func goFunction(f *parser.Function) string {
if f.Meta == "signal" || strings.Contains(f.Virtual, "impure") && f.Output == "void" {
var tmp string
for _, signalMode := range []string{"Connect", "Disconnect", "callback"} {
f.SignalMode = signalMode
if signalMode == "callback" {
tmp += fmt.Sprintf("//export callback%v%v", f.Class(), strings.Replace(strings.Title(f.Name), "~", "Destroy", -1))
if f.Overload {
tmp += f.OverloadNumber
}
tmp += "\n"
}
tmp += fmt.Sprintf("%v{\n%v\n}\n\n", goFunctionHeader(f), goFunctionBody(f))
}
f.SignalMode = ""
var isPrivate bool
if f.Meta == "signal" {
isPrivate = converter.IsPrivateSignal(f)
}
var tmpMeta = f.Meta
f.Meta = "plain"
if !isPrivate {
tmp += fmt.Sprintf("%v{\n%v\n}\n\n", goFunctionHeader(f), goFunctionBody(f))
if tmpMeta != "signal" {
var tmpTmp = strings.Replace(fmt.Sprintf("%v{\n%v\n}\n\n", goFunctionHeader(f), goFunctionBody(f)), "_"+strings.Title(f.Name)+"(", "_"+strings.Title(f.Name)+"Default(", -1)
tmp += strings.Replace(tmpTmp, ")"+strings.Title(f.Name)+"(", ")"+strings.Title(f.Name)+"Default(", -1)
}
}
f.Meta = tmpMeta
return tmp
}
if isGeneric(f) {
var tmp string
for _, m := range jniGenericModes(f) {
f.TemplateMode = m
tmp += fmt.Sprintf("%v{\n%v\n}\n", goFunctionHeader(f), goFunctionBody(f))
}
f.TemplateMode = ""
return tmp
}
return fmt.Sprintf("%v{\n%v\n}", goFunctionHeader(f), goFunctionBody(f))
}