Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gui.NewQPolygonF3 panics #1255

Open
ToxicGLaDOS opened this issue Nov 19, 2021 · 1 comment
Open

gui.NewQPolygonF3 panics #1255

ToxicGLaDOS opened this issue Nov 19, 2021 · 1 comment

Comments

@ToxicGLaDOS
Copy link

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
Copy link

NaymDev commented May 17, 2024

Any fix after 3 years?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants