目前该项目为试验状态
GoQt 是一个Go语言的GUI工具包。它允许程序员使用Go语言更加容易的构建功能丰富的图形界面应用程序。GoQt使用cgo代码封装了流行的Qt跨平台 GUI库。类似Golang和Qt,GoQt是开源的,其中Qt绑定动态库qtdrv使用LGPL协议,Go语言的ui库则使用BSD协议。
GoQt理论上支持跨平台,但我只在windows上使用Qt4.8.5和Qt5.5.1编译测试过。
安装GoQt
### 1.get goqt
> go get github.com/visualfc/goqt
### 2.build qtdrv, need install QtSDK
> cd goqt/qtdrv
> qmake "CONFIG+=release"
> make
### 3.build rcc
> cd goqt/tools/rcc
> qmake "CONFIG+=release"
> make
### 4.build ui, need CGO_ENABLED=1 and install gcc
> cd goqt/ui
> go install -v
### 5.build examples
> cd goqt\examples\minimal
> build.bat
> ..\..\bin\minimal.exe
示例例程序
package main
import (
"fmt"
"runtime"
"github.com/visualfc/goqt/ui"
)
func main() {
ui.Run(func() {
info := fmt.Sprintf("Hello GoQt Version %v \ngo verison %v %v/%v", ui.Version(), runtime.Version(), runtime.GOOS, runtime.GOARCH)
lable := ui.NewLabel()
lable.SetText(info)
hbox := ui.NewHBoxLayout()
hbox.AddWidget(lable)
widget := ui.NewWidget()
widget.SetLayout(hbox)
widget.Show()
})
}
LiteIDE作者出品,https://github.com/visualfc/goqt
--
--
官网: http://golang-china.org/
IRC: irc.freenode.net #golang-china
@golangchina
---
您收到此邮件是因为您订阅了Google网上论坛上的“Golang-China”群组。
要退订此群组并停止接收此群组的电子邮件,请发送电子邮件到golang-china...@googlegroups.com。
要在网络上查看此讨论,请访问https://groups.google.com/d/msgid/golang-china/de8de0b8-f385-4d38-8fc8-ed9725af218c%40googlegroups.com。
要查看更多选项,请访问https://groups.google.com/d/optout。