qt README

The project's README from github.com/therecipe/qt. As one markdown file: README.md.

Introduction

Qt is a free and open-source widget toolkit for creating graphical user interfaces as well as cross-platform applications that run on various software and hardware platforms with little or no change in the underlying codebase.

Go, also known as Golang, is a programming language designed at Google.

therecipe/qt allows you to write Qt applications entirely in Go, JavaScript/TypeScript, Dart/Flutter, Haxe and Swift

Beside the language bindings provided, therecipe/qt also greatly simplifies the deployment of Qt applications to various software and hardware platforms.

At the time of writing, almost all Qt functions and classes are accessible, and you should be able to find everything you need to build fully featured Qt applications.

Impressions

Gallery of example applications.

JavaScript Demo | source

Installation

The following instructions assume that you already installed Go and Git

(Experimental) cgo-less version (try this first, if you are new and want to test the binding)

Windows
go get -ldflags="-w" github.com/therecipe/examples/basic/widgets && for /f %v in ('go env GOPATH') do %v\bin\widgets.exe
macOS/Linux
go get -ldflags="-w" github.com/therecipe/examples/basic/widgets && $(go env GOPATH)/bin/widgets

Default version

Windows (more info)
set GO111MODULE=off
go get -v github.com/therecipe/qt/cmd/... && for /f %v in ('go env GOPATH') do %v\bin\qtsetup test && %v\bin\qtsetup -test=false
macOS (more info)
export GO111MODULE=off; xcode-select --install; go get -v github.com/therecipe/qt/cmd/... && $(go env GOPATH)/bin/qtsetup test && $(go env GOPATH)/bin/qtsetup -test=false
Linux (more info)
export GO111MODULE=off; go get -v github.com/therecipe/qt/cmd/... && $(go env GOPATH)/bin/qtsetup test && $(go env GOPATH)/bin/qtsetup -test=false

Resources

Deployment Targets

Target Arch Linkage Docker Deployment Host OS
Windows 32 / 64 dynamic / static Yes Any
macOS 64 dynamic Yes Any
Linux arm / arm64 / 64 dynamic / static / system Yes Any
Android (+Wear) arm / arm64 dynamic Yes Any
Android-Emulator (+Wear) 32 dynamic Yes Any
SailfishOS arm system Yes Any
SailfishOS-Emulator 32 system Yes Any
Raspberry Pi (1/2/3) arm dynamic / system Yes Any
Ubuntu Touch arm / 64 system Yes Any
JavaScript 32 static Yes Any
WebAssembly 32 static Yes Any
iOS arm64 static No macOS
iOS-Simulator 64 static No macOS
AsteroidOS arm system No Linux
FreeBSD 32 / 64 system No FreeBSD

License

This package is released under LGPLv3

Qt itself is licensed and available under multiple licenses.

qt (therecipe/qt)

Searching Database…

10.8K ·GitHub
这是什么?therecipe/qt 是一套 Go 语言绑定,用于 Qt 图形界面工具包,让你完全用 Go 构建原生图形应用程序(也支持 JavaScript/TypeScript、Dart/Flutter、Haxe 或 Swift)。
这是一个独立的 GUI 框架,还是只是 Qt 的绑定?它是一个绑定层,把现有的 Qt C++ 控件工具包开放给 Go。你可以在 Go 代码中直接调用真正的 Qt 类和函数,而不是使用 Go 原生的控件库。
我该如何用它构建 Qt 应用?安装 Go 和 Git 之后,你可以选择实验性的 cgo-less 版本(建议优先尝试),或默认版本。两者都有各自针对 Windows、macOS、Linux 的安装步骤,详见安装文档。
我需要先装好 Go 和 Git 吗?需要。安装说明默认你在添加该绑定之前已经安装好 Go 和 Git。
所有目标平台都能用同样的方式构建和部署吗?不能。大多数目标平台(Windows、macOS、Linux、Android、Raspberry Pi、JS、WebAssembly 等)支持从任意宿主系统通过 Docker 部署,但 iOS 和 iOS-Simulator 必须在 macOS 上构建,AsteroidOS 需要 Linux,FreeBSD 需要 FreeBSD,这四个平台都没有 Docker 部署方式。
除了 Go,还有哪些语言可以使用这个绑定?该项目除 Go 外,还支持使用 JavaScript/TypeScript、Dart/Flutter、Haxe 和 Swift 编写 Qt 应用。
我可以用 Docker 部署做好的应用吗?可以。对于大多数部署目标(Windows、macOS、Linux、Android、Raspberry Pi、Ubuntu Touch、Sailfish OS、JavaScript、WebAssembly),项目支持从任意宿主系统通过 Docker 部署。
我在 Go 中能使用多少 Qt 功能?几乎所有 Qt 函数和类都已开放,因此你可以构建功能完整的 Qt 应用,而不是只能使用有限的控件子集。
为什么选它而不是原生的 Go GUI 库?它让你能使用 Qt 成熟、经过大量验证的控件工具包,并获得广泛的平台支持(从桌面操作系统到 Sailfish OS、AsteroidOS 和 WebAssembly),而不是依赖规模较小、仅面向 Go 的 GUI 生态。
What are similar projects?moonshine, kivy, PySimpleGUI, fyne, sherpa-onnx, ebiten, supertonic, mygo
Creator
therecipe
Size
171.8 MB
Stars
10.8K
Updated
CommitSep 04
Age
11y
Commits · 90 Days