mirror of
https://github.com/bluszcz/cutego.git
synced 2024-09-29 05:35:16 +03:00
fix qtmoc
This commit is contained in:
parent
4efdadb17c
commit
5218638454
1 changed files with 38 additions and 37 deletions
|
@ -137,6 +137,44 @@ func (c *Class) IsQObjectSubClass() bool {
|
|||
}
|
||||
|
||||
func (c *Class) add() {
|
||||
|
||||
//TODO: needed until input + cgo support for generic Containers<T> to ignore virtuals with moc
|
||||
if c.Module == MOC {
|
||||
for _, sbc := range c.GetBases() {
|
||||
for _, sbcf := range ClassMap[sbc].Functions {
|
||||
if IsPackedList(sbcf.Output) {
|
||||
sbcf.Virtual = "non"
|
||||
sbcf.Meta = PLAIN
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//add generic qRegisterMetaType functions
|
||||
if !c.HasFunctionWithName("qRegisterMetaType") {
|
||||
var tmpF = &Function{
|
||||
Name: "qRegisterMetaType",
|
||||
Fullname: fmt.Sprintf("%v::qRegisterMetaType", c.Name),
|
||||
Access: "public",
|
||||
Virtual: "non",
|
||||
Meta: PLAIN,
|
||||
NonMember: true,
|
||||
NonMoc: true,
|
||||
Output: fmt.Sprintf("int"),
|
||||
Parameters: []*Parameter{},
|
||||
Signature: "()",
|
||||
TemplateModeGo: fmt.Sprintf("%v*", c.Name),
|
||||
}
|
||||
c.Functions = append(c.Functions, tmpF)
|
||||
|
||||
var f = *tmpF
|
||||
f.Overload = true
|
||||
f.OverloadNumber = "2"
|
||||
f.Parameters = []*Parameter{{Name: "typeName", Value: "const char *"}}
|
||||
f.Signature = "(const char *typeName)"
|
||||
c.Functions = append(c.Functions, &f)
|
||||
}
|
||||
}
|
||||
|
||||
switch c.Name {
|
||||
case "QColor", "QFont", "QImage":
|
||||
{
|
||||
|
@ -225,43 +263,6 @@ func (c *Class) add() {
|
|||
}
|
||||
}
|
||||
|
||||
//TODO: needed until input + cgo support for generic Containers<T> to ignore virtuals with moc
|
||||
if c.Module == MOC {
|
||||
for _, sbc := range c.GetBases() {
|
||||
for _, sbcf := range ClassMap[sbc].Functions {
|
||||
if IsPackedList(sbcf.Output) {
|
||||
sbcf.Virtual = "non"
|
||||
sbcf.Meta = PLAIN
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//add generic qRegisterMetaType functions
|
||||
if !c.HasFunctionWithName("qRegisterMetaType") {
|
||||
var tmpF = &Function{
|
||||
Name: "qRegisterMetaType",
|
||||
Fullname: fmt.Sprintf("%v::qRegisterMetaType", c.Name),
|
||||
Access: "public",
|
||||
Virtual: "non",
|
||||
Meta: PLAIN,
|
||||
NonMember: true,
|
||||
NonMoc: true,
|
||||
Output: fmt.Sprintf("int"),
|
||||
Parameters: []*Parameter{},
|
||||
Signature: "()",
|
||||
TemplateModeGo: fmt.Sprintf("%v*", c.Name),
|
||||
}
|
||||
c.Functions = append(c.Functions, tmpF)
|
||||
|
||||
var f = *tmpF
|
||||
f.Overload = true
|
||||
f.OverloadNumber = "2"
|
||||
f.Parameters = []*Parameter{{Name: "typeName", Value: "const char *"}}
|
||||
f.Signature = "(const char *typeName)"
|
||||
c.Functions = append(c.Functions, &f)
|
||||
}
|
||||
}
|
||||
|
||||
if IsPackedList(f.Output) {
|
||||
var b bool
|
||||
for _, p := range f.Parameters {
|
||||
|
|
Loading…
Reference in a new issue