Compare commits
No commits in common. "master" and "v0.10.0" have entirely different histories.
33
.dockerignore
Normal file
@ -0,0 +1,33 @@
|
||||
cmd/genbindings/cachedir
|
||||
|
||||
*.exe
|
||||
|
||||
cmd/handbindings/handbindings
|
||||
cmd/handbindings/bindings_test/direct
|
||||
cmd/handbindings/bindings_test/testapp
|
||||
cmd/genbindings/genbindings
|
||||
cmd/miqt-uic/miqt-uic
|
||||
cmd/miqt-rcc/miqt-rcc
|
||||
|
||||
examples/goroutine6/goroutine6
|
||||
examples/helloworld/helloworld
|
||||
examples/helloworld6/helloworld6
|
||||
examples/mdoutliner/mdoutliner
|
||||
examples/mdoutliner6/mdoutliner6
|
||||
examples/windowsmanifest/windowsmanifest
|
||||
examples/uidesigner/uidesigner
|
||||
examples/trivialwizard6/trivialwizard6
|
||||
examples/subclass/subclass
|
||||
examples/modelview/modelview
|
||||
examples/modelview_color6/modelview_color6
|
||||
examples/libraries/extras-scintillaedit/extras-scintillaedit
|
||||
examples/libraries/qt-multimedia/qt-multimedia
|
||||
examples/libraries/qt-network/qt-network
|
||||
examples/libraries/qt-printsupport/qt-printsupport
|
||||
examples/libraries/qt-script/qt-script
|
||||
examples/libraries/qt-svg/qt-svg
|
||||
examples/libraries/qt-webengine/qt-webengine
|
||||
examples/libraries/qt-webkit/qt-webkit
|
||||
examples/libraries/qt6-multimedia/qt6-multimedia
|
||||
examples/libraries/qt6-webengine/qt6-webengine
|
||||
examples/libraries/restricted-extras-qscintilla/restricted-extras-qscintilla
|
161
.github/workflows/miqt.yml
vendored
@ -14,9 +14,6 @@ jobs:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
# WARNING: This loads the cache but does not commit back any new changes to
|
||||
# it unless the cache is invalidated in GitHub
|
||||
# It will help to do that every time a new Qt library is added
|
||||
- name: Cache clang ASTs
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
@ -36,13 +33,15 @@ jobs:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
# This uses the `genbindings` container in miqt-docker
|
||||
- name: Cache GOCACHE
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.cache/go-build
|
||||
key: linux64-buildall-gocache
|
||||
|
||||
- name: Rebuild all libraries and examples
|
||||
run: make build-all
|
||||
|
||||
- name: Run marshalling test suite
|
||||
run: cmd/miqt-docker/miqt-docker genbindings /bin/bash -c 'cd examples/marshalling && env QT_QPA_PLATFORM=offscreen go test -v'
|
||||
|
||||
miqt_linux64_qt5:
|
||||
runs-on: ubuntu-24.04
|
||||
|
||||
@ -50,10 +49,17 @@ jobs:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Linux64 bindings compile
|
||||
run: |
|
||||
make cmd/miqt-docker/miqt-docker
|
||||
cd qt && ../cmd/miqt-docker/miqt-docker linux64-go1.19-qt5.15-dynamic go build
|
||||
- name: Linux64 docker build
|
||||
run: docker build -t miqt/linux64:qt5 -f docker/linux64-go1.19-qt5.15-dynamic.Dockerfile .
|
||||
|
||||
- name: Cache GOCACHE
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.cache/go-build
|
||||
key: linux64-qt5-gocache
|
||||
|
||||
- name: Linux64 bindings compile and test
|
||||
run: docker run -v ~/.cache/go-build:/root/.cache/go-build -v $PWD:/src -w /src miqt/linux64:qt5 /bin/bash -c 'cd qt && go build && cd ../examples/marshalling && env QT_QPA_PLATFORM=offscreen go test -v'
|
||||
|
||||
miqt_linux64_qt6_4:
|
||||
runs-on: ubuntu-24.04
|
||||
@ -62,10 +68,17 @@ jobs:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Linux64 docker build
|
||||
run: docker build -t miqt/linux64:qt64 -f docker/linux64-go1.19-qt6.4-dynamic.Dockerfile .
|
||||
|
||||
- name: Cache GOCACHE
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.cache/go-build
|
||||
key: linux64-qt64-gocache
|
||||
|
||||
- name: Linux64 bindings compile
|
||||
run: |
|
||||
make cmd/miqt-docker/miqt-docker
|
||||
cd qt6 && ../cmd/miqt-docker/miqt-docker linux64-go1.19-qt6.4-dynamic go build
|
||||
run: docker run -v ~/.cache/go-build:/root/.cache/go-build -v $PWD:/src -w /src miqt/linux64:qt64 /bin/bash -c 'cd qt6 && go build'
|
||||
|
||||
miqt_linux64_qt6_8:
|
||||
runs-on: ubuntu-24.04
|
||||
@ -74,10 +87,17 @@ jobs:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Linux64 docker build
|
||||
run: docker build -t miqt/linux64:qt68 -f docker/linux64-go1.23-qt6.8-dynamic.Dockerfile .
|
||||
|
||||
- name: Cache GOCACHE
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.cache/go-build
|
||||
key: linux64-qt68-gocache
|
||||
|
||||
- name: Linux64 bindings compile
|
||||
run: |
|
||||
make cmd/miqt-docker/miqt-docker
|
||||
cd qt6 && ../cmd/miqt-docker/miqt-docker linux64-go1.23-qt6.8-dynamic go build
|
||||
run: docker run -v ~/.cache/go-build:/root/.cache/go-build -v $PWD:/src -w /src miqt/linux64:qt68 /bin/bash -c 'cd qt6 && go build'
|
||||
|
||||
miqt_win32_qt5:
|
||||
runs-on: ubuntu-24.04
|
||||
@ -86,10 +106,17 @@ jobs:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Cache GOCACHE
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.cache/go-build
|
||||
key: win32-qt5-gocache
|
||||
|
||||
- name: Win32 docker build
|
||||
run: docker build -t miqt/win32:qt5 -f docker/win32-cross-go1.23-qt5.15-static.Dockerfile .
|
||||
|
||||
- name: Win32 bindings compile
|
||||
run: |
|
||||
make cmd/miqt-docker/miqt-docker
|
||||
cmd/miqt-docker/miqt-docker win32-cross-go1.23-qt5.15-static /bin/bash -c 'cd qt && go build && cd ../examples/helloworld && go build'
|
||||
run: docker run -v ~/.cache/go-build:/root/.cache/go-build -v $PWD:/src -w /src miqt/win32:qt5 /bin/bash -c 'cd qt && go build && cd ../examples/helloworld && go build'
|
||||
|
||||
miqt_win64_qt5:
|
||||
runs-on: ubuntu-24.04
|
||||
@ -98,10 +125,17 @@ jobs:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Cache GOCACHE
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.cache/go-build
|
||||
key: win64-qt5-gocache
|
||||
|
||||
- name: Win64 docker build
|
||||
run: docker build -t miqt/win64:qt5 -f docker/win64-cross-go1.23-qt5.15-static.Dockerfile .
|
||||
|
||||
- name: Win64 bindings compile
|
||||
run: |
|
||||
make cmd/miqt-docker/miqt-docker
|
||||
cmd/miqt-docker/miqt-docker win64-cross-go1.23-qt5.15-static /bin/bash -c 'cd qt && go build && cd ../examples/helloworld && go build'
|
||||
run: docker run -v ~/.cache/go-build:/root/.cache/go-build -v $PWD:/src -w /src miqt/win64:qt5 /bin/bash -c 'cd qt && go build && cd ../examples/helloworld && go build'
|
||||
|
||||
miqt_win64_qt68:
|
||||
runs-on: ubuntu-24.04
|
||||
@ -110,10 +144,17 @@ jobs:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Cache GOCACHE
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.cache/go-build
|
||||
key: win64-qt68-gocache
|
||||
|
||||
- name: Win64 docker build
|
||||
run: docker build -t miqt/win64:qt68 -f docker/win64-cross-go1.23-qt6.8-dynamic.Dockerfile .
|
||||
|
||||
- name: Win64 bindings compile
|
||||
run: |
|
||||
make cmd/miqt-docker/miqt-docker
|
||||
cmd/miqt-docker/miqt-docker win64-cross-go1.23-qt6.8-dynamic /bin/bash -c 'cd qt6 && go build && cd ../examples/helloworld6 && go build'
|
||||
run: docker run -v ~/.cache/go-build:/root/.cache/go-build -v $PWD:/src -w /src miqt/win64:qt68 /bin/bash -c 'cd qt6 && go build && cd ../examples/helloworld6 && go build'
|
||||
|
||||
miqt_android_qt5:
|
||||
runs-on: ubuntu-24.04
|
||||
@ -122,23 +163,57 @@ jobs:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Android compile
|
||||
run: |
|
||||
make cmd/miqt-docker/miqt-docker
|
||||
cd examples/helloworld
|
||||
../../cmd/miqt-docker/miqt-docker android-armv8a-go1.23-qt5.15-dynamic -android-build
|
||||
test -f helloworld.apk
|
||||
- name: Android armv8a docker build
|
||||
run: docker build -t miqt/android:qt5 -f docker/android-armv8a-go1.23-qt5.15-dynamic.Dockerfile .
|
||||
|
||||
miqt_android_qt6:
|
||||
runs-on: ubuntu-24.04
|
||||
- name: Cache GOCACHE
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.cache/go-build
|
||||
key: android-qt5-armv8a-gocache
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Android compile app as c-shared my_go_app.so
|
||||
run: docker run -v ~/.cache/go-build:/root/.cache/go-build -v $PWD:/src -w /src/examples/android miqt/android:qt5 go build -buildmode c-shared -ldflags "-s -w -extldflags -Wl,-soname,my_go_app.so" -o android-build/libs/arm64-v8a/my_go_app.so
|
||||
|
||||
- name: Android compile
|
||||
run: |
|
||||
make cmd/miqt-docker/miqt-docker
|
||||
cd examples/helloworld6
|
||||
../../cmd/miqt-docker/miqt-docker android-armv8a-go1.23-qt6.6-dynamic -android-build
|
||||
test -f helloworld6.apk
|
||||
- name: Android generate libRealAppName.so linking stub
|
||||
run: docker run -v ~/.cache/go-build:/root/.cache/go-build -v $PWD:/src -w /src/examples/android miqt/android:qt5 android-stub-gen.sh my_go_app.so AndroidMain android-build/libs/arm64-v8a/libRealAppName_arm64-v8a.so
|
||||
|
||||
- name: Android generate json packaging metadata
|
||||
run: docker run --rm -v $(pwd):/src -w /src/examples/android miqt/android:qt5 android-mktemplate.sh RealAppName deployment-settings.json
|
||||
|
||||
- name: Android build APK package
|
||||
run: docker run --rm -v $(pwd):/src -w /src/examples/android miqt/android:qt5 androiddeployqt --input ./deployment-settings.json --output ./android-build/
|
||||
|
||||
- name: Verify that package exists
|
||||
run: test -f examples/android/android-build/build/outputs/apk/debug/android-build-debug.apk
|
||||
|
||||
# miqt_android_qt6:
|
||||
# runs-on: ubuntu-24.04
|
||||
#
|
||||
# steps:
|
||||
# - name: Checkout
|
||||
# uses: actions/checkout@v4
|
||||
#
|
||||
# - name: Android armv8a docker build
|
||||
# run: docker build -t miqt/android:qt6 -f docker/android-armv8a-go1.23-qt6.6-dynamic.Dockerfile .
|
||||
#
|
||||
# - name: Cache GOCACHE
|
||||
# uses: actions/cache@v4
|
||||
# with:
|
||||
# path: ~/.cache/go-build
|
||||
# key: android-qt6-armv8a-gocache
|
||||
#
|
||||
# - name: Android compile app as c-shared my_go_app.so
|
||||
# run: docker run -v ~/.cache/go-build:/root/.cache/go-build -v $PWD:/src -w /src/examples/android6 miqt/android:qt6 go build -buildmode c-shared -ldflags "-s -w -extldflags -Wl,-soname,my_go_app.so" -o android-build/libs/arm64-v8a/my_go_app.so
|
||||
#
|
||||
# - name: Android generate libRealAppName.so linking stub
|
||||
# run: docker run -v ~/.cache/go-build:/root/.cache/go-build -v $PWD:/src -w /src/examples/android6 miqt/android:qt6 android-stub-gen.sh my_go_app.so AndroidMain android-build/libs/arm64-v8a/libRealAppName_arm64-v8a.so --qt6
|
||||
#
|
||||
# - name: Android generate json packaging metadata
|
||||
# run: docker run --rm -v $(pwd):/src -w /src/examples/android6 miqt/android:qt6 android-mktemplate.sh RealAppName deployment-settings.json
|
||||
#
|
||||
# - name: Android build APK package
|
||||
# run: docker run --rm -v $(pwd):/src -w /src/examples/android6 miqt/android:qt6 androiddeployqt --input ./deployment-settings.json --output ./android-build/
|
||||
#
|
||||
# - name: Verify that package exists
|
||||
# run: test -f examples/android6/android-build/build/outputs/apk/debug/android-build-debug.apk
|
||||
|
13
.gitignore
vendored
@ -1,6 +1,15 @@
|
||||
# cache files for genbindings
|
||||
cmd/genbindings/cachedir/
|
||||
|
||||
# docker files
|
||||
container-build-cache/
|
||||
|
||||
# local genbindings configuration
|
||||
cmd/genbindings/genbindings.local*
|
||||
|
||||
# local pkg-config configuration
|
||||
pkg-config/*.pc
|
||||
|
||||
# binaries
|
||||
*.exe
|
||||
|
||||
@ -8,7 +17,6 @@ cmd/handbindings/handbindings
|
||||
cmd/handbindings/bindings_test/direct
|
||||
cmd/handbindings/bindings_test/testapp
|
||||
cmd/genbindings/genbindings
|
||||
cmd/miqt-docker/miqt-docker
|
||||
cmd/miqt-uic/miqt-uic
|
||||
cmd/miqt-rcc/miqt-rcc
|
||||
|
||||
@ -16,7 +24,6 @@ examples/goroutine6/goroutine6
|
||||
examples/helloqml6/helloqml6
|
||||
examples/helloworld/helloworld
|
||||
examples/helloworld6/helloworld6
|
||||
examples/lcdclock6/lcdclock6
|
||||
examples/mdoutliner/mdoutliner
|
||||
examples/mdoutliner6/mdoutliner6
|
||||
examples/windowsmanifest/windowsmanifest
|
||||
@ -28,7 +35,6 @@ examples/modelview_color6/modelview_color6
|
||||
examples/libraries/extras-scintillaedit/extras-scintillaedit
|
||||
examples/libraries/qt-multimedia/qt-multimedia
|
||||
examples/libraries/qt-network/qt-network
|
||||
examples/libraries/qt-pdf/qt-pdf
|
||||
examples/libraries/qt-printsupport/qt-printsupport
|
||||
examples/libraries/qt-script/qt-script
|
||||
examples/libraries/qt-svg/qt-svg
|
||||
@ -37,7 +43,6 @@ examples/libraries/qt-webkit/qt-webkit
|
||||
examples/libraries/qt6-multimedia/qt6-multimedia
|
||||
examples/libraries/qt6-network/qt6-network
|
||||
examples/libraries/qt6-network-sctp/qt6-network-sctp
|
||||
examples/libraries/qt6-pdf/qt6-pdf
|
||||
examples/libraries/qt6-webengine/qt6-webengine
|
||||
examples/libraries/restricted-extras-charts6/restricted-extras-charts6
|
||||
examples/libraries/restricted-extras-qscintilla/restricted-extras-qscintilla
|
||||
|
37
Makefile
@ -1,23 +1,40 @@
|
||||
BUILDSTAMPS := docker/genbindings.docker-buildstamp
|
||||
DOCKER := docker
|
||||
SHELL := /bin/bash
|
||||
GO := go
|
||||
|
||||
# DOCKEREXEC runs the target command in the `genbindings` docker container.
|
||||
# It mounts in the current GOCACHE and GOMODCACHE.
|
||||
DOCKEREXEC = mkdir -p "$$(go env GOCACHE)" && \
|
||||
mkdir -p "$$(go env GOMODCACHE)" && \
|
||||
$(DOCKER) run \
|
||||
--user "$$(id -u):$$(id -g)" \
|
||||
-v "$$(go env GOCACHE):/.cache/go-build" \
|
||||
-v "$$(go env GOMODCACHE):/go/pkg/mod" \
|
||||
-v "$$PWD:/src" \
|
||||
-w /src \
|
||||
miqt/genbindings:latest \
|
||||
/bin/bash -c
|
||||
|
||||
.PHONY: all
|
||||
all: genbindings
|
||||
|
||||
cmd/miqt-docker/miqt-docker: go.mod cmd/miqt-docker/*.go docker/*.Dockerfile
|
||||
$(GO) build -o cmd/miqt-docker/miqt-docker ./cmd/miqt-docker
|
||||
docker/genbindings.docker-buildstamp: docker/genbindings.Dockerfile
|
||||
$(DOCKER) build -t miqt/genbindings:latest -f docker/genbindings.Dockerfile .
|
||||
touch $@
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
$(DOCKER) image rm -f miqt/genbindings:latest
|
||||
rm -f $(BUILDSTAMPS)
|
||||
|
||||
.PHONY: clean-cache
|
||||
clean-cache:
|
||||
rm -f cmd/genbindings/cachedir/*.json
|
||||
|
||||
cmd/genbindings/genbindings: go.mod cmd/genbindings/*.go
|
||||
$(GO) build -o cmd/genbindings/genbindings ./cmd/genbindings
|
||||
|
||||
.PHONY: genbindings
|
||||
genbindings: cmd/miqt-docker/miqt-docker cmd/genbindings/genbindings
|
||||
cd cmd/genbindings && ../miqt-docker/miqt-docker genbindings ./genbindings
|
||||
genbindings: $(BUILDSTAMPS)
|
||||
$(DOCKEREXEC) 'cd cmd/genbindings && go build && ./genbindings'
|
||||
|
||||
.PHONY: build-all
|
||||
build-all: cmd/miqt-docker/miqt-docker
|
||||
./cmd/miqt-docker/miqt-docker genbindings go build ./...
|
||||
build-all: $(BUILDSTAMPS)
|
||||
$(DOCKEREXEC) 'go build ./...'
|
||||
|
95
README.md
@ -53,8 +53,6 @@ Make sure to compile with `go build -ldflags "-s -w"`. This reduces the `hellowo
|
||||
|
||||
Then, it's possible to reduce the size further with `upx --best` to 2MB or `upx --lzma` to 1.4MB.
|
||||
|
||||
You can also try `miqt-docker native -minify-build` to use aggressive `CFLAGS`.
|
||||
|
||||
### Q2. Can I release a proprietary, commercial app with this binding?
|
||||
|
||||
Yes. You must also meet your Qt license obligations: either use Qt dynamically-linked dll/so/dylib files under the LGPL, or, purchase a Qt commercial license for static linking.
|
||||
@ -65,7 +63,7 @@ The first time MIQT is used, your `go build` would take [about 10 minutes](https
|
||||
|
||||
If you are compiling your app within a Dockerfile, you could cache the build step by running `go install github.com/mappu/miqt/qt`.
|
||||
|
||||
If you are compiling your app with a one-shot `docker run` command, the compile speed can be improved if you also bind-mount the Docker container's `GOCACHE` directory: `-v $(pwd)/container-build-cache:/root/.cache/go-build`. The `miqt-docker` helper app does this automatically.
|
||||
If you are compiling your app with a one-shot `docker run` command, the compile speed can be improved if you also bind-mount the Docker container's `GOCACHE` directory: `-v $(pwd)/container-build-cache:/root/.cache/go-build`
|
||||
|
||||
See also [issue #8](https://github.com/mappu/miqt/issues/8).
|
||||
|
||||
@ -86,29 +84,27 @@ MIQT is a clean-room binding that does not use any code from other Qt bindings.
|
||||
|
||||
Most functions are implemented 1:1. [The Qt documentation](https://doc.qt.io/qt-5/classes.html) should be used.
|
||||
|
||||
Container types:
|
||||
- The `QByteArray`, `QString`, `QList<T>`, `QVector<T>`, `QMap<K,V>`, `QHash<K,V>` types are projected as plain Go `[]byte`, `string`, `[]T`, and `map[K]V`. Therefore, you can't call any of the Qt type's methods, you must use some Go equivalent method instead.
|
||||
The `QByteArray`, `QString`, `QList<T>`, `QVector<T>`, `QMap<K,V>`, `QHash<K,V>` types are projected as plain Go `[]byte`, `string`, `[]T`, and `map[K]V`. Therefore, you can't call any of the Qt type's methods, you must use some Go equivalent method instead.
|
||||
|
||||
- Go strings are internally converted to QString using `QString::fromUtf8`. Therefore, the Go string must be UTF-8 to avoid [mojibake](https://en.wikipedia.org/wiki/Mojibake). If the Go string contains binary data, the conversion would corrupt such bytes into U+FFFD (<28>). On return to Go space, this becomes `\xEF\xBF\xBD`.
|
||||
- The iteration order of a Qt `QMap`/`QHash` will differ from the Go map iteration order. `QMap` is iterated by key order, but Go maps and `QHash` iterate in an undefined internal order.
|
||||
|
||||
Memory management:
|
||||
- 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.
|
||||
- The iteration order of a Qt QMap/QHash will differ from the Go map iteration order. QMap is iterated by key order, but Go maps and QHash iterate in an undefined internal order.
|
||||
|
||||
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.
|
||||
|
||||
The `connect(sourceObject, sourceSignal, targetObject, targetSlot)` is projected as `targetObject.onSourceSignal(func()...)`.
|
||||
|
||||
Events and signals:
|
||||
- The `connect(sourceObject, sourceSignal, targetObject, targetSlot)` is projected as `targetObject.onSourceSignal(func()...)`.
|
||||
- You can also override virtual methods like PaintEvent in the same way. Your callback `func()` receives `super()` as a first argument that can be used to call the base class implementation.
|
||||
|
||||
Class pointers:
|
||||
- Qt class inherited types are projected as a Go embedded struct. For example, to pass a `var myLabel *qt.QLabel` to a function taking only the `*qt.QWidget` base class, write `myLabel.QWidget`.
|
||||
Qt class inherited types are projected as a Go embedded struct. For example, to pass a `var myLabel *qt.QLabel` to a function taking only the `*qt.QWidget` base class, write `myLabel.QWidget`.
|
||||
|
||||
- When a Qt subclass adds a method overload (e.g. `QMenu::addAction(QString)` vs `QWidget::addAction(QAction*)`), the base class version is shadowed and can only be called via `myQMenu.QWidget.AddAction(QAction*)`.
|
||||
|
||||
- A MIQT pointer points to a Go struct, not to the raw C++ Qt widget class. Therefore `QTabWidget.CurrentWidget() == MyTab` will never compare equal because `CurrentWidget()` created a new Go struct wrapping the same C++ pointer. You can compare `QTabWidget.CurrentIndex()`, or, you can use: `QTabWidget.CurrentWidget().UnsafePointer() == MyTab.UnsafePointer()`.
|
||||
|
||||
Multithreading:
|
||||
- The Go runtime migrates goroutines between OS threads, but Qt expects fixed OS threads to be used for each QObject. When you first call `qt.NewQApplication` in MIQT, that will be considered the [Qt main thread](https://doc.qt.io/qt-6/thread-basics.html#gui-thread-and-worker-thread) and will automatically signal the Go runtime to bind to a fixed OS thread using `runtime.LockOSThread()`.
|
||||
- When accessing Qt objects from inside another goroutine, it's safest to use `(qt6/mainthread).Wait()` or `Start()` to access the Qt objects from Qt's main thread.
|
||||
The Go runtime migrates goroutines between OS threads, but Qt expects fixed OS threads to be used for each QObject. When you first call `qt.NewQApplication` in MIQT, that will be considered the [Qt main thread](https://doc.qt.io/qt-6/thread-basics.html#gui-thread-and-worker-thread) and will automatically signal the Go runtime to bind to a fixed OS thread using `runtime.LockOSThread()`.
|
||||
|
||||
Android:
|
||||
- A `QFileDialog` may return a filepath of the form `content://...`. Such paths can be opened with `qt.QFile` but not with Go `os.Open()`; you can pass the handle to Go using `os.NewFile(QFile.Handle(), "name")`.
|
||||
- When accessing Qt objects from inside another goroutine, it's safest to use `(qt6/mainthread).Wait()` to access the Qt objects from Qt's main thread.
|
||||
|
||||
Some C++ idioms that were difficult to project were omitted from the binding. But, this can be improved in the future.
|
||||
|
||||
@ -122,22 +118,20 @@ MIQT has a custom implementation of Qt `uic` and `rcc` tools, to allow using [Qt
|
||||
|
||||
MIQT uses `pkg-config` to find all used Qt libraries. Every Qt library should have a definition file in `.pc` format, which provides CGO with the necessary `CXXFLAGS`/`LDFLAGS`. Your Qt development environment already included the necessary `.pc` definition files.
|
||||
|
||||
You can use the `PKG_CONFIG_PATH` environment variable to override where CGO looks for `.pc` files. [Read more »](doc/pkg-config.md)
|
||||
You can use the `PKG_CONFIG_PATH` environment variable to override where CGO looks for `.pc` files. [Read more »](pkg-config/README.md)
|
||||
|
||||
### 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 update all imports by running `find . -type f -name .go -exec sed -i 's_"github.com/mappu/miqt/qt"_qt "github.com/mappu/miqt/qt6"_' {} \;`
|
||||
You can replace the import path in two ways:
|
||||
1. Add a go.mod directive: Run `go mod edit -replace github.com/mappu/miqt/qt=github.com/mappu/miqt/qt6`
|
||||
2. Or, 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?
|
||||
|
||||
Fork this repository and add your library to the `genbindings/config-libraries` file. [Read more »](cmd/genbindings/README.md)
|
||||
|
||||
### Q10. Is there an easy build tool?
|
||||
|
||||
You can use the ordinary `go get` and `go build` commands. To help with cross-compilation, you can use the optional `miqt-docker` tool. [Read more »](cmd/miqt-docker/README.md)
|
||||
|
||||
## Building
|
||||
|
||||
### Linux (native)
|
||||
@ -155,7 +149,7 @@ For dynamic linking, with the system Qt (Qt 5):
|
||||
apt install qtbase5-dev build-essential golang-go
|
||||
|
||||
# Debian / Ubuntu (Full)
|
||||
apt install qtbase5-dev libqscintilla2-qt5-dev libqt5svg5-dev libqt5webchannel5-dev libqt5webkit5-dev qtbase5-private-dev qtmultimedia5-dev qtpdf5-dev qtwebengine5-dev qtwebengine5-private-dev build-essential golang-go
|
||||
apt install qtbase5-dev libqscintilla2-qt5-dev libqt5svg5-dev libqt5webchannel5-dev libqt5webkit5-dev qtbase5-private-dev qtmultimedia5-dev qtwebengine5-dev qtwebengine5-private-dev build-essential golang-go
|
||||
```
|
||||
|
||||
For dynamic linking, with the system Qt (Qt 6):
|
||||
@ -165,10 +159,10 @@ For dynamic linking, with the system Qt (Qt 6):
|
||||
apt install qt6-base-dev build-essential golang-go
|
||||
|
||||
# Debian / Ubuntu (Full)
|
||||
apt install qt6-base-dev libqscintilla2-qt6-dev qt6-base-private-dev qt6-charts-dev qt6-multimedia-dev qt6-pdf-dev qt6-svg-dev qt6-webchannel-dev qt6-webengine-dev qt6-declarative-dev qml6-module-qtquick-{controls,shapes,layouts,templates,window} build-essential golang-go
|
||||
apt install qt6-base-dev libqscintilla2-qt6-dev qt6-base-private-dev qt6-charts-dev qt6-multimedia-dev qt6-svg-dev qt6-webchannel-dev qt6-webengine-dev qt6-declarative-dev qml6-module-qtquick-{controls,shapes,layouts,templates,window} build-essential golang-go
|
||||
|
||||
# Fedora
|
||||
dnf install qt6-qtbase-devel qscintilla-qt6-devel qt6-qtcharts-devel qt6-qtmultimedia-devel qt6-qtpdf-devel qt6-qtsvg-devel qt6-qtwebchannel-devel qt6-qtwebengine-devel qt6-qtdeclarative-devel golang
|
||||
dnf install qt6-qtbase-devel qscintilla-qt6-devel qt6-qtcharts-devel qt6-qtmultimedia-devel qt6-qtsvg-devel qt6-qtwebchannel-devel qt6-qtwebengine-devel qt6-qtdeclarative-devel golang
|
||||
|
||||
# Manjaro
|
||||
pamac install qt6-base qscintilla-qt6 qt6-charts qt6-multimedia qt6-svg qt6-webchannel qt6-webengine qt6-declarative go
|
||||
@ -186,13 +180,6 @@ pacman -S pkg-config gcc go qt6-base qscintilla-qt6 qt6-charts qt6-multimedia qt
|
||||
go build -ldflags '-s -w'
|
||||
```
|
||||
|
||||
### Windows (Docker with miqt-docker)
|
||||
|
||||
```bash
|
||||
go install github.com/mappu/miqt/cmd/miqt-docker
|
||||
miqt-docker win64-qt6-static -windows-build # or -qt5- or -static
|
||||
```
|
||||
|
||||
### Windows (native)
|
||||
|
||||
*Tested with Fsu0413 Qt 5.15 / Clang 18.1 native compilation*
|
||||
@ -249,14 +236,14 @@ Static linking is also available by installing the `mingw-w64-ucrt-x86_64-qt5-st
|
||||
For static linking:
|
||||
|
||||
1. Build the necessary docker container for cross-compilation:
|
||||
- In the `docker/` directory: docker build -t miqt/win64-cross:latest -f win64-cross-go1.23-qt5.15-static.Dockerfile .`
|
||||
- `docker build -t miqt/win64-cross:latest -f docker/win64-cross-go1.23-qt5.15-static.Dockerfile .`
|
||||
2. Build your application:
|
||||
- `docker run --rm -v $(pwd):/src -w /src miqt/win64-cross:latest go build --tags=windowsqtstatic -ldflags '-s -w -H windowsgui'`
|
||||
|
||||
For dynamic linking:
|
||||
|
||||
1. Build the necessary docker container for cross-compilation:
|
||||
- In the `docker/` directory: `docker build -t miqt/win64-dynamic:latest -f win64-cross-go1.23-qt5.15-dynamic.Dockerfile .`
|
||||
- `docker build -t miqt/win64-dynamic:latest -f docker/win64-cross-go1.23-qt5.15-dynamic.Dockerfile .`
|
||||
2. Build your application:
|
||||
- `docker run --rm -v $(pwd):/src -w /src miqt/win64-dynamic:latest go build -ldflags '-s -w -H windowsgui'`
|
||||
3. Copy necessary Qt LGPL libraries and plugin files.
|
||||
@ -273,7 +260,7 @@ To add an icon and other properties to the .exe, you can use [the go-winres tool
|
||||
pkg install git
|
||||
pkg install devel/pkgconf
|
||||
pkg install go
|
||||
pkg install qt6-base qt6-charts qt6-multimedia qt6-pdf qt6-svg qt6-webchannel qt6-webengine qt6-declarative qscintilla2-qt6
|
||||
pkg install qt6-base qt6-charts qt6-multimedia qt6-svg qt6-webchannel qt6-webengine qt6-declarative qscintilla2-qt6
|
||||
|
||||
go build -ldflags '-s -w'
|
||||
```
|
||||
@ -303,26 +290,44 @@ Installing `qt@5` from Homebrew may be very slow if Homebrew chooses to do a fro
|
||||
For dynamic linking:
|
||||
|
||||
1. Build the necessary docker container for cross-compilation:
|
||||
- In the `docker/` directory: `docker build -t miqt/osxcross:latest -f macos-cross-x86_64-sdk14.5-go1.19-qt5.15-dynamic.Dockerfile .`
|
||||
- `docker build -t miqt/osxcross:latest -f docker/macos-cross-x86_64-sdk14.5-go1.19-qt5.15-dynamic.Dockerfile .`
|
||||
2. Build your application:
|
||||
- `docker run --rm -v $(pwd):/src -w /src miqt/osxcross:latest go build -ldflags '-s -w'`
|
||||
3. Copy necessary Qt LGPL libraries and plugin files.
|
||||
|
||||
See FAQ Q3 for advice about docker performance.
|
||||
|
||||
### Android (Docker with miqt-docker)
|
||||
### Android (Docker)
|
||||
|
||||
*Tested with Raymii Qt 5.15 / Android SDK 31 / Android NDK 22 and with Qt.io Qt 6.6 / Android SDK 33 / Android NDK 25*
|
||||
*Tested with Raymii Qt 5.15 / Android SDK 31 / Android NDK 22*
|
||||
|
||||
*Tested with Qt.io Qt 6.6 / Android SDK 33 / Android NDK 25*
|
||||
|
||||
MIQT supports compiling for Android. Some extra steps are required to bridge the Java, C++, Go worlds.
|
||||
|
||||

|
||||
|
||||
```bash
|
||||
go install github.com/mappu/miqt/cmd/miqt-docker
|
||||
miqt-docker android-qt5 -android-build # or android-qt6
|
||||
```
|
||||
1. Modify your main function to [support `c-shared` build mode](https://pkg.go.dev/cmd/go#hdr-Build_modes).
|
||||
- Package `main` must have an empty `main` function.
|
||||
- Rename your `main` function to `AndroidMain` and add a comment `//export AndroidMain`.
|
||||
- Ensure to `import "C"`.
|
||||
- Check `examples/android` to see how to support both Android and desktop platforms.
|
||||
2. Build the necessary docker container for cross-compilation:
|
||||
- (Qt 5) `docker build -t miqt/android:latest -f docker/android-armv8a-go1.23-qt5.15-dynamic.Dockerfile .`
|
||||
- (Qt 6) `docker build -t miqt/android:latest -f docker/android-armv8a-go1.23-qt6.6-dynamic.Dockerfile .`
|
||||
3. Build your application as `.so` format:
|
||||
- `docker run --rm -v $(pwd):/src -w /src miqt/android:latest go build -buildmode c-shared -ldflags "-s -w -extldflags -Wl,-soname,my_go_app.so" -o android-build/libs/arm64-v8a/my_go_app.so`
|
||||
4. Build the Qt linking stub:
|
||||
- (Qt 5) `docker run --rm -v $(pwd):/src -w /src miqt/android:latest android-stub-gen.sh my_go_app.so AndroidMain android-build/libs/arm64-v8a/libRealAppName_arm64-v8a.so`
|
||||
- (Qt 6) Add `--qt6` final argument
|
||||
- The linking stub is needed because Qt for Android will itself only call a function named `main`, but `c-shared` can't create one.
|
||||
5. Build the [androiddeployqt](https://doc.qt.io/qt-6/android-deploy-qt-tool.html) configuration file:
|
||||
- `docker run --rm -v $(pwd):/src -w /src miqt/android:latest android-mktemplate.sh RealAppName deployment-settings.json`
|
||||
6. Build the android package:
|
||||
- `docker run --rm -v $(pwd):/src -w /src miqt/android:latest androiddeployqt --input ./deployment-settings.json --output ./android-build/`
|
||||
- By default, the resulting `.apk` is generated at `android-build/build/outputs/apk/debug/android-build-debug.apk`.
|
||||
- You can build in release mode by adding `--release`
|
||||
|
||||
This produces a `.apk` in the current directory. A default manifest, icon, and keystore will be created. If you customize the `AndroidManifest.xml` file or images, they will be used for the next build.
|
||||
See FAQ Q3 for advice about docker performance.
|
||||
|
||||
Advanced users may customize the build process or manually invoke `androiddeployqt`. You can invoke it inside the container environment via `miqt-docker android-qt5 androiddeployqt ...`. For more information, see the `android-build.sh` file that `miqt-docker` is running.
|
||||
For repeated builds, only steps 3 and 6 are needed. If you customize the `AndroidManifest.xml` file or images, they will be used for the next `androiddeployqt` run.
|
||||
|
66
cmd/android-mktemplate/android-mktemplate.sh
Executable file
@ -0,0 +1,66 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# android-mktemplate generates a template json file suitable for use with the
|
||||
# androiddeployqt tool.
|
||||
|
||||
set -eu
|
||||
|
||||
# QT_PATH is already pre-set in our docker container environment. Includes trailing slash.
|
||||
QT_PATH=${QT_PATH:-/usr/local/Qt-5.15.13/}
|
||||
QT_ANDROID=${QT_ANDROID:-$QT_PATH}
|
||||
|
||||
ndk_version() {
|
||||
ls /opt/android-sdk/ndk/ | tail -n1
|
||||
}
|
||||
|
||||
target_sdk_version() {
|
||||
ls /opt/android-sdk/platforms | tail -n1 | sed -re 's/android-//'
|
||||
}
|
||||
|
||||
build_tools_version() {
|
||||
ls /opt/android-sdk/build-tools | tail -n1
|
||||
}
|
||||
|
||||
extra_libs() {
|
||||
if [[ -d /opt/android_openssl ]] ; then
|
||||
# Our miqt Qt5 container includes these extra .so libraries
|
||||
# However, the aqtinstall-based Qt 6 container does not use them
|
||||
echo "/opt/android_openssl/ssl_1.1/arm64-v8a/libssl_1_1.so,/opt/android_openssl/ssl_1.1/arm64-v8a/libcrypto_1_1.so"
|
||||
fi
|
||||
}
|
||||
|
||||
main() {
|
||||
|
||||
if [[ $# -ne 2 ]] ; then
|
||||
echo "Usage: android-mktemplate.sh appname output.json" >&2
|
||||
exit 1
|
||||
fi
|
||||
local ARG_APPNAME="$1"
|
||||
local ARG_DESTFILE="$2"
|
||||
|
||||
# Available fields are documented in the template file at
|
||||
# @ref /usr/local/Qt-5.15.13/mkspecs/features/android/android_deployment_settings.prf
|
||||
cat > "${ARG_DESTFILE}" <<EOF
|
||||
{
|
||||
"_description": "Generated by miqt/android-mktemplate",
|
||||
"application-binary": "${ARG_APPNAME}",
|
||||
"architectures": {
|
||||
"arm64-v8a" : "aarch64-linux-android"
|
||||
},
|
||||
"android-extra-libs": "$(extra_libs)",
|
||||
"android-min-sdk-version": "23",
|
||||
"android-target-sdk-version": "$(target_sdk_version)",
|
||||
"ndk": "/opt/android-sdk/ndk/$(ndk_version)",
|
||||
"ndk-host": "linux-x86_64",
|
||||
"qt": "${QT_ANDROID}",
|
||||
"sdk": "/opt/android-sdk",
|
||||
"sdkBuildToolsRevision": "$(build_tools_version)",
|
||||
"stdcpp-path": "/opt/android-sdk/ndk/$(ndk_version)/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/",
|
||||
"tool-prefix": "llvm",
|
||||
"toolchain-prefix": "llvm",
|
||||
"useLLVM": true
|
||||
}
|
||||
EOF
|
||||
}
|
||||
|
||||
main "$@"
|
106
cmd/android-stub-gen/android-stub-gen.sh
Executable file
@ -0,0 +1,106 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# android-stub-gen generates a .so that runs an exported function from another
|
||||
# so file. This is because Qt for Android always tries to run `main`, but Go's
|
||||
# c-shared build mode cannot export a function named `main`.
|
||||
|
||||
set -eu
|
||||
|
||||
main() {
|
||||
|
||||
if [[ $# -ne 3 && $# -ne 4 ]] ; then
|
||||
echo "Usage: android-gen-stub.sh src.so function-name dest.so [--qt6|--qt5]" >&2
|
||||
exit 1
|
||||
fi
|
||||
local ARG_SOURCE_SOFILE="$1"
|
||||
local ARG_FUNCTIONNAME="$2"
|
||||
local ARG_DEST_SOFILE="$3"
|
||||
local ARG_QTVERSION="${4:---qt5}"
|
||||
|
||||
local tmpdir=$(mktemp -d)
|
||||
trap "rm -r ${tmpdir}" EXIT
|
||||
|
||||
echo "- Using temporary directory: ${tmpdir}"
|
||||
|
||||
echo "Generating stub..."
|
||||
|
||||
cat > $tmpdir/miqtstub.cpp <<EOF
|
||||
#include <android/log.h>
|
||||
#include <dlfcn.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
typedef void goMainFunc_t();
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
__android_log_print(ANDROID_LOG_VERBOSE, "miqt_stub", "Starting up");
|
||||
|
||||
void* handle = dlopen("$(basename "$ARG_SOURCE_SOFILE")", RTLD_LAZY);
|
||||
if (handle == NULL) {
|
||||
__android_log_print(ANDROID_LOG_VERBOSE, "miqt_stub", "miqt_stub: null handle opening so: %s", dlerror());
|
||||
exit(1);
|
||||
}
|
||||
|
||||
void* goMain = dlsym(handle, "${ARG_FUNCTIONNAME}");
|
||||
if (goMain == NULL) {
|
||||
__android_log_print(ANDROID_LOG_VERBOSE, "miqt_stub", "miqt_stub: null handle looking for function: %s", dlerror());
|
||||
exit(1);
|
||||
}
|
||||
|
||||
__android_log_print(ANDROID_LOG_VERBOSE, "miqt_stub", "miqt_stub: Found target, calling");
|
||||
|
||||
// Cast to function pointer and call
|
||||
goMainFunc_t* f = (goMainFunc_t*)goMain;
|
||||
f();
|
||||
|
||||
__android_log_print(ANDROID_LOG_VERBOSE, "miqt_stub", "miqt_stub: Target function returned");
|
||||
return 0;
|
||||
}
|
||||
|
||||
EOF
|
||||
|
||||
# Compile
|
||||
# Link with Qt libraries so that androiddeployqt detects us as being the
|
||||
# main shared library
|
||||
|
||||
if [[ $ARG_QTVERSION == '--qt5' ]] ; then
|
||||
|
||||
# QT_PATH is already pre-set in our docker container environment. Includes trailing slash.
|
||||
QT_PATH=${QT_PATH:-/usr/local/Qt-5.15.13/}
|
||||
echo "- Found Qt path: ${QT_PATH}"
|
||||
|
||||
$CXX -shared \
|
||||
-ldl \
|
||||
-llog \
|
||||
-L${QT_PATH}plugins/platforms -lplugins_platforms_qtforandroid_arm64-v8a \
|
||||
$(pkg-config --libs Qt5Widgets) \
|
||||
$(pkg-config --libs Qt5AndroidExtras) \
|
||||
$tmpdir/miqtstub.cpp \
|
||||
"-Wl,-soname,$(basename "$ARG_DEST_SOFILE")" \
|
||||
-o "$ARG_DEST_SOFILE"
|
||||
|
||||
elif [[ $ARG_QTVERSION == '--qt6' ]] ; then
|
||||
|
||||
# QT_ANDROID is already pre-set in our docker container environment. Does NOT include trailing slash
|
||||
QT_ANDROID=${QT_ANDROID:-/opt/Qt/6.6.1/android_arm64_v8a}
|
||||
echo "- Found Qt path: ${QT_ANDROID}"
|
||||
|
||||
# There is no AndroidExtras in Qt 6
|
||||
|
||||
$CXX -shared \
|
||||
-ldl \
|
||||
-llog \
|
||||
-L${QT_ANDROID}/plugins/platforms -lplugins_platforms_qtforandroid_arm64-v8a \
|
||||
$(pkg-config --libs Qt6Widgets) \
|
||||
$tmpdir/miqtstub.cpp \
|
||||
"-Wl,-soname,$(basename "$ARG_DEST_SOFILE")" \
|
||||
-o "$ARG_DEST_SOFILE"
|
||||
|
||||
else
|
||||
echo "Unknown Qt version argument "${ARG_QTVERSION}" (expected --qt5 or --qt6)" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Done."
|
||||
}
|
||||
|
||||
main "$@"
|
@ -38,7 +38,7 @@ You should check the following configuration:
|
||||
|
||||
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.](../../doc/pkg-config.md)
|
||||
- If your library does not include a pkg-config file, [you must create one.](pkg-config/README.md)
|
||||
3. Patch `cmd/genbindings/config-libraries.go` to add a new `generate` block for your target library
|
||||
4. Run `genbindings` to regenerate all bindings
|
||||
- The first run must populate clang ASTs into a cache directory and may be slower, but it is fast afterwards
|
||||
|
@ -461,15 +461,6 @@ nextMethod:
|
||||
return CppClass{}, err
|
||||
}
|
||||
|
||||
// Check for private signal
|
||||
if i, ok := isPrivateSignal(&mm); ok {
|
||||
// Remove only the QPrivateSignal parameter, keep other parameters
|
||||
mm.Parameters = append(mm.Parameters[:i], mm.Parameters[i+1:]...)
|
||||
mm.IsSignal = true
|
||||
ret.PrivateSignals = append(ret.PrivateSignals, mm)
|
||||
continue nextMethod
|
||||
}
|
||||
|
||||
mm.IsSignal = isSignal && !mm.IsStatic && AllowSignal(mm)
|
||||
mm.IsProtected = (visibility == VsProtected)
|
||||
|
||||
@ -524,17 +515,6 @@ func isExplicitlyDeleted(node map[string]interface{}) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// isPrivateSignal checks if a method is a private signal by looking for a
|
||||
// QPrivateSignal parameter
|
||||
func isPrivateSignal(method *CppMethod) (int, bool) {
|
||||
for i, param := range method.Parameters {
|
||||
if strings.HasSuffix(param.ParameterType, "::QPrivateSignal") {
|
||||
return i, true
|
||||
}
|
||||
}
|
||||
return -1, false
|
||||
}
|
||||
|
||||
// processEnum parses a Clang enum into our CppEnum intermediate format.
|
||||
func processEnum(node map[string]interface{}, addNamePrefix string) (CppEnum, error) {
|
||||
var ret CppEnum
|
||||
|
@ -200,22 +200,6 @@ func ProcessLibraries(clangBin, outDir, extraLibsDir string) {
|
||||
ClangMatchSameHeaderDefinitionOnly,
|
||||
)
|
||||
|
||||
// Qt 5 PDF
|
||||
// Depends on QtCore/Gui/Widgets
|
||||
generate(
|
||||
"qt/pdf",
|
||||
[]string{
|
||||
"/usr/include/x86_64-linux-gnu/qt5/QtPdf",
|
||||
"/usr/include/x86_64-linux-gnu/qt5/QtPdfWidgets",
|
||||
},
|
||||
AllowAllHeaders,
|
||||
clangBin,
|
||||
pkgConfigCflags("Qt5PdfWidgets"),
|
||||
outDir,
|
||||
ClangMatchSameHeaderDefinitionOnly,
|
||||
)
|
||||
|
||||
|
||||
// Depends on QtCore/Gui/Widgets, QPrintSupport
|
||||
generate(
|
||||
"qt-restricted-extras/qscintilla",
|
||||
@ -450,23 +434,6 @@ func ProcessLibraries(clangBin, outDir, extraLibsDir string) {
|
||||
ClangMatchSameHeaderDefinitionOnly,
|
||||
)
|
||||
|
||||
|
||||
// Qt 6 PDF
|
||||
generate(
|
||||
"qt6/pdf",
|
||||
[]string{
|
||||
"/usr/include/x86_64-linux-gnu/qt6/QtPdf",
|
||||
"/usr/include/x86_64-linux-gnu/qt6/QtPdfWidgets",
|
||||
},
|
||||
AllowAllHeaders,
|
||||
clangBin,
|
||||
"--std=c++17 "+pkgConfigCflags("Qt6PdfWidgets"),
|
||||
outDir,
|
||||
ClangMatchSameHeaderDefinitionOnly,
|
||||
)
|
||||
|
||||
|
||||
|
||||
// Qt 6 Charts
|
||||
// Depends on QtCore/Gui/Widgets
|
||||
generate(
|
||||
|
@ -877,33 +877,19 @@ extern "C" {
|
||||
}
|
||||
}
|
||||
|
||||
if len(c.Methods) > 0 {
|
||||
ret.WriteString("\n")
|
||||
}
|
||||
|
||||
for _, m := range virtualMethods {
|
||||
ret.WriteString(fmt.Sprintf("bool %s(%s* self, intptr_t slot);\n", cabiOverrideVirtualName(c, m), "void" /*methodPrefixName*/))
|
||||
|
||||
ret.WriteString(fmt.Sprintf("%s %s(%s);\n", m.ReturnType.RenderTypeCabi(), cabiVirtualBaseName(c, m), emitParametersCabi(m, ifv(m.IsConst, "const ", "")+"void" /*className*/ +"*")))
|
||||
}
|
||||
if len(virtualMethods) > 0 {
|
||||
ret.WriteString("\n")
|
||||
|
||||
if len(virtualMethods) > 0 {
|
||||
for _, m := range protectedMethods {
|
||||
ret.WriteString(fmt.Sprintf("%s %s(bool* _dynamic_cast_ok, %s);\n", m.ReturnType.RenderTypeCabi(), cabiProtectedBaseName(c, m), emitParametersCabi(m, ifv(m.IsConst, "const ", "")+"void" /*className*/ +"*")))
|
||||
}
|
||||
if len(protectedMethods) > 0 {
|
||||
ret.WriteString("\n")
|
||||
}
|
||||
}
|
||||
|
||||
for _, m := range c.PrivateSignals {
|
||||
ret.WriteString(fmt.Sprintf("%s %s(%s* self, intptr_t slot);\n", m.ReturnType.RenderTypeCabi(), cabiConnectName(c, m), className))
|
||||
}
|
||||
if len(c.PrivateSignals) > 0 {
|
||||
ret.WriteString("\n")
|
||||
}
|
||||
|
||||
// delete
|
||||
if c.CanDelete {
|
||||
ret.WriteString(fmt.Sprintf("void %s(%s* self);\n", cabiDeleteName(c), className))
|
||||
}
|
||||
@ -921,6 +907,11 @@ extern "C" {
|
||||
return ret.String(), nil
|
||||
}
|
||||
|
||||
func fullyQualifiedConstructor(className string) string {
|
||||
parts := strings.Split(className, `::`)
|
||||
return className + "::" + parts[len(parts)-1]
|
||||
}
|
||||
|
||||
func emitParametersCabiConstructor(c *CppClass, ctor *CppMethod) string {
|
||||
|
||||
slist := make([]string, 0, len(ctor.Parameters))
|
||||
@ -979,9 +970,7 @@ extern "C" {
|
||||
`)
|
||||
|
||||
for _, c := range src.Classes {
|
||||
methodsAndPrivateSignals := append(c.Methods, c.PrivateSignals...)
|
||||
|
||||
for _, m := range methodsAndPrivateSignals {
|
||||
for _, m := range c.Methods {
|
||||
if m.IsSignal {
|
||||
callback := "void " + cabiCallbackName(c, m) + "(intptr_t"
|
||||
|
||||
@ -1012,34 +1001,37 @@ extern "C" {
|
||||
`)
|
||||
|
||||
for _, c := range src.Classes {
|
||||
className := cabiClassName(c.ClassName)
|
||||
|
||||
methodPrefixName := cabiClassName(c.ClassName)
|
||||
cppClassName := c.ClassName
|
||||
virtualMethods := c.VirtualMethods()
|
||||
protectedMethods := c.ProtectedMethods()
|
||||
|
||||
if len(virtualMethods) > 0 {
|
||||
subclassName := cppSubclassName(c)
|
||||
|
||||
ret.WriteString("class " + subclassName + " final : public " + c.ClassName + " {\n" +
|
||||
overriddenClassName := cppSubclassName(c)
|
||||
|
||||
ret.WriteString("class " + overriddenClassName + " final : public " + cppClassName + " {\n" +
|
||||
"public:\n" +
|
||||
"\n",
|
||||
)
|
||||
|
||||
for _, ctor := range c.Ctors {
|
||||
ret.WriteString("\t" + subclassName + "(" + emitParametersCpp(ctor) + "): " + c.ClassName + "(" + emitParameterNames(ctor) + ") {}\n")
|
||||
ret.WriteString("\t" + overriddenClassName + "(" + emitParametersCpp(ctor) + "): " + cppClassName + "(" + emitParameterNames(ctor) + ") {};\n")
|
||||
}
|
||||
ret.WriteString("\n")
|
||||
|
||||
if !c.CanDelete {
|
||||
ret.WriteString(
|
||||
"private:\n" +
|
||||
"\tvirtual ~" + subclassName + "();\n" + // = delete;\n" +
|
||||
"\tvirtual ~" + overriddenClassName + "();\n" + // = delete;\n" +
|
||||
"\n" +
|
||||
"public:\n" +
|
||||
"\n",
|
||||
)
|
||||
} else {
|
||||
ret.WriteString(
|
||||
"\tvirtual ~" + subclassName + "() override = default;\n" +
|
||||
"\tvirtual ~" + overriddenClassName + "() override = default;\n" +
|
||||
"\n",
|
||||
)
|
||||
}
|
||||
@ -1082,7 +1074,7 @@ extern "C" {
|
||||
ret.WriteString("\t\t\treturn " + getCppZeroValue(m.ReturnType) + "; // Pure virtual, there is no base we can call\n")
|
||||
}
|
||||
} else {
|
||||
ret.WriteString("\t\t\t" + maybeReturn + c.ClassName + "::" + m.CppCallTarget() + "(" + emitParameterNames(m) + ");\n")
|
||||
ret.WriteString("\t\t\t" + maybeReturn + methodPrefixName + "::" + m.CppCallTarget() + "(" + emitParameterNames(m) + ");\n")
|
||||
|
||||
if m.ReturnType.Void() {
|
||||
ret.WriteString("\t\t\treturn;\n")
|
||||
@ -1102,11 +1094,11 @@ extern "C" {
|
||||
}
|
||||
|
||||
ret.WriteString(
|
||||
"\n" +
|
||||
signalCode +
|
||||
"\t\t\n" +
|
||||
signalCode + "\n" +
|
||||
"\t\t" + maybeReturn2 + cabiCallbackName(c, m) + "(" + strings.Join(paramArgs, `, `) + ");\n" +
|
||||
returnTransformP +
|
||||
ifv(maybeReturn == "", "", "\t\treturn "+returnTransformF+";") + "\n" +
|
||||
returnTransformP + "\n" +
|
||||
"\t\t" + ifv(maybeReturn == "", "", "return "+returnTransformF+";") + "\n" +
|
||||
"\t}\n" +
|
||||
|
||||
"\n",
|
||||
@ -1152,6 +1144,8 @@ extern "C" {
|
||||
ret.WriteString(
|
||||
"};\n" +
|
||||
"\n")
|
||||
|
||||
cppClassName = overriddenClassName
|
||||
}
|
||||
|
||||
for i, ctor := range c.Ctors {
|
||||
@ -1159,7 +1153,7 @@ extern "C" {
|
||||
preamble, forwarding := emitParametersCABI2CppForwarding(ctor.Parameters, "\t")
|
||||
|
||||
ret.WriteString(
|
||||
className + "* " + cabiNewName(c, i) + "(" + emitParametersCabi(ctor, "") + ") {\n",
|
||||
cabiClassName(c.ClassName) + "* " + cabiNewName(c, i) + "(" + emitParametersCabiConstructor(&c, &ctor) + ") {\n",
|
||||
)
|
||||
|
||||
if ctor.RequireCpp != nil {
|
||||
@ -1170,9 +1164,7 @@ extern "C" {
|
||||
|
||||
ret.WriteString(
|
||||
preamble +
|
||||
"\treturn new (std::nothrow) " +
|
||||
ifv(len(virtualMethods) > 0, cppSubclassName(c), c.ClassName) +
|
||||
"(" + forwarding + ");\n",
|
||||
"\treturn new " + cppClassName + "(" + forwarding + ");\n",
|
||||
)
|
||||
|
||||
if ctor.RequireCpp != nil {
|
||||
@ -1195,7 +1187,7 @@ extern "C" {
|
||||
// need the base pointers to call base methods from CGO
|
||||
if len(c.DirectInheritClassInfo()) > 0 {
|
||||
ret.WriteString(
|
||||
"void " + cabiVirtBaseName(c) + "(" + className + "* src",
|
||||
"void " + cabiVirtBaseName(c) + "(" + methodPrefixName + "* src",
|
||||
)
|
||||
for _, baseClass := range c.DirectInheritClassInfo() {
|
||||
ret.WriteString(", " + baseClass.Class.ClassName + "** outptr_" + cabiClassName(baseClass.Class.ClassName))
|
||||
@ -1259,7 +1251,7 @@ extern "C" {
|
||||
"#endif\n"+
|
||||
"}\n"+
|
||||
"\n",
|
||||
m.ReturnType.RenderTypeCabi(), className, m.SafeMethodName(), emitParametersCabi(m, ifv(m.IsConst, "const ", "")+className+"*"),
|
||||
m.ReturnType.RenderTypeCabi(), methodPrefixName, m.SafeMethodName(), emitParametersCabi(m, ifv(m.IsConst, "const ", "")+methodPrefixName+"*"),
|
||||
preamble,
|
||||
emitAssignCppToCabi("\treturn ", m.ReturnType, callTarget),
|
||||
unavailableRetn,
|
||||
@ -1267,10 +1259,10 @@ extern "C" {
|
||||
|
||||
} else if m.BecomesNonConstInVersion != nil {
|
||||
|
||||
nonConstCallTarget := "const_cast<" + c.ClassName + "*>(self)->" + m.CppCallTarget() + "(" + forwarding + ")"
|
||||
nonConstCallTarget := "const_cast<" + methodPrefixName + "*>(self)->" + m.CppCallTarget() + "(" + forwarding + ")"
|
||||
|
||||
ret.WriteString("" +
|
||||
m.ReturnType.RenderTypeCabi() + " " + className + "_" + m.SafeMethodName() + "(" + emitParametersCabi(m, ifv(m.IsConst, "const ", "")+className+"*") + ") {\n" +
|
||||
m.ReturnType.RenderTypeCabi() + " " + methodPrefixName + "_" + m.SafeMethodName() + "(" + emitParametersCabi(m, ifv(m.IsConst, "const ", "")+methodPrefixName+"*") + ") {\n" +
|
||||
preamble + "\n" +
|
||||
"// This method was changed from const to non-const in Qt " + *m.BecomesNonConstInVersion + "\n" +
|
||||
"#if QT_VERSION < QT_VERSION_CHECK(" + strings.Replace(*m.BecomesNonConstInVersion, `.`, `,`, -1) + ",0)\n" +
|
||||
@ -1287,9 +1279,9 @@ extern "C" {
|
||||
ret.WriteString("" +
|
||||
"// This method's return type was changed from non-const to const in Qt " + *m.ReturnType.BecomesConstInVersion + "\n" +
|
||||
"#if QT_VERSION >= QT_VERSION_CHECK(" + strings.Replace(*m.ReturnType.BecomesConstInVersion, `.`, `,`, -1) + ",0)\n" +
|
||||
"const " + m.ReturnType.RenderTypeCabi() + " " + className + "_" + m.SafeMethodName() + "(" + emitParametersCabi(m, ifv(m.IsConst, "const ", "")+className+"*") + ") {\n" +
|
||||
"const " + m.ReturnType.RenderTypeCabi() + " " + methodPrefixName + "_" + m.SafeMethodName() + "(" + emitParametersCabi(m, ifv(m.IsConst, "const ", "")+methodPrefixName+"*") + ") {\n" +
|
||||
"#else\n" +
|
||||
m.ReturnType.RenderTypeCabi() + " " + className + "_" + m.SafeMethodName() + "(" + emitParametersCabi(m, ifv(m.IsConst, "const ", "")+className+"*") + ") {\n" +
|
||||
m.ReturnType.RenderTypeCabi() + " " + methodPrefixName + "_" + m.SafeMethodName() + "(" + emitParametersCabi(m, ifv(m.IsConst, "const ", "")+methodPrefixName+"*") + ") {\n" +
|
||||
"#endif\n" +
|
||||
preamble + "\n" +
|
||||
emitAssignCppToCabi("\treturn ", m.ReturnType, callTarget) +
|
||||
@ -1304,7 +1296,7 @@ extern "C" {
|
||||
"%s"+
|
||||
"}\n"+
|
||||
"\n",
|
||||
m.ReturnType.RenderTypeCabi(), className, m.SafeMethodName(), emitParametersCabi(m, ifv(m.IsConst, "const ", "")+className+"*"),
|
||||
m.ReturnType.RenderTypeCabi(), methodPrefixName, m.SafeMethodName(), emitParametersCabi(m, ifv(m.IsConst, "const ", "")+methodPrefixName+"*"),
|
||||
preamble,
|
||||
emitAssignCppToCabi("\treturn ", m.ReturnType, callTarget),
|
||||
))
|
||||
@ -1330,8 +1322,8 @@ extern "C" {
|
||||
signalCode += "\t\t" + cabiCallbackName(c, m) + "(" + strings.Join(paramArgs, `, `) + ");\n"
|
||||
|
||||
ret.WriteString(
|
||||
`void ` + cabiConnectName(c, m) + `(` + className + `* self, intptr_t slot) {` + "\n" +
|
||||
"\t" + className + `::connect(self, ` + exactSignal + `, self, [=](` + emitParametersCpp(m) + `) {` + "\n" +
|
||||
`void ` + cabiConnectName(c, m) + `(` + methodPrefixName + `* self, intptr_t slot) {` + "\n" +
|
||||
"\t" + cppClassName + `::connect(self, ` + exactSignal + `, self, [=](` + emitParametersCpp(m) + `) {` + "\n" +
|
||||
signalCode +
|
||||
"\t});\n" +
|
||||
"}\n" +
|
||||
@ -1370,14 +1362,6 @@ extern "C" {
|
||||
return ret
|
||||
}
|
||||
|
||||
if len(virtualMethods) > 0 {
|
||||
// This is a subclassed class. In that case, we allow calling
|
||||
// protected methods
|
||||
// This is a standalone function, but it can access the protected
|
||||
// method via a friend declaration
|
||||
|
||||
subclassName := cppSubclassName(c)
|
||||
|
||||
// Virtual override helpers
|
||||
for _, m := range virtualMethods {
|
||||
|
||||
@ -1389,11 +1373,11 @@ extern "C" {
|
||||
|
||||
ret.WriteString(
|
||||
`bool ` + cabiOverrideVirtualName(c, m) + `(void* self, intptr_t slot) {` + "\n" +
|
||||
"\t" + subclassName + "* self_cast = dynamic_cast<" + subclassName + "*>( (" + c.ClassName + "*)(self) );\n" +
|
||||
"\t" + cppClassName + "* self_cast = dynamic_cast<" + cppClassName + "*>( (" + cabiClassName(c.ClassName) + "*)(self) );\n" +
|
||||
"\tif (self_cast == nullptr) {\n" +
|
||||
"\t\treturn false;\n" +
|
||||
"\t}\n" +
|
||||
"\n" +
|
||||
"\t\n" +
|
||||
"\tself_cast->handle__" + m.SafeMethodName() + " = slot;\n" +
|
||||
"\treturn true;\n" +
|
||||
"}\n" +
|
||||
@ -1410,38 +1394,51 @@ extern "C" {
|
||||
// qualified syntax (`MiqtSubclass->QFoo::Bar()`). This method
|
||||
// takes and returns CABI types.
|
||||
|
||||
var parametersCabi []string
|
||||
for _, p := range m.Parameters {
|
||||
parametersCabi = append(parametersCabi, p.RenderTypeCabi()+" "+p.cParameterName())
|
||||
}
|
||||
vbpreamble, vbforwarding := emitParametersCABI2CppForwarding(m.Parameters, "\t")
|
||||
|
||||
callTarget := "static_cast<" + ifv(m.IsConst, "const ", "") + subclassName + "*>(self)->" + c.ClassName + "::" + m.CppCallTarget() + "(" + vbforwarding + ")"
|
||||
callTarget := "( (" + ifv(m.IsConst, "const ", "") + cppClassName + "*)(self) )->" + c.ClassName + "::" + m.CppCallTarget() + "(" + vbforwarding + ")"
|
||||
|
||||
ret.WriteString(
|
||||
m.ReturnType.RenderTypeCabi() + " " + cabiVirtualBaseName(c, m) + "(" + emitParametersCabi(m, ifv(m.IsConst, "const ", "")+"void*") + ") {\n" +
|
||||
vbpreamble +
|
||||
fixupProtectedReferences(emitAssignCppToCabi("\treturn ", m.ReturnType, callTarget)) +
|
||||
vbpreamble + "\n" +
|
||||
fixupProtectedReferences(emitAssignCppToCabi("\treturn ", m.ReturnType, callTarget)) + "\n" +
|
||||
"}\n" +
|
||||
"\n",
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if len(virtualMethods) > 0 {
|
||||
// This is a subclassed class. In that case, we allow calling
|
||||
// protected methods
|
||||
// This is a standalone function, but it can access the protected
|
||||
// method via a friend declaration
|
||||
|
||||
for _, m := range protectedMethods {
|
||||
|
||||
vbpreamble, vbforwarding := emitParametersCABI2CppForwarding(m.Parameters, "\t\t")
|
||||
vbCallTarget := "self_cast->" + m.CppCallTarget() + "(" + vbforwarding + ")"
|
||||
|
||||
//
|
||||
|
||||
ret.WriteString(
|
||||
m.ReturnType.RenderTypeCabi() + " " + cabiProtectedBaseName(c, m) + "(bool* _dynamic_cast_ok, " + emitParametersCabi(m, ifv(m.IsConst, "const ", "")+"void*") + ") {\n" +
|
||||
|
||||
"\t" + subclassName + "* self_cast = dynamic_cast<" + subclassName + "*>( (" + c.ClassName + "*)(self) );\n" +
|
||||
"\t" + cppClassName + "* self_cast = dynamic_cast<" + cppClassName + "*>( (" + cabiClassName(c.ClassName) + "*)(self) );\n" +
|
||||
"\tif (self_cast == nullptr) {\n" +
|
||||
"\t\t*_dynamic_cast_ok = false;\n" +
|
||||
"\t\treturn " + getCabiZeroValue(m.ReturnType) + ";\n" +
|
||||
"\t}\n" +
|
||||
"\n" +
|
||||
"\t\n" +
|
||||
"\t*_dynamic_cast_ok = true;\n" +
|
||||
vbpreamble +
|
||||
fixupProtectedReferences(emitAssignCppToCabi("\treturn ", m.ReturnType, vbCallTarget)) +
|
||||
"\t" + vbpreamble + "\n" +
|
||||
fixupProtectedReferences(emitAssignCppToCabi("\treturn ", m.ReturnType, vbCallTarget)) + "\n" +
|
||||
"}\n" +
|
||||
"\n",
|
||||
)
|
||||
@ -1449,38 +1446,12 @@ extern "C" {
|
||||
}
|
||||
}
|
||||
|
||||
for _, m := range c.PrivateSignals {
|
||||
exactSignal := `&` + c.ClassName + `::` + m.CppCallTarget()
|
||||
|
||||
paramArgs := []string{"slot"}
|
||||
paramArgDefs := []string{"intptr_t cb"}
|
||||
|
||||
var signalCode string
|
||||
|
||||
for i, p := range m.Parameters {
|
||||
signalCode += emitAssignCppToCabi(fmt.Sprintf("\t\t%s sigval%d = ", p.RenderTypeCabi(), i+1), p, p.cParameterName())
|
||||
paramArgs = append(paramArgs, fmt.Sprintf("sigval%d", i+1))
|
||||
paramArgDefs = append(paramArgDefs, p.RenderTypeCabi()+" "+p.cParameterName())
|
||||
}
|
||||
|
||||
signalCode += "\t\t" + cabiCallbackName(c, m) + "(" + strings.Join(paramArgs, `, `) + ");\n"
|
||||
|
||||
ret.WriteString(
|
||||
`void ` + cabiConnectName(c, m) + `(` + className + `* self, intptr_t slot) {` + "\n" +
|
||||
"\t" + className + `::connect(self, ` + exactSignal + `, self, [=](` + emitParametersCpp(m) + `) {` + "\n" +
|
||||
signalCode +
|
||||
"\t});\n" +
|
||||
"}\n" +
|
||||
"\n",
|
||||
)
|
||||
}
|
||||
|
||||
// Delete
|
||||
// If we subclassed, our class destructor is always virtual. Therefore
|
||||
// we can delete from the self ptr without any dynamic_cast<>
|
||||
if c.CanDelete {
|
||||
ret.WriteString(
|
||||
"void " + cabiDeleteName(c) + "(" + className + "* self) {\n" +
|
||||
"void " + cabiDeleteName(c) + "(" + methodPrefixName + "* self) {\n" +
|
||||
"\tdelete self;\n" +
|
||||
"}\n" +
|
||||
"\n",
|
||||
|
@ -1130,45 +1130,6 @@ import "C"
|
||||
|
||||
}
|
||||
|
||||
for _, m := range c.PrivateSignals {
|
||||
gfs.imports["unsafe"] = struct{}{}
|
||||
gfs.imports["runtime/cgo"] = struct{}{}
|
||||
|
||||
var cgoNamedParams []string
|
||||
var paramNames []string
|
||||
conversion := ""
|
||||
|
||||
if len(m.Parameters) > 0 {
|
||||
conversion = "// Convert all CABI parameters to Go parameters\n"
|
||||
}
|
||||
for i, pp := range m.Parameters {
|
||||
cgoNamedParams = append(cgoNamedParams, pp.goParameterName()+" "+pp.parameterTypeCgo())
|
||||
|
||||
paramNames = append(paramNames, fmt.Sprintf("slotval%d", i+1))
|
||||
conversion += gfs.emitCabiToGo(fmt.Sprintf("slotval%d := ", i+1), pp, pp.goParameterName()) + "\n"
|
||||
}
|
||||
|
||||
goCbType := `func(` + gfs.emitParametersGo(m.Parameters) + `)`
|
||||
callbackName := cabiCallbackName(c, m)
|
||||
ret.WriteString(`func (this *` + goClassName + `) On` + m.goMethodName() + `(slot ` + goCbType + `) {
|
||||
C.` + cabiConnectName(c, m) + `(this.h, C.intptr_t(cgo.NewHandle(slot)) )
|
||||
}
|
||||
|
||||
//export ` + callbackName + `
|
||||
func ` + callbackName + `(cb C.intptr_t` + ifv(len(m.Parameters) > 0, ", ", "") + strings.Join(cgoNamedParams, `, `) + `) {
|
||||
gofunc, ok := cgo.Handle(cb).Value().(` + goCbType + `)
|
||||
if !ok {
|
||||
panic("miqt: callback of non-callback type (heap corruption?)")
|
||||
}
|
||||
|
||||
` + conversion + `
|
||||
|
||||
gofunc(` + strings.Join(paramNames, `, `) + ` )
|
||||
}
|
||||
|
||||
`)
|
||||
}
|
||||
|
||||
if c.CanDelete {
|
||||
gfs.imports["runtime"] = struct{}{} // Finalizer
|
||||
|
||||
|
@ -412,7 +412,6 @@ type CppClass struct {
|
||||
ChildClassdefs []CppClass
|
||||
ChildEnums []CppEnum
|
||||
PrivateMethods []string
|
||||
PrivateSignals []CppMethod
|
||||
}
|
||||
|
||||
// VirtualMethods checks if the class has any virtual methods. This requires global
|
||||
|
@ -1,63 +0,0 @@
|
||||
# miqt-docker
|
||||
|
||||
This is an optional helper program to quickly run a dockerized MIQT cross-compiler
|
||||
environment. Many containers are available targeting different OSes and Qt versions.
|
||||
|
||||
It also has some built-in commands that can be run either dockerized or natively.
|
||||
|
||||
## Usage
|
||||
|
||||
Run `miqt-docker` with no arguments to see full usage instructions and all
|
||||
available embedded dockerfiles:
|
||||
|
||||
```bash
|
||||
Usage: miqt-docker ENVIRONMENT COMMAND...
|
||||
|
||||
COMMAND may be any shell command (e.g. go build); or /bin/bash to get an
|
||||
interactive terminal; or one of the following predefined tasks:
|
||||
|
||||
-build Run 'go build' with usual MIQT flags
|
||||
-minify-build Run 'go build' with special minification flags
|
||||
-windows-build Run 'go build' with special Windows support
|
||||
-android-build Build an Android APK (using the android-qt5 or android-qt6
|
||||
container environments)
|
||||
|
||||
Environment variables:
|
||||
DOCKER Override the path to docker
|
||||
|
||||
Available container environments: (use - as wildcard character)
|
||||
[...]
|
||||
```
|
||||
|
||||
You can specify the environment using a short form of the name. For example,
|
||||
`win64-static` will be expanded to the regex `/win64.+static/` and pick the
|
||||
best available match with the highest version number (`win64-cross-go1.24-qt6.8-static`
|
||||
at time of writing).
|
||||
This allows you to pin platforms and major versions in build commands while
|
||||
automatically upgrading to minor versions.
|
||||
|
||||
Example build commands:
|
||||
|
||||
```bash
|
||||
miqt-docker macos go build -ldflags '-s -w'
|
||||
miqt-docker native -minify-build
|
||||
miqt-docker win64-qt6-static -windows-build
|
||||
miqt-docker win64-qt6-static /bin/bash
|
||||
miqt-docker android-qt6 -android-build
|
||||
```
|
||||
|
||||
## Comparison to manual Docker commands
|
||||
|
||||
You can create a dockerized MIQT build environment yourself using the Dockerfiles
|
||||
in the `docker/` directory. The benefit of miqt-docker is:
|
||||
|
||||
- Embeds all available MIQT docker containers
|
||||
- Use glob matches to automatically pick the highest version container for target
|
||||
- Automatically build new docker containers or reuse existing, based on content hash of the Dockerfile
|
||||
- Consistently named docker images across multiple projects using MIQT
|
||||
- Automatically bind source code volume from current go.mod / go.work / git repository and preserve relative working directory
|
||||
- Handles bind-mounting the GOCACHE and GOMODCACHE directories for fast rebuilds
|
||||
- Handles using the proper uid+gid on Linux
|
||||
- Automatically detect sudo requirement on Linux
|
||||
- Convenient predefined tasks
|
||||
- Advanced build support for Android
|
@ -1,415 +0,0 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# android-build.sh allows building a MIQT Go application for Android.
|
||||
# For details, see the top-level README.md file.
|
||||
|
||||
set -Eeuo pipefail
|
||||
|
||||
# QT_PATH is pre-set in the Qt 5 docker container environment. Includes trailing slash
|
||||
# QT_ANDROID is pre-set in the Qt 6 docker container environment
|
||||
QT_PATH=${QT_PATH:-/usr/local/Qt-5.15.13/}
|
||||
QT_ANDROID=${QT_ANDROID:-$QT_PATH}
|
||||
|
||||
export LC_ALL=C.UTF-8
|
||||
|
||||
# get_app_name returns the android app's name. This affects the default name
|
||||
# in deployment-settings.json and the generated lib.so names.
|
||||
# You can still customise the package name and the package ID in the xml
|
||||
# files after generation.
|
||||
get_app_name() {
|
||||
basename "$(pwd)"
|
||||
}
|
||||
|
||||
get_stub_soname() {
|
||||
# libRealAppName_arm64-v8a.so
|
||||
echo "lib$(get_app_name)_arm64-v8a.so"
|
||||
}
|
||||
|
||||
get_go_soname() {
|
||||
echo "libMiqtGolangApp_arm64-v8a.so"
|
||||
}
|
||||
|
||||
ndk_version() {
|
||||
ls /opt/android-sdk/ndk/ | tail -n1
|
||||
}
|
||||
|
||||
target_sdk_version() {
|
||||
ls /opt/android-sdk/platforms | tail -n1 | sed -re 's/android-//'
|
||||
}
|
||||
|
||||
build_tools_version() {
|
||||
ls /opt/android-sdk/build-tools | tail -n1
|
||||
}
|
||||
|
||||
# extra_libs returns a comma-separated list of extra libraries to include in
|
||||
# the apk package
|
||||
extra_libs() {
|
||||
if [[ -d /opt/android_openssl ]] ; then
|
||||
# Our miqt Qt5 container includes these extra .so libraries
|
||||
# However, the aqtinstall-based Qt 6 container does not use them
|
||||
echo "/opt/android_openssl/ssl_1.1/arm64-v8a/libssl_1_1.so,/opt/android_openssl/ssl_1.1/arm64-v8a/libcrypto_1_1.so"
|
||||
fi
|
||||
}
|
||||
|
||||
# generate_template_contents produces a deployment settings JSON file that is
|
||||
# understood by the androiddeployqt program.
|
||||
# Available fields are documented in the template file at:
|
||||
# @ref /usr/local/Qt-5.15.13/mkspecs/features/android/android_deployment_settings.prf
|
||||
generate_template_contents() {
|
||||
|
||||
cat <<EOF
|
||||
{
|
||||
"_description": "Generated by miqt/android-mktemplate",
|
||||
"application-binary": "$(get_app_name)",
|
||||
"architectures": {
|
||||
"arm64-v8a" : "aarch64-linux-android"
|
||||
},
|
||||
"android-extra-libs": "$(extra_libs)",
|
||||
"android-min-sdk-version": "23",
|
||||
"android-target-sdk-version": "$(target_sdk_version)",
|
||||
"ndk": "/opt/android-sdk/ndk/$(ndk_version)",
|
||||
"ndk-host": "linux-x86_64",
|
||||
"qt": "${QT_ANDROID}",
|
||||
"sdk": "/opt/android-sdk",
|
||||
"sdkBuildToolsRevision": "$(build_tools_version)",
|
||||
"stdcpp-path": "/opt/android-sdk/ndk/$(ndk_version)/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/",
|
||||
"tool-prefix": "llvm",
|
||||
"toolchain-prefix": "llvm",
|
||||
"useLLVM": true
|
||||
}
|
||||
EOF
|
||||
}
|
||||
|
||||
# pkg_config_dependencies echoes the pkg-config packages that are needed as
|
||||
# a baseline for the detected Qt version.
|
||||
# It's not smart enough to discover other Qt packages yet.
|
||||
pkg_config_dependencies() {
|
||||
local QT_VERSION=$(detect_miqt_qt_version)
|
||||
if [[ $QT_VERSION == 'qt5' ]] ; then
|
||||
echo Qt5Widgets
|
||||
echo Qt5AndroidExtras
|
||||
|
||||
elif [[ $QT_VERSION == 'qt6' ]] ; then
|
||||
# There is no AndroidExtras in Qt 6
|
||||
echo Qt6Widgets
|
||||
|
||||
fi
|
||||
}
|
||||
|
||||
# android_stub_gen generates a .so that runs an exported function from another
|
||||
# so file. This is because Qt for Android always tries to run `main`, but Go's
|
||||
# c-shared build mode cannot export a function named `main`.
|
||||
android_stub_gen() {
|
||||
|
||||
local STUBNAME="miqt-stub-$(date +%s).cpp"
|
||||
|
||||
cat > $STUBNAME <<EOF
|
||||
#include <android/log.h>
|
||||
#include <dlfcn.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
typedef void goMainFunc_t();
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
__android_log_print(ANDROID_LOG_VERBOSE, "miqt_stub", "Starting up");
|
||||
|
||||
void* handle = dlopen("$(get_go_soname)", RTLD_LAZY);
|
||||
if (handle == NULL) {
|
||||
__android_log_print(ANDROID_LOG_VERBOSE, "miqt_stub", "miqt_stub: null handle opening so: %s", dlerror());
|
||||
exit(1);
|
||||
}
|
||||
|
||||
void* goMain = dlsym(handle, "AndroidMain");
|
||||
if (goMain == NULL) {
|
||||
__android_log_print(ANDROID_LOG_VERBOSE, "miqt_stub", "miqt_stub: null handle looking for function: %s", dlerror());
|
||||
exit(1);
|
||||
}
|
||||
|
||||
__android_log_print(ANDROID_LOG_VERBOSE, "miqt_stub", "miqt_stub: Found target, calling");
|
||||
|
||||
// Cast to function pointer and call
|
||||
goMainFunc_t* f = (goMainFunc_t*)goMain;
|
||||
f();
|
||||
|
||||
__android_log_print(ANDROID_LOG_VERBOSE, "miqt_stub", "miqt_stub: Target function returned");
|
||||
return 0;
|
||||
}
|
||||
|
||||
EOF
|
||||
|
||||
# Compile
|
||||
# Link with Qt libraries so that androiddeployqt detects us as being the
|
||||
# main shared library
|
||||
|
||||
$CXX -shared \
|
||||
-ldl \
|
||||
-llog \
|
||||
-L${QT_ANDROID}/plugins/platforms -lplugins_platforms_qtforandroid_arm64-v8a \
|
||||
$(pkg-config --libs $(pkg_config_dependencies)) \
|
||||
${STUBNAME} \
|
||||
"-Wl,-soname,$(basename "$(get_stub_soname)")" \
|
||||
-o "android-build/libs/arm64-v8a/$(get_stub_soname)"
|
||||
|
||||
rm "${STUBNAME}"
|
||||
}
|
||||
|
||||
# require_is_main_package verifies that this is the main Go package.
|
||||
require_is_main_package() {
|
||||
if ! grep -Fq 'package main' *.go ; then
|
||||
echo "This doesn't seem to be the main package" >&2
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
# patch_app_main sets up the startup go files so that the go program can be
|
||||
# built either as c-shared for Android or as a normal program for desktop OSes.
|
||||
patch_app_main() {
|
||||
|
||||
# Replace func main() with app_main()
|
||||
|
||||
for srcfile in *.go ; do
|
||||
sed -i -re 's/^func main\(\) \{/func app_main() {/' "$srcfile"
|
||||
done
|
||||
|
||||
# Add shim startup files
|
||||
|
||||
cat <<EOF > startup_android.go
|
||||
//go:build android
|
||||
// +build android
|
||||
|
||||
package main
|
||||
|
||||
import "C" // Required for export support
|
||||
|
||||
//export AndroidMain
|
||||
func AndroidMain() {
|
||||
app_main()
|
||||
}
|
||||
|
||||
func main() {
|
||||
// Must be empty
|
||||
}
|
||||
|
||||
EOF
|
||||
|
||||
cat <<EOF > startup_other.go
|
||||
//go:build !android
|
||||
// +build !android
|
||||
|
||||
package main
|
||||
|
||||
func main() {
|
||||
app_main()
|
||||
}
|
||||
|
||||
EOF
|
||||
|
||||
gofmt -w startup_android.go || true
|
||||
gofmt -w startup_other.go || true
|
||||
|
||||
# Done
|
||||
}
|
||||
|
||||
# unpatch_app_main undoes the transformation from patch_app_main.
|
||||
unpatch_app_main() {
|
||||
|
||||
# Replace func main() with app_main()
|
||||
|
||||
for srcfile in *.go ; do
|
||||
sed -i -re 's/^func app_main\(\) \{/func main() {/' "$srcfile"
|
||||
done
|
||||
|
||||
# Remove extra startup files
|
||||
|
||||
rm startup_android.go || true
|
||||
rm startup_other.go || true
|
||||
}
|
||||
|
||||
# build_app_so compiles the Go app as a c-shared .so.
|
||||
build_app_so() {
|
||||
go build \
|
||||
-buildmode c-shared \
|
||||
-ldflags "-s -w -extldflags -Wl,-soname,$(get_go_soname)" \
|
||||
-o "android-build/libs/arm64-v8a/$(get_go_soname)"
|
||||
}
|
||||
|
||||
sdkmanager() {
|
||||
echo /opt/android-sdk/cmdline-tools/*/bin/sdkmanager
|
||||
}
|
||||
|
||||
# build_apk calls androiddeployqt to package the android-build directory into
|
||||
# the final apk.
|
||||
build_apk() {
|
||||
|
||||
# Qt 6 androiddeployqt: Understands the QT_ANDROID_KEYSTORE_STORE_PASS in env
|
||||
# Qt 5 androiddeployqt: Doesn't - any use of `--sign keystore alias` here
|
||||
# requires stdin prompt but doesn't pass androiddeployqt's stdin through
|
||||
# to jarsigner subprocess
|
||||
# Either way, don't sign the app here, rely on separate jarsigner command
|
||||
|
||||
# Work around an issue with Qt 6 sporadically failing to detect that
|
||||
# we have a valid Qt platform plugin
|
||||
# TODO why does this happen? Is it related to file sort ordering?
|
||||
# It really does fix itself after multiple attempts (usually less than 5)
|
||||
# - When it fails: Error: qmlimportscanner not found at /qmlimportscanner
|
||||
# - When it works: Error: qmlimportscanner not found at libexec/qmlimportscanner
|
||||
while ! androiddeployqt \
|
||||
--input ./deployment-settings.json \
|
||||
--output ./android-build/ \
|
||||
--release \
|
||||
2> >(tee /tmp/androiddeployqt.stderr.log >&2) ; do
|
||||
|
||||
if grep -Fq 'Make sure the app links to Qt Gui library' /tmp/androiddeployqt.stderr.log ; then
|
||||
echo "Detected temporary problem with Qt plugin detection. Retrying..."
|
||||
sleep 1
|
||||
|
||||
else
|
||||
# real error
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
local OUTAPK=$(get_app_name).apk
|
||||
rm "$OUTAPK" || true
|
||||
|
||||
# Zipalign
|
||||
echo "Zipalign..."
|
||||
/opt/android-sdk/build-tools/*/zipalign \
|
||||
-p 4 \
|
||||
./android-build/build/outputs/apk/release/android-build-release-unsigned.apk \
|
||||
"$OUTAPK"
|
||||
|
||||
# Sign
|
||||
echo "Signing..."
|
||||
#jarsigner \
|
||||
# -verbose \
|
||||
# -sigalg SHA256withRSA -digestalg SHA256 \
|
||||
# -keystore ./android.keystore \
|
||||
# "$OUTAPK" \
|
||||
# "${QT_ANDROID_KEYSTORE_ALIAS}" \
|
||||
# -storepass:env QT_ANDROID_KEYSTORE_STORE_PASS \
|
||||
# -keypass:env QT_ANDROID_KEYSTORE_KEY_PASS
|
||||
|
||||
/opt/android-sdk/build-tools/*/apksigner \
|
||||
sign \
|
||||
--ks ./android.keystore \
|
||||
--ks-key-alias "${QT_ANDROID_KEYSTORE_ALIAS}" \
|
||||
--ks-pass env:QT_ANDROID_KEYSTORE_STORE_PASS \
|
||||
--key-pass env:QT_ANDROID_KEYSTORE_KEY_PASS \
|
||||
"$OUTAPK"
|
||||
}
|
||||
|
||||
# detect_env_qt_version detects the system's current Qt version.
|
||||
detect_env_qt_version() {
|
||||
if qmake --version | fgrep -q 'Qt version 5' ; then
|
||||
echo "qt5"
|
||||
return 0
|
||||
|
||||
elif qmake --version | fgrep -q 'Qt version 6' ; then
|
||||
echo "qt6"
|
||||
return 0
|
||||
|
||||
else
|
||||
echo "Missing Qt tools in PATH" >&2
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
# detect_miqt_qt_version echoes either "qt5", "qt6", or exits bash.
|
||||
detect_miqt_qt_version() {
|
||||
local IS_QT5=false
|
||||
if grep -qF '"github.com/mappu/miqt/qt"' *.go ; then
|
||||
IS_QT5=true
|
||||
fi
|
||||
|
||||
local IS_QT6=false
|
||||
if grep -qF '"github.com/mappu/miqt/qt6"' *.go ; then
|
||||
IS_QT6=true
|
||||
fi
|
||||
|
||||
if [[ $IS_QT5 == true && $IS_QT6 == true ]] ; then
|
||||
echo "Found qt5 and qt6 imports, confused about what to do next" >&2
|
||||
exit 1
|
||||
|
||||
elif [[ $IS_QT5 == true ]] ; then
|
||||
echo "qt5"
|
||||
return 0
|
||||
|
||||
elif [[ $IS_QT6 == true ]] ; then
|
||||
echo "qt6"
|
||||
return 0
|
||||
|
||||
else
|
||||
echo "Found neither qt5 nor qt6 imports. Is this a MIQT Qt app?" >&2
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
generate_default_keystore() {
|
||||
|
||||
local GENPASS=storepass_$(cat /dev/urandom | head -c64 | md5sum | cut -d' ' -f1)
|
||||
|
||||
keytool \
|
||||
-genkeypair \
|
||||
-dname "cn=Miqt, ou=Miqt, o=Miqt, c=US" \
|
||||
-keyalg RSA \
|
||||
-alias miqt \
|
||||
-keypass "${GENPASS}" \
|
||||
-keystore ./android.keystore \
|
||||
-storepass "${GENPASS}" \
|
||||
-validity 20000
|
||||
|
||||
echo "QT_ANDROID_KEYSTORE_PATH=./android.keystore" > android.keystore.env
|
||||
echo "QT_ANDROID_KEYSTORE_ALIAS=miqt" >> android.keystore.env
|
||||
echo "QT_ANDROID_KEYSTORE_STORE_PASS=${GENPASS}" >> android.keystore.env
|
||||
echo "QT_ANDROID_KEYSTORE_KEY_PASS=${GENPASS}" >> android.keystore.env
|
||||
}
|
||||
|
||||
# main is the entrypoint for android-build.sh.
|
||||
main() {
|
||||
|
||||
if [[ $(detect_env_qt_version) != $(detect_miqt_qt_version) ]] ; then
|
||||
echo "The system is $(detect_env_qt_version) but the app uses $(detect_miqt_qt_version). Is this the right container?" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
require_is_main_package
|
||||
|
||||
# Rebuild deployment-settings.json
|
||||
if [[ ! -f deployment-settings.json ]] ; then
|
||||
echo "Generating deployment-settings.json..."
|
||||
generate_template_contents > deployment-settings.json
|
||||
fi
|
||||
|
||||
mkdir -p android-build/libs/arm64-v8a
|
||||
|
||||
if [[ ! -f android-build/libs/arm64-v8a/$(get_stub_soname) ]] ; then
|
||||
echo "Generating stub so..."
|
||||
android_stub_gen
|
||||
fi
|
||||
|
||||
# Rebuild miqt_golang_app.so
|
||||
echo "Compiling Go app..."
|
||||
patch_app_main
|
||||
build_app_so
|
||||
unpatch_app_main
|
||||
|
||||
# Keypair
|
||||
if [[ ! -f android.keystore || ! -f android.keystore.env ]] ; then
|
||||
echo "Signing keystore not found, generating a default one..."
|
||||
generate_default_keystore
|
||||
fi
|
||||
|
||||
# Load keypair credentials into exported env vars
|
||||
set -o allexport
|
||||
source android.keystore.env
|
||||
set +o allexport
|
||||
|
||||
# Generate .apk
|
||||
echo "Packaging APK..."
|
||||
build_apk
|
||||
|
||||
echo "Complete"
|
||||
}
|
||||
|
||||
main "$@"
|
@ -1,108 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"io"
|
||||
"log"
|
||||
"os"
|
||||
"os/exec"
|
||||
"regexp"
|
||||
)
|
||||
|
||||
var (
|
||||
needsSudo bool
|
||||
)
|
||||
|
||||
// dockerImage describes an image available in the docker daemon.
|
||||
type dockerImage struct {
|
||||
ID string
|
||||
Repository string
|
||||
Tag string
|
||||
}
|
||||
|
||||
// dockerCommand creates an *exec.Cmd for running docker. It respects the global
|
||||
// `needsSudo` state.
|
||||
func dockerCommand(args ...string) *exec.Cmd {
|
||||
docker := os.Getenv("DOCKER")
|
||||
if docker == "" {
|
||||
docker = "docker"
|
||||
}
|
||||
|
||||
if needsSudo {
|
||||
useArgs := make([]string, 0, len(args)+1)
|
||||
useArgs = append(useArgs, docker)
|
||||
useArgs = append(useArgs, args...)
|
||||
return exec.Command(`sudo`, useArgs...)
|
||||
}
|
||||
|
||||
return exec.Command(docker, args...)
|
||||
}
|
||||
|
||||
// dockerListImages lists all the current docker images.
|
||||
func dockerListImages() ([]dockerImage, error) {
|
||||
|
||||
cmd := dockerCommand(`image`, `ls`, `--format`, `{{json . }}`)
|
||||
cmd.Stderr = os.Stderr // passthrough
|
||||
|
||||
buff, err := cmd.Output()
|
||||
if err != nil {
|
||||
if !needsSudo {
|
||||
// Retry with sudo
|
||||
log.Println("Retrying with sudo...")
|
||||
needsSudo = true
|
||||
return dockerListImages()
|
||||
}
|
||||
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var ret []dockerImage
|
||||
|
||||
dec := json.NewDecoder(bytes.NewReader(buff))
|
||||
for {
|
||||
var entry dockerImage
|
||||
err = dec.Decode(&entry)
|
||||
if err != nil {
|
||||
if errors.Is(err, io.EOF) {
|
||||
return ret, nil
|
||||
}
|
||||
return nil, err // real error
|
||||
}
|
||||
|
||||
ret = append(ret, entry)
|
||||
}
|
||||
}
|
||||
|
||||
// dockerFindImage searches all the current docker images to find one named as
|
||||
// the supplied `repository:tag`.
|
||||
func dockerFindImage(repository, tag string) (*dockerImage, error) {
|
||||
|
||||
images, err := dockerListImages()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
re := regexp.MustCompile("^localhost/")
|
||||
|
||||
for _, im := range images {
|
||||
if (im.Repository == repository || re.ReplaceAllString(im.Repository, "") == repository) && im.Tag == tag {
|
||||
// found it
|
||||
return &im, nil
|
||||
}
|
||||
}
|
||||
|
||||
// No match
|
||||
return nil, os.ErrNotExist
|
||||
}
|
||||
|
||||
// dockerBuild builds the supplied dockerfile and tags it as repository:tag
|
||||
// as well as repository:latest.
|
||||
func dockerBuild(dockerfile []byte, repository, tag string) error {
|
||||
cmd := dockerCommand(`build`, `-t`, repository+`:`+tag, `-t`, repository+`:latest`, `-`)
|
||||
cmd.Stderr = os.Stderr
|
||||
cmd.Stdin = bytes.NewReader(dockerfile)
|
||||
|
||||
return cmd.Run()
|
||||
}
|
@ -1,64 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// highestCommonParent finds the oldest ancestor of a set of paths.
|
||||
// If there is no common ancestor, returns / on Linux or an error on Windows.
|
||||
func highestCommonParent(paths []string) (string, error) {
|
||||
if len(paths) == 0 {
|
||||
return "", errors.New("no input")
|
||||
}
|
||||
|
||||
parts := strings.Split(paths[0], string(filepath.Separator))
|
||||
|
||||
caseSensitive := runtime.GOOS != "windows"
|
||||
|
||||
for _, check := range paths {
|
||||
checkn := strings.Split(check, string(filepath.Separator))
|
||||
|
||||
// If this check path is shorter, the common part must also shrink
|
||||
if len(checkn) < len(parts) {
|
||||
parts = parts[0:len(checkn)]
|
||||
}
|
||||
|
||||
for i, checkpart := range checkn[0:len(parts)] { // len(parts) is now <= len(checkn) so this is safe
|
||||
if caseSensitive {
|
||||
if parts[i] == checkpart {
|
||||
continue
|
||||
}
|
||||
} else {
|
||||
// case insensitive comparison
|
||||
if strings.EqualFold(parts[i], checkpart) {
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
// Divergence from i: onwards
|
||||
parts = parts[0:i]
|
||||
break
|
||||
}
|
||||
|
||||
// Early failure case
|
||||
if len(parts) == 0 {
|
||||
break
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
isEmpty := len(parts) == 0 || (len(parts) == 1 && parts[0] == "")
|
||||
|
||||
if isEmpty {
|
||||
if runtime.GOOS == "windows" {
|
||||
return "", fmt.Errorf("Selected paths have no common ancestor: %v", paths)
|
||||
}
|
||||
return `/`, nil
|
||||
}
|
||||
|
||||
return strings.Join(parts, string(filepath.Separator)), nil
|
||||
}
|
@ -1,78 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"runtime"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestHighestCommonParent(t *testing.T) {
|
||||
if runtime.GOOS == "windows" {
|
||||
t.Skip("This test uses platform-specific paths")
|
||||
}
|
||||
|
||||
type testCase struct {
|
||||
input []string
|
||||
expect string
|
||||
}
|
||||
|
||||
cases := []testCase{
|
||||
|
||||
// Single input
|
||||
testCase{
|
||||
input: []string{`/foo/bar/baz`},
|
||||
expect: `/foo/bar/baz`,
|
||||
},
|
||||
|
||||
// Duplicated input
|
||||
testCase{
|
||||
input: []string{`/foo/bar/baz`, `/foo/bar/baz`},
|
||||
expect: `/foo/bar/baz`,
|
||||
},
|
||||
|
||||
// Trailing slashes are preserved if they all included trailing slashes
|
||||
testCase{
|
||||
input: []string{`/foo/bar/baz/`, `/foo/bar/baz/`},
|
||||
expect: `/foo/bar/baz/`,
|
||||
},
|
||||
|
||||
// Common directory
|
||||
testCase{
|
||||
input: []string{`/foo/bar/baz`, `/foo/quux`},
|
||||
expect: `/foo`,
|
||||
},
|
||||
|
||||
// Common directory, multiple inputs
|
||||
testCase{
|
||||
input: []string{`/foo/a`, `/foo/b`, `/foo/c`, `/foo/d`},
|
||||
expect: `/foo`,
|
||||
},
|
||||
|
||||
testCase{
|
||||
input: []string{`/foo/bar/baz`, `/unrelated`, `/foo/bar/baz`},
|
||||
expect: `/`,
|
||||
},
|
||||
|
||||
// No leading forwardslash (single input)
|
||||
testCase{
|
||||
input: []string{`foo/bar/baz`},
|
||||
expect: `foo/bar/baz`,
|
||||
},
|
||||
|
||||
// No leading forwardslash (empty output assumes /)
|
||||
testCase{
|
||||
input: []string{`foo/bar/baz`, `unrelated`, `foo/bar/baz`},
|
||||
expect: `/`,
|
||||
},
|
||||
}
|
||||
|
||||
for idx, tc := range cases {
|
||||
got, err := highestCommonParent(tc.input)
|
||||
if err != nil {
|
||||
t.Errorf("test %d: input(%v) got error=%v", idx, tc.input, err)
|
||||
continue
|
||||
}
|
||||
if got != tc.expect {
|
||||
t.Errorf("test %d: input(%v) got %q, want %q", idx, tc.input, got, tc.expect)
|
||||
}
|
||||
}
|
||||
}
|
@ -1,24 +0,0 @@
|
||||
//+build linux
|
||||
//go:build linux
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
"syscall"
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
func isatty() bool {
|
||||
fd := os.Stdout.Fd()
|
||||
req := syscall.TCGETS
|
||||
termios := syscall.Termios{}
|
||||
|
||||
_, _, errno := syscall.Syscall(syscall.SYS_IOCTL, uintptr(fd), uintptr(req), uintptr(unsafe.Pointer(&termios)))
|
||||
if errno != 0 {
|
||||
return false
|
||||
}
|
||||
|
||||
// Successfully got Termios info = stdout is a tty
|
||||
return true
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
//+build !linux
|
||||
//go:build !linux
|
||||
|
||||
package main
|
||||
|
||||
func isatty() bool {
|
||||
return true
|
||||
}
|
@ -1,300 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"crypto/sha256"
|
||||
"encoding/hex"
|
||||
"fmt"
|
||||
"io/fs"
|
||||
"log"
|
||||
"os"
|
||||
"os/exec"
|
||||
"os/user"
|
||||
"path"
|
||||
"path/filepath"
|
||||
"regexp"
|
||||
"runtime"
|
||||
"strings"
|
||||
|
||||
"github.com/mappu/miqt/docker"
|
||||
)
|
||||
|
||||
// glob2regex converts the glob pattern into a regexp.
|
||||
// It only supports `-` as a special character meaning 'anything'.
|
||||
// The resulting regex is unanchored i.e. can match anywhere within a target string.
|
||||
func glob2regex(pattern string) *regexp.Regexp {
|
||||
parts := strings.Split(pattern, `-`)
|
||||
for i, p := range parts {
|
||||
parts[i] = regexp.QuoteMeta(p)
|
||||
}
|
||||
|
||||
return regexp.MustCompile(strings.Join(parts, `.*`))
|
||||
}
|
||||
|
||||
// shasum returns the hex sha256 of a byte slice.
|
||||
func shasum(data []byte) string {
|
||||
hashdata := sha256.Sum256(data)
|
||||
return hex.EncodeToString(hashdata[:])
|
||||
}
|
||||
|
||||
// usage displays how to use miqt-docker and then exits the process.
|
||||
func usage(dockerfiles []fs.DirEntry) {
|
||||
fmt.Fprint(os.Stderr, `Usage: `+filepath.Base(os.Args[0])+` ENVIRONMENT COMMAND...
|
||||
|
||||
COMMAND may be any shell command (e.g. go build); or /bin/bash to get an
|
||||
interactive terminal; or one of the following special tasks:
|
||||
|
||||
-build Run 'go build' with usual MIQT flags
|
||||
-minify-build Run 'go build' with special minification flags
|
||||
-windows-build Run 'go build' with special Windows support
|
||||
-android-build Build an Android APK (using the android-qt5 or android-qt6
|
||||
container environments)
|
||||
|
||||
Environment variables:
|
||||
DOCKER Override the path to docker
|
||||
|
||||
Available container environments: (use - as wildcard character)
|
||||
native (Run natively without docker)
|
||||
`)
|
||||
|
||||
for _, ff := range dockerfiles {
|
||||
fmt.Fprintf(os.Stderr, " %s\n", strings.TrimSuffix(ff.Name(), `.Dockerfile`))
|
||||
}
|
||||
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
// getDockerRunArgsForGlob returns a []string array of all the {busywork} arguments
|
||||
// for a `docker {run -e -v ...} go build` command.
|
||||
// It does glob matching for the target container, and builds it if it does not yet exist.
|
||||
func getDockerRunArgsForGlob(dockerfiles []fs.DirEntry, containerNameGlob string, isatty bool) ([]string, error) {
|
||||
|
||||
requestEnvironment := glob2regex(containerNameGlob)
|
||||
var match string
|
||||
for _, ff := range dockerfiles {
|
||||
if !requestEnvironment.MatchString(ff.Name()) {
|
||||
continue
|
||||
}
|
||||
|
||||
match = ff.Name()
|
||||
// continue searching for a later match with higher version number
|
||||
}
|
||||
|
||||
if match == "" {
|
||||
return nil, fmt.Errorf("No available environment matches the request %q\n", containerNameGlob)
|
||||
}
|
||||
|
||||
if !(match == os.Args[1] || match == os.Args[1]+`.Dockerfile`) {
|
||||
// An inexact/glob match was involved. Show what it was
|
||||
log.Printf("Selecting dockerfile: %s", match)
|
||||
}
|
||||
|
||||
dockerFileContent, err := docker.ReadFile(match)
|
||||
if err != nil {
|
||||
return nil, err // shouldn't happen
|
||||
}
|
||||
|
||||
dockerfileHash := shasum(dockerFileContent)[:8] // First 8 characters of content hash
|
||||
|
||||
// Check to see if this dockerfile has already been turned into an image
|
||||
|
||||
containerName := `miqt-docker/` + strings.TrimSuffix(match, `.Dockerfile`)
|
||||
|
||||
_, err = dockerFindImage(containerName, dockerfileHash)
|
||||
if err != nil {
|
||||
if err != os.ErrNotExist {
|
||||
return nil, err // real error
|
||||
}
|
||||
|
||||
log.Printf("No matching docker image, creating...")
|
||||
err = dockerBuild(dockerFileContent, containerName, dockerfileHash)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Search again
|
||||
_, err = dockerFindImage(containerName, dockerfileHash)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Failed to build container for %s:%s: %w", containerName, dockerfileHash, err) // Any error now is a real error
|
||||
}
|
||||
}
|
||||
|
||||
// Container match found - clean up older containers for the same tag
|
||||
|
||||
allContainers, err := dockerListImages()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
for _, ctr := range allContainers {
|
||||
if ctr.Repository == containerName &&
|
||||
!(ctr.Tag == dockerfileHash || ctr.Tag == "latest") {
|
||||
log.Printf("Removing previous version container %s:%s ...", containerName, ctr.Tag)
|
||||
rmCmd := dockerCommand(`image`, `rm`, containerName+`:`+ctr.Tag)
|
||||
rmCmd.Stdout = os.Stdout
|
||||
rmCmd.Stderr = os.Stderr
|
||||
err = rmCmd.Run()
|
||||
if err != nil {
|
||||
log.Printf("Warning: Failed to remove previous container: %v", err.Error())
|
||||
// log and continue
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Container match found - safe to run our command
|
||||
|
||||
fullCommand := []string{"run",
|
||||
"--rm", // Delete container after execution
|
||||
"--init", // Handle signals for multiple processes
|
||||
"-i", // Interactive (supports stdin)
|
||||
}
|
||||
|
||||
if isatty {
|
||||
fullCommand = append(fullCommand, "-t")
|
||||
}
|
||||
|
||||
if runtime.GOOS != "windows" {
|
||||
userinfo, err := user.Current()
|
||||
if err != nil {
|
||||
log.Panic(err)
|
||||
}
|
||||
|
||||
fullCommand = append(fullCommand, `--user`, userinfo.Uid+`:`+userinfo.Gid)
|
||||
}
|
||||
|
||||
// Find the GOMODCACHE and GOCACHE to populate mapped volumes
|
||||
gomodcache, err := exec.Command(`go`, `env`, `GOMODCACHE`).Output()
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Finding GOMODCACHE: %w", err)
|
||||
}
|
||||
if gomodcache_sz := strings.TrimSpace(string(gomodcache)); len(gomodcache_sz) > 0 {
|
||||
_ = os.MkdirAll(gomodcache_sz, 0755) // Might not exist if no Go modules have been used yet
|
||||
|
||||
fullCommand = append(fullCommand, `-v`, gomodcache_sz+`:/go/pkg/mod`, `-e`, `GOMODCACHE=/go/pkg/mod`)
|
||||
}
|
||||
|
||||
gocache, err := exec.Command(`go`, `env`, `GOCACHE`).Output()
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Finding GOCACHE: %w", err)
|
||||
}
|
||||
if gocache_sz := strings.TrimSpace(string(gocache)); len(gocache_sz) > 0 {
|
||||
_ = os.MkdirAll(gocache_sz, 0755) // Might not exist if no Go packages have been built yet
|
||||
|
||||
fullCommand = append(fullCommand, `-v`, gocache_sz+`:/.cache/go-build`, `-e`, `GOCACHE=/.cache/go-build`)
|
||||
}
|
||||
|
||||
// We need to bind-mount probably not just the current working directory,
|
||||
// but upwards to the root git repo / go.mod file / go.work file (whichever
|
||||
// is highest)
|
||||
|
||||
var parentPaths []string
|
||||
gomod, err := exec.Command(`go`, `env`, `GOMOD`).Output()
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Finding GOMOD: %w", err)
|
||||
}
|
||||
if gomod_sz := strings.TrimSpace(string(gomod)); len(gomod_sz) > 0 {
|
||||
parentPaths = append(parentPaths, gomod_sz)
|
||||
}
|
||||
|
||||
gowork, err := exec.Command(`go`, `env`, `GOWORK`).Output()
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Finding GOWORK: %w", err)
|
||||
}
|
||||
if gowork_sz := strings.TrimSpace(string(gowork)); len(gowork_sz) > 0 {
|
||||
parentPaths = append(parentPaths, gowork_sz)
|
||||
}
|
||||
|
||||
gitroot, err := exec.Command(`git`, `rev-parse`, `--show-toplevel`).Output()
|
||||
if err != nil {
|
||||
// Maybe this isn't a git repository? Git is optional anyway, there are hg/bzr users
|
||||
// Don't panic
|
||||
} else {
|
||||
if gitroot_sz := strings.TrimSpace(string(gitroot)); len(gitroot_sz) > 0 {
|
||||
parentPaths = append(parentPaths, gitroot_sz)
|
||||
}
|
||||
}
|
||||
|
||||
cwd, err := os.Getwd()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
parentPaths = append(parentPaths, cwd) // It's an option too
|
||||
|
||||
basedir, err := highestCommonParent(parentPaths)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
relCwd, err := filepath.Rel(basedir, cwd)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Don't mount directly on /src , otherwise -android-build will not know
|
||||
// the package name for top-level builds. Use a subfolder within it
|
||||
mountDir := `/src/` + filepath.Base(cwd)
|
||||
|
||||
if runtime.GOOS == "windows" {
|
||||
// convert C:\foo\bar paths to /c/foo/bar that Docker understands
|
||||
// Otherwise, you experience "invalid mode" when the : is parsed
|
||||
basedir = `/` + strings.ToLower(string(basedir[0])) + `/` + strings.ReplaceAll(basedir[3:], `\`, `/`)
|
||||
|
||||
// Always forwardslashes for in-docker paths, even on Windows OS
|
||||
mountDir = strings.ReplaceAll(mountDir, `\`, `/`)
|
||||
}
|
||||
|
||||
fullCommand = append(fullCommand,
|
||||
`-v`, basedir+`:`+mountDir,
|
||||
`-w`, path.Join(mountDir, relCwd),
|
||||
|
||||
// Final standard docker commands
|
||||
`-e`, `HOME=/tmp`,
|
||||
containerName+`:`+dockerfileHash,
|
||||
)
|
||||
|
||||
return fullCommand, nil
|
||||
}
|
||||
|
||||
func main() {
|
||||
|
||||
dockerfiles, err := docker.Dockerfiles.ReadDir(`.`)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
if len(os.Args) < 3 {
|
||||
usage(dockerfiles)
|
||||
}
|
||||
|
||||
taskArgs, taskOp, taskAllowTty, err := evaluateTask(os.Args[2:])
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
var cmd *exec.Cmd
|
||||
if os.Args[1] == "native" {
|
||||
|
||||
if taskArgs[0] == `/bin/bash` && runtime.GOOS == "windows" {
|
||||
log.Fatal("This command can't be used in 'native' mode on Windows.")
|
||||
}
|
||||
|
||||
cmd = exec.Command(taskArgs[0], taskArgs[1:]...) // n.b. [1:] may be an empty slice
|
||||
|
||||
} else {
|
||||
dockerArgs, err := getDockerRunArgsForGlob(dockerfiles, os.Args[1], taskAllowTty && isatty())
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
dockerArgs = append(dockerArgs, taskArgs...)
|
||||
cmd = dockerCommand(dockerArgs...)
|
||||
}
|
||||
|
||||
cmd.Stdin = os.Stdin
|
||||
cmd.Stderr = os.Stderr
|
||||
cmd.Stdout = os.Stdout
|
||||
taskOp(cmd)
|
||||
err = cmd.Run()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
@ -1,77 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"embed"
|
||||
"errors"
|
||||
"fmt"
|
||||
"os/exec"
|
||||
)
|
||||
|
||||
//go:embed android-build.sh
|
||||
var embedAndroidBuildSh []byte
|
||||
|
||||
var _ embed.FS // Workaround to allow import of package `embed`
|
||||
|
||||
// evaluateTask turns the supplied process arguments into real arguments to
|
||||
// execute, handling quick command recipes as well as arbitrary execution
|
||||
func evaluateTask(taskArgs []string) (retArgs []string, fixup func(*exec.Cmd), allowTty bool, err error) {
|
||||
|
||||
if len(taskArgs) == 0 {
|
||||
return nil, nil, false, errors.New("No task specified")
|
||||
}
|
||||
|
||||
if len(taskArgs[0]) == 0 {
|
||||
return nil, nil, false, errors.New("Empty-string first command")
|
||||
}
|
||||
|
||||
// Set up defaults
|
||||
|
||||
retArgs = []string{}
|
||||
fixup = func(*exec.Cmd) {} // no-op
|
||||
allowTty = true
|
||||
|
||||
//
|
||||
|
||||
stdinFrom := func(stdinBytes []byte) func(*exec.Cmd) {
|
||||
return func(c *exec.Cmd) {
|
||||
c.Stdin = bytes.NewReader(stdinBytes)
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
if taskArgs[0][0] != '-' {
|
||||
// Task does not start with a hyphen = plain command
|
||||
retArgs = taskArgs
|
||||
return
|
||||
}
|
||||
|
||||
switch taskArgs[0] {
|
||||
case `-build`:
|
||||
retArgs = []string{"go", "build", "-ldflags", "-s -w"}
|
||||
retArgs = append(retArgs, taskArgs[1:]...)
|
||||
return
|
||||
|
||||
case `-windows-build`:
|
||||
retArgs = []string{"go", "build", "-ldflags", "-s -w -H windowsgui"}
|
||||
retArgs = append(retArgs, taskArgs[1:]...)
|
||||
return
|
||||
|
||||
case `-minify-build`:
|
||||
// @ref https://github.com/mappu/miqt/issues/147#issuecomment-2800331135
|
||||
retArgs = []string{`/bin/bash`, `-c`, "CGO_CFLAGS='-Os -ffunction-sections -fdata-sections -flto=auto' CGO_CXXFLAGS='-Os -ffunction-sections -fdata-sections -flto=auto' CGO_LDFLAGS='-Wl,--gc-sections -flto=auto -fwhole-program' go build -ldflags '-s -w'"}
|
||||
retArgs = append(retArgs, taskArgs[1:]...)
|
||||
return
|
||||
|
||||
case `-android-build`:
|
||||
retArgs = []string{"/bin/bash", "-s"}
|
||||
retArgs = append(retArgs, taskArgs[1:]...)
|
||||
fixup = stdinFrom(embedAndroidBuildSh)
|
||||
allowTty = false
|
||||
return
|
||||
|
||||
default:
|
||||
return nil, nil, false, fmt.Errorf("Unrecognized task %q", taskArgs[0])
|
||||
}
|
||||
}
|
81
cmd/miqt-uic/testdata/qt5_dialog.ui
vendored
@ -1,81 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Dialog</class>
|
||||
<widget class="QDialog" name="Dialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Dialog</string>
|
||||
</property>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>30</x>
|
||||
<y>240</y>
|
||||
<width>341</width>
|
||||
<height>32</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>20</x>
|
||||
<y>20</y>
|
||||
<width>171</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>QDialog as base class</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>Dialog</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>248</x>
|
||||
<y>254</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>157</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>Dialog</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>316</x>
|
||||
<y>260</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>286</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
45
cmd/miqt-uic/testdata/qt5_dialog.ui.go.expected
vendored
@ -1,45 +0,0 @@
|
||||
// Generated by miqt-uic. To update this file, edit the .ui file in
|
||||
// Qt Designer, and then run 'go generate'.
|
||||
//
|
||||
//go:generate miqt-uic go_generate_args
|
||||
|
||||
package test_package_name
|
||||
|
||||
import (
|
||||
"github.com/mappu/miqt/qt"
|
||||
)
|
||||
|
||||
type DialogUi struct {
|
||||
Dialog *qt.QDialog
|
||||
buttonBox *qt.QDialogButtonBox
|
||||
label *qt.QLabel
|
||||
}
|
||||
|
||||
// NewDialogUi creates all Qt widget classes for Dialog.
|
||||
func NewDialogUi() *DialogUi {
|
||||
ui := &DialogUi{}
|
||||
ui.Dialog = qt.NewQDialog(nil)
|
||||
ui.Dialog.SetObjectName("Dialog")
|
||||
ui.Dialog.Resize(400, 300)
|
||||
ui.buttonBox = qt.NewQDialogButtonBox(ui.Dialog.QWidget)
|
||||
ui.buttonBox.SetObjectName("buttonBox")
|
||||
ui.buttonBox.SetGeometry(qt.NewQRect(30, 240, 341, 32))
|
||||
ui.buttonBox.SetOrientation(qt.Horizontal)
|
||||
ui.buttonBox.SetStandardButtons(qt.QDialogButtonBox__Cancel | qt.QDialogButtonBox__Ok)
|
||||
ui.label = qt.NewQLabel(ui.Dialog.QWidget)
|
||||
ui.label.SetObjectName("label")
|
||||
ui.label.SetGeometry(qt.NewQRect(20, 20, 171, 31))
|
||||
|
||||
ui.buttonBox.OnAccepted(ui.Dialog.Accept)
|
||||
ui.buttonBox.OnRejected(ui.Dialog.Reject)
|
||||
|
||||
ui.Retranslate()
|
||||
|
||||
return ui
|
||||
}
|
||||
|
||||
// Retranslate reapplies all text translations.
|
||||
func (ui *DialogUi) Retranslate() {
|
||||
ui.Dialog.SetWindowTitle(qt.QCoreApplication_Tr("Dialog"))
|
||||
ui.label.SetText(qt.QDialog_Tr("QDialog as base class"))
|
||||
}
|
45
cmd/miqt-uic/testdata/qt5_mainwindow_button.ui
vendored
@ -1,45 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>MainWindow</class>
|
||||
<widget class="QMainWindow" name="MainWindow">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>600</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>MainWindow</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralwidget">
|
||||
<widget class="QPushButton" name="pushButton">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>20</x>
|
||||
<y>20</y>
|
||||
<width>84</width>
|
||||
<height>33</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>PushButton</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QMenuBar" name="menubar">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>29</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QStatusBar" name="statusbar"/>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
@ -1,49 +0,0 @@
|
||||
// Generated by miqt-uic. To update this file, edit the .ui file in
|
||||
// Qt Designer, and then run 'go generate'.
|
||||
//
|
||||
//go:generate miqt-uic go_generate_args
|
||||
|
||||
package test_package_name
|
||||
|
||||
import (
|
||||
"github.com/mappu/miqt/qt"
|
||||
)
|
||||
|
||||
type MainWindowUi struct {
|
||||
MainWindow *qt.QMainWindow
|
||||
centralwidget *qt.QWidget
|
||||
pushButton *qt.QPushButton
|
||||
menubar *qt.QMenuBar
|
||||
statusbar *qt.QStatusBar
|
||||
}
|
||||
|
||||
// NewMainWindowUi creates all Qt widget classes for MainWindow.
|
||||
func NewMainWindowUi() *MainWindowUi {
|
||||
ui := &MainWindowUi{}
|
||||
ui.MainWindow = qt.NewQMainWindow(nil)
|
||||
ui.MainWindow.SetObjectName("MainWindow")
|
||||
ui.MainWindow.Resize(800, 600)
|
||||
ui.centralwidget = qt.NewQWidget(ui.MainWindow.QWidget)
|
||||
ui.centralwidget.SetObjectName("centralwidget")
|
||||
ui.pushButton = qt.NewQPushButton(ui.centralwidget)
|
||||
ui.pushButton.SetObjectName("pushButton")
|
||||
ui.pushButton.SetGeometry(qt.NewQRect(20, 20, 84, 33))
|
||||
ui.MainWindow.SetCentralWidget(ui.centralwidget) // Set central widget
|
||||
ui.menubar = qt.NewQMenuBar(ui.MainWindow.QWidget)
|
||||
ui.menubar.SetObjectName("menubar")
|
||||
ui.menubar.Resize(800, 29)
|
||||
ui.MainWindow.SetMenuBar(ui.menubar)
|
||||
ui.statusbar = qt.NewQStatusBar(ui.MainWindow.QWidget)
|
||||
ui.statusbar.SetObjectName("statusbar")
|
||||
ui.MainWindow.SetStatusBar(ui.statusbar)
|
||||
|
||||
ui.Retranslate()
|
||||
|
||||
return ui
|
||||
}
|
||||
|
||||
// Retranslate reapplies all text translations.
|
||||
func (ui *MainWindowUi) Retranslate() {
|
||||
ui.MainWindow.SetWindowTitle(qt.QCoreApplication_Tr("MainWindow"))
|
||||
ui.pushButton.SetText(qt.QWidget_Tr("PushButton"))
|
||||
}
|
@ -1,62 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>MainWindow</class>
|
||||
<widget class="QMainWindow" name="MainWindow">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>600</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>MainWindow</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralwidget">
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QPushButton" name="pushButton_2">
|
||||
<property name="text">
|
||||
<string>top left</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QPushButton" name="pushButton">
|
||||
<property name="text">
|
||||
<string>top right</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QPushButton" name="pushButton_3">
|
||||
<property name="text">
|
||||
<string>bottom left</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QPushButton" name="pushButton_4">
|
||||
<property name="text">
|
||||
<string>bottom right</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QMenuBar" name="menubar">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>29</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QStatusBar" name="statusbar"/>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
@ -1,73 +0,0 @@
|
||||
// Generated by miqt-uic. To update this file, edit the .ui file in
|
||||
// Qt Designer, and then run 'go generate'.
|
||||
//
|
||||
//go:generate miqt-uic go_generate_args
|
||||
|
||||
package test_package_name
|
||||
|
||||
import (
|
||||
"github.com/mappu/miqt/qt"
|
||||
)
|
||||
|
||||
type MainWindowUi struct {
|
||||
MainWindow *qt.QMainWindow
|
||||
centralwidget *qt.QWidget
|
||||
gridLayout *qt.QGridLayout
|
||||
pushButton_2 *qt.QPushButton
|
||||
pushButton *qt.QPushButton
|
||||
pushButton_3 *qt.QPushButton
|
||||
pushButton_4 *qt.QPushButton
|
||||
menubar *qt.QMenuBar
|
||||
statusbar *qt.QStatusBar
|
||||
}
|
||||
|
||||
// NewMainWindowUi creates all Qt widget classes for MainWindow.
|
||||
func NewMainWindowUi() *MainWindowUi {
|
||||
ui := &MainWindowUi{}
|
||||
ui.MainWindow = qt.NewQMainWindow(nil)
|
||||
ui.MainWindow.SetObjectName("MainWindow")
|
||||
ui.MainWindow.Resize(800, 600)
|
||||
ui.centralwidget = qt.NewQWidget(ui.MainWindow.QWidget)
|
||||
ui.centralwidget.SetObjectName("centralwidget")
|
||||
ui.gridLayout = qt.NewQGridLayout(ui.centralwidget)
|
||||
ui.gridLayout.SetObjectName("gridLayout")
|
||||
ui.gridLayout.SetContentsMargins(11, 11, 11, 11)
|
||||
ui.gridLayout.SetSpacing(6)
|
||||
ui.pushButton_2 = qt.NewQPushButton(ui.centralwidget)
|
||||
ui.pushButton_2.SetObjectName("pushButton_2")
|
||||
|
||||
ui.gridLayout.AddWidget2(ui.pushButton_2.QWidget, 0, 0)
|
||||
ui.pushButton = qt.NewQPushButton(ui.centralwidget)
|
||||
ui.pushButton.SetObjectName("pushButton")
|
||||
|
||||
ui.gridLayout.AddWidget2(ui.pushButton.QWidget, 0, 1)
|
||||
ui.pushButton_3 = qt.NewQPushButton(ui.centralwidget)
|
||||
ui.pushButton_3.SetObjectName("pushButton_3")
|
||||
|
||||
ui.gridLayout.AddWidget2(ui.pushButton_3.QWidget, 1, 0)
|
||||
ui.pushButton_4 = qt.NewQPushButton(ui.centralwidget)
|
||||
ui.pushButton_4.SetObjectName("pushButton_4")
|
||||
|
||||
ui.gridLayout.AddWidget2(ui.pushButton_4.QWidget, 1, 1)
|
||||
ui.MainWindow.SetCentralWidget(ui.centralwidget) // Set central widget
|
||||
ui.menubar = qt.NewQMenuBar(ui.MainWindow.QWidget)
|
||||
ui.menubar.SetObjectName("menubar")
|
||||
ui.menubar.Resize(800, 29)
|
||||
ui.MainWindow.SetMenuBar(ui.menubar)
|
||||
ui.statusbar = qt.NewQStatusBar(ui.MainWindow.QWidget)
|
||||
ui.statusbar.SetObjectName("statusbar")
|
||||
ui.MainWindow.SetStatusBar(ui.statusbar)
|
||||
|
||||
ui.Retranslate()
|
||||
|
||||
return ui
|
||||
}
|
||||
|
||||
// Retranslate reapplies all text translations.
|
||||
func (ui *MainWindowUi) Retranslate() {
|
||||
ui.MainWindow.SetWindowTitle(qt.QCoreApplication_Tr("MainWindow"))
|
||||
ui.pushButton_2.SetText(qt.QWidget_Tr("top left"))
|
||||
ui.pushButton.SetText(qt.QWidget_Tr("top right"))
|
||||
ui.pushButton_3.SetText(qt.QWidget_Tr("bottom left"))
|
||||
ui.pushButton_4.SetText(qt.QWidget_Tr("bottom right"))
|
||||
}
|
48
cmd/miqt-uic/testdata/qt5_mainwindow_hlayout.ui
vendored
@ -1,48 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>MainWindow</class>
|
||||
<widget class="QMainWindow" name="MainWindow">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>600</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>MainWindow</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralwidget">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_2">
|
||||
<property name="text">
|
||||
<string>PushButton</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton">
|
||||
<property name="text">
|
||||
<string>PushButton</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QMenuBar" name="menubar">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>29</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QStatusBar" name="statusbar"/>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
@ -1,61 +0,0 @@
|
||||
// Generated by miqt-uic. To update this file, edit the .ui file in
|
||||
// Qt Designer, and then run 'go generate'.
|
||||
//
|
||||
//go:generate miqt-uic go_generate_args
|
||||
|
||||
package test_package_name
|
||||
|
||||
import (
|
||||
"github.com/mappu/miqt/qt"
|
||||
)
|
||||
|
||||
type MainWindowUi struct {
|
||||
MainWindow *qt.QMainWindow
|
||||
centralwidget *qt.QWidget
|
||||
horizontalLayout *qt.QHBoxLayout
|
||||
pushButton_2 *qt.QPushButton
|
||||
pushButton *qt.QPushButton
|
||||
menubar *qt.QMenuBar
|
||||
statusbar *qt.QStatusBar
|
||||
}
|
||||
|
||||
// NewMainWindowUi creates all Qt widget classes for MainWindow.
|
||||
func NewMainWindowUi() *MainWindowUi {
|
||||
ui := &MainWindowUi{}
|
||||
ui.MainWindow = qt.NewQMainWindow(nil)
|
||||
ui.MainWindow.SetObjectName("MainWindow")
|
||||
ui.MainWindow.Resize(800, 600)
|
||||
ui.centralwidget = qt.NewQWidget(ui.MainWindow.QWidget)
|
||||
ui.centralwidget.SetObjectName("centralwidget")
|
||||
ui.horizontalLayout = qt.NewQHBoxLayout(ui.centralwidget)
|
||||
ui.horizontalLayout.SetObjectName("horizontalLayout")
|
||||
ui.horizontalLayout.SetContentsMargins(11, 11, 11, 11)
|
||||
ui.horizontalLayout.SetSpacing(6)
|
||||
ui.pushButton_2 = qt.NewQPushButton(ui.centralwidget)
|
||||
ui.pushButton_2.SetObjectName("pushButton_2")
|
||||
|
||||
ui.horizontalLayout.AddWidget(ui.pushButton_2.QWidget)
|
||||
ui.pushButton = qt.NewQPushButton(ui.centralwidget)
|
||||
ui.pushButton.SetObjectName("pushButton")
|
||||
|
||||
ui.horizontalLayout.AddWidget(ui.pushButton.QWidget)
|
||||
ui.MainWindow.SetCentralWidget(ui.centralwidget) // Set central widget
|
||||
ui.menubar = qt.NewQMenuBar(ui.MainWindow.QWidget)
|
||||
ui.menubar.SetObjectName("menubar")
|
||||
ui.menubar.Resize(800, 29)
|
||||
ui.MainWindow.SetMenuBar(ui.menubar)
|
||||
ui.statusbar = qt.NewQStatusBar(ui.MainWindow.QWidget)
|
||||
ui.statusbar.SetObjectName("statusbar")
|
||||
ui.MainWindow.SetStatusBar(ui.statusbar)
|
||||
|
||||
ui.Retranslate()
|
||||
|
||||
return ui
|
||||
}
|
||||
|
||||
// Retranslate reapplies all text translations.
|
||||
func (ui *MainWindowUi) Retranslate() {
|
||||
ui.MainWindow.SetWindowTitle(qt.QCoreApplication_Tr("MainWindow"))
|
||||
ui.pushButton_2.SetText(qt.QWidget_Tr("PushButton"))
|
||||
ui.pushButton.SetText(qt.QWidget_Tr("PushButton"))
|
||||
}
|
47
cmd/miqt-uic/testdata/qt5_mainwindow_hspacer.ui
vendored
@ -1,47 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>MainWindow</class>
|
||||
<widget class="QMainWindow" name="MainWindow">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>600</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>MainWindow</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralwidget">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>785</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QMenuBar" name="menubar">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>29</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QStatusBar" name="statusbar"/>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
@ -1,53 +0,0 @@
|
||||
// Generated by miqt-uic. To update this file, edit the .ui file in
|
||||
// Qt Designer, and then run 'go generate'.
|
||||
//
|
||||
//go:generate miqt-uic go_generate_args
|
||||
|
||||
package test_package_name
|
||||
|
||||
import (
|
||||
"github.com/mappu/miqt/qt"
|
||||
)
|
||||
|
||||
type MainWindowUi struct {
|
||||
MainWindow *qt.QMainWindow
|
||||
centralwidget *qt.QWidget
|
||||
verticalLayout *qt.QVBoxLayout
|
||||
horizontalSpacer *qt.QSpacerItem
|
||||
menubar *qt.QMenuBar
|
||||
statusbar *qt.QStatusBar
|
||||
}
|
||||
|
||||
// NewMainWindowUi creates all Qt widget classes for MainWindow.
|
||||
func NewMainWindowUi() *MainWindowUi {
|
||||
ui := &MainWindowUi{}
|
||||
ui.MainWindow = qt.NewQMainWindow(nil)
|
||||
ui.MainWindow.SetObjectName("MainWindow")
|
||||
ui.MainWindow.Resize(800, 600)
|
||||
ui.centralwidget = qt.NewQWidget(ui.MainWindow.QWidget)
|
||||
ui.centralwidget.SetObjectName("centralwidget")
|
||||
ui.verticalLayout = qt.NewQVBoxLayout(ui.centralwidget)
|
||||
ui.verticalLayout.SetObjectName("verticalLayout")
|
||||
ui.verticalLayout.SetContentsMargins(11, 11, 11, 11)
|
||||
ui.verticalLayout.SetSpacing(6)
|
||||
ui.horizontalSpacer = qt.NewQSpacerItem4(785, 20, qt.QSizePolicy__Expanding, qt.QSizePolicy__Minimum)
|
||||
|
||||
ui.verticalLayout.AddItem(ui.horizontalSpacer.QLayoutItem)
|
||||
ui.MainWindow.SetCentralWidget(ui.centralwidget) // Set central widget
|
||||
ui.menubar = qt.NewQMenuBar(ui.MainWindow.QWidget)
|
||||
ui.menubar.SetObjectName("menubar")
|
||||
ui.menubar.Resize(800, 29)
|
||||
ui.MainWindow.SetMenuBar(ui.menubar)
|
||||
ui.statusbar = qt.NewQStatusBar(ui.MainWindow.QWidget)
|
||||
ui.statusbar.SetObjectName("statusbar")
|
||||
ui.MainWindow.SetStatusBar(ui.statusbar)
|
||||
|
||||
ui.Retranslate()
|
||||
|
||||
return ui
|
||||
}
|
||||
|
||||
// Retranslate reapplies all text translations.
|
||||
func (ui *MainWindowUi) Retranslate() {
|
||||
ui.MainWindow.SetWindowTitle(qt.QCoreApplication_Tr("MainWindow"))
|
||||
}
|
@ -1,45 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>MainWindow</class>
|
||||
<widget class="QMainWindow" name="MainWindow">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>600</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>MainWindow</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralwidget"/>
|
||||
<widget class="QMenuBar" name="menubar">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>29</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QStatusBar" name="statusbar"/>
|
||||
<action name="actionApplicationExit">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset theme="application-exit"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>ApplicationExit</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Custom Tooltip</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
@ -1,52 +0,0 @@
|
||||
// Generated by miqt-uic. To update this file, edit the .ui file in
|
||||
// Qt Designer, and then run 'go generate'.
|
||||
//
|
||||
//go:generate miqt-uic go_generate_args
|
||||
|
||||
package test_package_name
|
||||
|
||||
import (
|
||||
"github.com/mappu/miqt/qt"
|
||||
)
|
||||
|
||||
type MainWindowUi struct {
|
||||
MainWindow *qt.QMainWindow
|
||||
centralwidget *qt.QWidget
|
||||
menubar *qt.QMenuBar
|
||||
statusbar *qt.QStatusBar
|
||||
actionApplicationExit *qt.QAction
|
||||
}
|
||||
|
||||
// NewMainWindowUi creates all Qt widget classes for MainWindow.
|
||||
func NewMainWindowUi() *MainWindowUi {
|
||||
ui := &MainWindowUi{}
|
||||
ui.MainWindow = qt.NewQMainWindow(nil)
|
||||
ui.MainWindow.SetObjectName("MainWindow")
|
||||
ui.MainWindow.Resize(800, 600)
|
||||
ui.actionApplicationExit = qt.NewQAction()
|
||||
ui.actionApplicationExit.SetObjectName("actionApplicationExit")
|
||||
/* miqt-uic: no handler for QAction property 'checkable' */
|
||||
icon0 := qt.QIcon_FromTheme("application-exit")
|
||||
ui.actionApplicationExit.SetIcon(icon0)
|
||||
ui.centralwidget = qt.NewQWidget(ui.MainWindow.QWidget)
|
||||
ui.centralwidget.SetObjectName("centralwidget")
|
||||
ui.MainWindow.SetCentralWidget(ui.centralwidget) // Set central widget
|
||||
ui.menubar = qt.NewQMenuBar(ui.MainWindow.QWidget)
|
||||
ui.menubar.SetObjectName("menubar")
|
||||
ui.menubar.Resize(800, 29)
|
||||
ui.MainWindow.SetMenuBar(ui.menubar)
|
||||
ui.statusbar = qt.NewQStatusBar(ui.MainWindow.QWidget)
|
||||
ui.statusbar.SetObjectName("statusbar")
|
||||
ui.MainWindow.SetStatusBar(ui.statusbar)
|
||||
|
||||
ui.Retranslate()
|
||||
|
||||
return ui
|
||||
}
|
||||
|
||||
// Retranslate reapplies all text translations.
|
||||
func (ui *MainWindowUi) Retranslate() {
|
||||
ui.MainWindow.SetWindowTitle(qt.QCoreApplication_Tr("MainWindow"))
|
||||
ui.actionApplicationExit.SetText(qt.QMainWindow_Tr("ApplicationExit"))
|
||||
ui.actionApplicationExit.SetToolTip(qt.QMainWindow_Tr("Custom Tooltip"))
|
||||
}
|
56
cmd/miqt-uic/testdata/qt5_mainwindow_menu.ui
vendored
@ -1,56 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>MainWindow</class>
|
||||
<widget class="QMainWindow" name="MainWindow">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>600</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>MainWindow</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralwidget"/>
|
||||
<widget class="QMenuBar" name="menubar">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>29</height>
|
||||
</rect>
|
||||
</property>
|
||||
<widget class="QMenu" name="menu_File">
|
||||
<property name="title">
|
||||
<string>&File</string>
|
||||
</property>
|
||||
<addaction name="actionNew"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionE_xit"/>
|
||||
</widget>
|
||||
<addaction name="menu_File"/>
|
||||
</widget>
|
||||
<widget class="QStatusBar" name="statusbar"/>
|
||||
<action name="actionNew">
|
||||
<property name="text">
|
||||
<string>New...</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Custom Tooltip for New</string>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string>Ctrl+N</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionE_xit">
|
||||
<property name="text">
|
||||
<string>E&xit</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
@ -1,62 +0,0 @@
|
||||
// Generated by miqt-uic. To update this file, edit the .ui file in
|
||||
// Qt Designer, and then run 'go generate'.
|
||||
//
|
||||
//go:generate miqt-uic go_generate_args
|
||||
|
||||
package test_package_name
|
||||
|
||||
import (
|
||||
"github.com/mappu/miqt/qt"
|
||||
)
|
||||
|
||||
type MainWindowUi struct {
|
||||
MainWindow *qt.QMainWindow
|
||||
centralwidget *qt.QWidget
|
||||
menubar *qt.QMenuBar
|
||||
menu_File *qt.QMenu
|
||||
statusbar *qt.QStatusBar
|
||||
actionNew *qt.QAction
|
||||
actionE_xit *qt.QAction
|
||||
}
|
||||
|
||||
// NewMainWindowUi creates all Qt widget classes for MainWindow.
|
||||
func NewMainWindowUi() *MainWindowUi {
|
||||
ui := &MainWindowUi{}
|
||||
ui.MainWindow = qt.NewQMainWindow(nil)
|
||||
ui.MainWindow.SetObjectName("MainWindow")
|
||||
ui.MainWindow.Resize(800, 600)
|
||||
ui.actionNew = qt.NewQAction()
|
||||
ui.actionNew.SetObjectName("actionNew")
|
||||
ui.actionE_xit = qt.NewQAction()
|
||||
ui.actionE_xit.SetObjectName("actionE_xit")
|
||||
ui.centralwidget = qt.NewQWidget(ui.MainWindow.QWidget)
|
||||
ui.centralwidget.SetObjectName("centralwidget")
|
||||
ui.MainWindow.SetCentralWidget(ui.centralwidget) // Set central widget
|
||||
ui.menubar = qt.NewQMenuBar(ui.MainWindow.QWidget)
|
||||
ui.menubar.SetObjectName("menubar")
|
||||
ui.menubar.Resize(800, 29)
|
||||
ui.menu_File = qt.NewQMenu(ui.menubar.QWidget)
|
||||
ui.menu_File.SetObjectName("menu_File")
|
||||
ui.menu_File.QWidget.AddAction(ui.actionNew)
|
||||
ui.menu_File.AddSeparator()
|
||||
ui.menu_File.QWidget.AddAction(ui.actionE_xit)
|
||||
ui.menubar.AddMenu(ui.menu_File)
|
||||
ui.MainWindow.SetMenuBar(ui.menubar)
|
||||
ui.statusbar = qt.NewQStatusBar(ui.MainWindow.QWidget)
|
||||
ui.statusbar.SetObjectName("statusbar")
|
||||
ui.MainWindow.SetStatusBar(ui.statusbar)
|
||||
|
||||
ui.Retranslate()
|
||||
|
||||
return ui
|
||||
}
|
||||
|
||||
// Retranslate reapplies all text translations.
|
||||
func (ui *MainWindowUi) Retranslate() {
|
||||
ui.MainWindow.SetWindowTitle(qt.QCoreApplication_Tr("MainWindow"))
|
||||
ui.actionNew.SetText(qt.QMainWindow_Tr("New..."))
|
||||
ui.actionNew.SetToolTip(qt.QMainWindow_Tr("Custom Tooltip for New"))
|
||||
ui.actionNew.SetShortcut(qt.NewQKeySequence2(qt.QMainWindow_Tr("Ctrl+N")))
|
||||
ui.actionE_xit.SetText(qt.QMainWindow_Tr("E&xit"))
|
||||
ui.menu_File.SetTitle(qt.QMenuBar_Tr("&File"))
|
||||
}
|
@ -1,74 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>MainWindow</class>
|
||||
<widget class="QMainWindow" name="MainWindow">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>600</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>MainWindow</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralwidget">
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_2">
|
||||
<property name="text">
|
||||
<string>top left</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton">
|
||||
<property name="text">
|
||||
<string>top right</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_4">
|
||||
<property name="text">
|
||||
<string>bottom left</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_3">
|
||||
<property name="text">
|
||||
<string>bottom right</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QMenuBar" name="menubar">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>29</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QStatusBar" name="statusbar"/>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
@ -1,94 +0,0 @@
|
||||
// Generated by miqt-uic. To update this file, edit the .ui file in
|
||||
// Qt Designer, and then run 'go generate'.
|
||||
//
|
||||
//go:generate miqt-uic go_generate_args
|
||||
|
||||
package test_package_name
|
||||
|
||||
import (
|
||||
"github.com/mappu/miqt/qt"
|
||||
)
|
||||
|
||||
type MainWindowUi struct {
|
||||
MainWindow *qt.QMainWindow
|
||||
centralwidget *qt.QWidget
|
||||
gridLayout *qt.QGridLayout
|
||||
verticalLayout *qt.QVBoxLayout
|
||||
horizontalLayout *qt.QHBoxLayout
|
||||
pushButton_2 *qt.QPushButton
|
||||
pushButton *qt.QPushButton
|
||||
horizontalLayout_2 *qt.QHBoxLayout
|
||||
pushButton_4 *qt.QPushButton
|
||||
pushButton_3 *qt.QPushButton
|
||||
menubar *qt.QMenuBar
|
||||
statusbar *qt.QStatusBar
|
||||
}
|
||||
|
||||
// NewMainWindowUi creates all Qt widget classes for MainWindow.
|
||||
func NewMainWindowUi() *MainWindowUi {
|
||||
ui := &MainWindowUi{}
|
||||
ui.MainWindow = qt.NewQMainWindow(nil)
|
||||
ui.MainWindow.SetObjectName("MainWindow")
|
||||
ui.MainWindow.Resize(800, 600)
|
||||
ui.centralwidget = qt.NewQWidget(ui.MainWindow.QWidget)
|
||||
ui.centralwidget.SetObjectName("centralwidget")
|
||||
ui.gridLayout = qt.NewQGridLayout(ui.centralwidget)
|
||||
ui.gridLayout.SetObjectName("gridLayout")
|
||||
ui.gridLayout.SetContentsMargins(11, 11, 11, 11)
|
||||
ui.gridLayout.SetSpacing(6)
|
||||
ui.verticalLayout = qt.NewQVBoxLayout2()
|
||||
ui.verticalLayout.SetObjectName("verticalLayout")
|
||||
ui.verticalLayout.SetContentsMargins(11, 11, 11, 11)
|
||||
ui.verticalLayout.SetSpacing(6)
|
||||
ui.horizontalLayout = qt.NewQHBoxLayout2()
|
||||
ui.horizontalLayout.SetObjectName("horizontalLayout")
|
||||
ui.horizontalLayout.SetContentsMargins(11, 11, 11, 11)
|
||||
ui.horizontalLayout.SetSpacing(6)
|
||||
ui.pushButton_2 = qt.NewQPushButton(ui.centralwidget)
|
||||
ui.pushButton_2.SetObjectName("pushButton_2")
|
||||
|
||||
ui.horizontalLayout.AddWidget(ui.pushButton_2.QWidget)
|
||||
ui.pushButton = qt.NewQPushButton(ui.centralwidget)
|
||||
ui.pushButton.SetObjectName("pushButton")
|
||||
|
||||
ui.horizontalLayout.AddWidget(ui.pushButton.QWidget)
|
||||
|
||||
ui.verticalLayout.AddLayout(ui.horizontalLayout.QLayout)
|
||||
ui.horizontalLayout_2 = qt.NewQHBoxLayout2()
|
||||
ui.horizontalLayout_2.SetObjectName("horizontalLayout_2")
|
||||
ui.horizontalLayout_2.SetContentsMargins(11, 11, 11, 11)
|
||||
ui.horizontalLayout_2.SetSpacing(6)
|
||||
ui.pushButton_4 = qt.NewQPushButton(ui.centralwidget)
|
||||
ui.pushButton_4.SetObjectName("pushButton_4")
|
||||
|
||||
ui.horizontalLayout_2.AddWidget(ui.pushButton_4.QWidget)
|
||||
ui.pushButton_3 = qt.NewQPushButton(ui.centralwidget)
|
||||
ui.pushButton_3.SetObjectName("pushButton_3")
|
||||
|
||||
ui.horizontalLayout_2.AddWidget(ui.pushButton_3.QWidget)
|
||||
|
||||
ui.verticalLayout.AddLayout(ui.horizontalLayout_2.QLayout)
|
||||
|
||||
ui.gridLayout.AddLayout(ui.verticalLayout.QLayout, 0, 0)
|
||||
ui.MainWindow.SetCentralWidget(ui.centralwidget) // Set central widget
|
||||
ui.menubar = qt.NewQMenuBar(ui.MainWindow.QWidget)
|
||||
ui.menubar.SetObjectName("menubar")
|
||||
ui.menubar.Resize(800, 29)
|
||||
ui.MainWindow.SetMenuBar(ui.menubar)
|
||||
ui.statusbar = qt.NewQStatusBar(ui.MainWindow.QWidget)
|
||||
ui.statusbar.SetObjectName("statusbar")
|
||||
ui.MainWindow.SetStatusBar(ui.statusbar)
|
||||
|
||||
ui.Retranslate()
|
||||
|
||||
return ui
|
||||
}
|
||||
|
||||
// Retranslate reapplies all text translations.
|
||||
func (ui *MainWindowUi) Retranslate() {
|
||||
ui.MainWindow.SetWindowTitle(qt.QCoreApplication_Tr("MainWindow"))
|
||||
ui.pushButton_2.SetText(qt.QWidget_Tr("top left"))
|
||||
ui.pushButton.SetText(qt.QWidget_Tr("top right"))
|
||||
ui.pushButton_4.SetText(qt.QWidget_Tr("bottom left"))
|
||||
ui.pushButton_3.SetText(qt.QWidget_Tr("bottom right"))
|
||||
}
|
102
cmd/miqt-uic/testdata/qt5_mainwindow_tabs.ui
vendored
@ -1,102 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>MainWindow</class>
|
||||
<widget class="QMainWindow" name="MainWindow">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>600</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>MainWindow</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralwidget">
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="1" column="0">
|
||||
<widget class="QTabWidget" name="tabWidget_3">
|
||||
<property name="tabPosition">
|
||||
<enum>QTabWidget::West</enum>
|
||||
</property>
|
||||
<widget class="QWidget" name="tab_5">
|
||||
<attribute name="title">
|
||||
<string>Tab 1</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_6">
|
||||
<attribute name="title">
|
||||
<string>Tab 2</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QTabWidget" name="tabWidget">
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="tab">
|
||||
<attribute name="title">
|
||||
<string>First Tab</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_2">
|
||||
<attribute name="title">
|
||||
<string>Second Tab</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QTabWidget" name="tabWidget_2">
|
||||
<property name="tabPosition">
|
||||
<enum>QTabWidget::South</enum>
|
||||
</property>
|
||||
<widget class="QWidget" name="tab_3">
|
||||
<attribute name="title">
|
||||
<string>Tab 1</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_4">
|
||||
<attribute name="title">
|
||||
<string>Tab 2</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QTabWidget" name="tabWidget_4">
|
||||
<property name="tabPosition">
|
||||
<enum>QTabWidget::East</enum>
|
||||
</property>
|
||||
<widget class="QWidget" name="tab_7">
|
||||
<attribute name="title">
|
||||
<string>Tab 1</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_8">
|
||||
<attribute name="title">
|
||||
<string>Tab 2</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QMenuBar" name="menubar">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>29</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QStatusBar" name="statusbar"/>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
@ -1,114 +0,0 @@
|
||||
// Generated by miqt-uic. To update this file, edit the .ui file in
|
||||
// Qt Designer, and then run 'go generate'.
|
||||
//
|
||||
//go:generate miqt-uic go_generate_args
|
||||
|
||||
package test_package_name
|
||||
|
||||
import (
|
||||
"github.com/mappu/miqt/qt"
|
||||
)
|
||||
|
||||
type MainWindowUi struct {
|
||||
MainWindow *qt.QMainWindow
|
||||
centralwidget *qt.QWidget
|
||||
gridLayout *qt.QGridLayout
|
||||
tabWidget_3 *qt.QTabWidget
|
||||
tab_5 *qt.QWidget
|
||||
tab_6 *qt.QWidget
|
||||
tabWidget *qt.QTabWidget
|
||||
tab *qt.QWidget
|
||||
tab_2 *qt.QWidget
|
||||
tabWidget_2 *qt.QTabWidget
|
||||
tab_3 *qt.QWidget
|
||||
tab_4 *qt.QWidget
|
||||
tabWidget_4 *qt.QTabWidget
|
||||
tab_7 *qt.QWidget
|
||||
tab_8 *qt.QWidget
|
||||
menubar *qt.QMenuBar
|
||||
statusbar *qt.QStatusBar
|
||||
}
|
||||
|
||||
// NewMainWindowUi creates all Qt widget classes for MainWindow.
|
||||
func NewMainWindowUi() *MainWindowUi {
|
||||
ui := &MainWindowUi{}
|
||||
ui.MainWindow = qt.NewQMainWindow(nil)
|
||||
ui.MainWindow.SetObjectName("MainWindow")
|
||||
ui.MainWindow.Resize(800, 600)
|
||||
ui.centralwidget = qt.NewQWidget(ui.MainWindow.QWidget)
|
||||
ui.centralwidget.SetObjectName("centralwidget")
|
||||
ui.gridLayout = qt.NewQGridLayout(ui.centralwidget)
|
||||
ui.gridLayout.SetObjectName("gridLayout")
|
||||
ui.gridLayout.SetContentsMargins(11, 11, 11, 11)
|
||||
ui.gridLayout.SetSpacing(6)
|
||||
ui.tabWidget_3 = qt.NewQTabWidget(ui.centralwidget)
|
||||
ui.tabWidget_3.SetObjectName("tabWidget_3")
|
||||
ui.tabWidget_3.SetTabPosition(qt.QTabWidget__West)
|
||||
ui.tab_5 = qt.NewQWidget(ui.tabWidget_3.QWidget)
|
||||
ui.tab_5.SetObjectName("tab_5")
|
||||
ui.tabWidget_3.AddTab(ui.tab_5, "")
|
||||
ui.tab_6 = qt.NewQWidget(ui.tabWidget_3.QWidget)
|
||||
ui.tab_6.SetObjectName("tab_6")
|
||||
ui.tabWidget_3.AddTab(ui.tab_6, "")
|
||||
|
||||
ui.gridLayout.AddWidget2(ui.tabWidget_3.QWidget, 1, 0)
|
||||
ui.tabWidget = qt.NewQTabWidget(ui.centralwidget)
|
||||
ui.tabWidget.SetObjectName("tabWidget")
|
||||
ui.tab = qt.NewQWidget(ui.tabWidget.QWidget)
|
||||
ui.tab.SetObjectName("tab")
|
||||
ui.tabWidget.AddTab(ui.tab, "")
|
||||
ui.tab_2 = qt.NewQWidget(ui.tabWidget.QWidget)
|
||||
ui.tab_2.SetObjectName("tab_2")
|
||||
ui.tabWidget.AddTab(ui.tab_2, "")
|
||||
|
||||
ui.gridLayout.AddWidget2(ui.tabWidget.QWidget, 0, 1)
|
||||
ui.tabWidget_2 = qt.NewQTabWidget(ui.centralwidget)
|
||||
ui.tabWidget_2.SetObjectName("tabWidget_2")
|
||||
ui.tabWidget_2.SetTabPosition(qt.QTabWidget__South)
|
||||
ui.tab_3 = qt.NewQWidget(ui.tabWidget_2.QWidget)
|
||||
ui.tab_3.SetObjectName("tab_3")
|
||||
ui.tabWidget_2.AddTab(ui.tab_3, "")
|
||||
ui.tab_4 = qt.NewQWidget(ui.tabWidget_2.QWidget)
|
||||
ui.tab_4.SetObjectName("tab_4")
|
||||
ui.tabWidget_2.AddTab(ui.tab_4, "")
|
||||
|
||||
ui.gridLayout.AddWidget2(ui.tabWidget_2.QWidget, 2, 1)
|
||||
ui.tabWidget_4 = qt.NewQTabWidget(ui.centralwidget)
|
||||
ui.tabWidget_4.SetObjectName("tabWidget_4")
|
||||
ui.tabWidget_4.SetTabPosition(qt.QTabWidget__East)
|
||||
ui.tab_7 = qt.NewQWidget(ui.tabWidget_4.QWidget)
|
||||
ui.tab_7.SetObjectName("tab_7")
|
||||
ui.tabWidget_4.AddTab(ui.tab_7, "")
|
||||
ui.tab_8 = qt.NewQWidget(ui.tabWidget_4.QWidget)
|
||||
ui.tab_8.SetObjectName("tab_8")
|
||||
ui.tabWidget_4.AddTab(ui.tab_8, "")
|
||||
|
||||
ui.gridLayout.AddWidget2(ui.tabWidget_4.QWidget, 1, 2)
|
||||
ui.MainWindow.SetCentralWidget(ui.centralwidget) // Set central widget
|
||||
ui.menubar = qt.NewQMenuBar(ui.MainWindow.QWidget)
|
||||
ui.menubar.SetObjectName("menubar")
|
||||
ui.menubar.Resize(800, 29)
|
||||
ui.MainWindow.SetMenuBar(ui.menubar)
|
||||
ui.statusbar = qt.NewQStatusBar(ui.MainWindow.QWidget)
|
||||
ui.statusbar.SetObjectName("statusbar")
|
||||
ui.MainWindow.SetStatusBar(ui.statusbar)
|
||||
|
||||
ui.Retranslate()
|
||||
|
||||
ui.tabWidget.SetCurrentIndex(0)
|
||||
|
||||
return ui
|
||||
}
|
||||
|
||||
// Retranslate reapplies all text translations.
|
||||
func (ui *MainWindowUi) Retranslate() {
|
||||
ui.MainWindow.SetWindowTitle(qt.QCoreApplication_Tr("MainWindow"))
|
||||
ui.tabWidget_3.SetTabText(ui.tabWidget_3.IndexOf(ui.tab_5), qt.QTabWidget_Tr("Tab 1"))
|
||||
ui.tabWidget_3.SetTabText(ui.tabWidget_3.IndexOf(ui.tab_6), qt.QTabWidget_Tr("Tab 2"))
|
||||
ui.tabWidget.SetTabText(ui.tabWidget.IndexOf(ui.tab), qt.QTabWidget_Tr("First Tab"))
|
||||
ui.tabWidget.SetTabText(ui.tabWidget.IndexOf(ui.tab_2), qt.QTabWidget_Tr("Second Tab"))
|
||||
ui.tabWidget_2.SetTabText(ui.tabWidget_2.IndexOf(ui.tab_3), qt.QTabWidget_Tr("Tab 1"))
|
||||
ui.tabWidget_2.SetTabText(ui.tabWidget_2.IndexOf(ui.tab_4), qt.QTabWidget_Tr("Tab 2"))
|
||||
ui.tabWidget_4.SetTabText(ui.tabWidget_4.IndexOf(ui.tab_7), qt.QTabWidget_Tr("Tab 1"))
|
||||
ui.tabWidget_4.SetTabText(ui.tabWidget_4.IndexOf(ui.tab_8), qt.QTabWidget_Tr("Tab 2"))
|
||||
}
|
48
cmd/miqt-uic/testdata/qt5_mainwindow_vlayout.ui
vendored
@ -1,48 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>MainWindow</class>
|
||||
<widget class="QMainWindow" name="MainWindow">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>600</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>MainWindow</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralwidget">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton">
|
||||
<property name="text">
|
||||
<string>PushButton</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_2">
|
||||
<property name="text">
|
||||
<string>PushButton</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QMenuBar" name="menubar">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>29</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QStatusBar" name="statusbar"/>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
@ -1,61 +0,0 @@
|
||||
// Generated by miqt-uic. To update this file, edit the .ui file in
|
||||
// Qt Designer, and then run 'go generate'.
|
||||
//
|
||||
//go:generate miqt-uic go_generate_args
|
||||
|
||||
package test_package_name
|
||||
|
||||
import (
|
||||
"github.com/mappu/miqt/qt"
|
||||
)
|
||||
|
||||
type MainWindowUi struct {
|
||||
MainWindow *qt.QMainWindow
|
||||
centralwidget *qt.QWidget
|
||||
verticalLayout *qt.QVBoxLayout
|
||||
pushButton *qt.QPushButton
|
||||
pushButton_2 *qt.QPushButton
|
||||
menubar *qt.QMenuBar
|
||||
statusbar *qt.QStatusBar
|
||||
}
|
||||
|
||||
// NewMainWindowUi creates all Qt widget classes for MainWindow.
|
||||
func NewMainWindowUi() *MainWindowUi {
|
||||
ui := &MainWindowUi{}
|
||||
ui.MainWindow = qt.NewQMainWindow(nil)
|
||||
ui.MainWindow.SetObjectName("MainWindow")
|
||||
ui.MainWindow.Resize(800, 600)
|
||||
ui.centralwidget = qt.NewQWidget(ui.MainWindow.QWidget)
|
||||
ui.centralwidget.SetObjectName("centralwidget")
|
||||
ui.verticalLayout = qt.NewQVBoxLayout(ui.centralwidget)
|
||||
ui.verticalLayout.SetObjectName("verticalLayout")
|
||||
ui.verticalLayout.SetContentsMargins(11, 11, 11, 11)
|
||||
ui.verticalLayout.SetSpacing(6)
|
||||
ui.pushButton = qt.NewQPushButton(ui.centralwidget)
|
||||
ui.pushButton.SetObjectName("pushButton")
|
||||
|
||||
ui.verticalLayout.AddWidget(ui.pushButton.QWidget)
|
||||
ui.pushButton_2 = qt.NewQPushButton(ui.centralwidget)
|
||||
ui.pushButton_2.SetObjectName("pushButton_2")
|
||||
|
||||
ui.verticalLayout.AddWidget(ui.pushButton_2.QWidget)
|
||||
ui.MainWindow.SetCentralWidget(ui.centralwidget) // Set central widget
|
||||
ui.menubar = qt.NewQMenuBar(ui.MainWindow.QWidget)
|
||||
ui.menubar.SetObjectName("menubar")
|
||||
ui.menubar.Resize(800, 29)
|
||||
ui.MainWindow.SetMenuBar(ui.menubar)
|
||||
ui.statusbar = qt.NewQStatusBar(ui.MainWindow.QWidget)
|
||||
ui.statusbar.SetObjectName("statusbar")
|
||||
ui.MainWindow.SetStatusBar(ui.statusbar)
|
||||
|
||||
ui.Retranslate()
|
||||
|
||||
return ui
|
||||
}
|
||||
|
||||
// Retranslate reapplies all text translations.
|
||||
func (ui *MainWindowUi) Retranslate() {
|
||||
ui.MainWindow.SetWindowTitle(qt.QCoreApplication_Tr("MainWindow"))
|
||||
ui.pushButton.SetText(qt.QWidget_Tr("PushButton"))
|
||||
ui.pushButton_2.SetText(qt.QWidget_Tr("PushButton"))
|
||||
}
|
47
cmd/miqt-uic/testdata/qt5_mainwindow_vspacer.ui
vendored
@ -1,47 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>MainWindow</class>
|
||||
<widget class="QMainWindow" name="MainWindow">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>600</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>MainWindow</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralwidget">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QMenuBar" name="menubar">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>29</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QStatusBar" name="statusbar"/>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
@ -1,53 +0,0 @@
|
||||
// Generated by miqt-uic. To update this file, edit the .ui file in
|
||||
// Qt Designer, and then run 'go generate'.
|
||||
//
|
||||
//go:generate miqt-uic go_generate_args
|
||||
|
||||
package test_package_name
|
||||
|
||||
import (
|
||||
"github.com/mappu/miqt/qt"
|
||||
)
|
||||
|
||||
type MainWindowUi struct {
|
||||
MainWindow *qt.QMainWindow
|
||||
centralwidget *qt.QWidget
|
||||
verticalLayout *qt.QVBoxLayout
|
||||
verticalSpacer *qt.QSpacerItem
|
||||
menubar *qt.QMenuBar
|
||||
statusbar *qt.QStatusBar
|
||||
}
|
||||
|
||||
// NewMainWindowUi creates all Qt widget classes for MainWindow.
|
||||
func NewMainWindowUi() *MainWindowUi {
|
||||
ui := &MainWindowUi{}
|
||||
ui.MainWindow = qt.NewQMainWindow(nil)
|
||||
ui.MainWindow.SetObjectName("MainWindow")
|
||||
ui.MainWindow.Resize(800, 600)
|
||||
ui.centralwidget = qt.NewQWidget(ui.MainWindow.QWidget)
|
||||
ui.centralwidget.SetObjectName("centralwidget")
|
||||
ui.verticalLayout = qt.NewQVBoxLayout(ui.centralwidget)
|
||||
ui.verticalLayout.SetObjectName("verticalLayout")
|
||||
ui.verticalLayout.SetContentsMargins(11, 11, 11, 11)
|
||||
ui.verticalLayout.SetSpacing(6)
|
||||
ui.verticalSpacer = qt.NewQSpacerItem4(20, 40, qt.QSizePolicy__Minimum, qt.QSizePolicy__Expanding)
|
||||
|
||||
ui.verticalLayout.AddItem(ui.verticalSpacer.QLayoutItem)
|
||||
ui.MainWindow.SetCentralWidget(ui.centralwidget) // Set central widget
|
||||
ui.menubar = qt.NewQMenuBar(ui.MainWindow.QWidget)
|
||||
ui.menubar.SetObjectName("menubar")
|
||||
ui.menubar.Resize(800, 29)
|
||||
ui.MainWindow.SetMenuBar(ui.menubar)
|
||||
ui.statusbar = qt.NewQStatusBar(ui.MainWindow.QWidget)
|
||||
ui.statusbar.SetObjectName("statusbar")
|
||||
ui.MainWindow.SetStatusBar(ui.statusbar)
|
||||
|
||||
ui.Retranslate()
|
||||
|
||||
return ui
|
||||
}
|
||||
|
||||
// Retranslate reapplies all text translations.
|
||||
func (ui *MainWindowUi) Retranslate() {
|
||||
ui.MainWindow.SetWindowTitle(qt.QCoreApplication_Tr("MainWindow"))
|
||||
}
|
32
cmd/miqt-uic/testdata/qt5_widget.ui
vendored
@ -1,32 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Form</class>
|
||||
<widget class="QWidget" name="Form">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>20</x>
|
||||
<y>20</y>
|
||||
<width>231</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>QWidget as base class</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
36
cmd/miqt-uic/testdata/qt5_widget.ui.go.expected
vendored
@ -1,36 +0,0 @@
|
||||
// Generated by miqt-uic. To update this file, edit the .ui file in
|
||||
// Qt Designer, and then run 'go generate'.
|
||||
//
|
||||
//go:generate miqt-uic go_generate_args
|
||||
|
||||
package test_package_name
|
||||
|
||||
import (
|
||||
"github.com/mappu/miqt/qt"
|
||||
)
|
||||
|
||||
type FormUi struct {
|
||||
Form *qt.QWidget
|
||||
label *qt.QLabel
|
||||
}
|
||||
|
||||
// NewFormUi creates all Qt widget classes for Form.
|
||||
func NewFormUi() *FormUi {
|
||||
ui := &FormUi{}
|
||||
ui.Form = qt.NewQWidget(nil)
|
||||
ui.Form.SetObjectName("Form")
|
||||
ui.Form.Resize(400, 300)
|
||||
ui.label = qt.NewQLabel(ui.Form)
|
||||
ui.label.SetObjectName("label")
|
||||
ui.label.SetGeometry(qt.NewQRect(20, 20, 231, 21))
|
||||
|
||||
ui.Retranslate()
|
||||
|
||||
return ui
|
||||
}
|
||||
|
||||
// Retranslate reapplies all text translations.
|
||||
func (ui *FormUi) Retranslate() {
|
||||
ui.Form.SetWindowTitle(qt.QCoreApplication_Tr("Form"))
|
||||
ui.label.SetText(qt.QWidget_Tr("QWidget as base class"))
|
||||
}
|
@ -1,44 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Form</class>
|
||||
<widget class="QWidget" name="Form">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QSpinBox" name="first"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="second"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>first</sender>
|
||||
<signal>valueChanged(int)</signal>
|
||||
<receiver>second</receiver>
|
||||
<slot>setValue(int)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>105</x>
|
||||
<y>153</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>287</x>
|
||||
<y>155</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
@ -1,48 +0,0 @@
|
||||
// Generated by miqt-uic. To update this file, edit the .ui file in
|
||||
// Qt Designer, and then run 'go generate'.
|
||||
//
|
||||
//go:generate miqt-uic go_generate_args
|
||||
|
||||
package test_package_name
|
||||
|
||||
import (
|
||||
"github.com/mappu/miqt/qt"
|
||||
)
|
||||
|
||||
type FormUi struct {
|
||||
Form *qt.QWidget
|
||||
horizontalLayout *qt.QHBoxLayout
|
||||
first *qt.QSpinBox
|
||||
second *qt.QSpinBox
|
||||
}
|
||||
|
||||
// NewFormUi creates all Qt widget classes for Form.
|
||||
func NewFormUi() *FormUi {
|
||||
ui := &FormUi{}
|
||||
ui.Form = qt.NewQWidget(nil)
|
||||
ui.Form.SetObjectName("Form")
|
||||
ui.Form.Resize(400, 300)
|
||||
ui.horizontalLayout = qt.NewQHBoxLayout(ui.Form)
|
||||
ui.horizontalLayout.SetObjectName("horizontalLayout")
|
||||
ui.horizontalLayout.SetContentsMargins(11, 11, 11, 11)
|
||||
ui.horizontalLayout.SetSpacing(6)
|
||||
ui.first = qt.NewQSpinBox(ui.Form)
|
||||
ui.first.SetObjectName("first")
|
||||
|
||||
ui.horizontalLayout.AddWidget(ui.first.QWidget)
|
||||
ui.second = qt.NewQSpinBox(ui.Form)
|
||||
ui.second.SetObjectName("second")
|
||||
|
||||
ui.horizontalLayout.AddWidget(ui.second.QWidget)
|
||||
|
||||
ui.first.OnValueChanged(ui.second.SetValue)
|
||||
|
||||
ui.Retranslate()
|
||||
|
||||
return ui
|
||||
}
|
||||
|
||||
// Retranslate reapplies all text translations.
|
||||
func (ui *FormUi) Retranslate() {
|
||||
ui.Form.SetWindowTitle(qt.QCoreApplication_Tr("Form"))
|
||||
}
|
48
cmd/miqt-uic/testdata/qt64_mainwindow_hlayout.ui
vendored
@ -1,48 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>MainWindow</class>
|
||||
<widget class="QMainWindow" name="MainWindow">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>600</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>MainWindow</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralwidget">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_2">
|
||||
<property name="text">
|
||||
<string>PushButton</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton">
|
||||
<property name="text">
|
||||
<string>PushButton</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QMenuBar" name="menubar">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QStatusBar" name="statusbar"/>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
@ -1,75 +0,0 @@
|
||||
// Generated by miqt-uic. To update this file, edit the .ui file in
|
||||
// Qt Designer, and then run 'go generate'.
|
||||
//
|
||||
//go:generate miqt-uic go_generate_args
|
||||
|
||||
package test_package_name
|
||||
|
||||
import (
|
||||
qt "github.com/mappu/miqt/qt6"
|
||||
)
|
||||
|
||||
type MainWindowUi struct {
|
||||
MainWindow *qt.QMainWindow
|
||||
centralwidget *qt.QWidget
|
||||
horizontalLayout *qt.QHBoxLayout
|
||||
pushButton_2 *qt.QPushButton
|
||||
pushButton *qt.QPushButton
|
||||
menubar *qt.QMenuBar
|
||||
statusbar *qt.QStatusBar
|
||||
}
|
||||
|
||||
// NewMainWindowUi creates all Qt widget classes for MainWindow.
|
||||
func NewMainWindowUi() *MainWindowUi {
|
||||
ui := &MainWindowUi{}
|
||||
ui.MainWindow = qt.NewQMainWindow(nil)
|
||||
MainWindow__objectName := qt.NewQAnyStringView3("MainWindow")
|
||||
ui.MainWindow.SetObjectName(*MainWindow__objectName)
|
||||
MainWindow__objectName.Delete() // setter copied value
|
||||
ui.MainWindow.Resize(800, 600)
|
||||
ui.centralwidget = qt.NewQWidget(ui.MainWindow.QWidget)
|
||||
centralwidget__objectName := qt.NewQAnyStringView3("centralwidget")
|
||||
ui.centralwidget.SetObjectName(*centralwidget__objectName)
|
||||
centralwidget__objectName.Delete() // setter copied value
|
||||
ui.horizontalLayout = qt.NewQHBoxLayout(ui.centralwidget)
|
||||
horizontalLayout__objectName := qt.NewQAnyStringView3("horizontalLayout")
|
||||
ui.horizontalLayout.SetObjectName(*horizontalLayout__objectName)
|
||||
horizontalLayout__objectName.Delete() // setter copied value
|
||||
ui.horizontalLayout.SetContentsMargins(11, 11, 11, 11)
|
||||
ui.horizontalLayout.SetSpacing(6)
|
||||
ui.pushButton_2 = qt.NewQPushButton(ui.centralwidget)
|
||||
pushButton_2__objectName := qt.NewQAnyStringView3("pushButton_2")
|
||||
ui.pushButton_2.SetObjectName(*pushButton_2__objectName)
|
||||
pushButton_2__objectName.Delete() // setter copied value
|
||||
|
||||
ui.horizontalLayout.AddWidget(ui.pushButton_2.QWidget)
|
||||
ui.pushButton = qt.NewQPushButton(ui.centralwidget)
|
||||
pushButton__objectName := qt.NewQAnyStringView3("pushButton")
|
||||
ui.pushButton.SetObjectName(*pushButton__objectName)
|
||||
pushButton__objectName.Delete() // setter copied value
|
||||
|
||||
ui.horizontalLayout.AddWidget(ui.pushButton.QWidget)
|
||||
ui.MainWindow.SetCentralWidget(ui.centralwidget) // Set central widget
|
||||
ui.menubar = qt.NewQMenuBar(ui.MainWindow.QWidget)
|
||||
menubar__objectName := qt.NewQAnyStringView3("menubar")
|
||||
ui.menubar.SetObjectName(*menubar__objectName)
|
||||
menubar__objectName.Delete() // setter copied value
|
||||
ui.menubar.Resize(800, 22)
|
||||
ui.MainWindow.SetMenuBar(ui.menubar)
|
||||
ui.statusbar = qt.NewQStatusBar(ui.MainWindow.QWidget)
|
||||
statusbar__objectName := qt.NewQAnyStringView3("statusbar")
|
||||
ui.statusbar.SetObjectName(*statusbar__objectName)
|
||||
statusbar__objectName.Delete() // setter copied value
|
||||
ui.MainWindow.SetStatusBar(ui.statusbar)
|
||||
|
||||
ui.Retranslate()
|
||||
|
||||
return ui
|
||||
}
|
||||
|
||||
// Retranslate reapplies all text translations.
|
||||
func (ui *MainWindowUi) Retranslate() {
|
||||
ui.MainWindow.SetWindowTitle(qt.QCoreApplication_Tr("MainWindow"))
|
||||
ui.pushButton_2.SetText(qt.QWidget_Tr("PushButton"))
|
||||
ui.pushButton.SetText(qt.QWidget_Tr("PushButton"))
|
||||
}
|
47
cmd/miqt-uic/testdata/qt64_mainwindow_hspacer.ui
vendored
@ -1,47 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>MainWindow</class>
|
||||
<widget class="QMainWindow" name="MainWindow">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>600</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>MainWindow</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralwidget">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>785</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QMenuBar" name="menubar">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QStatusBar" name="statusbar"/>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
@ -1,63 +0,0 @@
|
||||
// Generated by miqt-uic. To update this file, edit the .ui file in
|
||||
// Qt Designer, and then run 'go generate'.
|
||||
//
|
||||
//go:generate miqt-uic go_generate_args
|
||||
|
||||
package test_package_name
|
||||
|
||||
import (
|
||||
qt "github.com/mappu/miqt/qt6"
|
||||
)
|
||||
|
||||
type MainWindowUi struct {
|
||||
MainWindow *qt.QMainWindow
|
||||
centralwidget *qt.QWidget
|
||||
verticalLayout *qt.QVBoxLayout
|
||||
horizontalSpacer *qt.QSpacerItem
|
||||
menubar *qt.QMenuBar
|
||||
statusbar *qt.QStatusBar
|
||||
}
|
||||
|
||||
// NewMainWindowUi creates all Qt widget classes for MainWindow.
|
||||
func NewMainWindowUi() *MainWindowUi {
|
||||
ui := &MainWindowUi{}
|
||||
ui.MainWindow = qt.NewQMainWindow(nil)
|
||||
MainWindow__objectName := qt.NewQAnyStringView3("MainWindow")
|
||||
ui.MainWindow.SetObjectName(*MainWindow__objectName)
|
||||
MainWindow__objectName.Delete() // setter copied value
|
||||
ui.MainWindow.Resize(800, 600)
|
||||
ui.centralwidget = qt.NewQWidget(ui.MainWindow.QWidget)
|
||||
centralwidget__objectName := qt.NewQAnyStringView3("centralwidget")
|
||||
ui.centralwidget.SetObjectName(*centralwidget__objectName)
|
||||
centralwidget__objectName.Delete() // setter copied value
|
||||
ui.verticalLayout = qt.NewQVBoxLayout(ui.centralwidget)
|
||||
verticalLayout__objectName := qt.NewQAnyStringView3("verticalLayout")
|
||||
ui.verticalLayout.SetObjectName(*verticalLayout__objectName)
|
||||
verticalLayout__objectName.Delete() // setter copied value
|
||||
ui.verticalLayout.SetContentsMargins(11, 11, 11, 11)
|
||||
ui.verticalLayout.SetSpacing(6)
|
||||
ui.horizontalSpacer = qt.NewQSpacerItem4(785, 20, qt.QSizePolicy__Expanding, qt.QSizePolicy__Minimum)
|
||||
|
||||
ui.verticalLayout.AddItem(ui.horizontalSpacer.QLayoutItem)
|
||||
ui.MainWindow.SetCentralWidget(ui.centralwidget) // Set central widget
|
||||
ui.menubar = qt.NewQMenuBar(ui.MainWindow.QWidget)
|
||||
menubar__objectName := qt.NewQAnyStringView3("menubar")
|
||||
ui.menubar.SetObjectName(*menubar__objectName)
|
||||
menubar__objectName.Delete() // setter copied value
|
||||
ui.menubar.Resize(800, 22)
|
||||
ui.MainWindow.SetMenuBar(ui.menubar)
|
||||
ui.statusbar = qt.NewQStatusBar(ui.MainWindow.QWidget)
|
||||
statusbar__objectName := qt.NewQAnyStringView3("statusbar")
|
||||
ui.statusbar.SetObjectName(*statusbar__objectName)
|
||||
statusbar__objectName.Delete() // setter copied value
|
||||
ui.MainWindow.SetStatusBar(ui.statusbar)
|
||||
|
||||
ui.Retranslate()
|
||||
|
||||
return ui
|
||||
}
|
||||
|
||||
// Retranslate reapplies all text translations.
|
||||
func (ui *MainWindowUi) Retranslate() {
|
||||
ui.MainWindow.SetWindowTitle(qt.QCoreApplication_Tr("MainWindow"))
|
||||
}
|
48
cmd/miqt-uic/testdata/qt64_mainwindow_vlayout.ui
vendored
@ -1,48 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>MainWindow</class>
|
||||
<widget class="QMainWindow" name="MainWindow">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>600</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>MainWindow</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralwidget">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton">
|
||||
<property name="text">
|
||||
<string>PushButton</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_2">
|
||||
<property name="text">
|
||||
<string>PushButton</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QMenuBar" name="menubar">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QStatusBar" name="statusbar"/>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
@ -1,75 +0,0 @@
|
||||
// Generated by miqt-uic. To update this file, edit the .ui file in
|
||||
// Qt Designer, and then run 'go generate'.
|
||||
//
|
||||
//go:generate miqt-uic go_generate_args
|
||||
|
||||
package test_package_name
|
||||
|
||||
import (
|
||||
qt "github.com/mappu/miqt/qt6"
|
||||
)
|
||||
|
||||
type MainWindowUi struct {
|
||||
MainWindow *qt.QMainWindow
|
||||
centralwidget *qt.QWidget
|
||||
verticalLayout *qt.QVBoxLayout
|
||||
pushButton *qt.QPushButton
|
||||
pushButton_2 *qt.QPushButton
|
||||
menubar *qt.QMenuBar
|
||||
statusbar *qt.QStatusBar
|
||||
}
|
||||
|
||||
// NewMainWindowUi creates all Qt widget classes for MainWindow.
|
||||
func NewMainWindowUi() *MainWindowUi {
|
||||
ui := &MainWindowUi{}
|
||||
ui.MainWindow = qt.NewQMainWindow(nil)
|
||||
MainWindow__objectName := qt.NewQAnyStringView3("MainWindow")
|
||||
ui.MainWindow.SetObjectName(*MainWindow__objectName)
|
||||
MainWindow__objectName.Delete() // setter copied value
|
||||
ui.MainWindow.Resize(800, 600)
|
||||
ui.centralwidget = qt.NewQWidget(ui.MainWindow.QWidget)
|
||||
centralwidget__objectName := qt.NewQAnyStringView3("centralwidget")
|
||||
ui.centralwidget.SetObjectName(*centralwidget__objectName)
|
||||
centralwidget__objectName.Delete() // setter copied value
|
||||
ui.verticalLayout = qt.NewQVBoxLayout(ui.centralwidget)
|
||||
verticalLayout__objectName := qt.NewQAnyStringView3("verticalLayout")
|
||||
ui.verticalLayout.SetObjectName(*verticalLayout__objectName)
|
||||
verticalLayout__objectName.Delete() // setter copied value
|
||||
ui.verticalLayout.SetContentsMargins(11, 11, 11, 11)
|
||||
ui.verticalLayout.SetSpacing(6)
|
||||
ui.pushButton = qt.NewQPushButton(ui.centralwidget)
|
||||
pushButton__objectName := qt.NewQAnyStringView3("pushButton")
|
||||
ui.pushButton.SetObjectName(*pushButton__objectName)
|
||||
pushButton__objectName.Delete() // setter copied value
|
||||
|
||||
ui.verticalLayout.AddWidget(ui.pushButton.QWidget)
|
||||
ui.pushButton_2 = qt.NewQPushButton(ui.centralwidget)
|
||||
pushButton_2__objectName := qt.NewQAnyStringView3("pushButton_2")
|
||||
ui.pushButton_2.SetObjectName(*pushButton_2__objectName)
|
||||
pushButton_2__objectName.Delete() // setter copied value
|
||||
|
||||
ui.verticalLayout.AddWidget(ui.pushButton_2.QWidget)
|
||||
ui.MainWindow.SetCentralWidget(ui.centralwidget) // Set central widget
|
||||
ui.menubar = qt.NewQMenuBar(ui.MainWindow.QWidget)
|
||||
menubar__objectName := qt.NewQAnyStringView3("menubar")
|
||||
ui.menubar.SetObjectName(*menubar__objectName)
|
||||
menubar__objectName.Delete() // setter copied value
|
||||
ui.menubar.Resize(800, 22)
|
||||
ui.MainWindow.SetMenuBar(ui.menubar)
|
||||
ui.statusbar = qt.NewQStatusBar(ui.MainWindow.QWidget)
|
||||
statusbar__objectName := qt.NewQAnyStringView3("statusbar")
|
||||
ui.statusbar.SetObjectName(*statusbar__objectName)
|
||||
statusbar__objectName.Delete() // setter copied value
|
||||
ui.MainWindow.SetStatusBar(ui.statusbar)
|
||||
|
||||
ui.Retranslate()
|
||||
|
||||
return ui
|
||||
}
|
||||
|
||||
// Retranslate reapplies all text translations.
|
||||
func (ui *MainWindowUi) Retranslate() {
|
||||
ui.MainWindow.SetWindowTitle(qt.QCoreApplication_Tr("MainWindow"))
|
||||
ui.pushButton.SetText(qt.QWidget_Tr("PushButton"))
|
||||
ui.pushButton_2.SetText(qt.QWidget_Tr("PushButton"))
|
||||
}
|
47
cmd/miqt-uic/testdata/qt64_mainwindow_vspacer.ui
vendored
@ -1,47 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>MainWindow</class>
|
||||
<widget class="QMainWindow" name="MainWindow">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>600</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>MainWindow</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralwidget">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QMenuBar" name="menubar">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QStatusBar" name="statusbar"/>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
@ -1,63 +0,0 @@
|
||||
// Generated by miqt-uic. To update this file, edit the .ui file in
|
||||
// Qt Designer, and then run 'go generate'.
|
||||
//
|
||||
//go:generate miqt-uic go_generate_args
|
||||
|
||||
package test_package_name
|
||||
|
||||
import (
|
||||
qt "github.com/mappu/miqt/qt6"
|
||||
)
|
||||
|
||||
type MainWindowUi struct {
|
||||
MainWindow *qt.QMainWindow
|
||||
centralwidget *qt.QWidget
|
||||
verticalLayout *qt.QVBoxLayout
|
||||
verticalSpacer *qt.QSpacerItem
|
||||
menubar *qt.QMenuBar
|
||||
statusbar *qt.QStatusBar
|
||||
}
|
||||
|
||||
// NewMainWindowUi creates all Qt widget classes for MainWindow.
|
||||
func NewMainWindowUi() *MainWindowUi {
|
||||
ui := &MainWindowUi{}
|
||||
ui.MainWindow = qt.NewQMainWindow(nil)
|
||||
MainWindow__objectName := qt.NewQAnyStringView3("MainWindow")
|
||||
ui.MainWindow.SetObjectName(*MainWindow__objectName)
|
||||
MainWindow__objectName.Delete() // setter copied value
|
||||
ui.MainWindow.Resize(800, 600)
|
||||
ui.centralwidget = qt.NewQWidget(ui.MainWindow.QWidget)
|
||||
centralwidget__objectName := qt.NewQAnyStringView3("centralwidget")
|
||||
ui.centralwidget.SetObjectName(*centralwidget__objectName)
|
||||
centralwidget__objectName.Delete() // setter copied value
|
||||
ui.verticalLayout = qt.NewQVBoxLayout(ui.centralwidget)
|
||||
verticalLayout__objectName := qt.NewQAnyStringView3("verticalLayout")
|
||||
ui.verticalLayout.SetObjectName(*verticalLayout__objectName)
|
||||
verticalLayout__objectName.Delete() // setter copied value
|
||||
ui.verticalLayout.SetContentsMargins(11, 11, 11, 11)
|
||||
ui.verticalLayout.SetSpacing(6)
|
||||
ui.verticalSpacer = qt.NewQSpacerItem4(20, 40, qt.QSizePolicy__Minimum, qt.QSizePolicy__Expanding)
|
||||
|
||||
ui.verticalLayout.AddItem(ui.verticalSpacer.QLayoutItem)
|
||||
ui.MainWindow.SetCentralWidget(ui.centralwidget) // Set central widget
|
||||
ui.menubar = qt.NewQMenuBar(ui.MainWindow.QWidget)
|
||||
menubar__objectName := qt.NewQAnyStringView3("menubar")
|
||||
ui.menubar.SetObjectName(*menubar__objectName)
|
||||
menubar__objectName.Delete() // setter copied value
|
||||
ui.menubar.Resize(800, 22)
|
||||
ui.MainWindow.SetMenuBar(ui.menubar)
|
||||
ui.statusbar = qt.NewQStatusBar(ui.MainWindow.QWidget)
|
||||
statusbar__objectName := qt.NewQAnyStringView3("statusbar")
|
||||
ui.statusbar.SetObjectName(*statusbar__objectName)
|
||||
statusbar__objectName.Delete() // setter copied value
|
||||
ui.MainWindow.SetStatusBar(ui.statusbar)
|
||||
|
||||
ui.Retranslate()
|
||||
|
||||
return ui
|
||||
}
|
||||
|
||||
// Retranslate reapplies all text translations.
|
||||
func (ui *MainWindowUi) Retranslate() {
|
||||
ui.MainWindow.SetWindowTitle(qt.QCoreApplication_Tr("MainWindow"))
|
||||
}
|
47
cmd/miqt-uic/testdata/qt69_mainwindow_hspacer.ui
vendored
@ -1,47 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>MainWindow</class>
|
||||
<widget class="QMainWindow" name="MainWindow">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>600</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>MainWindow</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralwidget">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>785</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QMenuBar" name="menubar">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QStatusBar" name="statusbar"/>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
@ -1,63 +0,0 @@
|
||||
// Generated by miqt-uic. To update this file, edit the .ui file in
|
||||
// Qt Designer, and then run 'go generate'.
|
||||
//
|
||||
//go:generate miqt-uic go_generate_args
|
||||
|
||||
package test_package_name
|
||||
|
||||
import (
|
||||
qt "github.com/mappu/miqt/qt6"
|
||||
)
|
||||
|
||||
type MainWindowUi struct {
|
||||
MainWindow *qt.QMainWindow
|
||||
centralwidget *qt.QWidget
|
||||
verticalLayout *qt.QVBoxLayout
|
||||
horizontalSpacer *qt.QSpacerItem
|
||||
menubar *qt.QMenuBar
|
||||
statusbar *qt.QStatusBar
|
||||
}
|
||||
|
||||
// NewMainWindowUi creates all Qt widget classes for MainWindow.
|
||||
func NewMainWindowUi() *MainWindowUi {
|
||||
ui := &MainWindowUi{}
|
||||
ui.MainWindow = qt.NewQMainWindow(nil)
|
||||
MainWindow__objectName := qt.NewQAnyStringView3("MainWindow")
|
||||
ui.MainWindow.SetObjectName(*MainWindow__objectName)
|
||||
MainWindow__objectName.Delete() // setter copied value
|
||||
ui.MainWindow.Resize(800, 600)
|
||||
ui.centralwidget = qt.NewQWidget(ui.MainWindow.QWidget)
|
||||
centralwidget__objectName := qt.NewQAnyStringView3("centralwidget")
|
||||
ui.centralwidget.SetObjectName(*centralwidget__objectName)
|
||||
centralwidget__objectName.Delete() // setter copied value
|
||||
ui.verticalLayout = qt.NewQVBoxLayout(ui.centralwidget)
|
||||
verticalLayout__objectName := qt.NewQAnyStringView3("verticalLayout")
|
||||
ui.verticalLayout.SetObjectName(*verticalLayout__objectName)
|
||||
verticalLayout__objectName.Delete() // setter copied value
|
||||
ui.verticalLayout.SetContentsMargins(11, 11, 11, 11)
|
||||
ui.verticalLayout.SetSpacing(6)
|
||||
ui.horizontalSpacer = qt.NewQSpacerItem4(785, 20, qt.QSizePolicy__Expanding, qt.QSizePolicy__Minimum)
|
||||
|
||||
ui.verticalLayout.AddItem(ui.horizontalSpacer.QLayoutItem)
|
||||
ui.MainWindow.SetCentralWidget(ui.centralwidget) // Set central widget
|
||||
ui.menubar = qt.NewQMenuBar(ui.MainWindow.QWidget)
|
||||
menubar__objectName := qt.NewQAnyStringView3("menubar")
|
||||
ui.menubar.SetObjectName(*menubar__objectName)
|
||||
menubar__objectName.Delete() // setter copied value
|
||||
ui.menubar.Resize(800, 22)
|
||||
ui.MainWindow.SetMenuBar(ui.menubar)
|
||||
ui.statusbar = qt.NewQStatusBar(ui.MainWindow.QWidget)
|
||||
statusbar__objectName := qt.NewQAnyStringView3("statusbar")
|
||||
ui.statusbar.SetObjectName(*statusbar__objectName)
|
||||
statusbar__objectName.Delete() // setter copied value
|
||||
ui.MainWindow.SetStatusBar(ui.statusbar)
|
||||
|
||||
ui.Retranslate()
|
||||
|
||||
return ui
|
||||
}
|
||||
|
||||
// Retranslate reapplies all text translations.
|
||||
func (ui *MainWindowUi) Retranslate() {
|
||||
ui.MainWindow.SetWindowTitle(qt.QCoreApplication_Tr("MainWindow"))
|
||||
}
|
@ -1,45 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>MainWindow</class>
|
||||
<widget class="QMainWindow" name="MainWindow">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>600</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>MainWindow</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralwidget"/>
|
||||
<widget class="QMenuBar" name="menubar">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QStatusBar" name="statusbar"/>
|
||||
<action name="actionApplicationExit">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset theme="QIcon::ThemeIcon::ApplicationExit"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>ApplicationExit</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Custom Tooltip</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
@ -1,62 +0,0 @@
|
||||
// Generated by miqt-uic. To update this file, edit the .ui file in
|
||||
// Qt Designer, and then run 'go generate'.
|
||||
//
|
||||
//go:generate miqt-uic go_generate_args
|
||||
|
||||
package test_package_name
|
||||
|
||||
import (
|
||||
qt "github.com/mappu/miqt/qt6"
|
||||
)
|
||||
|
||||
type MainWindowUi struct {
|
||||
MainWindow *qt.QMainWindow
|
||||
centralwidget *qt.QWidget
|
||||
menubar *qt.QMenuBar
|
||||
statusbar *qt.QStatusBar
|
||||
actionApplicationExit *qt.QAction
|
||||
}
|
||||
|
||||
// NewMainWindowUi creates all Qt widget classes for MainWindow.
|
||||
func NewMainWindowUi() *MainWindowUi {
|
||||
ui := &MainWindowUi{}
|
||||
ui.MainWindow = qt.NewQMainWindow(nil)
|
||||
MainWindow__objectName := qt.NewQAnyStringView3("MainWindow")
|
||||
ui.MainWindow.SetObjectName(*MainWindow__objectName)
|
||||
MainWindow__objectName.Delete() // setter copied value
|
||||
ui.MainWindow.Resize(800, 600)
|
||||
ui.actionApplicationExit = qt.NewQAction()
|
||||
actionApplicationExit__objectName := qt.NewQAnyStringView3("actionApplicationExit")
|
||||
ui.actionApplicationExit.SetObjectName(*actionApplicationExit__objectName)
|
||||
actionApplicationExit__objectName.Delete() // setter copied value
|
||||
/* miqt-uic: no handler for QAction property 'checkable' */
|
||||
icon0 := qt.QIcon_FromTheme("application-exit")
|
||||
ui.actionApplicationExit.SetIcon(icon0)
|
||||
ui.centralwidget = qt.NewQWidget(ui.MainWindow.QWidget)
|
||||
centralwidget__objectName := qt.NewQAnyStringView3("centralwidget")
|
||||
ui.centralwidget.SetObjectName(*centralwidget__objectName)
|
||||
centralwidget__objectName.Delete() // setter copied value
|
||||
ui.MainWindow.SetCentralWidget(ui.centralwidget) // Set central widget
|
||||
ui.menubar = qt.NewQMenuBar(ui.MainWindow.QWidget)
|
||||
menubar__objectName := qt.NewQAnyStringView3("menubar")
|
||||
ui.menubar.SetObjectName(*menubar__objectName)
|
||||
menubar__objectName.Delete() // setter copied value
|
||||
ui.menubar.Resize(800, 22)
|
||||
ui.MainWindow.SetMenuBar(ui.menubar)
|
||||
ui.statusbar = qt.NewQStatusBar(ui.MainWindow.QWidget)
|
||||
statusbar__objectName := qt.NewQAnyStringView3("statusbar")
|
||||
ui.statusbar.SetObjectName(*statusbar__objectName)
|
||||
statusbar__objectName.Delete() // setter copied value
|
||||
ui.MainWindow.SetStatusBar(ui.statusbar)
|
||||
|
||||
ui.Retranslate()
|
||||
|
||||
return ui
|
||||
}
|
||||
|
||||
// Retranslate reapplies all text translations.
|
||||
func (ui *MainWindowUi) Retranslate() {
|
||||
ui.MainWindow.SetWindowTitle(qt.QCoreApplication_Tr("MainWindow"))
|
||||
ui.actionApplicationExit.SetText(qt.QMainWindow_Tr("ApplicationExit"))
|
||||
ui.actionApplicationExit.SetToolTip(qt.QMainWindow_Tr("Custom Tooltip"))
|
||||
}
|
47
cmd/miqt-uic/testdata/qt69_mainwindow_vspacer.ui
vendored
@ -1,47 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>MainWindow</class>
|
||||
<widget class="QMainWindow" name="MainWindow">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>600</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>MainWindow</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralwidget">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QMenuBar" name="menubar">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QStatusBar" name="statusbar"/>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
@ -1,63 +0,0 @@
|
||||
// Generated by miqt-uic. To update this file, edit the .ui file in
|
||||
// Qt Designer, and then run 'go generate'.
|
||||
//
|
||||
//go:generate miqt-uic go_generate_args
|
||||
|
||||
package test_package_name
|
||||
|
||||
import (
|
||||
qt "github.com/mappu/miqt/qt6"
|
||||
)
|
||||
|
||||
type MainWindowUi struct {
|
||||
MainWindow *qt.QMainWindow
|
||||
centralwidget *qt.QWidget
|
||||
verticalLayout *qt.QVBoxLayout
|
||||
verticalSpacer *qt.QSpacerItem
|
||||
menubar *qt.QMenuBar
|
||||
statusbar *qt.QStatusBar
|
||||
}
|
||||
|
||||
// NewMainWindowUi creates all Qt widget classes for MainWindow.
|
||||
func NewMainWindowUi() *MainWindowUi {
|
||||
ui := &MainWindowUi{}
|
||||
ui.MainWindow = qt.NewQMainWindow(nil)
|
||||
MainWindow__objectName := qt.NewQAnyStringView3("MainWindow")
|
||||
ui.MainWindow.SetObjectName(*MainWindow__objectName)
|
||||
MainWindow__objectName.Delete() // setter copied value
|
||||
ui.MainWindow.Resize(800, 600)
|
||||
ui.centralwidget = qt.NewQWidget(ui.MainWindow.QWidget)
|
||||
centralwidget__objectName := qt.NewQAnyStringView3("centralwidget")
|
||||
ui.centralwidget.SetObjectName(*centralwidget__objectName)
|
||||
centralwidget__objectName.Delete() // setter copied value
|
||||
ui.verticalLayout = qt.NewQVBoxLayout(ui.centralwidget)
|
||||
verticalLayout__objectName := qt.NewQAnyStringView3("verticalLayout")
|
||||
ui.verticalLayout.SetObjectName(*verticalLayout__objectName)
|
||||
verticalLayout__objectName.Delete() // setter copied value
|
||||
ui.verticalLayout.SetContentsMargins(11, 11, 11, 11)
|
||||
ui.verticalLayout.SetSpacing(6)
|
||||
ui.verticalSpacer = qt.NewQSpacerItem4(20, 40, qt.QSizePolicy__Minimum, qt.QSizePolicy__Expanding)
|
||||
|
||||
ui.verticalLayout.AddItem(ui.verticalSpacer.QLayoutItem)
|
||||
ui.MainWindow.SetCentralWidget(ui.centralwidget) // Set central widget
|
||||
ui.menubar = qt.NewQMenuBar(ui.MainWindow.QWidget)
|
||||
menubar__objectName := qt.NewQAnyStringView3("menubar")
|
||||
ui.menubar.SetObjectName(*menubar__objectName)
|
||||
menubar__objectName.Delete() // setter copied value
|
||||
ui.menubar.Resize(800, 22)
|
||||
ui.MainWindow.SetMenuBar(ui.menubar)
|
||||
ui.statusbar = qt.NewQStatusBar(ui.MainWindow.QWidget)
|
||||
statusbar__objectName := qt.NewQAnyStringView3("statusbar")
|
||||
ui.statusbar.SetObjectName(*statusbar__objectName)
|
||||
statusbar__objectName.Delete() // setter copied value
|
||||
ui.MainWindow.SetStatusBar(ui.statusbar)
|
||||
|
||||
ui.Retranslate()
|
||||
|
||||
return ui
|
||||
}
|
||||
|
||||
// Retranslate reapplies all text translations.
|
||||
func (ui *MainWindowUi) Retranslate() {
|
||||
ui.MainWindow.SetWindowTitle(qt.QCoreApplication_Tr("MainWindow"))
|
||||
}
|
@ -10,10 +10,9 @@ type UiLayoutItem struct {
|
||||
RowSpan *int `xml:"rowspan,attr"`
|
||||
ColSpan *int `xml:"colspan,attr"`
|
||||
|
||||
// A layout item either has a widget, or a spacer, or another layout
|
||||
// A layout item either has a widget, or a spacer
|
||||
Widget *UiWidget `xml:"widget"`
|
||||
Spacer *UiSpacer `xml:"spacer"`
|
||||
Layout *UiLayout `xml:"layout"`
|
||||
}
|
||||
|
||||
type UiLayout struct {
|
||||
@ -61,8 +60,7 @@ type UiString struct {
|
||||
}
|
||||
|
||||
type UiIcon struct {
|
||||
ResourceFile string `xml:"resource,attr,omitempty"`
|
||||
Theme string `xml:"theme,attr"`
|
||||
ResourceFile string `xml:"resource,attr"`
|
||||
|
||||
NormalOff *string `xml:"normaloff,omitempty"`
|
||||
NormalOn *string `xml:"normalon,omitempty"`
|
||||
@ -76,22 +74,8 @@ type UiIcon struct {
|
||||
Base string `xml:",chardata"`
|
||||
}
|
||||
|
||||
type UiSizePolicy struct {
|
||||
HSizeType string `xml:"hsizetype,attr"`
|
||||
VSizeType string `xml:"vsizetype,attr"`
|
||||
HStretch int `xml:"horstretch"`
|
||||
VStretch int `xml:"verstretch"`
|
||||
}
|
||||
|
||||
type UiSize struct {
|
||||
Width int `xml:"width"`
|
||||
Height int `xml:"height"`
|
||||
}
|
||||
|
||||
type UiProperty struct {
|
||||
Name string `xml:"name,attr"`
|
||||
StdSetVal *string `xml:"stdset,attr,omitempty"` // Used by sizeHint sometimes?
|
||||
|
||||
StringVal *UiString `xml:"string,omitempty"`
|
||||
NumberVal *string `xml:"number,omitempty"` // Preserve as string literal
|
||||
BoolVal *bool `xml:"bool,omitempty"` // "true" or "false"
|
||||
@ -99,8 +83,6 @@ type UiProperty struct {
|
||||
RectVal *UiRect `xml:"rect,omitempty"`
|
||||
IconVal *UiIcon `xml:"iconset,omitempty"`
|
||||
SetVal *string `xml:"set,omitempty"`
|
||||
SizePolicyVal *UiSizePolicy `xml:"sizepolicy,omitempty"`
|
||||
SizeVal *UiSize `xml:"size,omitempty"`
|
||||
}
|
||||
|
||||
type UiActionReference struct {
|
||||
@ -115,26 +97,7 @@ type UiAction struct {
|
||||
type UiResources struct {
|
||||
}
|
||||
|
||||
type UiConnectionHint struct {
|
||||
Type string `xml:"type,attr"`
|
||||
X int `xml:"x"`
|
||||
Y int `xml:"y"`
|
||||
}
|
||||
|
||||
type UiConnectionHints struct {
|
||||
Hints []UiConnectionHint `xml:"hint"`
|
||||
}
|
||||
|
||||
type UiConnection struct {
|
||||
Sender string `xml:"sender"`
|
||||
Signal string `xml:"signal"`
|
||||
Receiver string `xml:"receiver"`
|
||||
Slot string `xml:"slot"`
|
||||
Hints *UiConnectionHints `xml:"hints",omitempty`
|
||||
}
|
||||
|
||||
type UiConnections struct {
|
||||
Connections []UiConnection `xml:"connection"`
|
||||
}
|
||||
|
||||
type UiLayoutDefault struct {
|
||||
|
@ -3,86 +3,47 @@ package main
|
||||
import (
|
||||
"fmt"
|
||||
"go/format"
|
||||
"regexp"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
|
||||
type generateState struct {
|
||||
UseQt6 bool
|
||||
RootWindowName string
|
||||
DefaultGridMargin int
|
||||
DefaultSpacing int
|
||||
IconCounter int
|
||||
trackWidgetClasses map[string]string
|
||||
}
|
||||
var (
|
||||
RootWindowName = ""
|
||||
DefaultGridMargin = 11
|
||||
DefaultSpacing = 6
|
||||
IconCounter = 0
|
||||
)
|
||||
|
||||
func NewGenerateState(useQt6 bool) *generateState {
|
||||
return &generateState{
|
||||
UseQt6: useQt6,
|
||||
RootWindowName: "",
|
||||
DefaultGridMargin: 11,
|
||||
DefaultSpacing: 6,
|
||||
IconCounter: 0,
|
||||
trackWidgetClasses: make(map[string]string),
|
||||
}
|
||||
}
|
||||
|
||||
func (gs *generateState) collectClassNames_Layout(l *UiLayout) []string {
|
||||
func collectClassNames_Widget(u *UiWidget) []string {
|
||||
var ret []string
|
||||
|
||||
if l.Name != "" {
|
||||
ret = append(ret, l.Name+" *qt."+l.Class)
|
||||
gs.trackWidgetClasses[l.Name] = l.Class
|
||||
if u.Name != "" {
|
||||
ret = append(ret, u.Name+" *qt."+u.Class)
|
||||
}
|
||||
|
||||
for _, li := range l.Items {
|
||||
for _, w := range u.Widgets {
|
||||
ret = append(ret, collectClassNames_Widget(&w)...)
|
||||
}
|
||||
if u.Layout != nil {
|
||||
ret = append(ret, u.Layout.Name+" *qt."+u.Layout.Class)
|
||||
for _, li := range u.Layout.Items {
|
||||
if li.Widget != nil {
|
||||
ret = append(ret, gs.collectClassNames_Widget(li.Widget)...)
|
||||
ret = append(ret, collectClassNames_Widget(li.Widget)...)
|
||||
}
|
||||
if li.Spacer != nil {
|
||||
ret = append(ret, li.Spacer.Name+" *qt.QSpacerItem")
|
||||
}
|
||||
if li.Layout != nil {
|
||||
ret = append(ret, gs.collectClassNames_Layout(li.Layout)...)
|
||||
}
|
||||
}
|
||||
|
||||
return ret
|
||||
}
|
||||
|
||||
func (gs *generateState) collectClassNames_Widget(u *UiWidget) []string {
|
||||
var ret []string
|
||||
|
||||
if u.Name != "" {
|
||||
ret = append(ret, u.Name+" *qt."+u.Class)
|
||||
gs.trackWidgetClasses[u.Name] = u.Class
|
||||
}
|
||||
|
||||
for _, w := range u.Widgets {
|
||||
ret = append(ret, gs.collectClassNames_Widget(&w)...)
|
||||
}
|
||||
if u.Layout != nil {
|
||||
ret = append(ret, gs.collectClassNames_Layout(u.Layout)...)
|
||||
}
|
||||
for _, a := range u.Actions {
|
||||
ret = append(ret, a.Name+" *qt.QAction")
|
||||
}
|
||||
return ret
|
||||
}
|
||||
|
||||
func (gs *generateState) generateString_noTr(s string) string {
|
||||
return strconv.Quote(s)
|
||||
}
|
||||
|
||||
func (gs *generateState) generateString(s *UiString, parentClass string) string {
|
||||
if s.Notr {
|
||||
return gs.generateString_noTr(s.Value)
|
||||
} else if parentClass == "" {
|
||||
return `qt.QCoreApplication_Tr(` + gs.generateString_noTr(s.Value) + `)`
|
||||
} else {
|
||||
return `qt.` + parentClass + `_Tr(` + gs.generateString_noTr(s.Value) + `)`
|
||||
func generateString(s *UiString, parentClass string) string {
|
||||
if s.Notr || parentClass == "" {
|
||||
return strconv.Quote(s.Value)
|
||||
}
|
||||
return `qt.` + parentClass + `_Tr(` + strconv.Quote(s.Value) + `)`
|
||||
}
|
||||
|
||||
// qwidgetName creates the T.QWidget name that MIQT needs to access the base class.
|
||||
@ -104,46 +65,19 @@ func normalizeEnumName(s string) string {
|
||||
return `qt.` + strings.Replace(s, `::`, `__`, -1)
|
||||
}
|
||||
|
||||
func normalizeIconThemeName(themeName string) string {
|
||||
// Qt 6.8++ emits the theme in enum format: `QIcon::ThemeIcon::ApplicationExit`
|
||||
// Older Qt emits it as a string const: `application-exit`
|
||||
// For compatibility, detect and convert to old-style names
|
||||
// @ref https://github.com/mappu/miqt/issues/228
|
||||
func renderIcon(iconVal *UiIcon, ret *strings.Builder) string {
|
||||
|
||||
const prefix = `QIcon::ThemeIcon::`
|
||||
iconName := fmt.Sprintf("icon%d", IconCounter)
|
||||
IconCounter++
|
||||
|
||||
if !strings.HasPrefix(themeName, prefix) {
|
||||
return themeName
|
||||
}
|
||||
|
||||
ret := regexp.MustCompile(`[A-Z]`).ReplaceAllStringFunc(themeName[len(prefix):], func(s string) string {
|
||||
return `-` + strings.ToLower(s)
|
||||
})
|
||||
return strings.TrimPrefix(ret, `-`)
|
||||
}
|
||||
|
||||
func (gs *generateState) renderIcon(iconVal *UiIcon, ret *strings.Builder) string {
|
||||
|
||||
iconName := fmt.Sprintf("icon%d", gs.IconCounter)
|
||||
gs.IconCounter++
|
||||
|
||||
if iconVal.Theme != "" {
|
||||
ret.WriteString(iconName + ` := qt.QIcon_FromTheme(` + strconv.Quote(normalizeIconThemeName(iconVal.Theme)) + ")\n")
|
||||
} else {
|
||||
ret.WriteString(iconName + " := qt.NewQIcon()\n")
|
||||
}
|
||||
|
||||
// A base entry is a synonym for NormalOff. Don't need them both
|
||||
if iconVal.NormalOff != nil && *iconVal.NormalOff != "." {
|
||||
if iconVal.NormalOff != nil {
|
||||
ret.WriteString(iconName + ".AddFile4(" + strconv.Quote(*iconVal.NormalOff) + ", qt.NewQSize(), qt.QIcon__Normal, qt.QIcon__Off)\n")
|
||||
} else {
|
||||
base := strings.TrimSpace(iconVal.Base)
|
||||
if base == "" || base == "." {
|
||||
// skip
|
||||
} else {
|
||||
ret.WriteString(iconName + ".AddFile(" + strconv.Quote(strings.TrimSpace(iconVal.Base)) + ")\n")
|
||||
}
|
||||
}
|
||||
|
||||
if iconVal.NormalOn != nil {
|
||||
ret.WriteString(iconName + ".AddFile4(" + strconv.Quote(*iconVal.NormalOn) + ", qt.NewQSize(), qt.QIcon__Normal, qt.QIcon__On)\n")
|
||||
@ -170,9 +104,9 @@ func (gs *generateState) renderIcon(iconVal *UiIcon, ret *strings.Builder) strin
|
||||
return iconName
|
||||
}
|
||||
|
||||
func (gs *generateState) renderProperties(properties []UiProperty, ret *strings.Builder, targetName, parentClass string, isLayout bool) error {
|
||||
func renderProperties(properties []UiProperty, ret *strings.Builder, targetName, parentClass string, isLayout bool) error {
|
||||
|
||||
contentsMargins := [4]int{gs.DefaultGridMargin, gs.DefaultGridMargin, gs.DefaultGridMargin, gs.DefaultGridMargin} // left, top, right, bottom
|
||||
contentsMargins := [4]int{DefaultGridMargin, DefaultGridMargin, DefaultGridMargin, DefaultGridMargin} // left, top, right, bottom
|
||||
customContentsMargins := false
|
||||
customSpacing := false
|
||||
|
||||
@ -207,8 +141,8 @@ func (gs *generateState) renderProperties(properties []UiProperty, ret *strings.
|
||||
customContentsMargins = true
|
||||
|
||||
} else if prop.StringVal != nil {
|
||||
// "windowTitle", "title", "text", "shortcut"
|
||||
ret.WriteString(`ui.` + targetName + setterFunc + `(` + gs.generateString(prop.StringVal, parentClass) + ")\n")
|
||||
// "windowTitle", "title", "text"
|
||||
ret.WriteString(`ui.` + targetName + setterFunc + `(` + generateString(prop.StringVal, parentClass) + ")\n")
|
||||
|
||||
} else if prop.NumberVal != nil {
|
||||
// "currentIndex"
|
||||
@ -245,20 +179,9 @@ func (gs *generateState) renderProperties(properties []UiProperty, ret *strings.
|
||||
ret.WriteString(`ui.` + targetName + setterFunc + `(` + emit + ")\n")
|
||||
|
||||
} else if prop.IconVal != nil {
|
||||
iconName := gs.renderIcon(prop.IconVal, ret)
|
||||
iconName := renderIcon(prop.IconVal, ret)
|
||||
ret.WriteString(`ui.` + targetName + setterFunc + `(` + iconName + ")\n")
|
||||
|
||||
} else if prop.Name == "sizePolicy" {
|
||||
spn := targetName + "__sizePolicy"
|
||||
ret.WriteString(spn + " := qt.NewQSizePolicy()\n")
|
||||
ret.WriteString(spn + ".SetHorizontalPolicy(" + normalizeEnumName("QSizePolicy::"+prop.SizePolicyVal.HSizeType) + ")\n")
|
||||
ret.WriteString(spn + ".SetVerticalPolicy(" + normalizeEnumName("QSizePolicy::"+prop.SizePolicyVal.VSizeType) + ")\n")
|
||||
ret.WriteString(spn + ".SetHorizontalStretch(" + strconv.Itoa(prop.SizePolicyVal.HStretch) + ")\n")
|
||||
ret.WriteString(spn + ".SetVerticalStretch(" + strconv.Itoa(prop.SizePolicyVal.VStretch) + ")\n")
|
||||
ret.WriteString(spn + ".SetHeightForWidth(ui." + targetName + ".SizePolicy().HasHeightForWidth())\n")
|
||||
ret.WriteString("ui." + targetName + ".SetSizePolicy(*" + spn + ")\n")
|
||||
ret.WriteString(spn + ".Delete() // setter copies values\n")
|
||||
|
||||
} else {
|
||||
ret.WriteString("/* miqt-uic: no handler for " + targetName + " property '" + prop.Name + "' */\n")
|
||||
}
|
||||
@ -270,235 +193,29 @@ func (gs *generateState) renderProperties(properties []UiProperty, ret *strings.
|
||||
|
||||
if !customSpacing && isLayout {
|
||||
// Layouts must specify spacing, unless, we specified it already
|
||||
ret.WriteString(`ui.` + targetName + `.SetSpacing(` + fmt.Sprintf("%d", gs.DefaultSpacing) + ")\n")
|
||||
ret.WriteString(`ui.` + targetName + `.SetSpacing(` + fmt.Sprintf("%d", DefaultSpacing) + ")\n")
|
||||
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (gs *generateState) generateSetObjectName(target string, objectName string) string {
|
||||
if gs.UseQt6 {
|
||||
// return `ui.` + target + `.SetObjectName(*qt.NewQAnyStringView3(` + strconv.Quote(objectName) + "))\n"
|
||||
spn := target + "__objectName"
|
||||
ret := spn + `:= qt.NewQAnyStringView3(` + strconv.Quote(objectName) + ")\n"
|
||||
ret += `ui.` + target + ".SetObjectName(*" + spn + ")\n"
|
||||
ret += spn + ".Delete() // setter copied value\n"
|
||||
return ret
|
||||
|
||||
} else {
|
||||
return `ui.` + target + `.SetObjectName(` + strconv.Quote(objectName) + ")\n"
|
||||
}
|
||||
}
|
||||
|
||||
func (gs *generateState) assignWidgetToLayout(ret *strings.Builder, l *UiLayout, child *UiLayoutItem, noun string, widgetName string) {
|
||||
|
||||
switch l.Class {
|
||||
case `QFormLayout`:
|
||||
// Row and Column are always populated.
|
||||
rowPos := fmt.Sprintf("%d", *child.Row)
|
||||
var colPos string
|
||||
if *child.Column == 0 {
|
||||
colPos = `qt.QFormLayout__LabelRole`
|
||||
} else if *child.Column == 1 {
|
||||
colPos = `qt.QFormLayout__FieldRole`
|
||||
} else {
|
||||
ret.WriteString("/* miqt-uic: QFormLayout does not understand column index */\n")
|
||||
return
|
||||
}
|
||||
|
||||
// For QFormLayout it's SetWidget
|
||||
ret.WriteString(`
|
||||
ui.` + l.Name + `.Set` + noun + `(` + rowPos + `, ` + colPos + `, ` + widgetName + `)
|
||||
`)
|
||||
|
||||
case `QGridLayout`:
|
||||
if child.ColSpan != nil || child.RowSpan != nil {
|
||||
// If either are present, use full four-value AddWidget3
|
||||
rowSpan := 1
|
||||
if child.RowSpan != nil {
|
||||
rowSpan = *child.RowSpan
|
||||
}
|
||||
colSpan := 1
|
||||
if child.ColSpan != nil {
|
||||
colSpan = *child.ColSpan
|
||||
}
|
||||
|
||||
if noun == "Widget" {
|
||||
noun += "3"
|
||||
} else if noun == "Layout" {
|
||||
noun += "2"
|
||||
}
|
||||
|
||||
ret.WriteString(`
|
||||
ui.` + l.Name + `.Add` + noun + `(` + widgetName + `, ` + fmt.Sprintf("%d, %d, %d, %d", *child.Row, *child.Column, rowSpan, colSpan) + `)
|
||||
`)
|
||||
|
||||
} else {
|
||||
// Row and Column are always present in the .ui file
|
||||
// For row/column it's AddWidget2
|
||||
|
||||
if noun == "Widget" {
|
||||
noun += "2"
|
||||
} else if noun == "Layout" {
|
||||
// no suffix
|
||||
}
|
||||
|
||||
ret.WriteString(`
|
||||
ui.` + l.Name + `.Add` + noun + `(` + widgetName + `, ` + fmt.Sprintf("%d, %d", *child.Row, *child.Column) + `)
|
||||
`)
|
||||
}
|
||||
|
||||
case "QVBoxLayout", "QHBoxLayout":
|
||||
// For box layout it's AddWidget
|
||||
ret.WriteString(`
|
||||
ui.` + l.Name + `.Add` + noun + `(` + widgetName + `)
|
||||
`)
|
||||
|
||||
default:
|
||||
ret.WriteString("/* miqt-uic: no handler for layout '" + l.Class + "' */\n")
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
func (gs *generateState) generateLayout(l *UiLayout, parentName string, parentClass string, isNestedLayout bool) (string, error) {
|
||||
|
||||
var ret strings.Builder
|
||||
|
||||
if isNestedLayout {
|
||||
ctor := "New" + l.Class + "2"
|
||||
ret.WriteString(`ui.` + l.Name + ` = qt.` + ctor + "()\n")
|
||||
|
||||
} else {
|
||||
ctor := "New" + l.Class
|
||||
ret.WriteString(`ui.` + l.Name + ` = qt.` + ctor + `(` + qwidgetName(parentName, parentClass) + ")\n")
|
||||
}
|
||||
|
||||
ret.WriteString(gs.generateSetObjectName(l.Name, l.Name))
|
||||
|
||||
// Layout->Properties
|
||||
|
||||
err := gs.renderProperties(l.Properties, &ret, l.Name, parentClass, true) // Always emit spacing/padding calls
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
// Layout->Items
|
||||
|
||||
for i, child := range l.Items {
|
||||
|
||||
// A layout item is either a widget, or a spacer, or another layout
|
||||
|
||||
if child.Spacer != nil {
|
||||
nest, err := gs.generateSpacer(*child.Spacer)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf(l.Name+"/Layout/Spacer[%d]: %w", i, err)
|
||||
}
|
||||
|
||||
ret.WriteString(nest)
|
||||
|
||||
// Assign to layout
|
||||
gs.assignWidgetToLayout(&ret, l, &child, "Item", `ui.`+child.Spacer.Name+`.QLayoutItem`)
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
if child.Widget != nil {
|
||||
|
||||
// Layout items have the parent as the real QWidget parent and are
|
||||
// separately assigned to the layout afterwards
|
||||
|
||||
nest, err := gs.generateWidget(*child.Widget, parentName, parentClass)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf(l.Name+"/Layout/Item[%d]: %w", i, err)
|
||||
}
|
||||
|
||||
ret.WriteString(nest)
|
||||
|
||||
// Assign to layout
|
||||
gs.assignWidgetToLayout(&ret, l, &child, "Widget", qwidgetName(`ui.`+child.Widget.Name, child.Widget.Class))
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
if child.Layout != nil {
|
||||
|
||||
nest, err := gs.generateLayout(child.Layout, parentName, parentClass, true) // nested
|
||||
if err != nil {
|
||||
return "", fmt.Errorf(l.Name+"/Layout/Item[%d]: %w", i, err)
|
||||
}
|
||||
|
||||
ret.WriteString(nest)
|
||||
|
||||
// Assign to layout
|
||||
gs.assignWidgetToLayout(&ret, l, &child, "Layout", `ui.`+child.Layout.Name+`.QLayout`)
|
||||
}
|
||||
|
||||
//
|
||||
}
|
||||
|
||||
return ret.String(), nil
|
||||
}
|
||||
|
||||
func (gs *generateState) generateSpacer(spc UiSpacer) (string, error) {
|
||||
ret := strings.Builder{}
|
||||
|
||||
// qt.NewQSpacerItem4(w, h, sizepolicy, sizepolicy)
|
||||
// Same in both qt5 + qt6
|
||||
|
||||
var (
|
||||
w int = 0
|
||||
h int = 0
|
||||
isVertical bool = false
|
||||
)
|
||||
|
||||
for _, prop := range spc.Properties {
|
||||
if prop.Name == "sizeHint" {
|
||||
w = prop.SizeVal.Width
|
||||
h = prop.SizeVal.Height
|
||||
|
||||
} else if prop.Name == "orientation" {
|
||||
// qt5.15: "Qt::Horizontal"
|
||||
// qt6.4: "Qt::Horizontal"
|
||||
// qt6.??: "Qt::Orientation::Horizontal"
|
||||
if strings.HasSuffix(*prop.EnumVal, "Vertical") {
|
||||
isVertical = true
|
||||
}
|
||||
|
||||
} else {
|
||||
ret.WriteString("/* miqt-uic: no handler for spacer " + spc.Name + " property '" + prop.Name + "' */\n")
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
sizePolicy := "qt.QSizePolicy__Expanding, qt.QSizePolicy__Minimum" // horizontal
|
||||
if isVertical {
|
||||
sizePolicy = "qt.QSizePolicy__Minimum, qt.QSizePolicy__Expanding" // vertical
|
||||
}
|
||||
|
||||
ret.WriteString(`ui.` + spc.Name + ` = qt.NewQSpacerItem4(` + fmt.Sprintf("%d, %d", w, h) + ", " + sizePolicy + ")\n")
|
||||
|
||||
return ret.String(), nil
|
||||
}
|
||||
|
||||
func (gs *generateState) generateWidget(w UiWidget, parentName string, parentClass string) (string, error) {
|
||||
func generateWidget(w UiWidget, parentName string, parentClass string) (string, error) {
|
||||
ret := strings.Builder{}
|
||||
|
||||
ctor := "New" + w.Class
|
||||
|
||||
ret.WriteString(`ui.` + w.Name + ` = qt.` + ctor + `(` + qwidgetName(parentName, parentClass) + ")\n")
|
||||
|
||||
ret.WriteString(gs.generateSetObjectName(w.Name, w.Name))
|
||||
|
||||
if gs.RootWindowName == "" {
|
||||
gs.RootWindowName = `ui.` + w.Name
|
||||
ret.WriteString(`
|
||||
ui.` + w.Name + ` = qt.` + ctor + `(` + qwidgetName(parentName, parentClass) + `)
|
||||
ui.` + w.Name + `.SetObjectName(` + strconv.Quote(w.Name) + `)
|
||||
`)
|
||||
if RootWindowName == "" {
|
||||
RootWindowName = `ui.` + w.Name
|
||||
}
|
||||
|
||||
// Properties
|
||||
|
||||
err := gs.renderProperties(w.Properties, &ret, w.Name, parentClass, false)
|
||||
err := renderProperties(w.Properties, &ret, w.Name, parentClass, false)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
@ -507,7 +224,7 @@ func (gs *generateState) generateWidget(w UiWidget, parentName string, parentCla
|
||||
|
||||
for _, attr := range w.Attributes {
|
||||
if parentClass == "QTabWidget" && attr.Name == "title" {
|
||||
ret.WriteString(parentName + `.SetTabText(` + parentName + ".IndexOf(ui." + w.Name + "), " + gs.generateString(attr.StringVal, parentClass) + ")\n")
|
||||
ret.WriteString(parentName + `.SetTabText(` + parentName + ".IndexOf(ui." + w.Name + "), " + generateString(attr.StringVal, parentClass) + ")\n")
|
||||
|
||||
} else if w.Class == "QDockWidget" && parentClass == "QMainWindow" && attr.Name == "dockWidgetArea" {
|
||||
ret.WriteString(parentName + `.AddDockWidget(qt.DockWidgetArea(` + *attr.NumberVal + `), ui.` + w.Name + `)` + "\n")
|
||||
@ -527,43 +244,125 @@ func (gs *generateState) generateWidget(w UiWidget, parentName string, parentCla
|
||||
// Layout
|
||||
|
||||
if w.Layout != nil {
|
||||
nest, err := gs.generateLayout(w.Layout, `ui.`+w.Name, w.Class, false)
|
||||
ctor := "New" + w.Layout.Class
|
||||
|
||||
ret.WriteString(`
|
||||
ui.` + w.Layout.Name + ` = qt.` + ctor + `(` + qwidgetName("ui."+w.Name, w.Class) + `)
|
||||
ui.` + w.Layout.Name + `.SetObjectName(` + strconv.Quote(w.Layout.Name) + `)
|
||||
`)
|
||||
|
||||
// Layout->Properties
|
||||
|
||||
err := renderProperties(w.Layout.Properties, &ret, w.Layout.Name, parentClass, true) // Always emit spacing/padding calls
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
// Layout->Items
|
||||
|
||||
for i, child := range w.Layout.Items {
|
||||
|
||||
// A layout item is either a widget, or a spacer
|
||||
|
||||
if child.Spacer != nil {
|
||||
ret.WriteString("/* miqt-uic: no handler for spacer */\n")
|
||||
}
|
||||
|
||||
if child.Widget != nil {
|
||||
|
||||
// Layout items have the parent as the real QWidget parent and are
|
||||
// separately assigned to the layout afterwards
|
||||
|
||||
nest, err := generateWidget(*child.Widget, `ui.`+w.Name, w.Class)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf(w.Name+"/Layout/Item[%d]: %w", i, err)
|
||||
}
|
||||
|
||||
ret.WriteString(nest)
|
||||
|
||||
// Assign to layout
|
||||
|
||||
switch w.Layout.Class {
|
||||
case `QFormLayout`:
|
||||
// Row and Column are always populated.
|
||||
rowPos := fmt.Sprintf("%d", *child.Row)
|
||||
var colPos string
|
||||
if *child.Column == 0 {
|
||||
colPos = `qt.QFormLayout__LabelRole`
|
||||
} else if *child.Column == 1 {
|
||||
colPos = `qt.QFormLayout__FieldRole`
|
||||
} else {
|
||||
ret.WriteString("/* miqt-uic: QFormLayout does not understand column index */\n")
|
||||
continue
|
||||
}
|
||||
|
||||
// For QFormLayout it's SetWidget
|
||||
ret.WriteString(`
|
||||
ui.` + w.Layout.Name + `.SetWidget(` + rowPos + `, ` + colPos + `, ` + qwidgetName(`ui.`+child.Widget.Name, child.Widget.Class) + `)
|
||||
`)
|
||||
|
||||
case `QGridLayout`:
|
||||
if child.ColSpan != nil || child.RowSpan != nil {
|
||||
// If either are present, use full four-value AddWidget3
|
||||
rowSpan := 1
|
||||
if child.RowSpan != nil {
|
||||
rowSpan = *child.RowSpan
|
||||
}
|
||||
colSpan := 1
|
||||
if child.ColSpan != nil {
|
||||
colSpan = *child.ColSpan
|
||||
}
|
||||
|
||||
ret.WriteString(`
|
||||
ui.` + w.Layout.Name + `.AddWidget3(` + qwidgetName(`ui.`+child.Widget.Name, child.Widget.Class) + `, ` + fmt.Sprintf("%d, %d, %d, %d", *child.Row, *child.Column, rowSpan, colSpan) + `)
|
||||
`)
|
||||
|
||||
} else {
|
||||
// Row and Column are always present in the .ui file
|
||||
// For row/column it's AddWidget2
|
||||
|
||||
ret.WriteString(`
|
||||
ui.` + w.Layout.Name + `.AddWidget2(` + qwidgetName(`ui.`+child.Widget.Name, child.Widget.Class) + `, ` + fmt.Sprintf("%d, %d", *child.Row, *child.Column) + `)
|
||||
`)
|
||||
}
|
||||
|
||||
case "QVBoxLayout", "QHBoxLayout":
|
||||
// For box layout it's AddWidget
|
||||
ret.WriteString(`
|
||||
ui.` + w.Layout.Name + `.AddWidget(` + qwidgetName(`ui.`+child.Widget.Name, child.Widget.Class) + `)
|
||||
`)
|
||||
|
||||
default:
|
||||
ret.WriteString("/* miqt-uic: no handler for layout '" + w.Layout.Class + "' */\n")
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Actions
|
||||
|
||||
for _, a := range w.Actions {
|
||||
ret.WriteString(`ui.` + a.Name + ` = qt.NewQAction(` + parentName + ")\n")
|
||||
ret.WriteString(gs.generateSetObjectName(a.Name, a.Name))
|
||||
ret.WriteString(`
|
||||
ui.` + a.Name + ` = qt.NewQAction(` + parentName + `)
|
||||
ui.` + a.Name + `.SetObjectName(` + strconv.Quote(a.Name) + `)
|
||||
`)
|
||||
|
||||
// QActions are translated in the parent window's context
|
||||
for _, prop := range a.Properties {
|
||||
if prop.Name == "text" {
|
||||
ret.WriteString("ui." + a.Name + `.SetText(` + gs.generateString(prop.StringVal, w.Class) + `)` + "\n")
|
||||
if prop, ok := propertyByName(a.Properties, "text"); ok {
|
||||
ret.WriteString("ui." + a.Name + `.SetText(` + generateString(prop.StringVal, w.Class) + `)` + "\n")
|
||||
}
|
||||
|
||||
} else if prop.Name == "shortcut" {
|
||||
ret.WriteString("ui." + a.Name + `.SetShortcut(qt.NewQKeySequence2(` + gs.generateString(prop.StringVal, w.Class) + `))` + "\n")
|
||||
if prop, ok := propertyByName(a.Properties, "shortcut"); ok {
|
||||
ret.WriteString("ui." + a.Name + `.SetShortcut(qt.NewQKeySequence2(` + generateString(prop.StringVal, w.Class) + `))` + "\n")
|
||||
}
|
||||
|
||||
} else if prop.Name == "icon" {
|
||||
iconName := gs.renderIcon(prop.IconVal, &ret)
|
||||
if prop, ok := propertyByName(a.Properties, "icon"); ok {
|
||||
iconName := renderIcon(prop.IconVal, &ret)
|
||||
ret.WriteString(`ui.` + a.Name + `.SetIcon(` + iconName + ")\n")
|
||||
|
||||
} else if prop.Name == "toolTip" {
|
||||
ret.WriteString(`ui.` + a.Name + `.SetToolTip(` + gs.generateString(prop.StringVal, w.Class) + `)` + "\n")
|
||||
|
||||
} else {
|
||||
ret.WriteString("/* miqt-uic: no handler for QAction property '" + prop.Name + "' */\n")
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Items
|
||||
|
||||
for itemNo, itm := range w.Items {
|
||||
@ -574,7 +373,7 @@ func (gs *generateState) generateWidget(w UiWidget, parentName string, parentCla
|
||||
// TODO Abstract for all SetItem{Foo} properties
|
||||
for _, prop := range itm.Properties {
|
||||
if prop.Name == "text" {
|
||||
ret.WriteString("ui." + w.Name + `.SetItemText(` + fmt.Sprintf("%d", itemNo) + `, ` + gs.generateString(prop.StringVal, w.Class) + `)` + "\n")
|
||||
ret.WriteString("ui." + w.Name + `.SetItemText(` + fmt.Sprintf("%d", itemNo) + `, ` + generateString(prop.StringVal, w.Class) + `)` + "\n")
|
||||
} else {
|
||||
ret.WriteString("/* miqt-uic: no handler for item property '" + prop.Name + "' */\n")
|
||||
|
||||
@ -588,7 +387,7 @@ func (gs *generateState) generateWidget(w UiWidget, parentName string, parentCla
|
||||
|
||||
for _, prop := range col.Properties {
|
||||
if prop.Name == "text" {
|
||||
ret.WriteString("ui." + w.Name + ".HeaderItem().SetText(" + fmt.Sprintf("%d", colNo) + ", " + gs.generateString(prop.StringVal, w.Class) + ")\n")
|
||||
ret.WriteString("ui." + w.Name + ".HeaderItem().SetText(" + fmt.Sprintf("%d", colNo) + ", " + generateString(prop.StringVal, w.Class) + ")\n")
|
||||
} else {
|
||||
ret.WriteString("/* miqt-uic: no handler for column property '" + prop.Name + "' */\n")
|
||||
}
|
||||
@ -604,7 +403,7 @@ func (gs *generateState) generateWidget(w UiWidget, parentName string, parentCla
|
||||
)
|
||||
|
||||
for i, child := range w.Widgets {
|
||||
nest, err := gs.generateWidget(child, `ui.`+w.Name, w.Class)
|
||||
nest, err := generateWidget(child, `ui.`+w.Name, w.Class)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf(w.Name+"/Widgets[%d]: %w", i, err)
|
||||
}
|
||||
@ -647,7 +446,7 @@ func (gs *generateState) generateWidget(w UiWidget, parentName string, parentCla
|
||||
if w.Class == `QTabWidget` {
|
||||
if icon, ok := propertyByName(child.Attributes, "icon"); ok {
|
||||
// AddTab() overload with icon
|
||||
iconName := gs.renderIcon(icon.IconVal, &ret)
|
||||
iconName := renderIcon(icon.IconVal, &ret)
|
||||
ret.WriteString(`ui.` + w.Name + `.AddTab2(` + qwidgetName(`ui.`+child.Name, child.Class) + `, ` + iconName + `, "")` + "\n")
|
||||
|
||||
} else {
|
||||
@ -672,55 +471,37 @@ func (gs *generateState) generateWidget(w UiWidget, parentName string, parentCla
|
||||
if w.Class == "QMenuBar" {
|
||||
ret.WriteString("ui." + w.Name + ".AddMenu(ui." + a.Name + ")\n")
|
||||
} else if w.Class == "QMenu" || w.Class == "QToolBar" {
|
||||
|
||||
// It's possible this is a nested menu, then we need to call AddMenu insted
|
||||
// Resolve the class type of a.Name
|
||||
if aClass, ok := gs.trackWidgetClasses[a.Name]; ok && aClass == "QMenu" {
|
||||
// Nested
|
||||
ret.WriteString("ui." + w.Name + ".AddMenu(ui." + a.Name + ")\n")
|
||||
|
||||
} else {
|
||||
// QMenu has its own .AddAction() implementation that takes plain string
|
||||
// That's convenient, but it shadows the AddAction version that takes a QAction*
|
||||
// We need to use the underlying QWidget.AddAction explicitly
|
||||
ret.WriteString("ui." + w.Name + ".QWidget.AddAction(ui." + a.Name + ")\n")
|
||||
}
|
||||
} else {
|
||||
ret.WriteString("ui." + w.Name + ".AddAction(ui." + a.Name + ")\n")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if w.Class == "QDialogButtonBox" {
|
||||
// TODO make this using a native connection instead of a C++ -> Go -> C++ roundtrip
|
||||
ret.WriteString(`ui.` + w.Name + `.OnAccepted(` + RootWindowName + ".Accept)\n")
|
||||
ret.WriteString(`ui.` + w.Name + `.OnRejected(` + RootWindowName + ".Reject)\n")
|
||||
}
|
||||
|
||||
return ret.String(), nil
|
||||
}
|
||||
|
||||
func normalizeSignalName(s string) string {
|
||||
if s == "" {
|
||||
return ""
|
||||
}
|
||||
|
||||
// n.b. Signal arity must match exactly here
|
||||
// TODO support slot with lower arity than signal
|
||||
if idx := strings.IndexByte(s, '('); idx != -1 {
|
||||
return strings.ToUpper(string(s[0])) + s[1:idx]
|
||||
}
|
||||
return strings.ToUpper(string(s[0])) + s[1:]
|
||||
}
|
||||
|
||||
func generate(packageName string, goGenerateArgs string, u UiFile, useQt6 bool) ([]byte, error) {
|
||||
|
||||
gs := NewGenerateState(useQt6)
|
||||
|
||||
ret := strings.Builder{}
|
||||
|
||||
// Update globals for layoutdefault, if present
|
||||
|
||||
if u.LayoutDefault != nil {
|
||||
if u.LayoutDefault.Spacing != nil {
|
||||
gs.DefaultSpacing = *u.LayoutDefault.Spacing
|
||||
DefaultSpacing = *u.LayoutDefault.Spacing
|
||||
}
|
||||
if u.LayoutDefault.Margin != nil {
|
||||
gs.DefaultGridMargin = *u.LayoutDefault.Margin
|
||||
DefaultGridMargin = *u.LayoutDefault.Margin
|
||||
}
|
||||
}
|
||||
|
||||
@ -743,7 +524,7 @@ import (
|
||||
)
|
||||
|
||||
type ` + u.Class + `Ui struct {
|
||||
` + strings.Join(gs.collectClassNames_Widget(&u.Widget), "\n") + `
|
||||
` + strings.Join(collectClassNames_Widget(&u.Widget), "\n") + `
|
||||
}
|
||||
|
||||
// New` + u.Class + `Ui creates all Qt widget classes for ` + u.Class + `.
|
||||
@ -751,7 +532,7 @@ func New` + u.Class + `Ui() *` + u.Class + `Ui {
|
||||
ui := &` + u.Class + `Ui{}
|
||||
`)
|
||||
|
||||
nest, err := gs.generateWidget(u.Widget, "", "")
|
||||
nest, err := generateWidget(u.Widget, "", "")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -770,13 +551,6 @@ func New` + u.Class + `Ui() *` + u.Class + `Ui {
|
||||
}
|
||||
}
|
||||
|
||||
// Connections
|
||||
|
||||
for _, c := range u.Connections.Connections {
|
||||
// TODO make this using a native connection instead of a C++ -> Go -> C++ roundtrip
|
||||
ret.WriteString(`ui.` + c.Sender + `.On` + normalizeSignalName(c.Signal) + `(ui.` + c.Receiver + "." + normalizeSignalName(c.Slot) + ")\n")
|
||||
}
|
||||
|
||||
ret.WriteString("\nui.Retranslate()\n\n")
|
||||
|
||||
for _, sci := range setCurrentIndex {
|
||||
|
@ -4,32 +4,15 @@ import (
|
||||
"bytes"
|
||||
"encoding/xml"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestNormalizeThemeName(t *testing.T) {
|
||||
check := func(input, want string) {
|
||||
got := normalizeIconThemeName(input)
|
||||
if got != want {
|
||||
t.Errorf("normalizeIconThemeName(%q): got %q, want %q", input, got, want)
|
||||
}
|
||||
}
|
||||
|
||||
check("application-exit", "application-exit") // no-op
|
||||
check("", "")
|
||||
check("QIcon::unsupported", "QIcon::unsupported") // invalid input
|
||||
check("QIcon::ThemeIcon::ApplicationExit", "application-exit")
|
||||
}
|
||||
|
||||
func TestFixtureMarshalRoundtrip(t *testing.T) {
|
||||
|
||||
testFixture := func(fixtureFile string, qt6 bool) {
|
||||
testFixture := func(fixtureFile string) {
|
||||
in, err := ioutil.ReadFile(fixtureFile)
|
||||
if err != nil {
|
||||
t.Fatalf("ReadFile(%q): %v", fixtureFile, err)
|
||||
t.Fatalf("ReadFile: %v", err)
|
||||
}
|
||||
|
||||
in = bytes.Replace(in, []byte("\r"), []byte{}, -1) // Replace CRLF to LF
|
||||
@ -54,51 +37,11 @@ func TestFixtureMarshalRoundtrip(t *testing.T) {
|
||||
// Verify that the marshalled result matches the original identically,
|
||||
// i.e. we did not miss any properties in our XML type definitions
|
||||
if string(in) != string(ret) {
|
||||
t.Errorf("Mismatch(%q)", fixtureFile)
|
||||
t.Errorf("Mismatch")
|
||||
t.Log(lineDiff(string(in), string(ret)))
|
||||
}
|
||||
|
||||
if strings.HasPrefix(fixtureFile, `..`) {
|
||||
return
|
||||
}
|
||||
|
||||
// Generate Go code
|
||||
goSrc, err := generate("test_package_name", "go_generate_args", parsed, qt6)
|
||||
if err != nil {
|
||||
t.Fatalf("Generate: %v", err)
|
||||
}
|
||||
|
||||
fixtureExpect := fixtureFile + ".go.expected"
|
||||
expectGoSrc, err := os.ReadFile(fixtureExpect)
|
||||
if err != nil {
|
||||
if os.IsNotExist(err) {
|
||||
t.Errorf("WARNING: %q does not exist, creating for the first time", fixtureExpect)
|
||||
_ = os.WriteFile(fixtureExpect, goSrc, 0644)
|
||||
} else {
|
||||
t.Errorf("ReadFile(%q): %v", fixtureExpect, err)
|
||||
}
|
||||
} else {
|
||||
if string(expectGoSrc) != string(goSrc) {
|
||||
t.Errorf("Mismatch(%q)", fixtureExpect)
|
||||
t.Log(lineDiff(string(expectGoSrc), string(goSrc)))
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
testFixture("../../examples/uidesigner/design.ui", false)
|
||||
|
||||
ents, err := os.ReadDir("testdata")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
for _, ent := range ents {
|
||||
if !strings.HasSuffix(ent.Name(), ".ui") {
|
||||
continue
|
||||
}
|
||||
testFixture(filepath.Join("testdata", ent.Name()), strings.HasPrefix(ent.Name(), "qt6"))
|
||||
}
|
||||
|
||||
testFixture("../../examples/uidesigner/design.ui")
|
||||
}
|
||||
|
@ -4,6 +4,9 @@ RUN wget 'https://go.dev/dl/go1.23.1.linux-amd64.tar.gz' && \
|
||||
tar x -C /usr/local/ -f go1.23.1.linux-amd64.tar.gz && \
|
||||
rm go1.23.1.linux-amd64.tar.gz
|
||||
|
||||
COPY cmd/android-stub-gen/android-stub-gen.sh /usr/local/bin/android-stub-gen.sh
|
||||
COPY cmd/android-mktemplate/android-mktemplate.sh /usr/local/bin/android-mktemplate.sh
|
||||
|
||||
ENV PATH=/usr/local/go/bin:/opt/cmake/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/Qt-5.15.13/bin:/opt/android-sdk/cmdline-tools/tools/bin:/opt/android-sdk/tools:/opt/android-sdk/tools/bin:/opt/android-sdk/platform-tools
|
||||
|
||||
# The pkg-config definitions were all installed with platform-specific suffixes
|
||||
@ -11,10 +14,6 @@ ENV PATH=/usr/local/go/bin:/opt/cmake/bin:/usr/local/sbin:/usr/local/bin:/usr/sb
|
||||
# This container is targeting armv8-a, so set up simple symlinks
|
||||
RUN /bin/bash -c 'cd /usr/local/Qt-5.15.13/lib/pkgconfig ; for f in *_arm64-v8a.pc ; do cp $f "$(basename -s _arm64-v8a.pc "$f").pc"; done'
|
||||
|
||||
# This is gross but (A) it's containerized and (B) allows --uid=1000 to perform builds
|
||||
# Only needed for certain problematic versions of the Android SDK; a readonly SDK works in both older+newer SDKs
|
||||
RUN /bin/bash -c 'find /opt/android-sdk/ -type d -exec chmod 777 {} \; && find /opt/android-sdk/ -perm 660 -exec chmod 666 {} \;'
|
||||
|
||||
ENV CC=/opt/android-sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android30-clang
|
||||
ENV CXX=/opt/android-sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android30-clang++
|
||||
ENV CGO_ENABLED=1
|
||||
|
@ -9,6 +9,9 @@ RUN wget 'https://go.dev/dl/go1.23.6.linux-amd64.tar.gz' && \
|
||||
tar x -C /usr/local/ -f go1.23.6.linux-amd64.tar.gz && \
|
||||
rm go1.23.6.linux-amd64.tar.gz
|
||||
|
||||
COPY cmd/android-stub-gen/android-stub-gen.sh /usr/local/bin/android-stub-gen.sh
|
||||
COPY cmd/android-mktemplate/android-mktemplate.sh /usr/local/bin/android-mktemplate.sh
|
||||
|
||||
# Fix up pkg-config definitions:
|
||||
# 1. There are only pkg-config definitions included for gcc_64 (Linux native), not for the android_arm64_v8a target we actually want
|
||||
# 2. It looks for `Libs: -L${libdir} -lQt6Widgets` but the file is named libQt6Widgets_arm64-v8a.so
|
||||
|
@ -1,16 +0,0 @@
|
||||
// This Go file exports all the *.Dockerfile files for miqt-docker to use.
|
||||
package docker
|
||||
|
||||
import (
|
||||
"embed"
|
||||
)
|
||||
|
||||
//go:embed *.Dockerfile
|
||||
var Dockerfiles embed.FS
|
||||
|
||||
// ReadFile returns the content of one of the dockerfiles.
|
||||
// That's because an embed.FS appears out-of-package as a []fs.DirEntry, which
|
||||
// isn't directly readable.
|
||||
func ReadFile(name string) ([]byte, error) {
|
||||
return Dockerfiles.ReadFile(name)
|
||||
}
|
@ -5,7 +5,6 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
|
||||
golang-go \
|
||||
qtbase5-dev \
|
||||
qtmultimedia5-dev \
|
||||
qtpdf5-dev \
|
||||
qtscript5-dev \
|
||||
libqt5svg5-dev \
|
||||
libqt5webkit5-dev \
|
||||
@ -14,7 +13,6 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
|
||||
qt6-charts-dev \
|
||||
qt6-declarative-dev \
|
||||
qt6-multimedia-dev \
|
||||
qt6-pdf-dev \
|
||||
qt6-svg-dev \
|
||||
qt6-webengine-dev \
|
||||
libqscintilla2-qt5-dev \
|
||||
@ -39,43 +37,10 @@ RUN \
|
||||
qmake && \
|
||||
make
|
||||
|
||||
# Custom pkg-config definitions
|
||||
|
||||
RUN mkdir -p /usr/local/lib/pkgconfig
|
||||
|
||||
RUN echo 'includedir=/usr/include/x86_64-linux-gnu/qt5/Qsci/' \
|
||||
'\n' \
|
||||
'\nName: QScintilla' \
|
||||
'\nDescription: Qt5 port of the Scintilla source code editing widget' \
|
||||
'\nURL: http://www.riverbankcomputing.co.uk/software/qscintilla' \
|
||||
'\nVersion: 2.13.3' \
|
||||
'\nRequires: Qt5Widgets, Qt5PrintSupport' \
|
||||
'\nLibs: -lqscintilla2_qt5' \
|
||||
'\nCflags: -I${includedir}' \
|
||||
> /usr/local/lib/pkgconfig/QScintilla.pc
|
||||
|
||||
RUN echo 'includedir=/usr/include/x86_64-linux-gnu/qt6/Qsci/' \
|
||||
'\n' \
|
||||
'\nName: QScintilla6' \
|
||||
'\nDescription: Qt6 port of the Scintilla source code editing widget' \
|
||||
'\nURL: http://www.riverbankcomputing.co.uk/software/qscintilla' \
|
||||
'\nVersion: 2.13.3' \
|
||||
'\nRequires: Qt6Widgets, Qt6PrintSupport' \
|
||||
'\nLibs: -lqscintilla2_qt6' \
|
||||
'\nCflags: -I${includedir}' \
|
||||
> /usr/local/lib/pkgconfig/QScintilla6.pc
|
||||
|
||||
RUN echo 'srcdir=/usr/local/src/scintilla/' \
|
||||
'\n' \
|
||||
'\nName: ScintillaEdit' \
|
||||
'\nDescription: Scintilla upstream Qt port' \
|
||||
'\nURL: https://www.scintilla.org/' \
|
||||
'\nVersion: 5.5.2' \
|
||||
'\nRequires: Qt5Widgets' \
|
||||
'\nLibs: -L${srcdir}/bin -lScintillaEdit' \
|
||||
'\nCflags: -include stdint.h -I${srcdir}/qt/ScintillaEdit -I${srcdir}/qt/ScintillaEditBase -I${srcdir}/include -I${srcdir}/src' \
|
||||
> /usr/local/lib/pkgconfig/ScintillaEdit.pc
|
||||
|
||||
#
|
||||
COPY pkg-config/QScintilla.pc.example /usr/local/lib/pkgconfig/QScintilla.pc
|
||||
COPY pkg-config/QScintilla6.pc.example /usr/local/lib/pkgconfig/QScintilla6.pc
|
||||
COPY pkg-config/ScintillaEdit.pc.example /usr/local/lib/pkgconfig/ScintillaEdit.pc
|
||||
|
||||
ENV GOFLAGS=-buildvcs=false
|
||||
|
29
examples/android/main.go
Normal file
@ -0,0 +1,29 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/mappu/miqt/qt"
|
||||
)
|
||||
|
||||
func myRealMainFunc() {
|
||||
|
||||
qt.NewQApplication(os.Args)
|
||||
|
||||
btn := qt.NewQPushButton3("Hello world!")
|
||||
btn.SetFixedWidth(320)
|
||||
|
||||
var counter int = 0
|
||||
|
||||
btn.OnPressed(func() {
|
||||
counter++
|
||||
btn.SetText(fmt.Sprintf("You have clicked the button %d time(s)", counter))
|
||||
})
|
||||
|
||||
btn.Show()
|
||||
|
||||
qt.QApplication_Exec()
|
||||
|
||||
fmt.Println("OK!")
|
||||
}
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 33 KiB |
14
examples/android/startup_android.go
Normal file
@ -0,0 +1,14 @@
|
||||
// +build android
|
||||
|
||||
package main
|
||||
|
||||
import "C" // Required for export support
|
||||
|
||||
//export AndroidMain
|
||||
func AndroidMain() {
|
||||
myRealMainFunc()
|
||||
}
|
||||
|
||||
func main() {
|
||||
// Must be empty
|
||||
}
|
7
examples/android/startup_other.go
Normal file
@ -0,0 +1,7 @@
|
||||
// +build !android
|
||||
|
||||
package main
|
||||
|
||||
func main() {
|
||||
myRealMainFunc()
|
||||
}
|
29
examples/android6/main.go
Normal file
@ -0,0 +1,29 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
qt "github.com/mappu/miqt/qt6"
|
||||
)
|
||||
|
||||
func myRealMainFunc() {
|
||||
|
||||
qt.NewQApplication(os.Args)
|
||||
|
||||
btn := qt.NewQPushButton3("Hello world!")
|
||||
btn.SetFixedWidth(320)
|
||||
|
||||
var counter int = 0
|
||||
|
||||
btn.OnPressed(func() {
|
||||
counter++
|
||||
btn.SetText(fmt.Sprintf("You have clicked the button %d time(s)", counter))
|
||||
})
|
||||
|
||||
btn.Show()
|
||||
|
||||
qt.QApplication_Exec()
|
||||
|
||||
fmt.Println("OK!")
|
||||
}
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
14
examples/android6/startup_android.go
Normal file
@ -0,0 +1,14 @@
|
||||
// +build android
|
||||
|
||||
package main
|
||||
|
||||
import "C" // Required for export support
|
||||
|
||||
//export AndroidMain
|
||||
func AndroidMain() {
|
||||
myRealMainFunc()
|
||||
}
|
||||
|
||||
func main() {
|
||||
// Must be empty
|
||||
}
|
7
examples/android6/startup_other.go
Normal file
@ -0,0 +1,7 @@
|
||||
// +build !android
|
||||
|
||||
package main
|
||||
|
||||
func main() {
|
||||
myRealMainFunc()
|
||||
}
|
Before Width: | Height: | Size: 5.1 KiB |
@ -1,52 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
qt "github.com/mappu/miqt/qt6"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
qt.NewQApplication(os.Args)
|
||||
|
||||
widget := qt.NewQWidget2()
|
||||
defer widget.Delete()
|
||||
|
||||
widget.SetWindowTitle("Qt 6 LCD Clock Example")
|
||||
widget.Resize(360, 240)
|
||||
|
||||
hbox := qt.NewQHBoxLayout(widget)
|
||||
|
||||
lcd := qt.NewQLCDNumber(widget)
|
||||
lcd.SetStyleSheet("background-color: #729fcf; color: white;")
|
||||
|
||||
time := qt.QTime_CurrentTime()
|
||||
defer time.Delete()
|
||||
|
||||
text := time.ToStringWithFormat("hh:mm")
|
||||
if (time.Second() % 2) == 0 {
|
||||
text = strings.Replace(text, ":", " ", -1)
|
||||
}
|
||||
lcd.Display(text)
|
||||
|
||||
hbox.AddWidget(lcd.QFrame.QWidget)
|
||||
|
||||
timer := qt.NewQTimer2(widget.QObject)
|
||||
timer.Start(1000)
|
||||
timer.OnTimeout(func() {
|
||||
time := qt.QTime_CurrentTime()
|
||||
defer time.Delete()
|
||||
|
||||
text := time.ToStringWithFormat("hh:mm")
|
||||
if (time.Second() % 2) == 0 {
|
||||
text = strings.Replace(text, ":", " ", -1)
|
||||
}
|
||||
lcd.Display(text)
|
||||
})
|
||||
|
||||
widget.Show()
|
||||
|
||||
qt.QApplication_Exec()
|
||||
}
|
@ -1,27 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/mappu/miqt/qt"
|
||||
"github.com/mappu/miqt/qt/pdf"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
qt.NewQApplication(os.Args)
|
||||
|
||||
d := pdf.NewQPdfDocument()
|
||||
d.Load("example.pdf")
|
||||
|
||||
p := pdf.NewQPdfView2()
|
||||
p.SetWindowTitle("Qt 5 PDF Example")
|
||||
p.SetMinimumSize2(650, 600)
|
||||
p.SetPageMode(pdf.QPdfView__MultiPage)
|
||||
p.SetZoomMode(pdf.QPdfView__FitInView)
|
||||
p.SetDocument(d)
|
||||
|
||||
p.Show()
|
||||
|
||||
qt.QApplication_Exec()
|
||||
}
|
Before Width: | Height: | Size: 29 KiB |
@ -1,27 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
qt "github.com/mappu/miqt/qt6"
|
||||
"github.com/mappu/miqt/qt6/pdf"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
qt.NewQApplication(os.Args)
|
||||
|
||||
d := pdf.NewQPdfDocument()
|
||||
d.Load("example.pdf")
|
||||
|
||||
p := pdf.NewQPdfView2()
|
||||
p.SetWindowTitle("Qt 6 PDF Example")
|
||||
p.SetMinimumSize2(650, 600)
|
||||
p.SetPageMode(pdf.QPdfView__MultiPage)
|
||||
p.SetZoomMode(pdf.QPdfView__FitInView)
|
||||
p.SetDocument(d)
|
||||
|
||||
p.Show()
|
||||
|
||||
qt.QApplication_Exec()
|
||||
}
|
Before Width: | Height: | Size: 25 KiB |
9
pkg-config/QScintilla.pc.example
Normal file
@ -0,0 +1,9 @@
|
||||
includedir=/usr/include/x86_64-linux-gnu/qt5/Qsci/
|
||||
|
||||
Name: QScintilla
|
||||
Description: Qt5 port of the Scintilla source code editing widget
|
||||
URL: http://www.riverbankcomputing.co.uk/software/qscintilla
|
||||
Version: 2.13.3
|
||||
Requires: Qt5Widgets, Qt5PrintSupport
|
||||
Libs: -lqscintilla2_qt5
|
||||
Cflags: -I${includedir}
|
9
pkg-config/QScintilla6.pc.example
Normal file
@ -0,0 +1,9 @@
|
||||
includedir=/usr/include/x86_64-linux-gnu/qt6/Qsci/
|
||||
|
||||
Name: QScintilla6
|
||||
Description: Qt6 port of the Scintilla source code editing widget
|
||||
URL: http://www.riverbankcomputing.co.uk/software/qscintilla
|
||||
Version: 2.13.3
|
||||
Requires: Qt6Widgets, Qt6PrintSupport
|
||||
Libs: -lqscintilla2_qt6
|
||||
Cflags: -I${includedir}
|
@ -8,7 +8,6 @@ To specify the CFLAGS/CXXFLAGS and LDFLAGS for a specific library, make a `MyLib
|
||||
|
||||
```pkgconfig
|
||||
Name: My Library
|
||||
Requires: Qt6Widgets
|
||||
Libs: -lfoo
|
||||
Cflags: -I/path/
|
||||
```
|
||||
@ -17,8 +16,6 @@ Then run `PKG_CONFIG_PATH=/path/to/dir/ go build` so CGO will find your library.
|
||||
|
||||
The `PKG_CONFIG_PATH` environment variable is understood both by CGO and by genbindings.
|
||||
|
||||
When running genbindings in the docker/genbindings container, custom pkg-config files are created inline in the Dockerfile.
|
||||
|
||||
## Further reading
|
||||
|
||||
- [Guide to pkg-config](https://people.freedesktop.org/~dbn/pkg-config-guide.html)
|
||||
@ -28,23 +25,3 @@ When running genbindings in the docker/genbindings container, custom pkg-config
|
||||
$ pkg-config --variable pc_path pkg-config
|
||||
/usr/local/lib/x86_64-linux-gnu/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig
|
||||
```
|
||||
|
||||
List all available packages known to pkg-config:
|
||||
|
||||
```bash
|
||||
pkg-config --list-all
|
||||
```
|
||||
|
||||
A full example for QScintilla (Qt 5) from the [genbindings.Dockerfile](../docker/genbindings.Dockerfile):
|
||||
|
||||
```pkg-config
|
||||
includedir=/usr/include/x86_64-linux-gnu/qt5/Qsci/
|
||||
|
||||
Name: QScintilla
|
||||
Description: Qt5 port of the Scintilla source code editing widget
|
||||
URL: http://www.riverbankcomputing.co.uk/software/qscintilla
|
||||
Version: 2.13.3
|
||||
Requires: Qt5Widgets, Qt5PrintSupport
|
||||
Libs: -lqscintilla2_qt5
|
||||
Cflags: -I${includedir}
|
||||
```
|
9
pkg-config/ScintillaEdit.pc.example
Normal file
@ -0,0 +1,9 @@
|
||||
srcdir=/usr/local/src/scintilla/
|
||||
|
||||
Name: ScintillaEdit
|
||||
Description: Scintilla's own upstream Qt port
|
||||
URL: https://www.scintilla.org/
|
||||
Version: 5.5.2
|
||||
Requires: Qt5Widgets
|
||||
Libs: -L${srcdir}/bin -lScintillaEdit
|
||||
Cflags: -include stdint.h -I${srcdir}/qt/ScintillaEdit -I${srcdir}/qt/ScintillaEditBase -I${srcdir}/include -I${srcdir}/src
|
@ -315,7 +315,6 @@ bool Scintilla__Internal__Point_operatorEqual(const Scintilla__Internal__Point*
|
||||
bool Scintilla__Internal__Point_operatorNotEqual(const Scintilla__Internal__Point* self, Scintilla__Internal__Point* other);
|
||||
Scintilla__Internal__Point* Scintilla__Internal__Point_operatorPlus(const Scintilla__Internal__Point* self, Scintilla__Internal__Point* other);
|
||||
Scintilla__Internal__Point* Scintilla__Internal__Point_operatorMinus(const Scintilla__Internal__Point* self, Scintilla__Internal__Point* other);
|
||||
|
||||
void Scintilla__Internal__Point_delete(Scintilla__Internal__Point* self);
|
||||
|
||||
bool Scintilla__Internal__Interval_operatorEqual(const Scintilla__Internal__Interval* self, Scintilla__Internal__Interval* other);
|
||||
@ -323,7 +322,6 @@ double Scintilla__Internal__Interval_Width(const Scintilla__Internal__Interval*
|
||||
bool Scintilla__Internal__Interval_Empty(const Scintilla__Internal__Interval* self);
|
||||
bool Scintilla__Internal__Interval_Intersects(const Scintilla__Internal__Interval* self, Scintilla__Internal__Interval* other);
|
||||
Scintilla__Internal__Interval* Scintilla__Internal__Interval_Offset(const Scintilla__Internal__Interval* self, double offset);
|
||||
|
||||
void Scintilla__Internal__Interval_delete(Scintilla__Internal__Interval* self);
|
||||
|
||||
Scintilla__Internal__PRectangle* Scintilla__Internal__PRectangle_new();
|
||||
@ -347,7 +345,6 @@ Scintilla__Internal__Point* Scintilla__Internal__PRectangle_Centre(const Scintil
|
||||
double Scintilla__Internal__PRectangle_Width(const Scintilla__Internal__PRectangle* self);
|
||||
double Scintilla__Internal__PRectangle_Height(const Scintilla__Internal__PRectangle* self);
|
||||
bool Scintilla__Internal__PRectangle_Empty(const Scintilla__Internal__PRectangle* self);
|
||||
|
||||
void Scintilla__Internal__PRectangle_delete(Scintilla__Internal__PRectangle* self);
|
||||
|
||||
Scintilla__Internal__ColourRGBA* Scintilla__Internal__ColourRGBA_new();
|
||||
@ -377,14 +374,12 @@ Scintilla__Internal__ColourRGBA* Scintilla__Internal__ColourRGBA_MixedWith(const
|
||||
Scintilla__Internal__ColourRGBA* Scintilla__Internal__ColourRGBA_MixedWith2(const Scintilla__Internal__ColourRGBA* self, Scintilla__Internal__ColourRGBA* other, double proportion);
|
||||
void Scintilla__Internal__ColourRGBA_operatorAssign(Scintilla__Internal__ColourRGBA* self, Scintilla__Internal__ColourRGBA* param1);
|
||||
Scintilla__Internal__ColourRGBA* Scintilla__Internal__ColourRGBA_Grey2(unsigned int grey, unsigned int alpha);
|
||||
|
||||
void Scintilla__Internal__ColourRGBA_delete(Scintilla__Internal__ColourRGBA* self);
|
||||
|
||||
Scintilla__Internal__Stroke* Scintilla__Internal__Stroke_new(Scintilla__Internal__ColourRGBA* colour_);
|
||||
Scintilla__Internal__Stroke* Scintilla__Internal__Stroke_new2(Scintilla__Internal__Stroke* param1);
|
||||
Scintilla__Internal__Stroke* Scintilla__Internal__Stroke_new3(Scintilla__Internal__ColourRGBA* colour_, double width_);
|
||||
float Scintilla__Internal__Stroke_WidthF(const Scintilla__Internal__Stroke* self);
|
||||
|
||||
void Scintilla__Internal__Stroke_delete(Scintilla__Internal__Stroke* self);
|
||||
|
||||
Scintilla__Internal__Fill* Scintilla__Internal__Fill_new(Scintilla__Internal__ColourRGBA* colour_);
|
||||
@ -446,13 +441,11 @@ Scintilla__Internal__Font* Scintilla__Internal__IScreenLine_FontOfPosition(const
|
||||
double Scintilla__Internal__IScreenLine_RepresentationWidth(const Scintilla__Internal__IScreenLine* self, size_t position);
|
||||
double Scintilla__Internal__IScreenLine_TabPositionAfter(const Scintilla__Internal__IScreenLine* self, double xPosition);
|
||||
void Scintilla__Internal__IScreenLine_operatorAssign(Scintilla__Internal__IScreenLine* self, Scintilla__Internal__IScreenLine* param1);
|
||||
|
||||
void Scintilla__Internal__IScreenLine_delete(Scintilla__Internal__IScreenLine* self);
|
||||
|
||||
size_t Scintilla__Internal__IScreenLineLayout_PositionFromX(Scintilla__Internal__IScreenLineLayout* self, double xDistance, bool charPosition);
|
||||
double Scintilla__Internal__IScreenLineLayout_XFromPosition(Scintilla__Internal__IScreenLineLayout* self, size_t caretPosition);
|
||||
void Scintilla__Internal__IScreenLineLayout_operatorAssign(Scintilla__Internal__IScreenLineLayout* self, Scintilla__Internal__IScreenLineLayout* param1);
|
||||
|
||||
void Scintilla__Internal__IScreenLineLayout_delete(Scintilla__Internal__IScreenLineLayout* self);
|
||||
|
||||
Scintilla__Internal__SurfaceMode* Scintilla__Internal__SurfaceMode_new();
|
||||
@ -491,7 +484,6 @@ void Scintilla__Internal__Surface_SetClip(Scintilla__Internal__Surface* self, Sc
|
||||
void Scintilla__Internal__Surface_PopClip(Scintilla__Internal__Surface* self);
|
||||
void Scintilla__Internal__Surface_FlushCachedState(Scintilla__Internal__Surface* self);
|
||||
void Scintilla__Internal__Surface_FlushDrawing(Scintilla__Internal__Surface* self);
|
||||
|
||||
void Scintilla__Internal__Surface_delete(Scintilla__Internal__Surface* self);
|
||||
|
||||
Scintilla__Internal__Window* Scintilla__Internal__Window_new();
|
||||
@ -509,7 +501,6 @@ void Scintilla__Internal__Window_InvalidateRectangle(Scintilla__Internal__Window
|
||||
void Scintilla__Internal__Window_SetCursor(Scintilla__Internal__Window* self, int curs);
|
||||
Scintilla__Internal__PRectangle* Scintilla__Internal__Window_GetMonitorRect(Scintilla__Internal__Window* self, Scintilla__Internal__Point* pt);
|
||||
void Scintilla__Internal__Window_ShowWithShow(Scintilla__Internal__Window* self, bool show);
|
||||
|
||||
void Scintilla__Internal__Window_delete(Scintilla__Internal__Window* self);
|
||||
|
||||
Scintilla__Internal__ListBoxEvent* Scintilla__Internal__ListBoxEvent_new(int event_);
|
||||
@ -517,7 +508,6 @@ void Scintilla__Internal__ListBoxEvent_delete(Scintilla__Internal__ListBoxEvent*
|
||||
|
||||
void Scintilla__Internal__IListBoxDelegate_ListNotify(Scintilla__Internal__IListBoxDelegate* self, Scintilla__Internal__ListBoxEvent* plbe);
|
||||
void Scintilla__Internal__IListBoxDelegate_operatorAssign(Scintilla__Internal__IListBoxDelegate* self, Scintilla__Internal__IListBoxDelegate* param1);
|
||||
|
||||
void Scintilla__Internal__IListBoxDelegate_delete(Scintilla__Internal__IListBoxDelegate* self);
|
||||
|
||||
void Scintilla__Internal__ListOptions_delete(Scintilla__Internal__ListOptions* self);
|
||||
@ -542,7 +532,6 @@ void Scintilla__Internal__ListBox_ClearRegisteredImages(Scintilla__Internal__Lis
|
||||
void Scintilla__Internal__ListBox_SetDelegate(Scintilla__Internal__ListBox* self, Scintilla__Internal__IListBoxDelegate* lbDelegate);
|
||||
void Scintilla__Internal__ListBox_SetList(Scintilla__Internal__ListBox* self, const char* list, char separator, char typesep);
|
||||
void Scintilla__Internal__ListBox_SetOptions(Scintilla__Internal__ListBox* self, Scintilla__Internal__ListOptions* options_);
|
||||
|
||||
void Scintilla__Internal__ListBox_delete(Scintilla__Internal__ListBox* self);
|
||||
|
||||
Scintilla__Internal__Menu* Scintilla__Internal__Menu_new();
|
||||
@ -550,7 +539,6 @@ void* Scintilla__Internal__Menu_GetID(const Scintilla__Internal__Menu* self);
|
||||
void Scintilla__Internal__Menu_CreatePopUp(Scintilla__Internal__Menu* self);
|
||||
void Scintilla__Internal__Menu_Destroy(Scintilla__Internal__Menu* self);
|
||||
void Scintilla__Internal__Menu_Show(Scintilla__Internal__Menu* self, Scintilla__Internal__Point* pt, Scintilla__Internal__Window* w);
|
||||
|
||||
void Scintilla__Internal__Menu_delete(Scintilla__Internal__Menu* self);
|
||||
|
||||
void Sci_CharacterRange_delete(Sci_CharacterRange* self);
|
||||
@ -685,7 +673,6 @@ struct miqt_string ScintillaEditBase_tr2(const char* s, const char* c);
|
||||
struct miqt_string ScintillaEditBase_tr3(const char* s, const char* c, int n);
|
||||
struct miqt_string ScintillaEditBase_trUtf82(const char* s, const char* c);
|
||||
struct miqt_string ScintillaEditBase_trUtf83(const char* s, const char* c, int n);
|
||||
|
||||
bool ScintillaEditBase_override_virtual_send(void* self, intptr_t slot);
|
||||
intptr_t ScintillaEditBase_virtualbase_send(const void* self, unsigned int iMessage, uintptr_t wParam, intptr_t lParam);
|
||||
bool ScintillaEditBase_override_virtual_sends(void* self, intptr_t slot);
|
||||
@ -792,7 +779,6 @@ bool ScintillaEditBase_override_virtual_connectNotify(void* self, intptr_t slot)
|
||||
void ScintillaEditBase_virtualbase_connectNotify(void* self, QMetaMethod* signal);
|
||||
bool ScintillaEditBase_override_virtual_disconnectNotify(void* self, intptr_t slot);
|
||||
void ScintillaEditBase_virtualbase_disconnectNotify(void* self, QMetaMethod* signal);
|
||||
|
||||
void ScintillaEditBase_protectedbase_setViewportMargins(bool* _dynamic_cast_ok, void* self, int left, int top, int right, int bottom);
|
||||
QMargins* ScintillaEditBase_protectedbase_viewportMargins(bool* _dynamic_cast_ok, const void* self);
|
||||
void ScintillaEditBase_protectedbase_drawFrame(bool* _dynamic_cast_ok, void* self, QPainter* param1);
|
||||
@ -806,7 +792,6 @@ QObject* ScintillaEditBase_protectedbase_sender(bool* _dynamic_cast_ok, const vo
|
||||
int ScintillaEditBase_protectedbase_senderSignalIndex(bool* _dynamic_cast_ok, const void* self);
|
||||
int ScintillaEditBase_protectedbase_receivers(bool* _dynamic_cast_ok, const void* self, const char* signal);
|
||||
bool ScintillaEditBase_protectedbase_isSignalConnected(bool* _dynamic_cast_ok, const void* self, QMetaMethod* signal);
|
||||
|
||||
void ScintillaEditBase_delete(ScintillaEditBase* self);
|
||||
|
||||
ScintillaDocument* ScintillaDocument_new();
|
||||
@ -872,7 +857,6 @@ struct miqt_string ScintillaDocument_tr3(const char* s, const char* c, int n);
|
||||
struct miqt_string ScintillaDocument_trUtf82(const char* s, const char* c);
|
||||
struct miqt_string ScintillaDocument_trUtf83(const char* s, const char* c, int n);
|
||||
void ScintillaDocument_beginUndoActionWithCoalesceWithPrior(ScintillaDocument* self, bool coalesceWithPrior);
|
||||
|
||||
bool ScintillaDocument_override_virtual_event(void* self, intptr_t slot);
|
||||
bool ScintillaDocument_virtualbase_event(void* self, QEvent* event);
|
||||
bool ScintillaDocument_override_virtual_eventFilter(void* self, intptr_t slot);
|
||||
@ -887,12 +871,10 @@ bool ScintillaDocument_override_virtual_connectNotify(void* self, intptr_t slot)
|
||||
void ScintillaDocument_virtualbase_connectNotify(void* self, QMetaMethod* signal);
|
||||
bool ScintillaDocument_override_virtual_disconnectNotify(void* self, intptr_t slot);
|
||||
void ScintillaDocument_virtualbase_disconnectNotify(void* self, QMetaMethod* signal);
|
||||
|
||||
QObject* ScintillaDocument_protectedbase_sender(bool* _dynamic_cast_ok, const void* self);
|
||||
int ScintillaDocument_protectedbase_senderSignalIndex(bool* _dynamic_cast_ok, const void* self);
|
||||
int ScintillaDocument_protectedbase_receivers(bool* _dynamic_cast_ok, const void* self, const char* signal);
|
||||
bool ScintillaDocument_protectedbase_isSignalConnected(bool* _dynamic_cast_ok, const void* self, QMetaMethod* signal);
|
||||
|
||||
void ScintillaDocument_delete(ScintillaDocument* self);
|
||||
|
||||
ScintillaEdit* ScintillaEdit_new(QWidget* parent);
|
||||
@ -1715,7 +1697,6 @@ struct miqt_string ScintillaEdit_tr2(const char* s, const char* c);
|
||||
struct miqt_string ScintillaEdit_tr3(const char* s, const char* c, int n);
|
||||
struct miqt_string ScintillaEdit_trUtf82(const char* s, const char* c);
|
||||
struct miqt_string ScintillaEdit_trUtf83(const char* s, const char* c, int n);
|
||||
|
||||
bool ScintillaEdit_override_virtual_send(void* self, intptr_t slot);
|
||||
intptr_t ScintillaEdit_virtualbase_send(const void* self, unsigned int iMessage, uintptr_t wParam, intptr_t lParam);
|
||||
bool ScintillaEdit_override_virtual_sends(void* self, intptr_t slot);
|
||||
@ -1822,7 +1803,6 @@ bool ScintillaEdit_override_virtual_connectNotify(void* self, intptr_t slot);
|
||||
void ScintillaEdit_virtualbase_connectNotify(void* self, QMetaMethod* signal);
|
||||
bool ScintillaEdit_override_virtual_disconnectNotify(void* self, intptr_t slot);
|
||||
void ScintillaEdit_virtualbase_disconnectNotify(void* self, QMetaMethod* signal);
|
||||
|
||||
void ScintillaEdit_protectedbase_setViewportMargins(bool* _dynamic_cast_ok, void* self, int left, int top, int right, int bottom);
|
||||
QMargins* ScintillaEdit_protectedbase_viewportMargins(bool* _dynamic_cast_ok, const void* self);
|
||||
void ScintillaEdit_protectedbase_drawFrame(bool* _dynamic_cast_ok, void* self, QPainter* param1);
|
||||
@ -1836,7 +1816,6 @@ QObject* ScintillaEdit_protectedbase_sender(bool* _dynamic_cast_ok, const void*
|
||||
int ScintillaEdit_protectedbase_senderSignalIndex(bool* _dynamic_cast_ok, const void* self);
|
||||
int ScintillaEdit_protectedbase_receivers(bool* _dynamic_cast_ok, const void* self, const char* signal);
|
||||
bool ScintillaEdit_protectedbase_isSignalConnected(bool* _dynamic_cast_ok, const void* self, QMetaMethod* signal);
|
||||
|
||||
void ScintillaEdit_delete(ScintillaEdit* self);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -171,7 +171,6 @@ void QAbstractAxis_setShadesVisibleWithVisible(QAbstractAxis* self, bool visible
|
||||
void QAbstractAxis_setReverseWithReverse(QAbstractAxis* self, bool reverse);
|
||||
void QAbstractAxis_setLabelsEditableWithEditable(QAbstractAxis* self, bool editable);
|
||||
void QAbstractAxis_setTruncateLabelsWithTruncateLabels(QAbstractAxis* self, bool truncateLabels);
|
||||
|
||||
void QAbstractAxis_delete(QAbstractAxis* self);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -83,7 +83,6 @@ void QAbstractBarSeries_connect_barsetsRemoved(QAbstractBarSeries* self, intptr_
|
||||
struct miqt_string QAbstractBarSeries_tr2(const char* s, const char* c);
|
||||
struct miqt_string QAbstractBarSeries_tr3(const char* s, const char* c, int n);
|
||||
void QAbstractBarSeries_setLabelsVisibleWithVisible(QAbstractBarSeries* self, bool visible);
|
||||
|
||||
void QAbstractBarSeries_delete(QAbstractBarSeries* self);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -61,7 +61,6 @@ struct miqt_string QAbstractSeries_tr2(const char* s, const char* c);
|
||||
struct miqt_string QAbstractSeries_tr3(const char* s, const char* c, int n);
|
||||
void QAbstractSeries_setVisibleWithVisible(QAbstractSeries* self, bool visible);
|
||||
void QAbstractSeries_setUseOpenGLWithEnable(QAbstractSeries* self, bool enable);
|
||||
|
||||
void QAbstractSeries_delete(QAbstractSeries* self);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -34,8 +34,8 @@ void miqt_exec_callback_QAreaLegendMarker_disconnectNotify(QAreaLegendMarker*, i
|
||||
class MiqtVirtualQAreaLegendMarker final : public QAreaLegendMarker {
|
||||
public:
|
||||
|
||||
MiqtVirtualQAreaLegendMarker(QAreaSeries* series, QLegend* legend): QAreaLegendMarker(series, legend) {}
|
||||
MiqtVirtualQAreaLegendMarker(QAreaSeries* series, QLegend* legend, QObject* parent): QAreaLegendMarker(series, legend, parent) {}
|
||||
MiqtVirtualQAreaLegendMarker(QAreaSeries* series, QLegend* legend): QAreaLegendMarker(series, legend) {};
|
||||
MiqtVirtualQAreaLegendMarker(QAreaSeries* series, QLegend* legend, QObject* parent): QAreaLegendMarker(series, legend, parent) {};
|
||||
|
||||
virtual ~MiqtVirtualQAreaLegendMarker() override = default;
|
||||
|
||||
@ -48,7 +48,9 @@ public:
|
||||
return QAreaLegendMarker::type();
|
||||
}
|
||||
|
||||
|
||||
int callback_return_value = miqt_exec_callback_QAreaLegendMarker_type(this, handle__type);
|
||||
|
||||
return static_cast<QLegendMarker::LegendMarkerType>(callback_return_value);
|
||||
}
|
||||
|
||||
@ -63,7 +65,9 @@ public:
|
||||
return QAreaLegendMarker::series();
|
||||
}
|
||||
|
||||
|
||||
QAreaSeries* callback_return_value = miqt_exec_callback_QAreaLegendMarker_series(this, handle__series);
|
||||
|
||||
return callback_return_value;
|
||||
}
|
||||
|
||||
@ -79,7 +83,9 @@ public:
|
||||
}
|
||||
|
||||
QEvent* sigval1 = event;
|
||||
|
||||
bool callback_return_value = miqt_exec_callback_QAreaLegendMarker_event(this, handle__event, sigval1);
|
||||
|
||||
return callback_return_value;
|
||||
}
|
||||
|
||||
@ -96,7 +102,9 @@ public:
|
||||
|
||||
QObject* sigval1 = watched;
|
||||
QEvent* sigval2 = event;
|
||||
|
||||
bool callback_return_value = miqt_exec_callback_QAreaLegendMarker_eventFilter(this, handle__eventFilter, sigval1, sigval2);
|
||||
|
||||
return callback_return_value;
|
||||
}
|
||||
|
||||
@ -113,8 +121,10 @@ public:
|
||||
}
|
||||
|
||||
QTimerEvent* sigval1 = event;
|
||||
|
||||
miqt_exec_callback_QAreaLegendMarker_timerEvent(this, handle__timerEvent, sigval1);
|
||||
|
||||
|
||||
}
|
||||
|
||||
friend void QAreaLegendMarker_virtualbase_timerEvent(void* self, QTimerEvent* event);
|
||||
@ -130,8 +140,10 @@ public:
|
||||
}
|
||||
|
||||
QChildEvent* sigval1 = event;
|
||||
|
||||
miqt_exec_callback_QAreaLegendMarker_childEvent(this, handle__childEvent, sigval1);
|
||||
|
||||
|
||||
}
|
||||
|
||||
friend void QAreaLegendMarker_virtualbase_childEvent(void* self, QChildEvent* event);
|
||||
@ -147,8 +159,10 @@ public:
|
||||
}
|
||||
|
||||
QEvent* sigval1 = event;
|
||||
|
||||
miqt_exec_callback_QAreaLegendMarker_customEvent(this, handle__customEvent, sigval1);
|
||||
|
||||
|
||||
}
|
||||
|
||||
friend void QAreaLegendMarker_virtualbase_customEvent(void* self, QEvent* event);
|
||||
@ -166,8 +180,10 @@ public:
|
||||
const QMetaMethod& signal_ret = signal;
|
||||
// Cast returned reference into pointer
|
||||
QMetaMethod* sigval1 = const_cast<QMetaMethod*>(&signal_ret);
|
||||
|
||||
miqt_exec_callback_QAreaLegendMarker_connectNotify(this, handle__connectNotify, sigval1);
|
||||
|
||||
|
||||
}
|
||||
|
||||
friend void QAreaLegendMarker_virtualbase_connectNotify(void* self, QMetaMethod* signal);
|
||||
@ -185,8 +201,10 @@ public:
|
||||
const QMetaMethod& signal_ret = signal;
|
||||
// Cast returned reference into pointer
|
||||
QMetaMethod* sigval1 = const_cast<QMetaMethod*>(&signal_ret);
|
||||
|
||||
miqt_exec_callback_QAreaLegendMarker_disconnectNotify(this, handle__disconnectNotify, sigval1);
|
||||
|
||||
|
||||
}
|
||||
|
||||
friend void QAreaLegendMarker_virtualbase_disconnectNotify(void* self, QMetaMethod* signal);
|
||||
@ -199,11 +217,11 @@ public:
|
||||
};
|
||||
|
||||
QAreaLegendMarker* QAreaLegendMarker_new(QAreaSeries* series, QLegend* legend) {
|
||||
return new (std::nothrow) MiqtVirtualQAreaLegendMarker(series, legend);
|
||||
return new MiqtVirtualQAreaLegendMarker(series, legend);
|
||||
}
|
||||
|
||||
QAreaLegendMarker* QAreaLegendMarker_new2(QAreaSeries* series, QLegend* legend, QObject* parent) {
|
||||
return new (std::nothrow) MiqtVirtualQAreaLegendMarker(series, legend, parent);
|
||||
return new MiqtVirtualQAreaLegendMarker(series, legend, parent);
|
||||
}
|
||||
|
||||
void QAreaLegendMarker_virtbase(QAreaLegendMarker* src, QLegendMarker** outptr_QLegendMarker) {
|
||||
@ -271,8 +289,10 @@ bool QAreaLegendMarker_override_virtual_type(void* self, intptr_t slot) {
|
||||
}
|
||||
|
||||
int QAreaLegendMarker_virtualbase_type(void* self) {
|
||||
MiqtVirtualQAreaLegendMarker::LegendMarkerType _ret = static_cast<MiqtVirtualQAreaLegendMarker*>(self)->QAreaLegendMarker::type();
|
||||
|
||||
MiqtVirtualQAreaLegendMarker::LegendMarkerType _ret = ( (MiqtVirtualQAreaLegendMarker*)(self) )->QAreaLegendMarker::type();
|
||||
return static_cast<int>(_ret);
|
||||
|
||||
}
|
||||
|
||||
bool QAreaLegendMarker_override_virtual_series(void* self, intptr_t slot) {
|
||||
@ -286,7 +306,9 @@ bool QAreaLegendMarker_override_virtual_series(void* self, intptr_t slot) {
|
||||
}
|
||||
|
||||
QAreaSeries* QAreaLegendMarker_virtualbase_series(void* self) {
|
||||
return static_cast<MiqtVirtualQAreaLegendMarker*>(self)->QAreaLegendMarker::series();
|
||||
|
||||
return ( (MiqtVirtualQAreaLegendMarker*)(self) )->QAreaLegendMarker::series();
|
||||
|
||||
}
|
||||
|
||||
bool QAreaLegendMarker_override_virtual_event(void* self, intptr_t slot) {
|
||||
@ -300,7 +322,9 @@ bool QAreaLegendMarker_override_virtual_event(void* self, intptr_t slot) {
|
||||
}
|
||||
|
||||
bool QAreaLegendMarker_virtualbase_event(void* self, QEvent* event) {
|
||||
return static_cast<MiqtVirtualQAreaLegendMarker*>(self)->QAreaLegendMarker::event(event);
|
||||
|
||||
return ( (MiqtVirtualQAreaLegendMarker*)(self) )->QAreaLegendMarker::event(event);
|
||||
|
||||
}
|
||||
|
||||
bool QAreaLegendMarker_override_virtual_eventFilter(void* self, intptr_t slot) {
|
||||
@ -314,7 +338,9 @@ bool QAreaLegendMarker_override_virtual_eventFilter(void* self, intptr_t slot) {
|
||||
}
|
||||
|
||||
bool QAreaLegendMarker_virtualbase_eventFilter(void* self, QObject* watched, QEvent* event) {
|
||||
return static_cast<MiqtVirtualQAreaLegendMarker*>(self)->QAreaLegendMarker::eventFilter(watched, event);
|
||||
|
||||
return ( (MiqtVirtualQAreaLegendMarker*)(self) )->QAreaLegendMarker::eventFilter(watched, event);
|
||||
|
||||
}
|
||||
|
||||
bool QAreaLegendMarker_override_virtual_timerEvent(void* self, intptr_t slot) {
|
||||
@ -328,7 +354,9 @@ bool QAreaLegendMarker_override_virtual_timerEvent(void* self, intptr_t slot) {
|
||||
}
|
||||
|
||||
void QAreaLegendMarker_virtualbase_timerEvent(void* self, QTimerEvent* event) {
|
||||
static_cast<MiqtVirtualQAreaLegendMarker*>(self)->QAreaLegendMarker::timerEvent(event);
|
||||
|
||||
( (MiqtVirtualQAreaLegendMarker*)(self) )->QAreaLegendMarker::timerEvent(event);
|
||||
|
||||
}
|
||||
|
||||
bool QAreaLegendMarker_override_virtual_childEvent(void* self, intptr_t slot) {
|
||||
@ -342,7 +370,9 @@ bool QAreaLegendMarker_override_virtual_childEvent(void* self, intptr_t slot) {
|
||||
}
|
||||
|
||||
void QAreaLegendMarker_virtualbase_childEvent(void* self, QChildEvent* event) {
|
||||
static_cast<MiqtVirtualQAreaLegendMarker*>(self)->QAreaLegendMarker::childEvent(event);
|
||||
|
||||
( (MiqtVirtualQAreaLegendMarker*)(self) )->QAreaLegendMarker::childEvent(event);
|
||||
|
||||
}
|
||||
|
||||
bool QAreaLegendMarker_override_virtual_customEvent(void* self, intptr_t slot) {
|
||||
@ -356,7 +386,9 @@ bool QAreaLegendMarker_override_virtual_customEvent(void* self, intptr_t slot) {
|
||||
}
|
||||
|
||||
void QAreaLegendMarker_virtualbase_customEvent(void* self, QEvent* event) {
|
||||
static_cast<MiqtVirtualQAreaLegendMarker*>(self)->QAreaLegendMarker::customEvent(event);
|
||||
|
||||
( (MiqtVirtualQAreaLegendMarker*)(self) )->QAreaLegendMarker::customEvent(event);
|
||||
|
||||
}
|
||||
|
||||
bool QAreaLegendMarker_override_virtual_connectNotify(void* self, intptr_t slot) {
|
||||
@ -370,7 +402,9 @@ bool QAreaLegendMarker_override_virtual_connectNotify(void* self, intptr_t slot)
|
||||
}
|
||||
|
||||
void QAreaLegendMarker_virtualbase_connectNotify(void* self, QMetaMethod* signal) {
|
||||
static_cast<MiqtVirtualQAreaLegendMarker*>(self)->QAreaLegendMarker::connectNotify(*signal);
|
||||
|
||||
( (MiqtVirtualQAreaLegendMarker*)(self) )->QAreaLegendMarker::connectNotify(*signal);
|
||||
|
||||
}
|
||||
|
||||
bool QAreaLegendMarker_override_virtual_disconnectNotify(void* self, intptr_t slot) {
|
||||
@ -384,7 +418,9 @@ bool QAreaLegendMarker_override_virtual_disconnectNotify(void* self, intptr_t sl
|
||||
}
|
||||
|
||||
void QAreaLegendMarker_virtualbase_disconnectNotify(void* self, QMetaMethod* signal) {
|
||||
static_cast<MiqtVirtualQAreaLegendMarker*>(self)->QAreaLegendMarker::disconnectNotify(*signal);
|
||||
|
||||
( (MiqtVirtualQAreaLegendMarker*)(self) )->QAreaLegendMarker::disconnectNotify(*signal);
|
||||
|
||||
}
|
||||
|
||||
QObject* QAreaLegendMarker_protectedbase_sender(bool* _dynamic_cast_ok, const void* self) {
|
||||
@ -395,7 +431,9 @@ QObject* QAreaLegendMarker_protectedbase_sender(bool* _dynamic_cast_ok, const vo
|
||||
}
|
||||
|
||||
*_dynamic_cast_ok = true;
|
||||
|
||||
return self_cast->sender();
|
||||
|
||||
}
|
||||
|
||||
int QAreaLegendMarker_protectedbase_senderSignalIndex(bool* _dynamic_cast_ok, const void* self) {
|
||||
@ -406,7 +444,9 @@ int QAreaLegendMarker_protectedbase_senderSignalIndex(bool* _dynamic_cast_ok, co
|
||||
}
|
||||
|
||||
*_dynamic_cast_ok = true;
|
||||
|
||||
return self_cast->senderSignalIndex();
|
||||
|
||||
}
|
||||
|
||||
int QAreaLegendMarker_protectedbase_receivers(bool* _dynamic_cast_ok, const void* self, const char* signal) {
|
||||
@ -417,7 +457,9 @@ int QAreaLegendMarker_protectedbase_receivers(bool* _dynamic_cast_ok, const void
|
||||
}
|
||||
|
||||
*_dynamic_cast_ok = true;
|
||||
|
||||
return self_cast->receivers(signal);
|
||||
|
||||
}
|
||||
|
||||
bool QAreaLegendMarker_protectedbase_isSignalConnected(bool* _dynamic_cast_ok, const void* self, QMetaMethod* signal) {
|
||||
@ -428,7 +470,9 @@ bool QAreaLegendMarker_protectedbase_isSignalConnected(bool* _dynamic_cast_ok, c
|
||||
}
|
||||
|
||||
*_dynamic_cast_ok = true;
|
||||
|
||||
return self_cast->isSignalConnected(*signal);
|
||||
|
||||
}
|
||||
|
||||
void QAreaLegendMarker_delete(QAreaLegendMarker* self) {
|
||||
|
@ -48,7 +48,6 @@ int QAreaLegendMarker_type(QAreaLegendMarker* self);
|
||||
QAreaSeries* QAreaLegendMarker_series(QAreaLegendMarker* self);
|
||||
struct miqt_string QAreaLegendMarker_tr2(const char* s, const char* c);
|
||||
struct miqt_string QAreaLegendMarker_tr3(const char* s, const char* c, int n);
|
||||
|
||||
bool QAreaLegendMarker_override_virtual_type(void* self, intptr_t slot);
|
||||
int QAreaLegendMarker_virtualbase_type(void* self);
|
||||
bool QAreaLegendMarker_override_virtual_series(void* self, intptr_t slot);
|
||||
@ -67,12 +66,10 @@ bool QAreaLegendMarker_override_virtual_connectNotify(void* self, intptr_t slot)
|
||||
void QAreaLegendMarker_virtualbase_connectNotify(void* self, QMetaMethod* signal);
|
||||
bool QAreaLegendMarker_override_virtual_disconnectNotify(void* self, intptr_t slot);
|
||||
void QAreaLegendMarker_virtualbase_disconnectNotify(void* self, QMetaMethod* signal);
|
||||
|
||||
QObject* QAreaLegendMarker_protectedbase_sender(bool* _dynamic_cast_ok, const void* self);
|
||||
int QAreaLegendMarker_protectedbase_senderSignalIndex(bool* _dynamic_cast_ok, const void* self);
|
||||
int QAreaLegendMarker_protectedbase_receivers(bool* _dynamic_cast_ok, const void* self, const char* signal);
|
||||
bool QAreaLegendMarker_protectedbase_isSignalConnected(bool* _dynamic_cast_ok, const void* self, QMetaMethod* signal);
|
||||
|
||||
void QAreaLegendMarker_delete(QAreaLegendMarker* self);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -50,10 +50,10 @@ void miqt_exec_callback_QAreaSeries_disconnectNotify(QAreaSeries*, intptr_t, QMe
|
||||
class MiqtVirtualQAreaSeries final : public QAreaSeries {
|
||||
public:
|
||||
|
||||
MiqtVirtualQAreaSeries(): QAreaSeries() {}
|
||||
MiqtVirtualQAreaSeries(QLineSeries* upperSeries): QAreaSeries(upperSeries) {}
|
||||
MiqtVirtualQAreaSeries(QObject* parent): QAreaSeries(parent) {}
|
||||
MiqtVirtualQAreaSeries(QLineSeries* upperSeries, QLineSeries* lowerSeries): QAreaSeries(upperSeries, lowerSeries) {}
|
||||
MiqtVirtualQAreaSeries(): QAreaSeries() {};
|
||||
MiqtVirtualQAreaSeries(QLineSeries* upperSeries): QAreaSeries(upperSeries) {};
|
||||
MiqtVirtualQAreaSeries(QObject* parent): QAreaSeries(parent) {};
|
||||
MiqtVirtualQAreaSeries(QLineSeries* upperSeries, QLineSeries* lowerSeries): QAreaSeries(upperSeries, lowerSeries) {};
|
||||
|
||||
virtual ~MiqtVirtualQAreaSeries() override = default;
|
||||
|
||||
@ -66,7 +66,9 @@ public:
|
||||
return QAreaSeries::type();
|
||||
}
|
||||
|
||||
|
||||
int callback_return_value = miqt_exec_callback_QAreaSeries_type(this, handle__type);
|
||||
|
||||
return static_cast<QAbstractSeries::SeriesType>(callback_return_value);
|
||||
}
|
||||
|
||||
@ -82,7 +84,9 @@ public:
|
||||
}
|
||||
|
||||
QEvent* sigval1 = event;
|
||||
|
||||
bool callback_return_value = miqt_exec_callback_QAreaSeries_event(this, handle__event, sigval1);
|
||||
|
||||
return callback_return_value;
|
||||
}
|
||||
|
||||
@ -99,7 +103,9 @@ public:
|
||||
|
||||
QObject* sigval1 = watched;
|
||||
QEvent* sigval2 = event;
|
||||
|
||||
bool callback_return_value = miqt_exec_callback_QAreaSeries_eventFilter(this, handle__eventFilter, sigval1, sigval2);
|
||||
|
||||
return callback_return_value;
|
||||
}
|
||||
|
||||
@ -116,8 +122,10 @@ public:
|
||||
}
|
||||
|
||||
QTimerEvent* sigval1 = event;
|
||||
|
||||
miqt_exec_callback_QAreaSeries_timerEvent(this, handle__timerEvent, sigval1);
|
||||
|
||||
|
||||
}
|
||||
|
||||
friend void QAreaSeries_virtualbase_timerEvent(void* self, QTimerEvent* event);
|
||||
@ -133,8 +141,10 @@ public:
|
||||
}
|
||||
|
||||
QChildEvent* sigval1 = event;
|
||||
|
||||
miqt_exec_callback_QAreaSeries_childEvent(this, handle__childEvent, sigval1);
|
||||
|
||||
|
||||
}
|
||||
|
||||
friend void QAreaSeries_virtualbase_childEvent(void* self, QChildEvent* event);
|
||||
@ -150,8 +160,10 @@ public:
|
||||
}
|
||||
|
||||
QEvent* sigval1 = event;
|
||||
|
||||
miqt_exec_callback_QAreaSeries_customEvent(this, handle__customEvent, sigval1);
|
||||
|
||||
|
||||
}
|
||||
|
||||
friend void QAreaSeries_virtualbase_customEvent(void* self, QEvent* event);
|
||||
@ -169,8 +181,10 @@ public:
|
||||
const QMetaMethod& signal_ret = signal;
|
||||
// Cast returned reference into pointer
|
||||
QMetaMethod* sigval1 = const_cast<QMetaMethod*>(&signal_ret);
|
||||
|
||||
miqt_exec_callback_QAreaSeries_connectNotify(this, handle__connectNotify, sigval1);
|
||||
|
||||
|
||||
}
|
||||
|
||||
friend void QAreaSeries_virtualbase_connectNotify(void* self, QMetaMethod* signal);
|
||||
@ -188,8 +202,10 @@ public:
|
||||
const QMetaMethod& signal_ret = signal;
|
||||
// Cast returned reference into pointer
|
||||
QMetaMethod* sigval1 = const_cast<QMetaMethod*>(&signal_ret);
|
||||
|
||||
miqt_exec_callback_QAreaSeries_disconnectNotify(this, handle__disconnectNotify, sigval1);
|
||||
|
||||
|
||||
}
|
||||
|
||||
friend void QAreaSeries_virtualbase_disconnectNotify(void* self, QMetaMethod* signal);
|
||||
@ -202,19 +218,19 @@ public:
|
||||
};
|
||||
|
||||
QAreaSeries* QAreaSeries_new() {
|
||||
return new (std::nothrow) MiqtVirtualQAreaSeries();
|
||||
return new MiqtVirtualQAreaSeries();
|
||||
}
|
||||
|
||||
QAreaSeries* QAreaSeries_new2(QLineSeries* upperSeries) {
|
||||
return new (std::nothrow) MiqtVirtualQAreaSeries(upperSeries);
|
||||
return new MiqtVirtualQAreaSeries(upperSeries);
|
||||
}
|
||||
|
||||
QAreaSeries* QAreaSeries_new3(QObject* parent) {
|
||||
return new (std::nothrow) MiqtVirtualQAreaSeries(parent);
|
||||
return new MiqtVirtualQAreaSeries(parent);
|
||||
}
|
||||
|
||||
QAreaSeries* QAreaSeries_new4(QLineSeries* upperSeries, QLineSeries* lowerSeries) {
|
||||
return new (std::nothrow) MiqtVirtualQAreaSeries(upperSeries, lowerSeries);
|
||||
return new MiqtVirtualQAreaSeries(upperSeries, lowerSeries);
|
||||
}
|
||||
|
||||
void QAreaSeries_virtbase(QAreaSeries* src, QAbstractSeries** outptr_QAbstractSeries) {
|
||||
@ -354,7 +370,7 @@ void QAreaSeries_clicked(QAreaSeries* self, QPointF* point) {
|
||||
}
|
||||
|
||||
void QAreaSeries_connect_clicked(QAreaSeries* self, intptr_t slot) {
|
||||
QAreaSeries::connect(self, static_cast<void (QAreaSeries::*)(const QPointF&)>(&QAreaSeries::clicked), self, [=](const QPointF& point) {
|
||||
MiqtVirtualQAreaSeries::connect(self, static_cast<void (QAreaSeries::*)(const QPointF&)>(&QAreaSeries::clicked), self, [=](const QPointF& point) {
|
||||
const QPointF& point_ret = point;
|
||||
// Cast returned reference into pointer
|
||||
QPointF* sigval1 = const_cast<QPointF*>(&point_ret);
|
||||
@ -367,7 +383,7 @@ void QAreaSeries_hovered(QAreaSeries* self, QPointF* point, bool state) {
|
||||
}
|
||||
|
||||
void QAreaSeries_connect_hovered(QAreaSeries* self, intptr_t slot) {
|
||||
QAreaSeries::connect(self, static_cast<void (QAreaSeries::*)(const QPointF&, bool)>(&QAreaSeries::hovered), self, [=](const QPointF& point, bool state) {
|
||||
MiqtVirtualQAreaSeries::connect(self, static_cast<void (QAreaSeries::*)(const QPointF&, bool)>(&QAreaSeries::hovered), self, [=](const QPointF& point, bool state) {
|
||||
const QPointF& point_ret = point;
|
||||
// Cast returned reference into pointer
|
||||
QPointF* sigval1 = const_cast<QPointF*>(&point_ret);
|
||||
@ -381,7 +397,7 @@ void QAreaSeries_pressed(QAreaSeries* self, QPointF* point) {
|
||||
}
|
||||
|
||||
void QAreaSeries_connect_pressed(QAreaSeries* self, intptr_t slot) {
|
||||
QAreaSeries::connect(self, static_cast<void (QAreaSeries::*)(const QPointF&)>(&QAreaSeries::pressed), self, [=](const QPointF& point) {
|
||||
MiqtVirtualQAreaSeries::connect(self, static_cast<void (QAreaSeries::*)(const QPointF&)>(&QAreaSeries::pressed), self, [=](const QPointF& point) {
|
||||
const QPointF& point_ret = point;
|
||||
// Cast returned reference into pointer
|
||||
QPointF* sigval1 = const_cast<QPointF*>(&point_ret);
|
||||
@ -394,7 +410,7 @@ void QAreaSeries_released(QAreaSeries* self, QPointF* point) {
|
||||
}
|
||||
|
||||
void QAreaSeries_connect_released(QAreaSeries* self, intptr_t slot) {
|
||||
QAreaSeries::connect(self, static_cast<void (QAreaSeries::*)(const QPointF&)>(&QAreaSeries::released), self, [=](const QPointF& point) {
|
||||
MiqtVirtualQAreaSeries::connect(self, static_cast<void (QAreaSeries::*)(const QPointF&)>(&QAreaSeries::released), self, [=](const QPointF& point) {
|
||||
const QPointF& point_ret = point;
|
||||
// Cast returned reference into pointer
|
||||
QPointF* sigval1 = const_cast<QPointF*>(&point_ret);
|
||||
@ -407,7 +423,7 @@ void QAreaSeries_doubleClicked(QAreaSeries* self, QPointF* point) {
|
||||
}
|
||||
|
||||
void QAreaSeries_connect_doubleClicked(QAreaSeries* self, intptr_t slot) {
|
||||
QAreaSeries::connect(self, static_cast<void (QAreaSeries::*)(const QPointF&)>(&QAreaSeries::doubleClicked), self, [=](const QPointF& point) {
|
||||
MiqtVirtualQAreaSeries::connect(self, static_cast<void (QAreaSeries::*)(const QPointF&)>(&QAreaSeries::doubleClicked), self, [=](const QPointF& point) {
|
||||
const QPointF& point_ret = point;
|
||||
// Cast returned reference into pointer
|
||||
QPointF* sigval1 = const_cast<QPointF*>(&point_ret);
|
||||
@ -420,7 +436,7 @@ void QAreaSeries_selected(QAreaSeries* self) {
|
||||
}
|
||||
|
||||
void QAreaSeries_connect_selected(QAreaSeries* self, intptr_t slot) {
|
||||
QAreaSeries::connect(self, static_cast<void (QAreaSeries::*)()>(&QAreaSeries::selected), self, [=]() {
|
||||
MiqtVirtualQAreaSeries::connect(self, static_cast<void (QAreaSeries::*)()>(&QAreaSeries::selected), self, [=]() {
|
||||
miqt_exec_callback_QAreaSeries_selected(slot);
|
||||
});
|
||||
}
|
||||
@ -430,7 +446,7 @@ void QAreaSeries_colorChanged(QAreaSeries* self, QColor* color) {
|
||||
}
|
||||
|
||||
void QAreaSeries_connect_colorChanged(QAreaSeries* self, intptr_t slot) {
|
||||
QAreaSeries::connect(self, static_cast<void (QAreaSeries::*)(QColor)>(&QAreaSeries::colorChanged), self, [=](QColor color) {
|
||||
MiqtVirtualQAreaSeries::connect(self, static_cast<void (QAreaSeries::*)(QColor)>(&QAreaSeries::colorChanged), self, [=](QColor color) {
|
||||
QColor* sigval1 = new QColor(color);
|
||||
miqt_exec_callback_QAreaSeries_colorChanged(slot, sigval1);
|
||||
});
|
||||
@ -441,7 +457,7 @@ void QAreaSeries_borderColorChanged(QAreaSeries* self, QColor* color) {
|
||||
}
|
||||
|
||||
void QAreaSeries_connect_borderColorChanged(QAreaSeries* self, intptr_t slot) {
|
||||
QAreaSeries::connect(self, static_cast<void (QAreaSeries::*)(QColor)>(&QAreaSeries::borderColorChanged), self, [=](QColor color) {
|
||||
MiqtVirtualQAreaSeries::connect(self, static_cast<void (QAreaSeries::*)(QColor)>(&QAreaSeries::borderColorChanged), self, [=](QColor color) {
|
||||
QColor* sigval1 = new QColor(color);
|
||||
miqt_exec_callback_QAreaSeries_borderColorChanged(slot, sigval1);
|
||||
});
|
||||
@ -453,7 +469,7 @@ void QAreaSeries_pointLabelsFormatChanged(QAreaSeries* self, struct miqt_string
|
||||
}
|
||||
|
||||
void QAreaSeries_connect_pointLabelsFormatChanged(QAreaSeries* self, intptr_t slot) {
|
||||
QAreaSeries::connect(self, static_cast<void (QAreaSeries::*)(const QString&)>(&QAreaSeries::pointLabelsFormatChanged), self, [=](const QString& format) {
|
||||
MiqtVirtualQAreaSeries::connect(self, static_cast<void (QAreaSeries::*)(const QString&)>(&QAreaSeries::pointLabelsFormatChanged), self, [=](const QString& format) {
|
||||
const QString format_ret = format;
|
||||
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
||||
QByteArray format_b = format_ret.toUtf8();
|
||||
@ -471,7 +487,7 @@ void QAreaSeries_pointLabelsVisibilityChanged(QAreaSeries* self, bool visible) {
|
||||
}
|
||||
|
||||
void QAreaSeries_connect_pointLabelsVisibilityChanged(QAreaSeries* self, intptr_t slot) {
|
||||
QAreaSeries::connect(self, static_cast<void (QAreaSeries::*)(bool)>(&QAreaSeries::pointLabelsVisibilityChanged), self, [=](bool visible) {
|
||||
MiqtVirtualQAreaSeries::connect(self, static_cast<void (QAreaSeries::*)(bool)>(&QAreaSeries::pointLabelsVisibilityChanged), self, [=](bool visible) {
|
||||
bool sigval1 = visible;
|
||||
miqt_exec_callback_QAreaSeries_pointLabelsVisibilityChanged(slot, sigval1);
|
||||
});
|
||||
@ -482,7 +498,7 @@ void QAreaSeries_pointLabelsFontChanged(QAreaSeries* self, QFont* font) {
|
||||
}
|
||||
|
||||
void QAreaSeries_connect_pointLabelsFontChanged(QAreaSeries* self, intptr_t slot) {
|
||||
QAreaSeries::connect(self, static_cast<void (QAreaSeries::*)(const QFont&)>(&QAreaSeries::pointLabelsFontChanged), self, [=](const QFont& font) {
|
||||
MiqtVirtualQAreaSeries::connect(self, static_cast<void (QAreaSeries::*)(const QFont&)>(&QAreaSeries::pointLabelsFontChanged), self, [=](const QFont& font) {
|
||||
const QFont& font_ret = font;
|
||||
// Cast returned reference into pointer
|
||||
QFont* sigval1 = const_cast<QFont*>(&font_ret);
|
||||
@ -495,7 +511,7 @@ void QAreaSeries_pointLabelsColorChanged(QAreaSeries* self, QColor* color) {
|
||||
}
|
||||
|
||||
void QAreaSeries_connect_pointLabelsColorChanged(QAreaSeries* self, intptr_t slot) {
|
||||
QAreaSeries::connect(self, static_cast<void (QAreaSeries::*)(const QColor&)>(&QAreaSeries::pointLabelsColorChanged), self, [=](const QColor& color) {
|
||||
MiqtVirtualQAreaSeries::connect(self, static_cast<void (QAreaSeries::*)(const QColor&)>(&QAreaSeries::pointLabelsColorChanged), self, [=](const QColor& color) {
|
||||
const QColor& color_ret = color;
|
||||
// Cast returned reference into pointer
|
||||
QColor* sigval1 = const_cast<QColor*>(&color_ret);
|
||||
@ -508,7 +524,7 @@ void QAreaSeries_pointLabelsClippingChanged(QAreaSeries* self, bool clipping) {
|
||||
}
|
||||
|
||||
void QAreaSeries_connect_pointLabelsClippingChanged(QAreaSeries* self, intptr_t slot) {
|
||||
QAreaSeries::connect(self, static_cast<void (QAreaSeries::*)(bool)>(&QAreaSeries::pointLabelsClippingChanged), self, [=](bool clipping) {
|
||||
MiqtVirtualQAreaSeries::connect(self, static_cast<void (QAreaSeries::*)(bool)>(&QAreaSeries::pointLabelsClippingChanged), self, [=](bool clipping) {
|
||||
bool sigval1 = clipping;
|
||||
miqt_exec_callback_QAreaSeries_pointLabelsClippingChanged(slot, sigval1);
|
||||
});
|
||||
@ -559,8 +575,10 @@ bool QAreaSeries_override_virtual_type(void* self, intptr_t slot) {
|
||||
}
|
||||
|
||||
int QAreaSeries_virtualbase_type(const void* self) {
|
||||
MiqtVirtualQAreaSeries::SeriesType _ret = static_cast<const MiqtVirtualQAreaSeries*>(self)->QAreaSeries::type();
|
||||
|
||||
MiqtVirtualQAreaSeries::SeriesType _ret = ( (const MiqtVirtualQAreaSeries*)(self) )->QAreaSeries::type();
|
||||
return static_cast<int>(_ret);
|
||||
|
||||
}
|
||||
|
||||
bool QAreaSeries_override_virtual_event(void* self, intptr_t slot) {
|
||||
@ -574,7 +592,9 @@ bool QAreaSeries_override_virtual_event(void* self, intptr_t slot) {
|
||||
}
|
||||
|
||||
bool QAreaSeries_virtualbase_event(void* self, QEvent* event) {
|
||||
return static_cast<MiqtVirtualQAreaSeries*>(self)->QAreaSeries::event(event);
|
||||
|
||||
return ( (MiqtVirtualQAreaSeries*)(self) )->QAreaSeries::event(event);
|
||||
|
||||
}
|
||||
|
||||
bool QAreaSeries_override_virtual_eventFilter(void* self, intptr_t slot) {
|
||||
@ -588,7 +608,9 @@ bool QAreaSeries_override_virtual_eventFilter(void* self, intptr_t slot) {
|
||||
}
|
||||
|
||||
bool QAreaSeries_virtualbase_eventFilter(void* self, QObject* watched, QEvent* event) {
|
||||
return static_cast<MiqtVirtualQAreaSeries*>(self)->QAreaSeries::eventFilter(watched, event);
|
||||
|
||||
return ( (MiqtVirtualQAreaSeries*)(self) )->QAreaSeries::eventFilter(watched, event);
|
||||
|
||||
}
|
||||
|
||||
bool QAreaSeries_override_virtual_timerEvent(void* self, intptr_t slot) {
|
||||
@ -602,7 +624,9 @@ bool QAreaSeries_override_virtual_timerEvent(void* self, intptr_t slot) {
|
||||
}
|
||||
|
||||
void QAreaSeries_virtualbase_timerEvent(void* self, QTimerEvent* event) {
|
||||
static_cast<MiqtVirtualQAreaSeries*>(self)->QAreaSeries::timerEvent(event);
|
||||
|
||||
( (MiqtVirtualQAreaSeries*)(self) )->QAreaSeries::timerEvent(event);
|
||||
|
||||
}
|
||||
|
||||
bool QAreaSeries_override_virtual_childEvent(void* self, intptr_t slot) {
|
||||
@ -616,7 +640,9 @@ bool QAreaSeries_override_virtual_childEvent(void* self, intptr_t slot) {
|
||||
}
|
||||
|
||||
void QAreaSeries_virtualbase_childEvent(void* self, QChildEvent* event) {
|
||||
static_cast<MiqtVirtualQAreaSeries*>(self)->QAreaSeries::childEvent(event);
|
||||
|
||||
( (MiqtVirtualQAreaSeries*)(self) )->QAreaSeries::childEvent(event);
|
||||
|
||||
}
|
||||
|
||||
bool QAreaSeries_override_virtual_customEvent(void* self, intptr_t slot) {
|
||||
@ -630,7 +656,9 @@ bool QAreaSeries_override_virtual_customEvent(void* self, intptr_t slot) {
|
||||
}
|
||||
|
||||
void QAreaSeries_virtualbase_customEvent(void* self, QEvent* event) {
|
||||
static_cast<MiqtVirtualQAreaSeries*>(self)->QAreaSeries::customEvent(event);
|
||||
|
||||
( (MiqtVirtualQAreaSeries*)(self) )->QAreaSeries::customEvent(event);
|
||||
|
||||
}
|
||||
|
||||
bool QAreaSeries_override_virtual_connectNotify(void* self, intptr_t slot) {
|
||||
@ -644,7 +672,9 @@ bool QAreaSeries_override_virtual_connectNotify(void* self, intptr_t slot) {
|
||||
}
|
||||
|
||||
void QAreaSeries_virtualbase_connectNotify(void* self, QMetaMethod* signal) {
|
||||
static_cast<MiqtVirtualQAreaSeries*>(self)->QAreaSeries::connectNotify(*signal);
|
||||
|
||||
( (MiqtVirtualQAreaSeries*)(self) )->QAreaSeries::connectNotify(*signal);
|
||||
|
||||
}
|
||||
|
||||
bool QAreaSeries_override_virtual_disconnectNotify(void* self, intptr_t slot) {
|
||||
@ -658,7 +688,9 @@ bool QAreaSeries_override_virtual_disconnectNotify(void* self, intptr_t slot) {
|
||||
}
|
||||
|
||||
void QAreaSeries_virtualbase_disconnectNotify(void* self, QMetaMethod* signal) {
|
||||
static_cast<MiqtVirtualQAreaSeries*>(self)->QAreaSeries::disconnectNotify(*signal);
|
||||
|
||||
( (MiqtVirtualQAreaSeries*)(self) )->QAreaSeries::disconnectNotify(*signal);
|
||||
|
||||
}
|
||||
|
||||
QObject* QAreaSeries_protectedbase_sender(bool* _dynamic_cast_ok, const void* self) {
|
||||
@ -669,7 +701,9 @@ QObject* QAreaSeries_protectedbase_sender(bool* _dynamic_cast_ok, const void* se
|
||||
}
|
||||
|
||||
*_dynamic_cast_ok = true;
|
||||
|
||||
return self_cast->sender();
|
||||
|
||||
}
|
||||
|
||||
int QAreaSeries_protectedbase_senderSignalIndex(bool* _dynamic_cast_ok, const void* self) {
|
||||
@ -680,7 +714,9 @@ int QAreaSeries_protectedbase_senderSignalIndex(bool* _dynamic_cast_ok, const vo
|
||||
}
|
||||
|
||||
*_dynamic_cast_ok = true;
|
||||
|
||||
return self_cast->senderSignalIndex();
|
||||
|
||||
}
|
||||
|
||||
int QAreaSeries_protectedbase_receivers(bool* _dynamic_cast_ok, const void* self, const char* signal) {
|
||||
@ -691,7 +727,9 @@ int QAreaSeries_protectedbase_receivers(bool* _dynamic_cast_ok, const void* self
|
||||
}
|
||||
|
||||
*_dynamic_cast_ok = true;
|
||||
|
||||
return self_cast->receivers(signal);
|
||||
|
||||
}
|
||||
|
||||
bool QAreaSeries_protectedbase_isSignalConnected(bool* _dynamic_cast_ok, const void* self, QMetaMethod* signal) {
|
||||
@ -702,7 +740,9 @@ bool QAreaSeries_protectedbase_isSignalConnected(bool* _dynamic_cast_ok, const v
|
||||
}
|
||||
|
||||
*_dynamic_cast_ok = true;
|
||||
|
||||
return self_cast->isSignalConnected(*signal);
|
||||
|
||||
}
|
||||
|
||||
void QAreaSeries_delete(QAreaSeries* self) {
|
||||
|
@ -110,7 +110,6 @@ struct miqt_string QAreaSeries_tr3(const char* s, const char* c, int n);
|
||||
void QAreaSeries_setPointsVisibleWithVisible(QAreaSeries* self, bool visible);
|
||||
void QAreaSeries_setPointLabelsVisibleWithVisible(QAreaSeries* self, bool visible);
|
||||
void QAreaSeries_setPointLabelsClippingWithEnabled(QAreaSeries* self, bool enabled);
|
||||
|
||||
bool QAreaSeries_override_virtual_type(void* self, intptr_t slot);
|
||||
int QAreaSeries_virtualbase_type(const void* self);
|
||||
bool QAreaSeries_override_virtual_event(void* self, intptr_t slot);
|
||||
@ -127,12 +126,10 @@ bool QAreaSeries_override_virtual_connectNotify(void* self, intptr_t slot);
|
||||
void QAreaSeries_virtualbase_connectNotify(void* self, QMetaMethod* signal);
|
||||
bool QAreaSeries_override_virtual_disconnectNotify(void* self, intptr_t slot);
|
||||
void QAreaSeries_virtualbase_disconnectNotify(void* self, QMetaMethod* signal);
|
||||
|
||||
QObject* QAreaSeries_protectedbase_sender(bool* _dynamic_cast_ok, const void* self);
|
||||
int QAreaSeries_protectedbase_senderSignalIndex(bool* _dynamic_cast_ok, const void* self);
|
||||
int QAreaSeries_protectedbase_receivers(bool* _dynamic_cast_ok, const void* self, const char* signal);
|
||||
bool QAreaSeries_protectedbase_isSignalConnected(bool* _dynamic_cast_ok, const void* self, QMetaMethod* signal);
|
||||
|
||||
void QAreaSeries_delete(QAreaSeries* self);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -37,8 +37,8 @@ void miqt_exec_callback_QBarCategoryAxis_disconnectNotify(QBarCategoryAxis*, int
|
||||
class MiqtVirtualQBarCategoryAxis final : public QBarCategoryAxis {
|
||||
public:
|
||||
|
||||
MiqtVirtualQBarCategoryAxis(): QBarCategoryAxis() {}
|
||||
MiqtVirtualQBarCategoryAxis(QObject* parent): QBarCategoryAxis(parent) {}
|
||||
MiqtVirtualQBarCategoryAxis(): QBarCategoryAxis() {};
|
||||
MiqtVirtualQBarCategoryAxis(QObject* parent): QBarCategoryAxis(parent) {};
|
||||
|
||||
virtual ~MiqtVirtualQBarCategoryAxis() override = default;
|
||||
|
||||
@ -51,7 +51,9 @@ public:
|
||||
return QBarCategoryAxis::type();
|
||||
}
|
||||
|
||||
|
||||
int callback_return_value = miqt_exec_callback_QBarCategoryAxis_type(this, handle__type);
|
||||
|
||||
return static_cast<QAbstractAxis::AxisType>(callback_return_value);
|
||||
}
|
||||
|
||||
@ -67,7 +69,9 @@ public:
|
||||
}
|
||||
|
||||
QEvent* sigval1 = event;
|
||||
|
||||
bool callback_return_value = miqt_exec_callback_QBarCategoryAxis_event(this, handle__event, sigval1);
|
||||
|
||||
return callback_return_value;
|
||||
}
|
||||
|
||||
@ -84,7 +88,9 @@ public:
|
||||
|
||||
QObject* sigval1 = watched;
|
||||
QEvent* sigval2 = event;
|
||||
|
||||
bool callback_return_value = miqt_exec_callback_QBarCategoryAxis_eventFilter(this, handle__eventFilter, sigval1, sigval2);
|
||||
|
||||
return callback_return_value;
|
||||
}
|
||||
|
||||
@ -101,8 +107,10 @@ public:
|
||||
}
|
||||
|
||||
QTimerEvent* sigval1 = event;
|
||||
|
||||
miqt_exec_callback_QBarCategoryAxis_timerEvent(this, handle__timerEvent, sigval1);
|
||||
|
||||
|
||||
}
|
||||
|
||||
friend void QBarCategoryAxis_virtualbase_timerEvent(void* self, QTimerEvent* event);
|
||||
@ -118,8 +126,10 @@ public:
|
||||
}
|
||||
|
||||
QChildEvent* sigval1 = event;
|
||||
|
||||
miqt_exec_callback_QBarCategoryAxis_childEvent(this, handle__childEvent, sigval1);
|
||||
|
||||
|
||||
}
|
||||
|
||||
friend void QBarCategoryAxis_virtualbase_childEvent(void* self, QChildEvent* event);
|
||||
@ -135,8 +145,10 @@ public:
|
||||
}
|
||||
|
||||
QEvent* sigval1 = event;
|
||||
|
||||
miqt_exec_callback_QBarCategoryAxis_customEvent(this, handle__customEvent, sigval1);
|
||||
|
||||
|
||||
}
|
||||
|
||||
friend void QBarCategoryAxis_virtualbase_customEvent(void* self, QEvent* event);
|
||||
@ -154,8 +166,10 @@ public:
|
||||
const QMetaMethod& signal_ret = signal;
|
||||
// Cast returned reference into pointer
|
||||
QMetaMethod* sigval1 = const_cast<QMetaMethod*>(&signal_ret);
|
||||
|
||||
miqt_exec_callback_QBarCategoryAxis_connectNotify(this, handle__connectNotify, sigval1);
|
||||
|
||||
|
||||
}
|
||||
|
||||
friend void QBarCategoryAxis_virtualbase_connectNotify(void* self, QMetaMethod* signal);
|
||||
@ -173,8 +187,10 @@ public:
|
||||
const QMetaMethod& signal_ret = signal;
|
||||
// Cast returned reference into pointer
|
||||
QMetaMethod* sigval1 = const_cast<QMetaMethod*>(&signal_ret);
|
||||
|
||||
miqt_exec_callback_QBarCategoryAxis_disconnectNotify(this, handle__disconnectNotify, sigval1);
|
||||
|
||||
|
||||
}
|
||||
|
||||
friend void QBarCategoryAxis_virtualbase_disconnectNotify(void* self, QMetaMethod* signal);
|
||||
@ -187,11 +203,11 @@ public:
|
||||
};
|
||||
|
||||
QBarCategoryAxis* QBarCategoryAxis_new() {
|
||||
return new (std::nothrow) MiqtVirtualQBarCategoryAxis();
|
||||
return new MiqtVirtualQBarCategoryAxis();
|
||||
}
|
||||
|
||||
QBarCategoryAxis* QBarCategoryAxis_new2(QObject* parent) {
|
||||
return new (std::nothrow) MiqtVirtualQBarCategoryAxis(parent);
|
||||
return new MiqtVirtualQBarCategoryAxis(parent);
|
||||
}
|
||||
|
||||
void QBarCategoryAxis_virtbase(QBarCategoryAxis* src, QAbstractAxis** outptr_QAbstractAxis) {
|
||||
@ -347,7 +363,7 @@ void QBarCategoryAxis_categoriesChanged(QBarCategoryAxis* self) {
|
||||
}
|
||||
|
||||
void QBarCategoryAxis_connect_categoriesChanged(QBarCategoryAxis* self, intptr_t slot) {
|
||||
QBarCategoryAxis::connect(self, static_cast<void (QBarCategoryAxis::*)()>(&QBarCategoryAxis::categoriesChanged), self, [=]() {
|
||||
MiqtVirtualQBarCategoryAxis::connect(self, static_cast<void (QBarCategoryAxis::*)()>(&QBarCategoryAxis::categoriesChanged), self, [=]() {
|
||||
miqt_exec_callback_QBarCategoryAxis_categoriesChanged(slot);
|
||||
});
|
||||
}
|
||||
@ -358,7 +374,7 @@ void QBarCategoryAxis_minChanged(QBarCategoryAxis* self, struct miqt_string min)
|
||||
}
|
||||
|
||||
void QBarCategoryAxis_connect_minChanged(QBarCategoryAxis* self, intptr_t slot) {
|
||||
QBarCategoryAxis::connect(self, static_cast<void (QBarCategoryAxis::*)(const QString&)>(&QBarCategoryAxis::minChanged), self, [=](const QString& min) {
|
||||
MiqtVirtualQBarCategoryAxis::connect(self, static_cast<void (QBarCategoryAxis::*)(const QString&)>(&QBarCategoryAxis::minChanged), self, [=](const QString& min) {
|
||||
const QString min_ret = min;
|
||||
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
||||
QByteArray min_b = min_ret.toUtf8();
|
||||
@ -377,7 +393,7 @@ void QBarCategoryAxis_maxChanged(QBarCategoryAxis* self, struct miqt_string max)
|
||||
}
|
||||
|
||||
void QBarCategoryAxis_connect_maxChanged(QBarCategoryAxis* self, intptr_t slot) {
|
||||
QBarCategoryAxis::connect(self, static_cast<void (QBarCategoryAxis::*)(const QString&)>(&QBarCategoryAxis::maxChanged), self, [=](const QString& max) {
|
||||
MiqtVirtualQBarCategoryAxis::connect(self, static_cast<void (QBarCategoryAxis::*)(const QString&)>(&QBarCategoryAxis::maxChanged), self, [=](const QString& max) {
|
||||
const QString max_ret = max;
|
||||
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
||||
QByteArray max_b = max_ret.toUtf8();
|
||||
@ -397,7 +413,7 @@ void QBarCategoryAxis_rangeChanged(QBarCategoryAxis* self, struct miqt_string mi
|
||||
}
|
||||
|
||||
void QBarCategoryAxis_connect_rangeChanged(QBarCategoryAxis* self, intptr_t slot) {
|
||||
QBarCategoryAxis::connect(self, static_cast<void (QBarCategoryAxis::*)(const QString&, const QString&)>(&QBarCategoryAxis::rangeChanged), self, [=](const QString& min, const QString& max) {
|
||||
MiqtVirtualQBarCategoryAxis::connect(self, static_cast<void (QBarCategoryAxis::*)(const QString&, const QString&)>(&QBarCategoryAxis::rangeChanged), self, [=](const QString& min, const QString& max) {
|
||||
const QString min_ret = min;
|
||||
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
||||
QByteArray min_b = min_ret.toUtf8();
|
||||
@ -423,7 +439,7 @@ void QBarCategoryAxis_countChanged(QBarCategoryAxis* self) {
|
||||
}
|
||||
|
||||
void QBarCategoryAxis_connect_countChanged(QBarCategoryAxis* self, intptr_t slot) {
|
||||
QBarCategoryAxis::connect(self, static_cast<void (QBarCategoryAxis::*)()>(&QBarCategoryAxis::countChanged), self, [=]() {
|
||||
MiqtVirtualQBarCategoryAxis::connect(self, static_cast<void (QBarCategoryAxis::*)()>(&QBarCategoryAxis::countChanged), self, [=]() {
|
||||
miqt_exec_callback_QBarCategoryAxis_countChanged(slot);
|
||||
});
|
||||
}
|
||||
@ -461,8 +477,10 @@ bool QBarCategoryAxis_override_virtual_type(void* self, intptr_t slot) {
|
||||
}
|
||||
|
||||
int QBarCategoryAxis_virtualbase_type(const void* self) {
|
||||
MiqtVirtualQBarCategoryAxis::AxisType _ret = static_cast<const MiqtVirtualQBarCategoryAxis*>(self)->QBarCategoryAxis::type();
|
||||
|
||||
MiqtVirtualQBarCategoryAxis::AxisType _ret = ( (const MiqtVirtualQBarCategoryAxis*)(self) )->QBarCategoryAxis::type();
|
||||
return static_cast<int>(_ret);
|
||||
|
||||
}
|
||||
|
||||
bool QBarCategoryAxis_override_virtual_event(void* self, intptr_t slot) {
|
||||
@ -476,7 +494,9 @@ bool QBarCategoryAxis_override_virtual_event(void* self, intptr_t slot) {
|
||||
}
|
||||
|
||||
bool QBarCategoryAxis_virtualbase_event(void* self, QEvent* event) {
|
||||
return static_cast<MiqtVirtualQBarCategoryAxis*>(self)->QBarCategoryAxis::event(event);
|
||||
|
||||
return ( (MiqtVirtualQBarCategoryAxis*)(self) )->QBarCategoryAxis::event(event);
|
||||
|
||||
}
|
||||
|
||||
bool QBarCategoryAxis_override_virtual_eventFilter(void* self, intptr_t slot) {
|
||||
@ -490,7 +510,9 @@ bool QBarCategoryAxis_override_virtual_eventFilter(void* self, intptr_t slot) {
|
||||
}
|
||||
|
||||
bool QBarCategoryAxis_virtualbase_eventFilter(void* self, QObject* watched, QEvent* event) {
|
||||
return static_cast<MiqtVirtualQBarCategoryAxis*>(self)->QBarCategoryAxis::eventFilter(watched, event);
|
||||
|
||||
return ( (MiqtVirtualQBarCategoryAxis*)(self) )->QBarCategoryAxis::eventFilter(watched, event);
|
||||
|
||||
}
|
||||
|
||||
bool QBarCategoryAxis_override_virtual_timerEvent(void* self, intptr_t slot) {
|
||||
@ -504,7 +526,9 @@ bool QBarCategoryAxis_override_virtual_timerEvent(void* self, intptr_t slot) {
|
||||
}
|
||||
|
||||
void QBarCategoryAxis_virtualbase_timerEvent(void* self, QTimerEvent* event) {
|
||||
static_cast<MiqtVirtualQBarCategoryAxis*>(self)->QBarCategoryAxis::timerEvent(event);
|
||||
|
||||
( (MiqtVirtualQBarCategoryAxis*)(self) )->QBarCategoryAxis::timerEvent(event);
|
||||
|
||||
}
|
||||
|
||||
bool QBarCategoryAxis_override_virtual_childEvent(void* self, intptr_t slot) {
|
||||
@ -518,7 +542,9 @@ bool QBarCategoryAxis_override_virtual_childEvent(void* self, intptr_t slot) {
|
||||
}
|
||||
|
||||
void QBarCategoryAxis_virtualbase_childEvent(void* self, QChildEvent* event) {
|
||||
static_cast<MiqtVirtualQBarCategoryAxis*>(self)->QBarCategoryAxis::childEvent(event);
|
||||
|
||||
( (MiqtVirtualQBarCategoryAxis*)(self) )->QBarCategoryAxis::childEvent(event);
|
||||
|
||||
}
|
||||
|
||||
bool QBarCategoryAxis_override_virtual_customEvent(void* self, intptr_t slot) {
|
||||
@ -532,7 +558,9 @@ bool QBarCategoryAxis_override_virtual_customEvent(void* self, intptr_t slot) {
|
||||
}
|
||||
|
||||
void QBarCategoryAxis_virtualbase_customEvent(void* self, QEvent* event) {
|
||||
static_cast<MiqtVirtualQBarCategoryAxis*>(self)->QBarCategoryAxis::customEvent(event);
|
||||
|
||||
( (MiqtVirtualQBarCategoryAxis*)(self) )->QBarCategoryAxis::customEvent(event);
|
||||
|
||||
}
|
||||
|
||||
bool QBarCategoryAxis_override_virtual_connectNotify(void* self, intptr_t slot) {
|
||||
@ -546,7 +574,9 @@ bool QBarCategoryAxis_override_virtual_connectNotify(void* self, intptr_t slot)
|
||||
}
|
||||
|
||||
void QBarCategoryAxis_virtualbase_connectNotify(void* self, QMetaMethod* signal) {
|
||||
static_cast<MiqtVirtualQBarCategoryAxis*>(self)->QBarCategoryAxis::connectNotify(*signal);
|
||||
|
||||
( (MiqtVirtualQBarCategoryAxis*)(self) )->QBarCategoryAxis::connectNotify(*signal);
|
||||
|
||||
}
|
||||
|
||||
bool QBarCategoryAxis_override_virtual_disconnectNotify(void* self, intptr_t slot) {
|
||||
@ -560,7 +590,9 @@ bool QBarCategoryAxis_override_virtual_disconnectNotify(void* self, intptr_t slo
|
||||
}
|
||||
|
||||
void QBarCategoryAxis_virtualbase_disconnectNotify(void* self, QMetaMethod* signal) {
|
||||
static_cast<MiqtVirtualQBarCategoryAxis*>(self)->QBarCategoryAxis::disconnectNotify(*signal);
|
||||
|
||||
( (MiqtVirtualQBarCategoryAxis*)(self) )->QBarCategoryAxis::disconnectNotify(*signal);
|
||||
|
||||
}
|
||||
|
||||
QObject* QBarCategoryAxis_protectedbase_sender(bool* _dynamic_cast_ok, const void* self) {
|
||||
@ -571,7 +603,9 @@ QObject* QBarCategoryAxis_protectedbase_sender(bool* _dynamic_cast_ok, const voi
|
||||
}
|
||||
|
||||
*_dynamic_cast_ok = true;
|
||||
|
||||
return self_cast->sender();
|
||||
|
||||
}
|
||||
|
||||
int QBarCategoryAxis_protectedbase_senderSignalIndex(bool* _dynamic_cast_ok, const void* self) {
|
||||
@ -582,7 +616,9 @@ int QBarCategoryAxis_protectedbase_senderSignalIndex(bool* _dynamic_cast_ok, con
|
||||
}
|
||||
|
||||
*_dynamic_cast_ok = true;
|
||||
|
||||
return self_cast->senderSignalIndex();
|
||||
|
||||
}
|
||||
|
||||
int QBarCategoryAxis_protectedbase_receivers(bool* _dynamic_cast_ok, const void* self, const char* signal) {
|
||||
@ -593,7 +629,9 @@ int QBarCategoryAxis_protectedbase_receivers(bool* _dynamic_cast_ok, const void*
|
||||
}
|
||||
|
||||
*_dynamic_cast_ok = true;
|
||||
|
||||
return self_cast->receivers(signal);
|
||||
|
||||
}
|
||||
|
||||
bool QBarCategoryAxis_protectedbase_isSignalConnected(bool* _dynamic_cast_ok, const void* self, QMetaMethod* signal) {
|
||||
@ -604,7 +642,9 @@ bool QBarCategoryAxis_protectedbase_isSignalConnected(bool* _dynamic_cast_ok, co
|
||||
}
|
||||
|
||||
*_dynamic_cast_ok = true;
|
||||
|
||||
return self_cast->isSignalConnected(*signal);
|
||||
|
||||
}
|
||||
|
||||
void QBarCategoryAxis_delete(QBarCategoryAxis* self) {
|
||||
|
@ -68,7 +68,6 @@ void QBarCategoryAxis_countChanged(QBarCategoryAxis* self);
|
||||
void QBarCategoryAxis_connect_countChanged(QBarCategoryAxis* self, intptr_t slot);
|
||||
struct miqt_string QBarCategoryAxis_tr2(const char* s, const char* c);
|
||||
struct miqt_string QBarCategoryAxis_tr3(const char* s, const char* c, int n);
|
||||
|
||||
bool QBarCategoryAxis_override_virtual_type(void* self, intptr_t slot);
|
||||
int QBarCategoryAxis_virtualbase_type(const void* self);
|
||||
bool QBarCategoryAxis_override_virtual_event(void* self, intptr_t slot);
|
||||
@ -85,12 +84,10 @@ bool QBarCategoryAxis_override_virtual_connectNotify(void* self, intptr_t slot);
|
||||
void QBarCategoryAxis_virtualbase_connectNotify(void* self, QMetaMethod* signal);
|
||||
bool QBarCategoryAxis_override_virtual_disconnectNotify(void* self, intptr_t slot);
|
||||
void QBarCategoryAxis_virtualbase_disconnectNotify(void* self, QMetaMethod* signal);
|
||||
|
||||
QObject* QBarCategoryAxis_protectedbase_sender(bool* _dynamic_cast_ok, const void* self);
|
||||
int QBarCategoryAxis_protectedbase_senderSignalIndex(bool* _dynamic_cast_ok, const void* self);
|
||||
int QBarCategoryAxis_protectedbase_receivers(bool* _dynamic_cast_ok, const void* self, const char* signal);
|
||||
bool QBarCategoryAxis_protectedbase_isSignalConnected(bool* _dynamic_cast_ok, const void* self, QMetaMethod* signal);
|
||||
|
||||
void QBarCategoryAxis_delete(QBarCategoryAxis* self);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|