Skip to content
Qt binding for Go (Golang) aims get Go's compile speed again.
Go
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.travis Release v107 Apr 29, 2019
cmd fix typo Mar 11, 2019
docs Fix little docs Dec 31, 2018
examples windows home is NULL Dec 23, 2018
miscutil fix heavy depends Feb 22, 2019
qt5 move dirs. Jan 26, 2018
qtandroidextras Improve minimal tag build core/gui/widgets support Apr 6, 2019
qtandroidrt supply some lost functions for android. May 18, 2018
qtcore Improve minimal tag build core/gui/widgets support Apr 6, 2019
qtgui Improve minimal tag build core/gui/widgets support Apr 6, 2019
qtmacextras Improve minimal tag build core/gui/widgets support Apr 6, 2019
qtmeta Optional use ffi call wrapper in qtinline Dec 9, 2018
qtmock Drop _ of overload method name Dec 8, 2018
qtmultimedia Improve minimal tag build core/gui/widgets support Apr 6, 2019
qtnetwork Improve minimal tag build core/gui/widgets support Apr 6, 2019
qtpositioning Improve minimal tag build core/gui/widgets support Apr 6, 2019
qtprintsupport improve go-uic and makefile and dir2qrc command. Apr 14, 2018
qtqml Improve minimal tag build core/gui/widgets support Apr 6, 2019
qtqt Fix more go-uic. Add cgo-rcc. Add signal/slot connect destroy. Aug 12, 2018
qtquick Improve minimal tag build core/gui/widgets support Apr 6, 2019
qtquickcontrols2 Improve minimal tag build core/gui/widgets support Apr 6, 2019
qtquicktemplates2 import path to github, no local now. add readme and license. Feb 12, 2018
qtquickwidgets Improve minimal tag build core/gui/widgets support Apr 6, 2019
qtrt fix CI. fix android lib search path Mar 21, 2019
qtsvg Improve minimal tag build core/gui/widgets support Apr 6, 2019
qtwebchannel Improve minimal tag build core/gui/widgets support Apr 6, 2019
qtwebengine Improve minimal tag build core/gui/widgets support Apr 6, 2019
qtwebenginecore Improve minimal tag build core/gui/widgets support Apr 6, 2019
qtwebenginewidgets Improve minimal tag build core/gui/widgets support Apr 6, 2019
qtwidgets Improve minimal tag build core/gui/widgets support Apr 6, 2019
qtwinextras Improve minimal tag build core/gui/widgets support Apr 6, 2019
tests Drop _ of overload method name Dec 8, 2018
toolutil fix heavy depends Feb 22, 2019
.gitignore Move tools into their own directory, following Go best practices. Mar 23, 2018
.travis.yml fix CI Dec 25, 2018
ChangeLog.md Update docs. Ready for rc4. Sep 8, 2018
Dockerfile.mingw fix CI. fix android lib search path Mar 21, 2019
Dockerfile.ubuntu16 add ubuntu16 ci. Feb 24, 2018
Gopkg.lock add install.md. use own version libdl gobinding. Mar 3, 2018
Gopkg.toml add install.md. use own version libdl gobinding. Mar 3, 2018
LICENSE import path to github, no local now. add readme and license. Feb 12, 2018
Makefile Update Makefile Apr 25, 2019
go.mod rebased from v5.12 Mar 22, 2019
go.sum Update go mod Dec 13, 2018
install.md Release v107 Apr 29, 2019
make.sh Optional use ffi call wrapper in qtinline Dec 9, 2018
noop.go Fix debug assert Dec 4, 2018
readme.md
run-mingw.sh fix CI Dec 25, 2018
run-ubuntu16.sh add install.md. use own version libdl gobinding. Mar 3, 2018

readme.md

qt.go

Qt5 binding for Go (Golang) without CGO that aims to achieve Go's native compile speeds. Instead of using common bindings and heavy C++ wrapper code that forces you to compile and link time and time again, Qt.Go uses FFI so there's only a runtime dependency.

Build Status Go Report Card GoDoc Sourcegraph

Features

  • Binding code with no CGO compile cost
  • Popular Qt5 packages (widgets/QML/extras) support
  • Simple go-uic, go-rcc tools
  • full signal/slot support
  • protected method override support
  • default arguments and value wrapper functions
  • Class/Method/Function/Enum comment for godoc
  • Go side signal/slot definition (experimental)

Multiple platforms support

All platforms should be supported, for now some of them are tested:

  • Archlinux/Ubuntu16+
  • MacOS
  • Android
  • Windows

Installation

requirement
  • go 1.9+
  • libffi
  • dlfcn (windows)
FFI

Make sure libffi is installed

Debian based: apt-get install libffi-dev

Arch based: pacman -S libffi

MacOS: brew install libffi

qt.go:
go get -v -u github.com/kitech/qt.go
runtime dependency:
git clone https://github.com/kitech/qt.inline.git
cd qt.inline
cmake .
make
cp libQt5Inline.so /usr/lib/libQt5Inline.so
uic/rcc
go get -v -u github.com/kitech/qt.go/cmd/go-uic
go get -v -u github.com/kitech/qt.go/cmd/go-rcc

Full Installation

Examples

package main
import "os"
import "github.com/kitech/qt.go/qtwidgets"
func main() {
    app := qtwidgets.NewQApplication(len(os.Args), os.Args, 0)
    btn := qtwidgets.NewQPushButton1("hello qt.go", nil)
    btn.Show()
    app.Exec()
}

More complex examples: https://github.com/kitech/qt.go/examples/ https://github.com/qtchina/qt.go.demos/

Go side signal/slot: syntax document usage demo

Community

Internals

Qt.Go uses FFI to call wrapped Qt functions and methods, so there is no compile/link time dependency on Qt, only a run time dependency.

This should make the development and testing phases much faster.

Internal document

You can’t perform that action at this time.