mirror of
https://github.com/mappu/miqt.git
synced 2025-01-21 22:20:38 +00:00
genbindings/exceptions: move header imports to exceptions.go
This commit is contained in:
parent
3ef53b4224
commit
cf2585416f
@ -420,12 +420,7 @@ func emitBindingCpp(src *CppParsedHeader, filename string) (string, error) {
|
||||
`)
|
||||
|
||||
for _, ref := range getReferencedTypes(src) {
|
||||
if ref[0] != 'Q' {
|
||||
continue
|
||||
}
|
||||
if strings.HasPrefix(ref, "QPlatform") {
|
||||
// e.g. QPlatformPixmap, QPlatformWindow, QPlatformScreen
|
||||
// These classes don't have a <> version to include
|
||||
if !ImportHeaderForClass(ref) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,9 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
func AllowDelete(c CppClass) bool {
|
||||
switch c.ClassName {
|
||||
case "QClipboard":
|
||||
@ -8,6 +12,28 @@ func AllowDelete(c CppClass) bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func ImportHeaderForClass(className string) bool {
|
||||
if className[0] != 'Q' {
|
||||
return false
|
||||
}
|
||||
|
||||
// TODO this could be implict by checking if files exist in known header paths
|
||||
|
||||
if strings.HasPrefix(className, "QPlatform") {
|
||||
// e.g. QPlatformPixmap, QPlatformWindow, QPlatformScreen
|
||||
// These classes don't have a <> version to include
|
||||
return false
|
||||
}
|
||||
|
||||
switch className {
|
||||
case "QGraphicsEffectSource", // e.g. qgraphicseffect.h
|
||||
"QText": // e.g. qtextcursor.h
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
func CheckComplexity(p CppParameter) error {
|
||||
|
||||
if p.QMapOf() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user