Cute (Qt) binding for Go (Golang) with support for Windows / macOS / Linux / FreeBSD / Android / iOS / Sailfish OS / Raspberry Pi / AsteroidOS / Ubuntu Touch / JavaScript / WebAssembly
Find a file
2016-08-28 18:09:35 +02:00
androidextras fix signal table cleanup 2016-08-26 15:33:11 +02:00
bluetooth added callbacks for virtual destructors 2016-08-27 01:22:01 +02:00
core added callbacks for virtual destructors 2016-08-27 01:22:01 +02:00
dbus added callbacks for virtual destructors 2016-08-27 01:22:01 +02:00
designer added callbacks for virtual destructors 2016-08-27 01:22:01 +02:00
gamepad fix signal table cleanup 2016-08-26 15:33:11 +02:00
gui added callbacks for virtual destructors 2016-08-27 01:22:01 +02:00
help added callbacks for virtual destructors 2016-08-27 01:22:01 +02:00
internal minor cleanup 2016-08-28 18:09:35 +02:00
location minor cleanup 2016-08-28 18:09:35 +02:00
macextras added callbacks for virtual destructors 2016-08-27 01:22:01 +02:00
multimedia added callbacks for virtual destructors 2016-08-27 01:22:01 +02:00
network added callbacks for virtual destructors 2016-08-27 01:22:01 +02:00
nfc added callbacks for virtual destructors 2016-08-27 01:22:01 +02:00
positioning added callbacks for virtual destructors 2016-08-27 01:22:01 +02:00
printsupport added callbacks for virtual destructors 2016-08-27 01:22:01 +02:00
purchasing fix signal table cleanup 2016-08-26 15:33:11 +02:00
qml added callbacks for virtual destructors 2016-08-27 01:22:01 +02:00
quick minor cleanup 2016-08-28 18:09:35 +02:00
sailfish fix signal table cleanup 2016-08-26 15:33:11 +02:00
script added callbacks for virtual destructors 2016-08-27 01:22:01 +02:00
scripttools fix signal table cleanup 2016-08-26 15:33:11 +02:00
scxml added callbacks for virtual destructors 2016-08-27 01:22:01 +02:00
sensors added callbacks for virtual destructors 2016-08-27 01:22:01 +02:00
serialbus added callbacks for virtual destructors 2016-08-27 01:22:01 +02:00
serialport added callbacks for virtual destructors 2016-08-27 01:22:01 +02:00
sql added callbacks for virtual destructors 2016-08-27 01:22:01 +02:00
svg fix signal table cleanup 2016-08-26 15:33:11 +02:00
testlib remove wrong finalizers + more signal table cleanup 2016-08-26 19:43:21 +02:00
uitools added callbacks for virtual destructors 2016-08-27 01:22:01 +02:00
webchannel added callbacks for virtual destructors 2016-08-27 01:22:01 +02:00
webengine added callbacks for virtual destructors 2016-08-27 01:22:01 +02:00
websockets added callbacks for virtual destructors 2016-08-27 01:22:01 +02:00
widgets added callbacks for virtual destructors 2016-08-27 01:22:01 +02:00
xml added callbacks for virtual destructors 2016-08-27 01:22:01 +02:00
xmlpatterns added callbacks for virtual destructors 2016-08-27 01:22:01 +02:00
.gitignore build minimal binaries 2016-05-28 18:18:42 +02:00
LICENSE complete rewrite 2015-10-24 17:18:24 +02:00
qt.go fix signal table cleanup 2016-08-26 15:33:11 +02:00
README.md fix links in README 2016-08-19 23:31:17 +02:00
setup.bat fix setup again 2016-08-21 05:00:42 +02:00
setup.sh fix setup again 2016-08-21 05:00:42 +02:00

Screenshots

Windows

Mac OS X

Linux

Android

Portrait

Landscape

iOS

Portrait

Landscape

Sailfish OS

source


Getting Started

Windows / Mac OS X / Linux

  1. Install Go >= 1.7.0 and setup a proper GOPATH

  2. Install Qt 5.7.0 in C:\Qt\Qt5.7.0\ or /usr/local/Qt5.7.0/

  3. Setup the environment

    • Windows

      • Add the directory that contains g++.exe to your PATH

        C:\Qt\Qt5.7.0\Tools\mingw530_32\bin

    • Mac OS X

      • Install Xcode >= 7.3.1
    • Linux

      • Install g++

        sudo apt-get install g++

      • Install OpenGL dependencies

        sudo apt-get install mesa-common-dev

  4. Download the binding

    go get github.com/therecipe/qt

  5. Generate, install and test

    cd %GOPATH%\src\github.com\therecipe\qt && setup.bat (run as admin)

    or

    cd $GOPATH/src/github.com/therecipe/qt && ./setup.sh


Android

  1. Set up the desktop version

  2. Install the Android SDK in C:\android\android-sdk\ or /opt/android-sdk/

  3. Install the SDK dependencies with C:\android\android-sdk\tools\android.bat or /opt/android-sdk/tools/android

    • Tools
      • Android SDK Build-tools (24.0.1)
    • Android 7.0 (API 24)
      • SDK Platform
    • Extras (Windows only)
      • Google USB Driver
  4. Install the Android NDK in C:\android\android-ndk\ or /opt/android-ndk/

  5. Install Java SE Development Kit (Linux: install in /opt/jdk/)

  6. Install and test

    cd %GOPATH%\src\github.com\therecipe\qt && setup.bat android (run as admin)

    or

    cd $GOPATH/src/github.com/therecipe/qt && ./setup.sh android


iOS

  1. Set up the desktop version on Mac OS X

  2. Install and test

    cd $GOPATH/src/github.com/therecipe/qt && ./setup.sh ios && ./setup.sh ios-simulator


Sailfish OS

  1. Set up the desktop version

  2. Install VirtualBox

  3. Install the Sailfish OS SDK in C:\SailfishOS\ or /opt/SailfishOS/

  4. Install and test

    cd %GOPATH%\src\github.com\therecipe\qt && setup.bat sailfish && setup.bat sailfish-emulator (run as admin)

    or

    cd $GOPATH/src/github.com/therecipe/qt && ./setup.sh sailfish && ./setup.sh sailfish-emulator


Quick Start

  1. Create a folder [GOPATH]/src/qtExample

  2. Create a file [GOPATH]/src/qtExample/main.go

package main

import ( "os"

	"github.com/therecipe/qt/widgets"

)

func main() { widgets.NewQApplication(len(os.Args), os.Args)

	var btn = widgets.NewQPushButton2("Hello World", nil)
	btn.Resize2(180, 44)
	btn.ConnectClicked(func(flag bool) {
		widgets.QMessageBox_Information(nil, "OK", "You Clicked me!", widgets.QMessageBox__Ok, widgets.QMessageBox__Ok)
	})

	var window = widgets.NewQMainWindow(nil, 0)
	window.SetWindowTitle("Hello World Example")
	window.Layout().AddWidget(btn)
	window.Show()

	widgets.QApplication_Exec()

}


3. Open the command line in `[GOPATH]/src` and run
`qtdeploy build desktop qtExample`

4. You will find the binary file here
`[GOPATH]/src/qtExample/deploy/[GOOS]/qtExample`

5. Take a look at the [other examples](http://github.com/therecipe/qt/tree/master/internal/examples)

6. Make yourself familiar with the [qt documentation](http://doc.qt.io/qt-5/classes.html)