Qt binding for Go (Golang) aims get Go's compile speed again.

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

Owner
yatsen1
slow net better than no net
yatsen1
Similar Resources

A Go (golang) Custom Flutter Engine Embedder for desktop

A Go (golang) Custom Flutter Engine Embedder for desktop

Go Flutter desktop embedder ⚠️ Warning: this project has been moved to its own organization. Please take a look at its new location: github.com/go-flu

Jul 23, 2022

Windows GUI library for Go (Golang). Comes with a graphical UI designer.

Version 2 Please go to Version 2 of this library for the latest version. Windows GUI Library This is a pure Go library to create native Windows GUIs.

Jan 1, 2023

Zenity dialogs for Golang, Windows, macOS

Zenity dialogs for Golang, Windows and macOS This repo includes both a cross-platform Go package providing Zenity-like dialogs (simple dialogs that in

Dec 31, 2022

Cross platform rapid GUI framework for golang based on Dear ImGui.

Cross platform rapid GUI framework for golang based on Dear ImGui.

giu Cross platform rapid GUI framework for golang based on Dear ImGui and the great golang binding imgui-go. Any contribution (features, widgets, tuto

Dec 28, 2022

NanoGUI.go NanoGUINanoGUI.go is a golang port of NanoGUI.

NanoGUI.go This is a golang port of NanoGUI. NanoGUI is a a minimalistic cross-platform widget library for OpenGL. Default Font Customize Guide TBD Co

Oct 19, 2022

百度网盘不限速客户端, golang + qt5, 跨平台图形界面

百度网盘不限速客户端, golang + qt5, 跨平台图形界面

pan-light _ _ _ _ | (_) | | | | _ __ __ _ _ __ | |_ __ _| |__ | |_ | '_ \ / _` |

Jan 1, 2023

Golang bindings for XCGUI, Windows GUI library, DirectUI design idea.

Golang bindings for XCGUI, Windows GUI library, DirectUI design idea.

XCGUI 项目文档 帮助文档 程序示例 介绍 English | 简体中文 DirectUI设计思想: 在窗口内没有子窗口,界面元素都是逻辑上的区域(无HWND句柄,安全,灵活), 所有UI元素都是自主开发(不受系统限制), 更加灵活的实现各种程序界面,满足不同用户的需求.

Dec 22, 2022

Hedgex Single User Interface With Golang

Hedgex Single User Interface With Golang

Nov 3, 2021

Tiny cross-platform webview library for C/C++/Golang. Uses WebKit (Gtk/Cocoa) and Edge (Windows)

webview A tiny cross-platform webview library for C/C++/Golang to build modern cross-platform GUIs. Also, there are Rust bindings, Python bindings, Ni

Jan 1, 2023
Comments
  • Update dl dependency to the latest version

    Update dl dependency to the latest version

    On windows it produces a compilation error, as the pinned old version of github.com/kitech/dl contains dlfcn symbols that are not there anymore. Just updating to the lattest version solves the issue.

    Closes: #44

  • go get -v -u github.com/kitech/qt.go

    go get -v -u github.com/kitech/qt.go

    $ go get -v -u github.com/kitech/qt.go
    github.com/kitech/qt.go (download)
    github.com/kitech/qt.go is a directory, should be a Go file
    

    Do i need to worry about this? I cannot see any text at all with the provided example:

    package main
    
    import (
    	"os"
    
    	"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()
    }
    

    Nor with any code of my own. I don't know if it is related.

  • 对象的某些属性或容器返回的地址与真实的地址不相符的问题

    对象的某些属性或容器返回的地址与真实的地址不相符的问题

    obj0 := qtcore.NewQObject(nil)
    obj1 := qtcore.NewQObject(obj0)
    obj2 := qtcore.NewQObject(obj0)
    
    fmt.Println("obj0", obj0)
    fmt.Println("obj1", obj1)
    fmt.Println("obj2", obj2)
    fmt.Println(obj1.Parent())
    // obj1, obj2
    fmt.Println(qtcore.NewQObjectListxFromPointer(obj0.Children().Cthis).ConvertToSlice())
    

    result:

    obj0 &{0xc0000aa068}
    obj1 &{0xc0000aa080}
    obj2 &{0xc0000aa098}
    // 此处应该返回的是 obj0 的地址,但是和obj0本身的地址不一样。
    &{0xc000010028}
    // 此处应该返回 obj1, obj2 的地址,但是和它们本身的真实地址不一样。
    [0xc0000aa0d0 0xc0000aa0f8]
    

    返回的地址不一致会造成很多不方便的问题,比如判断两个对象是否相等,等等。这种情况能否解决?

A utility library to make use of the X Go Binding easier. (Implements EWMH and ICCCM specs, key binding support, etc.)

xgbutil is a utility library designed to work with the X Go Binding. This project's main goal is to make various X related tasks easier. For example,

Dec 10, 2022
This project is "closed". If I begin again, it will be from scratch

This project is closed. If I begin again, it will be from scratch and using lessons learned while writing go.uik. Of course, if I begin again it will

Jan 1, 2023
Qt binding for Go (Golang) with support for Windows / macOS / Linux / FreeBSD / Android / iOS / Sailfish OS / Raspberry Pi / AsteroidOS / Ubuntu Touch / JavaScript / WebAssembly

Introduction Qt is a free and open-source widget toolkit for creating graphical user interfaces as well as cross-platform applications that run on var

Jan 2, 2023
Go binding for GTK
Go binding for GTK

go-gtk WHATS Go bindings for GTK SCREENSHOT INSTALL You can experiment with go-gtk by running the various example programs: git clone https://github.c

Jan 5, 2023
The X Go Binding is a low-level API to communicate with the X server. It is modeled on XCB and supports many X extensions.

Note that this project is largely unmaintained as I don't have the time to do or support more development. Please consider using this fork instead: ht

Dec 29, 2022
Simple QML binding for Go

Qamel Qamel is a simple QML binding for Go, heavily inspired by therecipe/qt. This package only binds Qt's classes that used for creating a simple QML

Jan 3, 2023
SDL2 binding for Go

SDL2 binding for Go go-sdl2 is SDL2 wrapped for Go users. It enables interoperability between Go and the SDL2 library which is written in C. That mean

Dec 30, 2022
Native Go (golang) Graphical Interface system (2D and 3D), built on GoKi tree framework
Native Go (golang) Graphical Interface system (2D and 3D), built on GoKi tree framework

GoGi is part of the GoKi Go language (golang) full strength tree structure system (ki = 木 = tree in Japanese) package gi is a scenegraph-based 2D and

Dec 25, 2022
Tiny cross-platform webview library for C/C++/Golang. Uses WebKit (Gtk/Cocoa) and Edge (Windows)

webview A tiny cross-platform webview library for C/C++/Golang to build modern cross-platform GUIs. Also, there are Rust bindings, Python bindings, Ni

Dec 28, 2022
Golang bindings of Sciter: the Embeddable HTML/CSS/script engine for modern UI development
Golang bindings of Sciter: the Embeddable HTML/CSS/script engine for modern UI development

Go bindings for Sciter Check this page for other language bindings (Delphi / D / Go / .NET / Python / Rust). Attention The ownership of project is tra

Dec 23, 2022