From 4d29341c7168f33bf4d4e0e4f23d89e3860a1c0c Mon Sep 17 00:00:00 2001 From: mappu Date: Sun, 20 Oct 2024 18:45:50 +1300 Subject: [PATCH] doc/README: upgrading qt5 to qt6 --- README.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/README.md b/README.md index fdf116d0..2ef4d45f 100644 --- a/README.md +++ b/README.md @@ -98,6 +98,27 @@ MIQT has a custom implementation of Qt `uic` and `rcc` tools, to allow using [Qt MIQT uses the `pkg-config` system to configure `CFLAGS`/`LDFLAGS` for Qt and for any other used Qt libraries. +### Q8. How can I upgrade a MIQT app from Qt 5 to Qt 6? + +The import path changes from `github.com/mappu/miqt/qt` to `github.com/mappu/miqt/qt6`, but most basic classes are the same. + +You can replace the import path in two ways: +1. A go.mod directive: Run `go mod edit -replace github.com/mappu/miqt/qt=github.com/mappu/miqt/qt6`. +2. Update all imports: Run `find . -type f -name .go -exec sed -i 's_"github.com/mappu/miqt/qt"_qt "github.com/mappu/miqt/qt6"_' {} \;` + +### Q9. How can I add bindings for another Qt library? + +1. Git clone this repository +2. In `docker/genbindings.Dockerfile`, add your library's headers and pkg-config file. + - If your library does not include a pkg-config file, you must create one +3. Patch `cmd/genbindings/main.go` to add a new `generate` block for your target library +4. Run genbindings to regenerate all bindings + - Add a cflags.go file to the generated binding directory with any extra flags (e.g. `--std=c++17`) that are required but not system-specific + - (Optional) Add an example in the `examples/libraries` directory +5. Commit the generated bindings + - You can then use your forked MIQT version with `replace` inside `go.mod` + - Or, open a Pull Request to add the library to MIQT + ## Building ### Linux (native)