gui.NewQPolygonF3 panics
ToxicGLaDOS opened this issue · 1 comments
ToxicGLaDOS commented
Calling gui.NewQPolygonF3
results in a panic with this message:
panic: interface conversion: interface {} is []*core.QPointF, not []interface {}
goroutine 1 [running, locked to thread]:
github.com/therecipe/qt/internal.convertToJson({0x15ec960, 0xc00000e3a8})
/home/jeff/go/pkg/mod/github.com/therecipe/qt@v0.0.0-20200904063919-c0c124a5770d/internal/internal.go:176 +0x66d
github.com/therecipe/qt/internal.convertListToJson({0xc00007a230, 0x5, 0x5})
/home/jeff/go/pkg/mod/github.com/therecipe/qt@v0.0.0-20200904063919-c0c124a5770d/internal/internal.go:149 +0x67
github.com/therecipe/qt/internal.convertToJson({0x15ee8e0, 0xc00000e3c0})
/home/jeff/go/pkg/mod/github.com/therecipe/qt@v0.0.0-20200904063919-c0c124a5770d/internal/internal.go:176 +0x629
github.com/therecipe/qt/internal.CallLocalFunction({0xc00007a230, 0x4, 0x4})
/home/jeff/go/pkg/mod/github.com/therecipe/qt@v0.0.0-20200904063919-c0c124a5770d/internal/internal.go:217 +0x34
github.com/therecipe/qt/gui.NewQPolygonF3(...)
/home/jeff/go/pkg/mod/github.com/therecipe/qt@v0.0.0-20200904063919-c0c124a5770d/gui/gui.go:32995
main.main()
/home/jeff/projects/gorchestratorbad/main.go:23 +0x4c9
exit status 2
Here's a minimum example
package main
import (
"fmt"
"github.com/therecipe/qt/core"
"github.com/therecipe/qt/gui"
"github.com/therecipe/qt/widgets"
)
var (
Scene *widgets.QGraphicsScene
View *widgets.QGraphicsView
)
func main() {
var p0 = core.NewQPointF3(0, 0)
var p1 = core.NewQPointF3(100, 0)
var p2 = core.NewQPointF3(85, 20)
var p3 = core.NewQPointF3(0, 0)
var points = []*core.QPointF{p0, p1, p2, p3}
var polygon = gui.NewQPolygonF3(points)
fmt.Printf("%v\n", polygon)
}
This issue seems related to #1188, #1204, and #1245, but different enough that I figured I should leave an issue.
NaymDev commented
Any fix after 3 years?