mikicomo

Go 语言 GUI 库 GoQt 0.1 发布

  •  1
     
  •   mikicomo · Dec 29, 2015 · 3239 views
    This topic created in 3873 days ago, the information mentioned may be changed or developed.

    GoQt 是 Go 语言的 Qt 图形库绑定,目前 0.1 版本已经发布。

    试验

    目前该项目为试验状态

    关于 GoQt

    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()
        })
    }
    
    3 replies    2015-12-30 08:26:05 +08:00
    mikicomo
        1
    mikicomo  
    OP
       Dec 29, 2015
    orvice
        2
    orvice  
       Dec 29, 2015
    mark
    mikicomo
        3
    mikicomo  
    OP
       Dec 30, 2015
    @orvice LiteIDE 作者操刀,赞~
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2709 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 12:28 · PVG 20:28 · LAX 05:28 · JFK 08:28
    ♥ Do have faith in what you're doing.