如何解决这个问题呢?该程序有效。但是 Gogland 中的方法以红色突出显示。添加了 Qt 5.8 版。
Gogland (1.0 Preview) 1.0 EAP
Build #GO-171.4694.61, built on June 27, 2017
Gogland EAP User
Expiration date: September 25, 2017
JRE: 1.8.0_112-release-736-b21 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Linux 4.8.0-58-generic
batis@dev:~$ printenv | grep GO
GOROOT=/usr/lib/go-1.8/
GOPATH=/home/batis/gocode/
package main
import (
"os"
"github.com/therecipe/qt/widgets"
)
func main() {
widgets.NewQApplication(len(os.Args), os.Args)
//create a window
window := widgets.NewQMainWindow(nil, 0)
......
widgets.QApplication_Exec()
}