mirror of
https://github.com/mappu/miqt.git
synced 2024-12-22 00:48:38 +00:00
doc/README: further information
This commit is contained in:
parent
ffcad261f1
commit
1bd1b2b6fe
21
README.md
21
README.md
@ -10,7 +10,7 @@ This is a straightforward binding of the Qt API using CGO. You must have a worki
|
||||
|
||||
## Project status
|
||||
|
||||
These bindings were newly started in August 2024. The bindings are functional. But, they may be immature in some ways. Please try out the bindings and raise issues if you have trouble. A detailed status is in the [TODO file](TODO).
|
||||
These bindings were newly started in August 2024. The bindings are functional for all of QtCore, QtGui, and QtWidgets. But, they may be immature in some ways. Please try out the bindings and raise issues if you have trouble. A detailed status is in the [TODO file](TODO).
|
||||
|
||||
## Supported platforms
|
||||
|
||||
@ -29,7 +29,7 @@ These bindings were newly started in August 2024. The bindings are functional. B
|
||||
|
||||
1. Why are the binaries so big?
|
||||
|
||||
Make sure to compile with `go build "-ldflags -s -w"`. This reduces the `helloworld` example from 42MB to 6MB.
|
||||
Make sure to compile with `go build "-ldflags -s -w"`. This reduces the `helloworld` example from 43MB to 6MB.
|
||||
|
||||
Then, it's possible to reduce the size further with `upx --best` to 2MB or `upx --lzma` to 1.4MB.
|
||||
|
||||
@ -40,3 +40,20 @@ Yes. You must also meet your Qt license obligations: either use Qt dynamically-l
|
||||
3. Why does it take so long to compile?
|
||||
|
||||
The first time the Qt bindings are compiled takes a long time. After this, it's fast. In a Dockerfile, you could cache the build step by running `go install github.com/mappu/miqt`.
|
||||
|
||||
4. How does this compare to other Qt bindings?
|
||||
|
||||
MIQT is a clean-room binding that does not use any code from other Qt bindings.
|
||||
|
||||
- [therecipe/qt](https://github.com/therecipe/qt) is the most mature Qt binding for Go. But because of the LGPL license, it's [extremely difficult to make a proprietary app](https://github.com/therecipe/qt/wiki/FAQ#can-i-make-a-proprietary-app-with-this-binding-). See also their [issue 259](https://github.com/therecipe/qt/issues/259).
|
||||
- [kitech/qt.go](https://github.com/kitech/qt.go) is another mature Qt binding for Go. Unfortunately, it's also using the LGPL license.
|
||||
|
||||
5. How does the MIQT Go API differ from the official Qt C++ API?
|
||||
|
||||
Most functions are implemented 1:1. The Qt documentation should be used.
|
||||
|
||||
The `QString` and `QList<T>` types are projected as plain Go `string` and `[]T`. Therefore, you can't call any of QString/QList's helper methods, you must use some Go equivalent method instead.
|
||||
|
||||
Where Qt returns a C++ object by value (e.g. QSize), the binding may have moved it to the heap, and in Go this may be represented as a pointer type. In such cases, a Go finalizer is added to automatically delete the heap object. This means code using MIQT can look basically similar to the Qt C++ equivalent code.
|
||||
|
||||
Some C++ idioms that were difficult to project were omitted from the binding. But, this can be improved in the future.
|
||||
|
Loading…
Reference in New Issue
Block a user