**GoQt**
**
简介
**
GoQt是Go语言的Qt图形库绑定。
*
版本 0.1
*
作者 七叶
**
试验
**
目前该项目为试验状态
**
关于GoQt
**
GoQt是一个Go语言的GUI工具包。它允许程序员使用Go语言更加容易的构建功能丰富的图形界面应用程序。GoQt使用cgo代码封装了流行的Qt跨平台GUI库。类似Golang和Qt,GoQt是开源的,其中Qt绑定动态库qtdrv使用LGPL协议,Go语言的ui库则使用BSD协议。
**
平台支持
**
###
System
* Windows x86 (32-bit or 64-bit)
* Linux x86 (32-bit or 64-bit)
* MacOS X10.6
###
Golang
* Go1.5.2
###
Qt Version
*
Qt4.8.5
*
Qt5.5.1
我在Windows/Linux/MaOSX平台上测试过Qt4.8.5,只在Windows平台上测试过Qt5.5.1。
**
安装GoQt
**
** **
<pre><strong>### Windows
#### 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
### Linux
#### 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.sh
> ../../bin/minimal
### MacOS X
#### 1.get goqt
> go get github.com/visualfc/goqt
#### 2.build qtdrv, need install QtSDK
> cd goqt/qtdrv
> qmake -spec macx-g++ "CONFIG+=release"
> make
#### 3.build rcc
> cd goqt/tools/rcc
> qmake -spec macx-g++ "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.sh
> ../../bin/minimal </strong></pre>
**
事例程序
**
<pre class="brush:cpp ;toolbar: true; auto-links: false;">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()
})
}</pre>
- 授权协议:
- BSD
- 开发语言:
- C/C++Google Go 查看源码»
- 操作系统:
- 跨平台WindowsLinuxOS X