Skip to content

Commit

Permalink
various qtbox related fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
therecipe committed Aug 27, 2020
1 parent 6367b92 commit 311f713
Show file tree
Hide file tree
Showing 58 changed files with 350 additions and 436 deletions.
8 changes: 0 additions & 8 deletions bluetooth/bluetooth.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,9 @@ import (
"github.com/therecipe/qt/core"
"github.com/therecipe/qt/internal"
"github.com/therecipe/qt/network"
"strings"
"unsafe"
)

func unpackStringList(s string) []string {
if len(s) == 0 {
return make([]string, 0)
}
return strings.Split(s, "¡¦!")
}

type QBluetooth struct {
internal.Internal
}
Expand Down
8 changes: 0 additions & 8 deletions charts/charts.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,9 @@ import (
"github.com/therecipe/qt/gui"
"github.com/therecipe/qt/internal"
"github.com/therecipe/qt/widgets"
"strings"
"unsafe"
)

func unpackStringList(s string) []string {
if len(s) == 0 {
return make([]string, 0)
}
return strings.Split(s, "¡¦!")
}

type QAbstractAxis struct {
core.QObject
}
Expand Down
7 changes: 0 additions & 7 deletions core/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,6 @@ import (
"unsafe"
)

func unpackStringList(s string) []string {
if len(s) == 0 {
return make([]string, 0)
}
return strings.Split(s, "¡¦!")
}

type QAbstractAnimation struct {
QObject
}
Expand Down
8 changes: 0 additions & 8 deletions datavisualization/datavisualization.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,9 @@ import (
"github.com/therecipe/qt/core"
"github.com/therecipe/qt/gui"
"github.com/therecipe/qt/internal"
"strings"
"unsafe"
)

func unpackStringList(s string) []string {
if len(s) == 0 {
return make([]string, 0)
}
return strings.Split(s, "¡¦!")
}

type Q3DBars struct {
internal.Internal
}
Expand Down
8 changes: 0 additions & 8 deletions dbus/dbus.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,9 @@ package dbus
import (
"github.com/therecipe/qt/core"
"github.com/therecipe/qt/internal"
"strings"
"unsafe"
)

func unpackStringList(s string) []string {
if len(s) == 0 {
return make([]string, 0)
}
return strings.Split(s, "¡¦!")
}

type QDBus struct {
internal.Internal
}
Expand Down
8 changes: 0 additions & 8 deletions designer/designer.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,9 @@ import (
"github.com/therecipe/qt/gui"
"github.com/therecipe/qt/internal"
"github.com/therecipe/qt/widgets"
"strings"
"unsafe"
)

func unpackStringList(s string) []string {
if len(s) == 0 {
return make([]string, 0)
}
return strings.Split(s, "¡¦!")
}

type AppFontDialog struct {
widgets.QDialog
}
Expand Down
8 changes: 0 additions & 8 deletions gamepad/gamepad.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,9 @@ package gamepad
import (
"github.com/therecipe/qt/core"
"github.com/therecipe/qt/internal"
"strings"
"unsafe"
)

func unpackStringList(s string) []string {
if len(s) == 0 {
return make([]string, 0)
}
return strings.Split(s, "¡¦!")
}

type QGamepad struct {
core.QObject
}
Expand Down
8 changes: 0 additions & 8 deletions gui/gui.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,9 @@ import (
"github.com/therecipe/qt/core"
"github.com/therecipe/qt/internal"
"github.com/therecipe/qt/interop/gow"
"strings"
"unsafe"
)

func unpackStringList(s string) []string {
if len(s) == 0 {
return make([]string, 0)
}
return strings.Split(s, "¡¦!")
}

type QAbstractOpenGLFunctions struct {
internal.Internal
}
Expand Down
8 changes: 0 additions & 8 deletions help/help.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,9 @@ import (
"github.com/therecipe/qt/gui"
"github.com/therecipe/qt/internal"
"github.com/therecipe/qt/widgets"
"strings"
"unsafe"
)

func unpackStringList(s string) []string {
if len(s) == 0 {
return make([]string, 0)
}
return strings.Split(s, "¡¦!")
}

type QCompressedHelpInfo struct {
internal.Internal
}
Expand Down
3 changes: 2 additions & 1 deletion internal/binding/converter/output.go
Original file line number Diff line number Diff line change
Expand Up @@ -846,7 +846,8 @@ func _cppOutput(name, value string, f *parser.Function) string {
f.Fullname == "QGuiApplication::highDpiScaleFactorRoundingPolicy" ||
f.Fullname == "QCanBusDevice::busStatus" ||
f.Fullname == "QTextBlockFormat::marker" ||
f.Fullname == "QActionGroup::exclusionPolicy" {
f.Fullname == "QActionGroup::exclusionPolicy" ||
f.ClassName() == "QWebEnginePage" {
return fmt.Sprintf("static_cast<qint64>(%v)", name)
}
return name
Expand Down
4 changes: 3 additions & 1 deletion internal/binding/files/utils-qml.go
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,8 @@ func (ptr *QJSEngine) fromJsToRef(tofi reflect.Type, jsval *QJSValue) reflect.Va
return nil
}

//TODO: some functions can't return on a chan such as core.QAbstractListModel::RowCount (when called i.e. by the core.QAbstractListModel::Index method); warn about these methods here if the remote lanuage is not supporting "SupportsSyncCallsIntoRemote" ?

//needed only for interop --->
fromJsToRefReturnsOnChan = true

Expand All @@ -320,7 +322,7 @@ func (ptr *QJSEngine) fromJsToRef(tofi reflect.Type, jsval *QJSValue) reflect.Va
}()

if tofi.NumOut() != 0 {
return []reflect.Value{reflect.ValueOf("___earlyReturn")}
return []reflect.Value{reflect.Zero(tofi.Out(0))} //TODO: (SupportsSyncCallsIntoRemote related); possible to trigger panic's with something like []reflect.Value{reflect.ValueOf("___earlyReturn")}
}
return nil
//needed only for interop <---
Expand Down
9 changes: 9 additions & 0 deletions internal/binding/parser/class.go
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,15 @@ func (c *Class) GetFunction(fname string) *Function {
return nil
}

func (c *Class) GetFunctionWithOverloadNumber(fname string, num string) *Function {
for _, f := range c.Functions {
if f.Name == fname && f.OverloadNumber == num {
return f
}
}
return nil
}

func (c *Class) GetTitledFunction(fname string) *Function {
for _, f := range c.Functions {
if strings.Title(f.Name) == strings.Title(fname) {
Expand Down
Loading

0 comments on commit 311f713

Please sign in to comment.