GoQt Go的Qt图形库绑定 GoQt

agolangf • 14862 次点击    
这是一个分享于 的项目,其中的信息可能已经有所发展或是发生改变。
**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 &gt; go get github.com/visualfc/goqt #### 2.build qtdrv, need install QtSDK &gt; cd goqt\qtdrv &gt; qmake &#34;CONFIG+=release&#34; &gt; make #### 3.build rcc &gt; cd goqt\tools\rcc &gt; qmake &#34;CONFIG+=release&#34; &gt; make #### 4.build ui, need CGO_ENABLED=1 and install gcc &gt; cd goqt\ui &gt; go install -v #### 5.build examples &gt; cd goqt\examples\minimal &gt; build.bat &gt; ..\..\bin\minimal.exe ### Linux #### 1.get goqt &gt; go get github.com/visualfc/goqt #### 2.build qtdrv, need install QtSDK &gt; cd goqt/qtdrv &gt; qmake &#34;CONFIG+=release&#34; &gt; make #### 3.build rcc &gt; cd goqt/tools/rcc &gt; qmake &#34;CONFIG+=release&#34; &gt; make #### 4.build ui, need CGO_ENABLED=1 and install gcc &gt; cd goqt/ui &gt; go install -v #### 5.build examples &gt; cd goqt/examples/minimal &gt; build.sh &gt; ../../bin/minimal ### MacOS X #### 1.get goqt &gt; go get github.com/visualfc/goqt #### 2.build qtdrv, need install QtSDK &gt; cd goqt/qtdrv &gt; qmake -spec macx-g++ &#34;CONFIG+=release&#34; &gt; make #### 3.build rcc &gt; cd goqt/tools/rcc &gt; qmake -spec macx-g++ &#34;CONFIG+=release&#34; &gt; make #### 4.build ui, need CGO_ENABLED=1 and install gcc &gt; cd goqt/ui &gt; go install -v #### 5.build examples &gt; cd goqt/examples/minimal &gt; build.sh &gt; ../../bin/minimal </strong></pre> ** 事例程序 ** <pre class="brush:cpp ;toolbar: true; auto-links: false;">package main import ( &#34;fmt&#34; &#34;runtime&#34; &#34;github.com/visualfc/goqt/ui&#34; ) func main() { ui.Run(func() { info := fmt.Sprintf(&#34;Hello GoQt Version %v \ngo verison %v %v/%v&#34;, 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
14862 次点击  
加入收藏 微博
1 回复  |  直到
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传