Skip to content
Andrew O edited this page Dec 10, 2021 · 26 revisions

Please make sure that you have successfully installed the binding first.

You can find the instructions to install the binding here.

Most new examples can be found here.

Basic Examples

The basic examples are the ones you want to look into if you are just getting started. They show you the bare minimum of code and file structure needed to get the different technologies of Qt working.

To test them run something like:

  • qtdeploy test desktop github.com/therecipe/examples/basic/widgets docs for Widgets
  • qtdeploy test desktop github.com/therecipe/examples/basic/quick docs for QML/Quick
  • qtdeploy test desktop github.com/therecipe/examples/basic/qml docs for QML

Advanced Examples

The advanced examples show you some more complex topics of Qt. Such as the usage of qtrcc and qtmoc, how to create and use List, Table and TreeModels. How to properly use goroutines, the different ways to communicate with QML and also how to create your own QML instantiable Go types.

To test them run something like:

  • qtdeploy test desktop github.com/therecipe/examples/advanced/widgets/tableview
  • qtdeploy test desktop github.com/therecipe/examples/advanced/qml_quick/tableview

Test Examples

The test examples show you how to write tests for widget and QML applications.

To test them run something like:

  • go get -d -v github.com/therecipe/examples/...
  • cd $(go env GOPATH)/src/github.com/therecipe/examples
  • qtmoc desktop ./test/widgets
  • go test -v ./test/widgets
  • qtmoc desktop ./test/qml_quick
  • qtrcc desktop ./test/qml_quick
  • go test -v ./test/qml_quick

Deploy Examples

The deploy examples show you how to brand your application for the different targets with a custom icon and name.

To test them run something like:

  • qtdeploy -docker build windows github.com/therecipe/examples/deploy/windows
  • qtdeploy build darwin github.com/therecipe/examples/deploy/darwin
  • qtdeploy -docker build linux github.com/therecipe/examples/deploy/linux
  • qtdeploy -docker build android github.com/therecipe/examples/deploy/android

(You may need to install docker and pull the right docker images first)

Misc Examples

The misc examples are a collection of various different examples, that got collected throughout the years. Some of them are ports of official Qt examples, others were created during development of the binding to test new technologies and some of them got submitted by contributors. The code quality varies strongly, and most of them will have to be rewritten at some point. You can find the full list here.

To test them run something like:

  • qtdeploy test desktop github.com/therecipe/qt/internal/examples/widgets/line_edits
  • qtdeploy test desktop github.com/therecipe/qt/internal/examples/qml/gallery
  • qtdeploy test desktop github.com/therecipe/qt/internal/examples/quick/photoviewer

3rd Party Examples/Demos/Applications

This is a list of 3rd Party applications that make use of this binding. Some of the are more complex than others, some of them might be (partially)broken and some of them are still in active development.

Feel free to add your own repo (in alphabetical order)

Clone this wiki locally