mirror of
https://github.com/mappu/miqt.git
synced 2025-01-22 06:30: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) {
|
for _, ref := range getReferencedTypes(src) {
|
||||||
if ref[0] != 'Q' {
|
if !ImportHeaderForClass(ref) {
|
||||||
continue
|
|
||||||
}
|
|
||||||
if strings.HasPrefix(ref, "QPlatform") {
|
|
||||||
// e.g. QPlatformPixmap, QPlatformWindow, QPlatformScreen
|
|
||||||
// These classes don't have a <> version to include
|
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,9 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"strings"
|
||||||
|
)
|
||||||
|
|
||||||
func AllowDelete(c CppClass) bool {
|
func AllowDelete(c CppClass) bool {
|
||||||
switch c.ClassName {
|
switch c.ClassName {
|
||||||
case "QClipboard":
|
case "QClipboard":
|
||||||
@ -8,6 +12,28 @@ func AllowDelete(c CppClass) bool {
|
|||||||
return true
|
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 {
|
func CheckComplexity(p CppParameter) error {
|
||||||
|
|
||||||
if p.QMapOf() {
|
if p.QMapOf() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user