使用 *QFileDialog.SelectedFiles() 时报错, "接口转换: 接口 {} 为 []interface {}, 而非 []string"
**The Issue** I'm trying to get the directories selected when using QFileDialog but I keep getting the following error: panic: interface conversion: interface{} is []interface{}, not []string goroutine 20 [running]: GitHub.com/therecipe/qt/widgets.(*QFileDialog).SelectedFiles(0x0?) C:/Users/_/go/pkg/mod/GitHub.com/therecipe/[email protected]/widgets/widgets.go:13192 +0x15e main.main.func1(0x0) D:/junk/qt-test/window.go:52 +0x70 reflect.Value.call({0x1967000?, 0xc000008828?, 0x1ee2040?}, {0x1bcaf82, 0x4}, {0xc0002104b0, 0x1, 0xd514a5?}) C:/Program Files/Go/src/reflect/value.go:584 +0x8c5 reflect.Value.Call({0x1967000?, 0xc000008828?, 0xc000200330?}, {0xc0002104b0?, 0x1953d40?, 0x0?}) C:/Program Files/Go/src/reflect/value.go:368 +0xbc GitHub.com/therecipe/qt/internal.handleCallback({0xc000116606, 0x22}) C:/Users/_/go/pkg/mod/GitHub.com/therecipe/[email protected]/internal/internal.go:73 +0x2fd GitHub.com/therecipe/qt/internal.asyncCallbackHandler({0xc000116606?, 0x0?}) C:/Users/_/go/pkg/mod/GitHub.com/therecipe/[email protected]/internal/internal.go:109 +0x1e created by GitHub.com/therecipe/qt/internal.InitProcess.func3 C:/Users/_a/go/pkg/mod/GitHub.com/therecipe/[email protected]/internal/internal.go:407 +0xf5 The error always happens at when .SelectedFiles() is called.
内容来源: therecipe/qt