Compare commits
71 Commits
Author | SHA1 | Date | |
---|---|---|---|
bf135d6e11 | |||
1722d3ebe5 | |||
fe2f81cb0d | |||
cb89fa6db0 | |||
1663eca3b5 | |||
6a97b50e86 | |||
![]() |
dd20e3ccbc | ||
09598e4980 | |||
5e66acd936 | |||
ef674bda2f | |||
cb757edcd2 | |||
82b5cc881e | |||
c13e71f66b | |||
37d4102d36 | |||
86d963abba | |||
7d9cb9ccd2 | |||
8583f1e535 | |||
dd62ee1f60 | |||
ead54f09d3 | |||
09149e0566 | |||
![]() |
e6b61cd339 | ||
![]() |
93ce2040d8 | ||
![]() |
3621373888 | ||
![]() |
2019f402a0 | ||
![]() |
0e6905c39e | ||
![]() |
82826d7a21 | ||
5ac6083a3d | |||
![]() |
fc7a764931 | ||
8aedac421d | |||
d7c54b4574 | |||
b3b914ede8 | |||
2fc549206b | |||
![]() |
32875ef65f | ||
7a6bac85b4 | |||
66aeefc77a | |||
1498f05fa5 | |||
d802e345fe | |||
9d4cabc099 | |||
9fc6ff9c25 | |||
2c44746902 | |||
95434b416e | |||
b55dd5e9c1 | |||
9747acc50b | |||
a01b7391ba | |||
901d2e0aa0 | |||
a82e43585d | |||
f0ce7984ce | |||
6d176bc410 | |||
66e0973242 | |||
a4a4074948 | |||
687579d76f | |||
6984b83aea | |||
34e7429fe1 | |||
c6ff8e0533 | |||
b2536be8d5 | |||
d075984e77 | |||
ded180f77b | |||
b3d5f541f0 | |||
69190ece2c | |||
8328ca7e12 | |||
c7b7e8fdfb | |||
7dd11c6d9b | |||
e7892c780e | |||
540b306715 | |||
da7c82a719 | |||
![]() |
4e841e0053 | ||
![]() |
72ad16086a | ||
![]() |
fdb15300e8 | ||
![]() |
c43c65ee2a | ||
![]() |
5a39358a1e | ||
![]() |
4cba7b0c99 |
@ -1,33 +0,0 @@
|
|||||||
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,6 +14,9 @@ jobs:
|
|||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
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
|
- name: Cache clang ASTs
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
@ -33,15 +36,13 @@ jobs:
|
|||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Cache GOCACHE
|
# This uses the `genbindings` container in miqt-docker
|
||||||
uses: actions/cache@v4
|
|
||||||
with:
|
|
||||||
path: ~/.cache/go-build
|
|
||||||
key: linux64-buildall-gocache
|
|
||||||
|
|
||||||
- name: Rebuild all libraries and examples
|
- name: Rebuild all libraries and examples
|
||||||
run: make build-all
|
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:
|
miqt_linux64_qt5:
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
|
|
||||||
@ -49,17 +50,10 @@ jobs:
|
|||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Linux64 docker build
|
- name: Linux64 bindings compile
|
||||||
run: docker build -t miqt/linux64:qt5 -f docker/linux64-go1.19-qt5.15-dynamic.Dockerfile .
|
run: |
|
||||||
|
make cmd/miqt-docker/miqt-docker
|
||||||
- name: Cache GOCACHE
|
cd qt && ../cmd/miqt-docker/miqt-docker linux64-go1.19-qt5.15-dynamic go build
|
||||||
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:
|
miqt_linux64_qt6_4:
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
@ -68,17 +62,10 @@ jobs:
|
|||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
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
|
- name: Linux64 bindings compile
|
||||||
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'
|
run: |
|
||||||
|
make cmd/miqt-docker/miqt-docker
|
||||||
|
cd qt6 && ../cmd/miqt-docker/miqt-docker linux64-go1.19-qt6.4-dynamic go build
|
||||||
|
|
||||||
miqt_linux64_qt6_8:
|
miqt_linux64_qt6_8:
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
@ -87,17 +74,10 @@ jobs:
|
|||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
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
|
- name: Linux64 bindings compile
|
||||||
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'
|
run: |
|
||||||
|
make cmd/miqt-docker/miqt-docker
|
||||||
|
cd qt6 && ../cmd/miqt-docker/miqt-docker linux64-go1.23-qt6.8-dynamic go build
|
||||||
|
|
||||||
miqt_win32_qt5:
|
miqt_win32_qt5:
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
@ -106,17 +86,10 @@ jobs:
|
|||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
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
|
- name: Win32 bindings compile
|
||||||
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'
|
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'
|
||||||
|
|
||||||
miqt_win64_qt5:
|
miqt_win64_qt5:
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
@ -125,17 +98,10 @@ jobs:
|
|||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
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
|
- name: Win64 bindings compile
|
||||||
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'
|
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'
|
||||||
|
|
||||||
miqt_win64_qt68:
|
miqt_win64_qt68:
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
@ -144,17 +110,10 @@ jobs:
|
|||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
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
|
- name: Win64 bindings compile
|
||||||
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'
|
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'
|
||||||
|
|
||||||
miqt_android_qt5:
|
miqt_android_qt5:
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
@ -163,57 +122,23 @@ jobs:
|
|||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Android armv8a docker build
|
- name: Android compile
|
||||||
run: docker build -t miqt/android:qt5 -f docker/android-armv8a-go1.23-qt5.15-dynamic.Dockerfile .
|
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: Cache GOCACHE
|
miqt_android_qt6:
|
||||||
uses: actions/cache@v4
|
runs-on: ubuntu-24.04
|
||||||
with:
|
|
||||||
path: ~/.cache/go-build
|
|
||||||
key: android-qt5-armv8a-gocache
|
|
||||||
|
|
||||||
- name: Android compile app as c-shared my_go_app.so
|
steps:
|
||||||
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: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Android generate libRealAppName.so linking stub
|
- name: Android compile
|
||||||
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
|
run: |
|
||||||
|
make cmd/miqt-docker/miqt-docker
|
||||||
- name: Android generate json packaging metadata
|
cd examples/helloworld6
|
||||||
run: docker run --rm -v $(pwd):/src -w /src/examples/android miqt/android:qt5 android-mktemplate.sh RealAppName deployment-settings.json
|
../../cmd/miqt-docker/miqt-docker android-armv8a-go1.23-qt6.6-dynamic -android-build
|
||||||
|
test -f helloworld6.apk
|
||||||
- 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,15 +1,6 @@
|
|||||||
# cache files for genbindings
|
# cache files for genbindings
|
||||||
cmd/genbindings/cachedir/
|
cmd/genbindings/cachedir/
|
||||||
|
|
||||||
# docker files
|
|
||||||
container-build-cache/
|
|
||||||
|
|
||||||
# local genbindings configuration
|
|
||||||
cmd/genbindings/genbindings.local*
|
|
||||||
|
|
||||||
# local pkg-config configuration
|
|
||||||
pkg-config/*.pc
|
|
||||||
|
|
||||||
# binaries
|
# binaries
|
||||||
*.exe
|
*.exe
|
||||||
|
|
||||||
@ -17,6 +8,7 @@ cmd/handbindings/handbindings
|
|||||||
cmd/handbindings/bindings_test/direct
|
cmd/handbindings/bindings_test/direct
|
||||||
cmd/handbindings/bindings_test/testapp
|
cmd/handbindings/bindings_test/testapp
|
||||||
cmd/genbindings/genbindings
|
cmd/genbindings/genbindings
|
||||||
|
cmd/miqt-docker/miqt-docker
|
||||||
cmd/miqt-uic/miqt-uic
|
cmd/miqt-uic/miqt-uic
|
||||||
cmd/miqt-rcc/miqt-rcc
|
cmd/miqt-rcc/miqt-rcc
|
||||||
|
|
||||||
@ -24,6 +16,7 @@ examples/goroutine6/goroutine6
|
|||||||
examples/helloqml6/helloqml6
|
examples/helloqml6/helloqml6
|
||||||
examples/helloworld/helloworld
|
examples/helloworld/helloworld
|
||||||
examples/helloworld6/helloworld6
|
examples/helloworld6/helloworld6
|
||||||
|
examples/lcdclock6/lcdclock6
|
||||||
examples/mdoutliner/mdoutliner
|
examples/mdoutliner/mdoutliner
|
||||||
examples/mdoutliner6/mdoutliner6
|
examples/mdoutliner6/mdoutliner6
|
||||||
examples/windowsmanifest/windowsmanifest
|
examples/windowsmanifest/windowsmanifest
|
||||||
@ -35,6 +28,7 @@ examples/modelview_color6/modelview_color6
|
|||||||
examples/libraries/extras-scintillaedit/extras-scintillaedit
|
examples/libraries/extras-scintillaedit/extras-scintillaedit
|
||||||
examples/libraries/qt-multimedia/qt-multimedia
|
examples/libraries/qt-multimedia/qt-multimedia
|
||||||
examples/libraries/qt-network/qt-network
|
examples/libraries/qt-network/qt-network
|
||||||
|
examples/libraries/qt-pdf/qt-pdf
|
||||||
examples/libraries/qt-printsupport/qt-printsupport
|
examples/libraries/qt-printsupport/qt-printsupport
|
||||||
examples/libraries/qt-script/qt-script
|
examples/libraries/qt-script/qt-script
|
||||||
examples/libraries/qt-svg/qt-svg
|
examples/libraries/qt-svg/qt-svg
|
||||||
@ -43,6 +37,7 @@ examples/libraries/qt-webkit/qt-webkit
|
|||||||
examples/libraries/qt6-multimedia/qt6-multimedia
|
examples/libraries/qt6-multimedia/qt6-multimedia
|
||||||
examples/libraries/qt6-network/qt6-network
|
examples/libraries/qt6-network/qt6-network
|
||||||
examples/libraries/qt6-network-sctp/qt6-network-sctp
|
examples/libraries/qt6-network-sctp/qt6-network-sctp
|
||||||
|
examples/libraries/qt6-pdf/qt6-pdf
|
||||||
examples/libraries/qt6-webengine/qt6-webengine
|
examples/libraries/qt6-webengine/qt6-webengine
|
||||||
examples/libraries/restricted-extras-charts6/restricted-extras-charts6
|
examples/libraries/restricted-extras-charts6/restricted-extras-charts6
|
||||||
examples/libraries/restricted-extras-qscintilla/restricted-extras-qscintilla
|
examples/libraries/restricted-extras-qscintilla/restricted-extras-qscintilla
|
||||||
|
37
Makefile
@ -1,40 +1,23 @@
|
|||||||
BUILDSTAMPS := docker/genbindings.docker-buildstamp
|
|
||||||
DOCKER := docker
|
|
||||||
SHELL := /bin/bash
|
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
|
.PHONY: all
|
||||||
all: genbindings
|
all: genbindings
|
||||||
|
|
||||||
docker/genbindings.docker-buildstamp: docker/genbindings.Dockerfile
|
cmd/miqt-docker/miqt-docker: go.mod cmd/miqt-docker/*.go docker/*.Dockerfile
|
||||||
$(DOCKER) build -t miqt/genbindings:latest -f docker/genbindings.Dockerfile .
|
$(GO) build -o cmd/miqt-docker/miqt-docker ./cmd/miqt-docker
|
||||||
touch $@
|
|
||||||
|
|
||||||
.PHONY: clean
|
|
||||||
clean:
|
|
||||||
$(DOCKER) image rm -f miqt/genbindings:latest
|
|
||||||
rm -f $(BUILDSTAMPS)
|
|
||||||
|
|
||||||
.PHONY: clean-cache
|
.PHONY: clean-cache
|
||||||
clean-cache:
|
clean-cache:
|
||||||
rm -f cmd/genbindings/cachedir/*.json
|
rm -f cmd/genbindings/cachedir/*.json
|
||||||
|
|
||||||
|
cmd/genbindings/genbindings: go.mod cmd/genbindings/*.go
|
||||||
|
$(GO) build -o cmd/genbindings/genbindings ./cmd/genbindings
|
||||||
|
|
||||||
.PHONY: genbindings
|
.PHONY: genbindings
|
||||||
genbindings: $(BUILDSTAMPS)
|
genbindings: cmd/miqt-docker/miqt-docker cmd/genbindings/genbindings
|
||||||
$(DOCKEREXEC) 'cd cmd/genbindings && go build && ./genbindings'
|
cd cmd/genbindings && ../miqt-docker/miqt-docker genbindings ./genbindings
|
||||||
|
|
||||||
.PHONY: build-all
|
.PHONY: build-all
|
||||||
build-all: $(BUILDSTAMPS)
|
build-all: cmd/miqt-docker/miqt-docker
|
||||||
$(DOCKEREXEC) 'go build ./...'
|
./cmd/miqt-docker/miqt-docker genbindings go build ./...
|
||||||
|
95
README.md
@ -53,6 +53,8 @@ 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.
|
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?
|
### 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.
|
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.
|
||||||
@ -63,7 +65,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 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`
|
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.
|
||||||
|
|
||||||
See also [issue #8](https://github.com/mappu/miqt/issues/8).
|
See also [issue #8](https://github.com/mappu/miqt/issues/8).
|
||||||
|
|
||||||
@ -84,27 +86,29 @@ 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.
|
Most functions are implemented 1:1. [The Qt documentation](https://doc.qt.io/qt-5/classes.html) should be used.
|
||||||
|
|
||||||
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.
|
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.
|
||||||
- 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`.
|
- 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.
|
||||||
|
|
||||||
- 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.
|
||||||
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.
|
- 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.
|
||||||
|
|
||||||
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`.
|
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`.
|
||||||
- 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*)`.
|
- 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()`.
|
- 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()`.
|
||||||
|
|
||||||
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()`.
|
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.
|
||||||
|
|
||||||
- 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.
|
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")`.
|
||||||
|
|
||||||
Some C++ idioms that were difficult to project were omitted from the binding. But, this can be improved in the future.
|
Some C++ idioms that were difficult to project were omitted from the binding. But, this can be improved in the future.
|
||||||
|
|
||||||
@ -118,20 +122,22 @@ 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.
|
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 »](pkg-config/README.md)
|
You can use the `PKG_CONFIG_PATH` environment variable to override where CGO looks for `.pc` files. [Read more »](doc/pkg-config.md)
|
||||||
|
|
||||||
### Q8. How can I upgrade a MIQT app from Qt 5 to Qt 6?
|
### 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.
|
The import path changes from `github.com/mappu/miqt/qt` to `github.com/mappu/miqt/qt6`, but most basic classes are the same.
|
||||||
|
|
||||||
You can replace the import path in two ways:
|
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"_' {} \;`
|
||||||
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?
|
### 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)
|
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
|
## Building
|
||||||
|
|
||||||
### Linux (native)
|
### Linux (native)
|
||||||
@ -149,7 +155,7 @@ For dynamic linking, with the system Qt (Qt 5):
|
|||||||
apt install qtbase5-dev build-essential golang-go
|
apt install qtbase5-dev build-essential golang-go
|
||||||
|
|
||||||
# Debian / Ubuntu (Full)
|
# Debian / Ubuntu (Full)
|
||||||
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
|
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
|
||||||
```
|
```
|
||||||
|
|
||||||
For dynamic linking, with the system Qt (Qt 6):
|
For dynamic linking, with the system Qt (Qt 6):
|
||||||
@ -159,10 +165,10 @@ For dynamic linking, with the system Qt (Qt 6):
|
|||||||
apt install qt6-base-dev build-essential golang-go
|
apt install qt6-base-dev build-essential golang-go
|
||||||
|
|
||||||
# Debian / Ubuntu (Full)
|
# Debian / Ubuntu (Full)
|
||||||
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
|
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
|
||||||
|
|
||||||
# Fedora
|
# Fedora
|
||||||
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
|
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
|
||||||
|
|
||||||
# Manjaro
|
# Manjaro
|
||||||
pamac install qt6-base qscintilla-qt6 qt6-charts qt6-multimedia qt6-svg qt6-webchannel qt6-webengine qt6-declarative go
|
pamac install qt6-base qscintilla-qt6 qt6-charts qt6-multimedia qt6-svg qt6-webchannel qt6-webengine qt6-declarative go
|
||||||
@ -180,6 +186,13 @@ pacman -S pkg-config gcc go qt6-base qscintilla-qt6 qt6-charts qt6-multimedia qt
|
|||||||
go build -ldflags '-s -w'
|
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)
|
### Windows (native)
|
||||||
|
|
||||||
*Tested with Fsu0413 Qt 5.15 / Clang 18.1 native compilation*
|
*Tested with Fsu0413 Qt 5.15 / Clang 18.1 native compilation*
|
||||||
@ -236,14 +249,14 @@ Static linking is also available by installing the `mingw-w64-ucrt-x86_64-qt5-st
|
|||||||
For static linking:
|
For static linking:
|
||||||
|
|
||||||
1. Build the necessary docker container for cross-compilation:
|
1. Build the necessary docker container for cross-compilation:
|
||||||
- `docker build -t miqt/win64-cross:latest -f docker/win64-cross-go1.23-qt5.15-static.Dockerfile .`
|
- In the `docker/` directory: docker build -t miqt/win64-cross:latest -f win64-cross-go1.23-qt5.15-static.Dockerfile .`
|
||||||
2. Build your application:
|
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'`
|
- `docker run --rm -v $(pwd):/src -w /src miqt/win64-cross:latest go build --tags=windowsqtstatic -ldflags '-s -w -H windowsgui'`
|
||||||
|
|
||||||
For dynamic linking:
|
For dynamic linking:
|
||||||
|
|
||||||
1. Build the necessary docker container for cross-compilation:
|
1. Build the necessary docker container for cross-compilation:
|
||||||
- `docker build -t miqt/win64-dynamic:latest -f docker/win64-cross-go1.23-qt5.15-dynamic.Dockerfile .`
|
- In the `docker/` directory: `docker build -t miqt/win64-dynamic:latest -f win64-cross-go1.23-qt5.15-dynamic.Dockerfile .`
|
||||||
2. Build your application:
|
2. Build your application:
|
||||||
- `docker run --rm -v $(pwd):/src -w /src miqt/win64-dynamic:latest go build -ldflags '-s -w -H windowsgui'`
|
- `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.
|
3. Copy necessary Qt LGPL libraries and plugin files.
|
||||||
@ -260,7 +273,7 @@ To add an icon and other properties to the .exe, you can use [the go-winres tool
|
|||||||
pkg install git
|
pkg install git
|
||||||
pkg install devel/pkgconf
|
pkg install devel/pkgconf
|
||||||
pkg install go
|
pkg install go
|
||||||
pkg install qt6-base qt6-charts qt6-multimedia qt6-svg qt6-webchannel qt6-webengine qt6-declarative qscintilla2-qt6
|
pkg install qt6-base qt6-charts qt6-multimedia qt6-pdf qt6-svg qt6-webchannel qt6-webengine qt6-declarative qscintilla2-qt6
|
||||||
|
|
||||||
go build -ldflags '-s -w'
|
go build -ldflags '-s -w'
|
||||||
```
|
```
|
||||||
@ -290,44 +303,26 @@ Installing `qt@5` from Homebrew may be very slow if Homebrew chooses to do a fro
|
|||||||
For dynamic linking:
|
For dynamic linking:
|
||||||
|
|
||||||
1. Build the necessary docker container for cross-compilation:
|
1. Build the necessary docker container for cross-compilation:
|
||||||
- `docker build -t miqt/osxcross:latest -f docker/macos-cross-x86_64-sdk14.5-go1.19-qt5.15-dynamic.Dockerfile .`
|
- In the `docker/` directory: `docker build -t miqt/osxcross:latest -f macos-cross-x86_64-sdk14.5-go1.19-qt5.15-dynamic.Dockerfile .`
|
||||||
2. Build your application:
|
2. Build your application:
|
||||||
- `docker run --rm -v $(pwd):/src -w /src miqt/osxcross:latest go build -ldflags '-s -w'`
|
- `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.
|
3. Copy necessary Qt LGPL libraries and plugin files.
|
||||||
|
|
||||||
See FAQ Q3 for advice about docker performance.
|
See FAQ Q3 for advice about docker performance.
|
||||||
|
|
||||||
### Android (Docker)
|
### Android (Docker with miqt-docker)
|
||||||
|
|
||||||
*Tested with Raymii Qt 5.15 / Android SDK 31 / Android NDK 22*
|
*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 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.
|
MIQT supports compiling for Android. Some extra steps are required to bridge the Java, C++, Go worlds.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
1. Modify your main function to [support `c-shared` build mode](https://pkg.go.dev/cmd/go#hdr-Build_modes).
|
```bash
|
||||||
- Package `main` must have an empty `main` function.
|
go install github.com/mappu/miqt/cmd/miqt-docker
|
||||||
- Rename your `main` function to `AndroidMain` and add a comment `//export AndroidMain`.
|
miqt-docker android-qt5 -android-build # or android-qt6
|
||||||
- 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`
|
|
||||||
|
|
||||||
See FAQ Q3 for advice about docker performance.
|
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.
|
||||||
|
|
||||||
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.
|
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.
|
||||||
|
@ -1,66 +0,0 @@
|
|||||||
#!/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 "$@"
|
|
@ -1,106 +0,0 @@
|
|||||||
#!/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
|
1. Git clone this repository
|
||||||
2. In `docker/genbindings.Dockerfile`, add your library's headers and pkg-config file.
|
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.](pkg-config/README.md)
|
- If your library does not include a pkg-config file, [you must create one.](../../doc/pkg-config.md)
|
||||||
3. Patch `cmd/genbindings/config-libraries.go` to add a new `generate` block for your target library
|
3. Patch `cmd/genbindings/config-libraries.go` to add a new `generate` block for your target library
|
||||||
4. Run `genbindings` to regenerate all bindings
|
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
|
- The first run must populate clang ASTs into a cache directory and may be slower, but it is fast afterwards
|
||||||
|
@ -461,6 +461,15 @@ nextMethod:
|
|||||||
return CppClass{}, err
|
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.IsSignal = isSignal && !mm.IsStatic && AllowSignal(mm)
|
||||||
mm.IsProtected = (visibility == VsProtected)
|
mm.IsProtected = (visibility == VsProtected)
|
||||||
|
|
||||||
@ -515,6 +524,17 @@ func isExplicitlyDeleted(node map[string]interface{}) bool {
|
|||||||
return false
|
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.
|
// processEnum parses a Clang enum into our CppEnum intermediate format.
|
||||||
func processEnum(node map[string]interface{}, addNamePrefix string) (CppEnum, error) {
|
func processEnum(node map[string]interface{}, addNamePrefix string) (CppEnum, error) {
|
||||||
var ret CppEnum
|
var ret CppEnum
|
||||||
|
@ -200,6 +200,22 @@ func ProcessLibraries(clangBin, outDir, extraLibsDir string) {
|
|||||||
ClangMatchSameHeaderDefinitionOnly,
|
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
|
// Depends on QtCore/Gui/Widgets, QPrintSupport
|
||||||
generate(
|
generate(
|
||||||
"qt-restricted-extras/qscintilla",
|
"qt-restricted-extras/qscintilla",
|
||||||
@ -434,6 +450,23 @@ func ProcessLibraries(clangBin, outDir, extraLibsDir string) {
|
|||||||
ClangMatchSameHeaderDefinitionOnly,
|
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
|
// Qt 6 Charts
|
||||||
// Depends on QtCore/Gui/Widgets
|
// Depends on QtCore/Gui/Widgets
|
||||||
generate(
|
generate(
|
||||||
|
@ -877,19 +877,33 @@ extern "C" {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(c.Methods) > 0 {
|
||||||
|
ret.WriteString("\n")
|
||||||
|
}
|
||||||
|
|
||||||
for _, m := range virtualMethods {
|
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("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*/ +"*")))
|
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 {
|
if len(virtualMethods) > 0 {
|
||||||
|
ret.WriteString("\n")
|
||||||
|
|
||||||
for _, m := range protectedMethods {
|
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*/ +"*")))
|
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 {
|
if c.CanDelete {
|
||||||
ret.WriteString(fmt.Sprintf("void %s(%s* self);\n", cabiDeleteName(c), className))
|
ret.WriteString(fmt.Sprintf("void %s(%s* self);\n", cabiDeleteName(c), className))
|
||||||
}
|
}
|
||||||
@ -907,11 +921,6 @@ extern "C" {
|
|||||||
return ret.String(), nil
|
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 {
|
func emitParametersCabiConstructor(c *CppClass, ctor *CppMethod) string {
|
||||||
|
|
||||||
slist := make([]string, 0, len(ctor.Parameters))
|
slist := make([]string, 0, len(ctor.Parameters))
|
||||||
@ -970,7 +979,9 @@ extern "C" {
|
|||||||
`)
|
`)
|
||||||
|
|
||||||
for _, c := range src.Classes {
|
for _, c := range src.Classes {
|
||||||
for _, m := range c.Methods {
|
methodsAndPrivateSignals := append(c.Methods, c.PrivateSignals...)
|
||||||
|
|
||||||
|
for _, m := range methodsAndPrivateSignals {
|
||||||
if m.IsSignal {
|
if m.IsSignal {
|
||||||
callback := "void " + cabiCallbackName(c, m) + "(intptr_t"
|
callback := "void " + cabiCallbackName(c, m) + "(intptr_t"
|
||||||
|
|
||||||
@ -1001,37 +1012,34 @@ extern "C" {
|
|||||||
`)
|
`)
|
||||||
|
|
||||||
for _, c := range src.Classes {
|
for _, c := range src.Classes {
|
||||||
|
className := cabiClassName(c.ClassName)
|
||||||
methodPrefixName := cabiClassName(c.ClassName)
|
|
||||||
cppClassName := c.ClassName
|
|
||||||
virtualMethods := c.VirtualMethods()
|
virtualMethods := c.VirtualMethods()
|
||||||
protectedMethods := c.ProtectedMethods()
|
protectedMethods := c.ProtectedMethods()
|
||||||
|
|
||||||
if len(virtualMethods) > 0 {
|
if len(virtualMethods) > 0 {
|
||||||
|
subclassName := cppSubclassName(c)
|
||||||
|
|
||||||
overriddenClassName := cppSubclassName(c)
|
ret.WriteString("class " + subclassName + " final : public " + c.ClassName + " {\n" +
|
||||||
|
|
||||||
ret.WriteString("class " + overriddenClassName + " final : public " + cppClassName + " {\n" +
|
|
||||||
"public:\n" +
|
"public:\n" +
|
||||||
"\n",
|
"\n",
|
||||||
)
|
)
|
||||||
|
|
||||||
for _, ctor := range c.Ctors {
|
for _, ctor := range c.Ctors {
|
||||||
ret.WriteString("\t" + overriddenClassName + "(" + emitParametersCpp(ctor) + "): " + cppClassName + "(" + emitParameterNames(ctor) + ") {};\n")
|
ret.WriteString("\t" + subclassName + "(" + emitParametersCpp(ctor) + "): " + c.ClassName + "(" + emitParameterNames(ctor) + ") {}\n")
|
||||||
}
|
}
|
||||||
ret.WriteString("\n")
|
ret.WriteString("\n")
|
||||||
|
|
||||||
if !c.CanDelete {
|
if !c.CanDelete {
|
||||||
ret.WriteString(
|
ret.WriteString(
|
||||||
"private:\n" +
|
"private:\n" +
|
||||||
"\tvirtual ~" + overriddenClassName + "();\n" + // = delete;\n" +
|
"\tvirtual ~" + subclassName + "();\n" + // = delete;\n" +
|
||||||
"\n" +
|
"\n" +
|
||||||
"public:\n" +
|
"public:\n" +
|
||||||
"\n",
|
"\n",
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
ret.WriteString(
|
ret.WriteString(
|
||||||
"\tvirtual ~" + overriddenClassName + "() override = default;\n" +
|
"\tvirtual ~" + subclassName + "() override = default;\n" +
|
||||||
"\n",
|
"\n",
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@ -1074,7 +1082,7 @@ extern "C" {
|
|||||||
ret.WriteString("\t\t\treturn " + getCppZeroValue(m.ReturnType) + "; // Pure virtual, there is no base we can call\n")
|
ret.WriteString("\t\t\treturn " + getCppZeroValue(m.ReturnType) + "; // Pure virtual, there is no base we can call\n")
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ret.WriteString("\t\t\t" + maybeReturn + methodPrefixName + "::" + m.CppCallTarget() + "(" + emitParameterNames(m) + ");\n")
|
ret.WriteString("\t\t\t" + maybeReturn + c.ClassName + "::" + m.CppCallTarget() + "(" + emitParameterNames(m) + ");\n")
|
||||||
|
|
||||||
if m.ReturnType.Void() {
|
if m.ReturnType.Void() {
|
||||||
ret.WriteString("\t\t\treturn;\n")
|
ret.WriteString("\t\t\treturn;\n")
|
||||||
@ -1094,11 +1102,11 @@ extern "C" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ret.WriteString(
|
ret.WriteString(
|
||||||
"\t\t\n" +
|
"\n" +
|
||||||
signalCode + "\n" +
|
signalCode +
|
||||||
"\t\t" + maybeReturn2 + cabiCallbackName(c, m) + "(" + strings.Join(paramArgs, `, `) + ");\n" +
|
"\t\t" + maybeReturn2 + cabiCallbackName(c, m) + "(" + strings.Join(paramArgs, `, `) + ");\n" +
|
||||||
returnTransformP + "\n" +
|
returnTransformP +
|
||||||
"\t\t" + ifv(maybeReturn == "", "", "return "+returnTransformF+";") + "\n" +
|
ifv(maybeReturn == "", "", "\t\treturn "+returnTransformF+";") + "\n" +
|
||||||
"\t}\n" +
|
"\t}\n" +
|
||||||
|
|
||||||
"\n",
|
"\n",
|
||||||
@ -1144,8 +1152,6 @@ extern "C" {
|
|||||||
ret.WriteString(
|
ret.WriteString(
|
||||||
"};\n" +
|
"};\n" +
|
||||||
"\n")
|
"\n")
|
||||||
|
|
||||||
cppClassName = overriddenClassName
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for i, ctor := range c.Ctors {
|
for i, ctor := range c.Ctors {
|
||||||
@ -1153,7 +1159,7 @@ extern "C" {
|
|||||||
preamble, forwarding := emitParametersCABI2CppForwarding(ctor.Parameters, "\t")
|
preamble, forwarding := emitParametersCABI2CppForwarding(ctor.Parameters, "\t")
|
||||||
|
|
||||||
ret.WriteString(
|
ret.WriteString(
|
||||||
cabiClassName(c.ClassName) + "* " + cabiNewName(c, i) + "(" + emitParametersCabiConstructor(&c, &ctor) + ") {\n",
|
className + "* " + cabiNewName(c, i) + "(" + emitParametersCabi(ctor, "") + ") {\n",
|
||||||
)
|
)
|
||||||
|
|
||||||
if ctor.RequireCpp != nil {
|
if ctor.RequireCpp != nil {
|
||||||
@ -1164,7 +1170,9 @@ extern "C" {
|
|||||||
|
|
||||||
ret.WriteString(
|
ret.WriteString(
|
||||||
preamble +
|
preamble +
|
||||||
"\treturn new " + cppClassName + "(" + forwarding + ");\n",
|
"\treturn new (std::nothrow) " +
|
||||||
|
ifv(len(virtualMethods) > 0, cppSubclassName(c), c.ClassName) +
|
||||||
|
"(" + forwarding + ");\n",
|
||||||
)
|
)
|
||||||
|
|
||||||
if ctor.RequireCpp != nil {
|
if ctor.RequireCpp != nil {
|
||||||
@ -1187,7 +1195,7 @@ extern "C" {
|
|||||||
// need the base pointers to call base methods from CGO
|
// need the base pointers to call base methods from CGO
|
||||||
if len(c.DirectInheritClassInfo()) > 0 {
|
if len(c.DirectInheritClassInfo()) > 0 {
|
||||||
ret.WriteString(
|
ret.WriteString(
|
||||||
"void " + cabiVirtBaseName(c) + "(" + methodPrefixName + "* src",
|
"void " + cabiVirtBaseName(c) + "(" + className + "* src",
|
||||||
)
|
)
|
||||||
for _, baseClass := range c.DirectInheritClassInfo() {
|
for _, baseClass := range c.DirectInheritClassInfo() {
|
||||||
ret.WriteString(", " + baseClass.Class.ClassName + "** outptr_" + cabiClassName(baseClass.Class.ClassName))
|
ret.WriteString(", " + baseClass.Class.ClassName + "** outptr_" + cabiClassName(baseClass.Class.ClassName))
|
||||||
@ -1251,7 +1259,7 @@ extern "C" {
|
|||||||
"#endif\n"+
|
"#endif\n"+
|
||||||
"}\n"+
|
"}\n"+
|
||||||
"\n",
|
"\n",
|
||||||
m.ReturnType.RenderTypeCabi(), methodPrefixName, m.SafeMethodName(), emitParametersCabi(m, ifv(m.IsConst, "const ", "")+methodPrefixName+"*"),
|
m.ReturnType.RenderTypeCabi(), className, m.SafeMethodName(), emitParametersCabi(m, ifv(m.IsConst, "const ", "")+className+"*"),
|
||||||
preamble,
|
preamble,
|
||||||
emitAssignCppToCabi("\treturn ", m.ReturnType, callTarget),
|
emitAssignCppToCabi("\treturn ", m.ReturnType, callTarget),
|
||||||
unavailableRetn,
|
unavailableRetn,
|
||||||
@ -1259,10 +1267,10 @@ extern "C" {
|
|||||||
|
|
||||||
} else if m.BecomesNonConstInVersion != nil {
|
} else if m.BecomesNonConstInVersion != nil {
|
||||||
|
|
||||||
nonConstCallTarget := "const_cast<" + methodPrefixName + "*>(self)->" + m.CppCallTarget() + "(" + forwarding + ")"
|
nonConstCallTarget := "const_cast<" + c.ClassName + "*>(self)->" + m.CppCallTarget() + "(" + forwarding + ")"
|
||||||
|
|
||||||
ret.WriteString("" +
|
ret.WriteString("" +
|
||||||
m.ReturnType.RenderTypeCabi() + " " + methodPrefixName + "_" + m.SafeMethodName() + "(" + emitParametersCabi(m, ifv(m.IsConst, "const ", "")+methodPrefixName+"*") + ") {\n" +
|
m.ReturnType.RenderTypeCabi() + " " + className + "_" + m.SafeMethodName() + "(" + emitParametersCabi(m, ifv(m.IsConst, "const ", "")+className+"*") + ") {\n" +
|
||||||
preamble + "\n" +
|
preamble + "\n" +
|
||||||
"// This method was changed from const to non-const in Qt " + *m.BecomesNonConstInVersion + "\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" +
|
"#if QT_VERSION < QT_VERSION_CHECK(" + strings.Replace(*m.BecomesNonConstInVersion, `.`, `,`, -1) + ",0)\n" +
|
||||||
@ -1279,9 +1287,9 @@ extern "C" {
|
|||||||
ret.WriteString("" +
|
ret.WriteString("" +
|
||||||
"// This method's return type was changed from non-const to const in Qt " + *m.ReturnType.BecomesConstInVersion + "\n" +
|
"// 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" +
|
"#if QT_VERSION >= QT_VERSION_CHECK(" + strings.Replace(*m.ReturnType.BecomesConstInVersion, `.`, `,`, -1) + ",0)\n" +
|
||||||
"const " + m.ReturnType.RenderTypeCabi() + " " + methodPrefixName + "_" + m.SafeMethodName() + "(" + emitParametersCabi(m, ifv(m.IsConst, "const ", "")+methodPrefixName+"*") + ") {\n" +
|
"const " + m.ReturnType.RenderTypeCabi() + " " + className + "_" + m.SafeMethodName() + "(" + emitParametersCabi(m, ifv(m.IsConst, "const ", "")+className+"*") + ") {\n" +
|
||||||
"#else\n" +
|
"#else\n" +
|
||||||
m.ReturnType.RenderTypeCabi() + " " + methodPrefixName + "_" + m.SafeMethodName() + "(" + emitParametersCabi(m, ifv(m.IsConst, "const ", "")+methodPrefixName+"*") + ") {\n" +
|
m.ReturnType.RenderTypeCabi() + " " + className + "_" + m.SafeMethodName() + "(" + emitParametersCabi(m, ifv(m.IsConst, "const ", "")+className+"*") + ") {\n" +
|
||||||
"#endif\n" +
|
"#endif\n" +
|
||||||
preamble + "\n" +
|
preamble + "\n" +
|
||||||
emitAssignCppToCabi("\treturn ", m.ReturnType, callTarget) +
|
emitAssignCppToCabi("\treturn ", m.ReturnType, callTarget) +
|
||||||
@ -1296,7 +1304,7 @@ extern "C" {
|
|||||||
"%s"+
|
"%s"+
|
||||||
"}\n"+
|
"}\n"+
|
||||||
"\n",
|
"\n",
|
||||||
m.ReturnType.RenderTypeCabi(), methodPrefixName, m.SafeMethodName(), emitParametersCabi(m, ifv(m.IsConst, "const ", "")+methodPrefixName+"*"),
|
m.ReturnType.RenderTypeCabi(), className, m.SafeMethodName(), emitParametersCabi(m, ifv(m.IsConst, "const ", "")+className+"*"),
|
||||||
preamble,
|
preamble,
|
||||||
emitAssignCppToCabi("\treturn ", m.ReturnType, callTarget),
|
emitAssignCppToCabi("\treturn ", m.ReturnType, callTarget),
|
||||||
))
|
))
|
||||||
@ -1322,8 +1330,8 @@ extern "C" {
|
|||||||
signalCode += "\t\t" + cabiCallbackName(c, m) + "(" + strings.Join(paramArgs, `, `) + ");\n"
|
signalCode += "\t\t" + cabiCallbackName(c, m) + "(" + strings.Join(paramArgs, `, `) + ");\n"
|
||||||
|
|
||||||
ret.WriteString(
|
ret.WriteString(
|
||||||
`void ` + cabiConnectName(c, m) + `(` + methodPrefixName + `* self, intptr_t slot) {` + "\n" +
|
`void ` + cabiConnectName(c, m) + `(` + className + `* self, intptr_t slot) {` + "\n" +
|
||||||
"\t" + cppClassName + `::connect(self, ` + exactSignal + `, self, [=](` + emitParametersCpp(m) + `) {` + "\n" +
|
"\t" + className + `::connect(self, ` + exactSignal + `, self, [=](` + emitParametersCpp(m) + `) {` + "\n" +
|
||||||
signalCode +
|
signalCode +
|
||||||
"\t});\n" +
|
"\t});\n" +
|
||||||
"}\n" +
|
"}\n" +
|
||||||
@ -1362,83 +1370,78 @@ extern "C" {
|
|||||||
return ret
|
return ret
|
||||||
}
|
}
|
||||||
|
|
||||||
// Virtual override helpers
|
|
||||||
for _, m := range virtualMethods {
|
|
||||||
|
|
||||||
// Virtual methods: Allow overriding
|
|
||||||
// (Never use a const self*)
|
|
||||||
// The pointer that we are passed is the base type, not the subclassed
|
|
||||||
// type. First cast the void* to the base type, and only then,
|
|
||||||
// upclass it
|
|
||||||
|
|
||||||
ret.WriteString(
|
|
||||||
`bool ` + cabiOverrideVirtualName(c, m) + `(void* self, intptr_t slot) {` + "\n" +
|
|
||||||
"\t" + cppClassName + "* self_cast = dynamic_cast<" + cppClassName + "*>( (" + cabiClassName(c.ClassName) + "*)(self) );\n" +
|
|
||||||
"\tif (self_cast == nullptr) {\n" +
|
|
||||||
"\t\treturn false;\n" +
|
|
||||||
"\t}\n" +
|
|
||||||
"\t\n" +
|
|
||||||
"\tself_cast->handle__" + m.SafeMethodName() + " = slot;\n" +
|
|
||||||
"\treturn true;\n" +
|
|
||||||
"}\n" +
|
|
||||||
"\n",
|
|
||||||
)
|
|
||||||
|
|
||||||
// 2. Add CABI function to call the base method
|
|
||||||
|
|
||||||
if !m.IsPureVirtual {
|
|
||||||
// This is not generally exposed in the Go binding, but when overriding
|
|
||||||
// the method, allows Go code to call super().
|
|
||||||
|
|
||||||
// This calls the target Qt C++ method directly using fully
|
|
||||||
// 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 := "( (" + 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 + "\n" +
|
|
||||||
fixupProtectedReferences(emitAssignCppToCabi("\treturn ", m.ReturnType, callTarget)) + "\n" +
|
|
||||||
"}\n" +
|
|
||||||
"\n",
|
|
||||||
)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if len(virtualMethods) > 0 {
|
if len(virtualMethods) > 0 {
|
||||||
// This is a subclassed class. In that case, we allow calling
|
// This is a subclassed class. In that case, we allow calling
|
||||||
// protected methods
|
// protected methods
|
||||||
// This is a standalone function, but it can access the protected
|
// This is a standalone function, but it can access the protected
|
||||||
// method via a friend declaration
|
// method via a friend declaration
|
||||||
|
|
||||||
|
subclassName := cppSubclassName(c)
|
||||||
|
|
||||||
|
// Virtual override helpers
|
||||||
|
for _, m := range virtualMethods {
|
||||||
|
|
||||||
|
// Virtual methods: Allow overriding
|
||||||
|
// (Never use a const self*)
|
||||||
|
// The pointer that we are passed is the base type, not the subclassed
|
||||||
|
// type. First cast the void* to the base type, and only then,
|
||||||
|
// upclass it
|
||||||
|
|
||||||
|
ret.WriteString(
|
||||||
|
`bool ` + cabiOverrideVirtualName(c, m) + `(void* self, intptr_t slot) {` + "\n" +
|
||||||
|
"\t" + subclassName + "* self_cast = dynamic_cast<" + subclassName + "*>( (" + c.ClassName + "*)(self) );\n" +
|
||||||
|
"\tif (self_cast == nullptr) {\n" +
|
||||||
|
"\t\treturn false;\n" +
|
||||||
|
"\t}\n" +
|
||||||
|
"\n" +
|
||||||
|
"\tself_cast->handle__" + m.SafeMethodName() + " = slot;\n" +
|
||||||
|
"\treturn true;\n" +
|
||||||
|
"}\n" +
|
||||||
|
"\n",
|
||||||
|
)
|
||||||
|
|
||||||
|
// 2. Add CABI function to call the base method
|
||||||
|
|
||||||
|
if !m.IsPureVirtual {
|
||||||
|
// This is not generally exposed in the Go binding, but when overriding
|
||||||
|
// the method, allows Go code to call super().
|
||||||
|
|
||||||
|
// This calls the target Qt C++ method directly using fully
|
||||||
|
// qualified syntax (`MiqtSubclass->QFoo::Bar()`). This method
|
||||||
|
// takes and returns CABI types.
|
||||||
|
|
||||||
|
vbpreamble, vbforwarding := emitParametersCABI2CppForwarding(m.Parameters, "\t")
|
||||||
|
|
||||||
|
callTarget := "static_cast<" + ifv(m.IsConst, "const ", "") + subclassName + "*>(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)) +
|
||||||
|
"}\n" +
|
||||||
|
"\n",
|
||||||
|
)
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for _, m := range protectedMethods {
|
for _, m := range protectedMethods {
|
||||||
|
|
||||||
vbpreamble, vbforwarding := emitParametersCABI2CppForwarding(m.Parameters, "\t\t")
|
vbpreamble, vbforwarding := emitParametersCABI2CppForwarding(m.Parameters, "\t\t")
|
||||||
vbCallTarget := "self_cast->" + m.CppCallTarget() + "(" + vbforwarding + ")"
|
vbCallTarget := "self_cast->" + m.CppCallTarget() + "(" + vbforwarding + ")"
|
||||||
|
|
||||||
//
|
|
||||||
|
|
||||||
ret.WriteString(
|
ret.WriteString(
|
||||||
m.ReturnType.RenderTypeCabi() + " " + cabiProtectedBaseName(c, m) + "(bool* _dynamic_cast_ok, " + emitParametersCabi(m, ifv(m.IsConst, "const ", "")+"void*") + ") {\n" +
|
m.ReturnType.RenderTypeCabi() + " " + cabiProtectedBaseName(c, m) + "(bool* _dynamic_cast_ok, " + emitParametersCabi(m, ifv(m.IsConst, "const ", "")+"void*") + ") {\n" +
|
||||||
|
|
||||||
"\t" + cppClassName + "* self_cast = dynamic_cast<" + cppClassName + "*>( (" + cabiClassName(c.ClassName) + "*)(self) );\n" +
|
"\t" + subclassName + "* self_cast = dynamic_cast<" + subclassName + "*>( (" + c.ClassName + "*)(self) );\n" +
|
||||||
"\tif (self_cast == nullptr) {\n" +
|
"\tif (self_cast == nullptr) {\n" +
|
||||||
"\t\t*_dynamic_cast_ok = false;\n" +
|
"\t\t*_dynamic_cast_ok = false;\n" +
|
||||||
"\t\treturn " + getCabiZeroValue(m.ReturnType) + ";\n" +
|
"\t\treturn " + getCabiZeroValue(m.ReturnType) + ";\n" +
|
||||||
"\t}\n" +
|
"\t}\n" +
|
||||||
"\t\n" +
|
"\n" +
|
||||||
"\t*_dynamic_cast_ok = true;\n" +
|
"\t*_dynamic_cast_ok = true;\n" +
|
||||||
"\t" + vbpreamble + "\n" +
|
vbpreamble +
|
||||||
fixupProtectedReferences(emitAssignCppToCabi("\treturn ", m.ReturnType, vbCallTarget)) + "\n" +
|
fixupProtectedReferences(emitAssignCppToCabi("\treturn ", m.ReturnType, vbCallTarget)) +
|
||||||
"}\n" +
|
"}\n" +
|
||||||
"\n",
|
"\n",
|
||||||
)
|
)
|
||||||
@ -1446,12 +1449,38 @@ 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
|
// Delete
|
||||||
// If we subclassed, our class destructor is always virtual. Therefore
|
// If we subclassed, our class destructor is always virtual. Therefore
|
||||||
// we can delete from the self ptr without any dynamic_cast<>
|
// we can delete from the self ptr without any dynamic_cast<>
|
||||||
if c.CanDelete {
|
if c.CanDelete {
|
||||||
ret.WriteString(
|
ret.WriteString(
|
||||||
"void " + cabiDeleteName(c) + "(" + methodPrefixName + "* self) {\n" +
|
"void " + cabiDeleteName(c) + "(" + className + "* self) {\n" +
|
||||||
"\tdelete self;\n" +
|
"\tdelete self;\n" +
|
||||||
"}\n" +
|
"}\n" +
|
||||||
"\n",
|
"\n",
|
||||||
|
@ -1130,6 +1130,45 @@ 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 {
|
if c.CanDelete {
|
||||||
gfs.imports["runtime"] = struct{}{} // Finalizer
|
gfs.imports["runtime"] = struct{}{} // Finalizer
|
||||||
|
|
||||||
|
@ -412,6 +412,7 @@ type CppClass struct {
|
|||||||
ChildClassdefs []CppClass
|
ChildClassdefs []CppClass
|
||||||
ChildEnums []CppEnum
|
ChildEnums []CppEnum
|
||||||
PrivateMethods []string
|
PrivateMethods []string
|
||||||
|
PrivateSignals []CppMethod
|
||||||
}
|
}
|
||||||
|
|
||||||
// VirtualMethods checks if the class has any virtual methods. This requires global
|
// VirtualMethods checks if the class has any virtual methods. This requires global
|
||||||
|
63
cmd/miqt-docker/README.md
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
# 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
|
415
cmd/miqt-docker/android-build.sh
Normal file
@ -0,0 +1,415 @@
|
|||||||
|
#!/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 "$@"
|
108
cmd/miqt-docker/docker.go
Normal file
@ -0,0 +1,108 @@
|
|||||||
|
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()
|
||||||
|
}
|
64
cmd/miqt-docker/filepath.go
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
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
|
||||||
|
}
|
78
cmd/miqt-docker/filepath_test.go
Normal file
@ -0,0 +1,78 @@
|
|||||||
|
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)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
24
cmd/miqt-docker/isatty_linux.go
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
//+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
|
||||||
|
}
|
8
cmd/miqt-docker/isatty_other.go
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
//+build !linux
|
||||||
|
//go:build !linux
|
||||||
|
|
||||||
|
package main
|
||||||
|
|
||||||
|
func isatty() bool {
|
||||||
|
return true
|
||||||
|
}
|
300
cmd/miqt-docker/main.go
Normal file
@ -0,0 +1,300 @@
|
|||||||
|
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)
|
||||||
|
}
|
||||||
|
}
|
77
cmd/miqt-docker/tasks.go
Normal file
@ -0,0 +1,77 @@
|
|||||||
|
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
Normal file
@ -0,0 +1,81 @@
|
|||||||
|
<?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
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
// 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
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
<?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>
|
49
cmd/miqt-uic/testdata/qt5_mainwindow_button.ui.go.expected
vendored
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
// 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"))
|
||||||
|
}
|
62
cmd/miqt-uic/testdata/qt5_mainwindow_gridlayout.ui
vendored
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
<?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>
|
73
cmd/miqt-uic/testdata/qt5_mainwindow_gridlayout.ui.go.expected
vendored
Normal file
@ -0,0 +1,73 @@
|
|||||||
|
// 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
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
<?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>
|
61
cmd/miqt-uic/testdata/qt5_mainwindow_hlayout.ui.go.expected
vendored
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
// 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
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
<?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>
|
53
cmd/miqt-uic/testdata/qt5_mainwindow_hspacer.ui.go.expected
vendored
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
// 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"))
|
||||||
|
}
|
45
cmd/miqt-uic/testdata/qt5_mainwindow_icon_theme.ui
vendored
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
<?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>
|
52
cmd/miqt-uic/testdata/qt5_mainwindow_icon_theme.ui.go.expected
vendored
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
// 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
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
<?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>
|
62
cmd/miqt-uic/testdata/qt5_mainwindow_menu.ui.go.expected
vendored
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
// 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"))
|
||||||
|
}
|
74
cmd/miqt-uic/testdata/qt5_mainwindow_nested_layouts.ui
vendored
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
<?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>
|
94
cmd/miqt-uic/testdata/qt5_mainwindow_nested_layouts.ui.go.expected
vendored
Normal file
@ -0,0 +1,94 @@
|
|||||||
|
// 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
Normal file
@ -0,0 +1,102 @@
|
|||||||
|
<?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>
|
114
cmd/miqt-uic/testdata/qt5_mainwindow_tabs.ui.go.expected
vendored
Normal file
@ -0,0 +1,114 @@
|
|||||||
|
// 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
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
<?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>
|
61
cmd/miqt-uic/testdata/qt5_mainwindow_vlayout.ui.go.expected
vendored
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
// 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
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
<?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>
|
53
cmd/miqt-uic/testdata/qt5_mainwindow_vspacer.ui.go.expected
vendored
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
// 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
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
<?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
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
// 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"))
|
||||||
|
}
|
44
cmd/miqt-uic/testdata/qt5_widget_connection_argument.ui
vendored
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
<?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>
|
48
cmd/miqt-uic/testdata/qt5_widget_connection_argument.ui.go.expected
vendored
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
// 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
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
<?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>
|
75
cmd/miqt-uic/testdata/qt64_mainwindow_hlayout.ui.go.expected
vendored
Normal file
@ -0,0 +1,75 @@
|
|||||||
|
// 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
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
<?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>
|
63
cmd/miqt-uic/testdata/qt64_mainwindow_hspacer.ui.go.expected
vendored
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
// 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
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
<?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>
|
75
cmd/miqt-uic/testdata/qt64_mainwindow_vlayout.ui.go.expected
vendored
Normal file
@ -0,0 +1,75 @@
|
|||||||
|
// 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
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
<?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>
|
63
cmd/miqt-uic/testdata/qt64_mainwindow_vspacer.ui.go.expected
vendored
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
// 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
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
<?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>
|
63
cmd/miqt-uic/testdata/qt69_mainwindow_hspacer.ui.go.expected
vendored
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
// 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"))
|
||||||
|
}
|
45
cmd/miqt-uic/testdata/qt69_mainwindow_icon_theme.ui
vendored
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
<?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>
|
62
cmd/miqt-uic/testdata/qt69_mainwindow_icon_theme.ui.go.expected
vendored
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
// 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
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
<?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>
|
63
cmd/miqt-uic/testdata/qt69_mainwindow_vspacer.ui.go.expected
vendored
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
// 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,9 +10,10 @@ type UiLayoutItem struct {
|
|||||||
RowSpan *int `xml:"rowspan,attr"`
|
RowSpan *int `xml:"rowspan,attr"`
|
||||||
ColSpan *int `xml:"colspan,attr"`
|
ColSpan *int `xml:"colspan,attr"`
|
||||||
|
|
||||||
// A layout item either has a widget, or a spacer
|
// A layout item either has a widget, or a spacer, or another layout
|
||||||
Widget *UiWidget `xml:"widget"`
|
Widget *UiWidget `xml:"widget"`
|
||||||
Spacer *UiSpacer `xml:"spacer"`
|
Spacer *UiSpacer `xml:"spacer"`
|
||||||
|
Layout *UiLayout `xml:"layout"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type UiLayout struct {
|
type UiLayout struct {
|
||||||
@ -60,7 +61,8 @@ type UiString struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type UiIcon struct {
|
type UiIcon struct {
|
||||||
ResourceFile string `xml:"resource,attr"`
|
ResourceFile string `xml:"resource,attr,omitempty"`
|
||||||
|
Theme string `xml:"theme,attr"`
|
||||||
|
|
||||||
NormalOff *string `xml:"normaloff,omitempty"`
|
NormalOff *string `xml:"normaloff,omitempty"`
|
||||||
NormalOn *string `xml:"normalon,omitempty"`
|
NormalOn *string `xml:"normalon,omitempty"`
|
||||||
@ -74,15 +76,31 @@ type UiIcon struct {
|
|||||||
Base string `xml:",chardata"`
|
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 {
|
type UiProperty struct {
|
||||||
Name string `xml:"name,attr"`
|
Name string `xml:"name,attr"`
|
||||||
StringVal *UiString `xml:"string,omitempty"`
|
StdSetVal *string `xml:"stdset,attr,omitempty"` // Used by sizeHint sometimes?
|
||||||
NumberVal *string `xml:"number,omitempty"` // Preserve as string literal
|
|
||||||
BoolVal *bool `xml:"bool,omitempty"` // "true" or "false"
|
StringVal *UiString `xml:"string,omitempty"`
|
||||||
EnumVal *string `xml:"enum,omitempty"`
|
NumberVal *string `xml:"number,omitempty"` // Preserve as string literal
|
||||||
RectVal *UiRect `xml:"rect,omitempty"`
|
BoolVal *bool `xml:"bool,omitempty"` // "true" or "false"
|
||||||
IconVal *UiIcon `xml:"iconset,omitempty"`
|
EnumVal *string `xml:"enum,omitempty"`
|
||||||
SetVal *string `xml:"set,omitempty"`
|
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 {
|
type UiActionReference struct {
|
||||||
@ -97,7 +115,26 @@ type UiAction struct {
|
|||||||
type UiResources 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 {
|
type UiConnections struct {
|
||||||
|
Connections []UiConnection `xml:"connection"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type UiLayoutDefault struct {
|
type UiLayoutDefault struct {
|
||||||
|
@ -3,35 +3,67 @@ package main
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"go/format"
|
"go/format"
|
||||||
|
"regexp"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
type generateState struct {
|
||||||
RootWindowName = ""
|
UseQt6 bool
|
||||||
DefaultGridMargin = 11
|
RootWindowName string
|
||||||
DefaultSpacing = 6
|
DefaultGridMargin int
|
||||||
IconCounter = 0
|
DefaultSpacing int
|
||||||
)
|
IconCounter int
|
||||||
|
trackWidgetClasses map[string]string
|
||||||
|
}
|
||||||
|
|
||||||
func collectClassNames_Widget(u *UiWidget) []string {
|
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 {
|
||||||
var ret []string
|
var ret []string
|
||||||
|
|
||||||
|
if l.Name != "" {
|
||||||
|
ret = append(ret, l.Name+" *qt."+l.Class)
|
||||||
|
gs.trackWidgetClasses[l.Name] = l.Class
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, li := range l.Items {
|
||||||
|
if li.Widget != nil {
|
||||||
|
ret = append(ret, gs.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 != "" {
|
if u.Name != "" {
|
||||||
ret = append(ret, u.Name+" *qt."+u.Class)
|
ret = append(ret, u.Name+" *qt."+u.Class)
|
||||||
|
gs.trackWidgetClasses[u.Name] = u.Class
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, w := range u.Widgets {
|
for _, w := range u.Widgets {
|
||||||
ret = append(ret, collectClassNames_Widget(&w)...)
|
ret = append(ret, gs.collectClassNames_Widget(&w)...)
|
||||||
}
|
}
|
||||||
if u.Layout != nil {
|
if u.Layout != nil {
|
||||||
ret = append(ret, u.Layout.Name+" *qt."+u.Layout.Class)
|
ret = append(ret, gs.collectClassNames_Layout(u.Layout)...)
|
||||||
for _, li := range u.Layout.Items {
|
|
||||||
if li.Widget != nil {
|
|
||||||
ret = append(ret, collectClassNames_Widget(li.Widget)...)
|
|
||||||
}
|
|
||||||
if li.Spacer != nil {
|
|
||||||
ret = append(ret, li.Spacer.Name+" *qt.QSpacerItem")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
for _, a := range u.Actions {
|
for _, a := range u.Actions {
|
||||||
ret = append(ret, a.Name+" *qt.QAction")
|
ret = append(ret, a.Name+" *qt.QAction")
|
||||||
@ -39,11 +71,18 @@ func collectClassNames_Widget(u *UiWidget) []string {
|
|||||||
return ret
|
return ret
|
||||||
}
|
}
|
||||||
|
|
||||||
func generateString(s *UiString, parentClass string) string {
|
func (gs *generateState) generateString_noTr(s string) string {
|
||||||
if s.Notr || parentClass == "" {
|
return strconv.Quote(s)
|
||||||
return strconv.Quote(s.Value)
|
}
|
||||||
|
|
||||||
|
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) + `)`
|
||||||
}
|
}
|
||||||
return `qt.` + parentClass + `_Tr(` + strconv.Quote(s.Value) + `)`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// qwidgetName creates the T.QWidget name that MIQT needs to access the base class.
|
// qwidgetName creates the T.QWidget name that MIQT needs to access the base class.
|
||||||
@ -65,18 +104,45 @@ func normalizeEnumName(s string) string {
|
|||||||
return `qt.` + strings.Replace(s, `::`, `__`, -1)
|
return `qt.` + strings.Replace(s, `::`, `__`, -1)
|
||||||
}
|
}
|
||||||
|
|
||||||
func renderIcon(iconVal *UiIcon, ret *strings.Builder) string {
|
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
|
||||||
|
|
||||||
iconName := fmt.Sprintf("icon%d", IconCounter)
|
const prefix = `QIcon::ThemeIcon::`
|
||||||
IconCounter++
|
|
||||||
|
|
||||||
ret.WriteString(iconName + " := qt.NewQIcon()\n")
|
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
|
// A base entry is a synonym for NormalOff. Don't need them both
|
||||||
if iconVal.NormalOff != nil {
|
if iconVal.NormalOff != nil && *iconVal.NormalOff != "." {
|
||||||
ret.WriteString(iconName + ".AddFile4(" + strconv.Quote(*iconVal.NormalOff) + ", qt.NewQSize(), qt.QIcon__Normal, qt.QIcon__Off)\n")
|
ret.WriteString(iconName + ".AddFile4(" + strconv.Quote(*iconVal.NormalOff) + ", qt.NewQSize(), qt.QIcon__Normal, qt.QIcon__Off)\n")
|
||||||
} else {
|
} else {
|
||||||
ret.WriteString(iconName + ".AddFile(" + strconv.Quote(strings.TrimSpace(iconVal.Base)) + ")\n")
|
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 {
|
if iconVal.NormalOn != nil {
|
||||||
@ -104,9 +170,9 @@ func renderIcon(iconVal *UiIcon, ret *strings.Builder) string {
|
|||||||
return iconName
|
return iconName
|
||||||
}
|
}
|
||||||
|
|
||||||
func renderProperties(properties []UiProperty, ret *strings.Builder, targetName, parentClass string, isLayout bool) error {
|
func (gs *generateState) renderProperties(properties []UiProperty, ret *strings.Builder, targetName, parentClass string, isLayout bool) error {
|
||||||
|
|
||||||
contentsMargins := [4]int{DefaultGridMargin, DefaultGridMargin, DefaultGridMargin, DefaultGridMargin} // left, top, right, bottom
|
contentsMargins := [4]int{gs.DefaultGridMargin, gs.DefaultGridMargin, gs.DefaultGridMargin, gs.DefaultGridMargin} // left, top, right, bottom
|
||||||
customContentsMargins := false
|
customContentsMargins := false
|
||||||
customSpacing := false
|
customSpacing := false
|
||||||
|
|
||||||
@ -141,8 +207,8 @@ func renderProperties(properties []UiProperty, ret *strings.Builder, targetName,
|
|||||||
customContentsMargins = true
|
customContentsMargins = true
|
||||||
|
|
||||||
} else if prop.StringVal != nil {
|
} else if prop.StringVal != nil {
|
||||||
// "windowTitle", "title", "text"
|
// "windowTitle", "title", "text", "shortcut"
|
||||||
ret.WriteString(`ui.` + targetName + setterFunc + `(` + generateString(prop.StringVal, parentClass) + ")\n")
|
ret.WriteString(`ui.` + targetName + setterFunc + `(` + gs.generateString(prop.StringVal, parentClass) + ")\n")
|
||||||
|
|
||||||
} else if prop.NumberVal != nil {
|
} else if prop.NumberVal != nil {
|
||||||
// "currentIndex"
|
// "currentIndex"
|
||||||
@ -179,9 +245,20 @@ func renderProperties(properties []UiProperty, ret *strings.Builder, targetName,
|
|||||||
ret.WriteString(`ui.` + targetName + setterFunc + `(` + emit + ")\n")
|
ret.WriteString(`ui.` + targetName + setterFunc + `(` + emit + ")\n")
|
||||||
|
|
||||||
} else if prop.IconVal != nil {
|
} else if prop.IconVal != nil {
|
||||||
iconName := renderIcon(prop.IconVal, ret)
|
iconName := gs.renderIcon(prop.IconVal, ret)
|
||||||
ret.WriteString(`ui.` + targetName + setterFunc + `(` + iconName + ")\n")
|
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 {
|
} else {
|
||||||
ret.WriteString("/* miqt-uic: no handler for " + targetName + " property '" + prop.Name + "' */\n")
|
ret.WriteString("/* miqt-uic: no handler for " + targetName + " property '" + prop.Name + "' */\n")
|
||||||
}
|
}
|
||||||
@ -193,29 +270,235 @@ func renderProperties(properties []UiProperty, ret *strings.Builder, targetName,
|
|||||||
|
|
||||||
if !customSpacing && isLayout {
|
if !customSpacing && isLayout {
|
||||||
// Layouts must specify spacing, unless, we specified it already
|
// Layouts must specify spacing, unless, we specified it already
|
||||||
ret.WriteString(`ui.` + targetName + `.SetSpacing(` + fmt.Sprintf("%d", DefaultSpacing) + ")\n")
|
ret.WriteString(`ui.` + targetName + `.SetSpacing(` + fmt.Sprintf("%d", gs.DefaultSpacing) + ")\n")
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func generateWidget(w UiWidget, parentName string, parentClass string) (string, error) {
|
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) {
|
||||||
ret := strings.Builder{}
|
ret := strings.Builder{}
|
||||||
|
|
||||||
ctor := "New" + w.Class
|
ctor := "New" + w.Class
|
||||||
|
|
||||||
ret.WriteString(`
|
ret.WriteString(`ui.` + w.Name + ` = qt.` + ctor + `(` + qwidgetName(parentName, parentClass) + ")\n")
|
||||||
ui.` + w.Name + ` = qt.` + ctor + `(` + qwidgetName(parentName, parentClass) + `)
|
|
||||||
ui.` + w.Name + `.SetObjectName(` + strconv.Quote(w.Name) + `)
|
ret.WriteString(gs.generateSetObjectName(w.Name, w.Name))
|
||||||
`)
|
|
||||||
if RootWindowName == "" {
|
if gs.RootWindowName == "" {
|
||||||
RootWindowName = `ui.` + w.Name
|
gs.RootWindowName = `ui.` + w.Name
|
||||||
}
|
}
|
||||||
|
|
||||||
// Properties
|
// Properties
|
||||||
|
|
||||||
err := renderProperties(w.Properties, &ret, w.Name, parentClass, false)
|
err := gs.renderProperties(w.Properties, &ret, w.Name, parentClass, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
@ -224,7 +507,7 @@ func generateWidget(w UiWidget, parentName string, parentClass string) (string,
|
|||||||
|
|
||||||
for _, attr := range w.Attributes {
|
for _, attr := range w.Attributes {
|
||||||
if parentClass == "QTabWidget" && attr.Name == "title" {
|
if parentClass == "QTabWidget" && attr.Name == "title" {
|
||||||
ret.WriteString(parentName + `.SetTabText(` + parentName + ".IndexOf(ui." + w.Name + "), " + generateString(attr.StringVal, parentClass) + ")\n")
|
ret.WriteString(parentName + `.SetTabText(` + parentName + ".IndexOf(ui." + w.Name + "), " + gs.generateString(attr.StringVal, parentClass) + ")\n")
|
||||||
|
|
||||||
} else if w.Class == "QDockWidget" && parentClass == "QMainWindow" && attr.Name == "dockWidgetArea" {
|
} else if w.Class == "QDockWidget" && parentClass == "QMainWindow" && attr.Name == "dockWidgetArea" {
|
||||||
ret.WriteString(parentName + `.AddDockWidget(qt.DockWidgetArea(` + *attr.NumberVal + `), ui.` + w.Name + `)` + "\n")
|
ret.WriteString(parentName + `.AddDockWidget(qt.DockWidgetArea(` + *attr.NumberVal + `), ui.` + w.Name + `)` + "\n")
|
||||||
@ -244,123 +527,41 @@ func generateWidget(w UiWidget, parentName string, parentClass string) (string,
|
|||||||
// Layout
|
// Layout
|
||||||
|
|
||||||
if w.Layout != nil {
|
if w.Layout != nil {
|
||||||
ctor := "New" + w.Layout.Class
|
nest, err := gs.generateLayout(w.Layout, `ui.`+w.Name, w.Class, false)
|
||||||
|
|
||||||
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 {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Layout->Items
|
ret.WriteString(nest)
|
||||||
|
|
||||||
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
|
// Actions
|
||||||
|
|
||||||
for _, a := range w.Actions {
|
for _, a := range w.Actions {
|
||||||
ret.WriteString(`
|
ret.WriteString(`ui.` + a.Name + ` = qt.NewQAction(` + parentName + ")\n")
|
||||||
ui.` + a.Name + ` = qt.NewQAction(` + parentName + `)
|
ret.WriteString(gs.generateSetObjectName(a.Name, a.Name))
|
||||||
ui.` + a.Name + `.SetObjectName(` + strconv.Quote(a.Name) + `)
|
|
||||||
`)
|
|
||||||
|
|
||||||
// QActions are translated in the parent window's context
|
// QActions are translated in the parent window's context
|
||||||
if prop, ok := propertyByName(a.Properties, "text"); ok {
|
for _, prop := range a.Properties {
|
||||||
ret.WriteString("ui." + a.Name + `.SetText(` + generateString(prop.StringVal, w.Class) + `)` + "\n")
|
if prop.Name == "text" {
|
||||||
|
ret.WriteString("ui." + a.Name + `.SetText(` + gs.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")
|
||||||
|
|
||||||
|
} else if prop.Name == "icon" {
|
||||||
|
iconName := gs.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")
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if prop, ok := propertyByName(a.Properties, "shortcut"); ok {
|
|
||||||
ret.WriteString("ui." + a.Name + `.SetShortcut(qt.NewQKeySequence2(` + generateString(prop.StringVal, w.Class) + `))` + "\n")
|
|
||||||
}
|
|
||||||
|
|
||||||
if prop, ok := propertyByName(a.Properties, "icon"); ok {
|
|
||||||
iconName := renderIcon(prop.IconVal, &ret)
|
|
||||||
ret.WriteString(`ui.` + a.Name + `.SetIcon(` + iconName + ")\n")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Items
|
// Items
|
||||||
@ -373,7 +574,7 @@ func generateWidget(w UiWidget, parentName string, parentClass string) (string,
|
|||||||
// TODO Abstract for all SetItem{Foo} properties
|
// TODO Abstract for all SetItem{Foo} properties
|
||||||
for _, prop := range itm.Properties {
|
for _, prop := range itm.Properties {
|
||||||
if prop.Name == "text" {
|
if prop.Name == "text" {
|
||||||
ret.WriteString("ui." + w.Name + `.SetItemText(` + fmt.Sprintf("%d", itemNo) + `, ` + generateString(prop.StringVal, w.Class) + `)` + "\n")
|
ret.WriteString("ui." + w.Name + `.SetItemText(` + fmt.Sprintf("%d", itemNo) + `, ` + gs.generateString(prop.StringVal, w.Class) + `)` + "\n")
|
||||||
} else {
|
} else {
|
||||||
ret.WriteString("/* miqt-uic: no handler for item property '" + prop.Name + "' */\n")
|
ret.WriteString("/* miqt-uic: no handler for item property '" + prop.Name + "' */\n")
|
||||||
|
|
||||||
@ -387,7 +588,7 @@ func generateWidget(w UiWidget, parentName string, parentClass string) (string,
|
|||||||
|
|
||||||
for _, prop := range col.Properties {
|
for _, prop := range col.Properties {
|
||||||
if prop.Name == "text" {
|
if prop.Name == "text" {
|
||||||
ret.WriteString("ui." + w.Name + ".HeaderItem().SetText(" + fmt.Sprintf("%d", colNo) + ", " + generateString(prop.StringVal, w.Class) + ")\n")
|
ret.WriteString("ui." + w.Name + ".HeaderItem().SetText(" + fmt.Sprintf("%d", colNo) + ", " + gs.generateString(prop.StringVal, w.Class) + ")\n")
|
||||||
} else {
|
} else {
|
||||||
ret.WriteString("/* miqt-uic: no handler for column property '" + prop.Name + "' */\n")
|
ret.WriteString("/* miqt-uic: no handler for column property '" + prop.Name + "' */\n")
|
||||||
}
|
}
|
||||||
@ -403,7 +604,7 @@ func generateWidget(w UiWidget, parentName string, parentClass string) (string,
|
|||||||
)
|
)
|
||||||
|
|
||||||
for i, child := range w.Widgets {
|
for i, child := range w.Widgets {
|
||||||
nest, err := generateWidget(child, `ui.`+w.Name, w.Class)
|
nest, err := gs.generateWidget(child, `ui.`+w.Name, w.Class)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", fmt.Errorf(w.Name+"/Widgets[%d]: %w", i, err)
|
return "", fmt.Errorf(w.Name+"/Widgets[%d]: %w", i, err)
|
||||||
}
|
}
|
||||||
@ -446,7 +647,7 @@ func generateWidget(w UiWidget, parentName string, parentClass string) (string,
|
|||||||
if w.Class == `QTabWidget` {
|
if w.Class == `QTabWidget` {
|
||||||
if icon, ok := propertyByName(child.Attributes, "icon"); ok {
|
if icon, ok := propertyByName(child.Attributes, "icon"); ok {
|
||||||
// AddTab() overload with icon
|
// AddTab() overload with icon
|
||||||
iconName := renderIcon(icon.IconVal, &ret)
|
iconName := gs.renderIcon(icon.IconVal, &ret)
|
||||||
ret.WriteString(`ui.` + w.Name + `.AddTab2(` + qwidgetName(`ui.`+child.Name, child.Class) + `, ` + iconName + `, "")` + "\n")
|
ret.WriteString(`ui.` + w.Name + `.AddTab2(` + qwidgetName(`ui.`+child.Name, child.Class) + `, ` + iconName + `, "")` + "\n")
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@ -471,37 +672,55 @@ func generateWidget(w UiWidget, parentName string, parentClass string) (string,
|
|||||||
if w.Class == "QMenuBar" {
|
if w.Class == "QMenuBar" {
|
||||||
ret.WriteString("ui." + w.Name + ".AddMenu(ui." + a.Name + ")\n")
|
ret.WriteString("ui." + w.Name + ".AddMenu(ui." + a.Name + ")\n")
|
||||||
} else if w.Class == "QMenu" || w.Class == "QToolBar" {
|
} else if w.Class == "QMenu" || w.Class == "QToolBar" {
|
||||||
// QMenu has its own .AddAction() implementation that takes plain string
|
|
||||||
// That's convenient, but it shadows the AddAction version that takes a QAction*
|
// It's possible this is a nested menu, then we need to call AddMenu insted
|
||||||
// We need to use the underlying QWidget.AddAction explicitly
|
// Resolve the class type of a.Name
|
||||||
ret.WriteString("ui." + w.Name + ".QWidget.AddAction(ui." + a.Name + ")\n")
|
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 {
|
} else {
|
||||||
ret.WriteString("ui." + w.Name + ".AddAction(ui." + a.Name + ")\n")
|
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
|
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) {
|
func generate(packageName string, goGenerateArgs string, u UiFile, useQt6 bool) ([]byte, error) {
|
||||||
|
|
||||||
|
gs := NewGenerateState(useQt6)
|
||||||
|
|
||||||
ret := strings.Builder{}
|
ret := strings.Builder{}
|
||||||
|
|
||||||
// Update globals for layoutdefault, if present
|
// Update globals for layoutdefault, if present
|
||||||
|
|
||||||
if u.LayoutDefault != nil {
|
if u.LayoutDefault != nil {
|
||||||
if u.LayoutDefault.Spacing != nil {
|
if u.LayoutDefault.Spacing != nil {
|
||||||
DefaultSpacing = *u.LayoutDefault.Spacing
|
gs.DefaultSpacing = *u.LayoutDefault.Spacing
|
||||||
}
|
}
|
||||||
if u.LayoutDefault.Margin != nil {
|
if u.LayoutDefault.Margin != nil {
|
||||||
DefaultGridMargin = *u.LayoutDefault.Margin
|
gs.DefaultGridMargin = *u.LayoutDefault.Margin
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -524,7 +743,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type ` + u.Class + `Ui struct {
|
type ` + u.Class + `Ui struct {
|
||||||
` + strings.Join(collectClassNames_Widget(&u.Widget), "\n") + `
|
` + strings.Join(gs.collectClassNames_Widget(&u.Widget), "\n") + `
|
||||||
}
|
}
|
||||||
|
|
||||||
// New` + u.Class + `Ui creates all Qt widget classes for ` + u.Class + `.
|
// New` + u.Class + `Ui creates all Qt widget classes for ` + u.Class + `.
|
||||||
@ -532,7 +751,7 @@ func New` + u.Class + `Ui() *` + u.Class + `Ui {
|
|||||||
ui := &` + u.Class + `Ui{}
|
ui := &` + u.Class + `Ui{}
|
||||||
`)
|
`)
|
||||||
|
|
||||||
nest, err := generateWidget(u.Widget, "", "")
|
nest, err := gs.generateWidget(u.Widget, "", "")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -551,6 +770,13 @@ 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")
|
ret.WriteString("\nui.Retranslate()\n\n")
|
||||||
|
|
||||||
for _, sci := range setCurrentIndex {
|
for _, sci := range setCurrentIndex {
|
||||||
|
@ -4,15 +4,32 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
"encoding/xml"
|
"encoding/xml"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
|
"os"
|
||||||
|
"path/filepath"
|
||||||
|
"strings"
|
||||||
"testing"
|
"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) {
|
func TestFixtureMarshalRoundtrip(t *testing.T) {
|
||||||
|
|
||||||
testFixture := func(fixtureFile string) {
|
testFixture := func(fixtureFile string, qt6 bool) {
|
||||||
in, err := ioutil.ReadFile(fixtureFile)
|
in, err := ioutil.ReadFile(fixtureFile)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("ReadFile: %v", err)
|
t.Fatalf("ReadFile(%q): %v", fixtureFile, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
in = bytes.Replace(in, []byte("\r"), []byte{}, -1) // Replace CRLF to LF
|
in = bytes.Replace(in, []byte("\r"), []byte{}, -1) // Replace CRLF to LF
|
||||||
@ -37,11 +54,51 @@ func TestFixtureMarshalRoundtrip(t *testing.T) {
|
|||||||
// Verify that the marshalled result matches the original identically,
|
// Verify that the marshalled result matches the original identically,
|
||||||
// i.e. we did not miss any properties in our XML type definitions
|
// i.e. we did not miss any properties in our XML type definitions
|
||||||
if string(in) != string(ret) {
|
if string(in) != string(ret) {
|
||||||
t.Errorf("Mismatch")
|
t.Errorf("Mismatch(%q)", fixtureFile)
|
||||||
t.Log(lineDiff(string(in), string(ret)))
|
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")
|
|
||||||
}
|
}
|
||||||
|
@ -8,6 +8,7 @@ To specify the CFLAGS/CXXFLAGS and LDFLAGS for a specific library, make a `MyLib
|
|||||||
|
|
||||||
```pkgconfig
|
```pkgconfig
|
||||||
Name: My Library
|
Name: My Library
|
||||||
|
Requires: Qt6Widgets
|
||||||
Libs: -lfoo
|
Libs: -lfoo
|
||||||
Cflags: -I/path/
|
Cflags: -I/path/
|
||||||
```
|
```
|
||||||
@ -16,6 +17,8 @@ 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.
|
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
|
## Further reading
|
||||||
|
|
||||||
- [Guide to pkg-config](https://people.freedesktop.org/~dbn/pkg-config-guide.html)
|
- [Guide to pkg-config](https://people.freedesktop.org/~dbn/pkg-config-guide.html)
|
||||||
@ -25,3 +28,23 @@ The `PKG_CONFIG_PATH` environment variable is understood both by CGO and by genb
|
|||||||
$ pkg-config --variable pc_path 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
|
/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}
|
||||||
|
```
|
@ -4,9 +4,6 @@ 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 && \
|
tar x -C /usr/local/ -f go1.23.1.linux-amd64.tar.gz && \
|
||||||
rm 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
|
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
|
# The pkg-config definitions were all installed with platform-specific suffixes
|
||||||
@ -14,6 +11,10 @@ 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
|
# 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'
|
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 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 CXX=/opt/android-sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android30-clang++
|
||||||
ENV CGO_ENABLED=1
|
ENV CGO_ENABLED=1
|
||||||
|
@ -9,9 +9,6 @@ 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 && \
|
tar x -C /usr/local/ -f go1.23.6.linux-amd64.tar.gz && \
|
||||||
rm 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:
|
# 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
|
# 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
|
# 2. It looks for `Libs: -L${libdir} -lQt6Widgets` but the file is named libQt6Widgets_arm64-v8a.so
|
||||||
|
16
docker/embed.go
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
// 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,6 +5,7 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
|
|||||||
golang-go \
|
golang-go \
|
||||||
qtbase5-dev \
|
qtbase5-dev \
|
||||||
qtmultimedia5-dev \
|
qtmultimedia5-dev \
|
||||||
|
qtpdf5-dev \
|
||||||
qtscript5-dev \
|
qtscript5-dev \
|
||||||
libqt5svg5-dev \
|
libqt5svg5-dev \
|
||||||
libqt5webkit5-dev \
|
libqt5webkit5-dev \
|
||||||
@ -13,6 +14,7 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
|
|||||||
qt6-charts-dev \
|
qt6-charts-dev \
|
||||||
qt6-declarative-dev \
|
qt6-declarative-dev \
|
||||||
qt6-multimedia-dev \
|
qt6-multimedia-dev \
|
||||||
|
qt6-pdf-dev \
|
||||||
qt6-svg-dev \
|
qt6-svg-dev \
|
||||||
qt6-webengine-dev \
|
qt6-webengine-dev \
|
||||||
libqscintilla2-qt5-dev \
|
libqscintilla2-qt5-dev \
|
||||||
@ -37,10 +39,43 @@ RUN \
|
|||||||
qmake && \
|
qmake && \
|
||||||
make
|
make
|
||||||
|
|
||||||
|
# Custom pkg-config definitions
|
||||||
|
|
||||||
RUN mkdir -p /usr/local/lib/pkgconfig
|
RUN mkdir -p /usr/local/lib/pkgconfig
|
||||||
|
|
||||||
COPY pkg-config/QScintilla.pc.example /usr/local/lib/pkgconfig/QScintilla.pc
|
RUN echo 'includedir=/usr/include/x86_64-linux-gnu/qt5/Qsci/' \
|
||||||
COPY pkg-config/QScintilla6.pc.example /usr/local/lib/pkgconfig/QScintilla6.pc
|
'\n' \
|
||||||
COPY pkg-config/ScintillaEdit.pc.example /usr/local/lib/pkgconfig/ScintillaEdit.pc
|
'\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
|
||||||
|
|
||||||
|
#
|
||||||
|
|
||||||
ENV GOFLAGS=-buildvcs=false
|
ENV GOFLAGS=-buildvcs=false
|
||||||
|
@ -1,29 +0,0 @@
|
|||||||
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!")
|
|
||||||
}
|
|
@ -1,14 +0,0 @@
|
|||||||
// +build android
|
|
||||||
|
|
||||||
package main
|
|
||||||
|
|
||||||
import "C" // Required for export support
|
|
||||||
|
|
||||||
//export AndroidMain
|
|
||||||
func AndroidMain() {
|
|
||||||
myRealMainFunc()
|
|
||||||
}
|
|
||||||
|
|
||||||
func main() {
|
|
||||||
// Must be empty
|
|
||||||
}
|
|
@ -1,7 +0,0 @@
|
|||||||
// +build !android
|
|
||||||
|
|
||||||
package main
|
|
||||||
|
|
||||||
func main() {
|
|
||||||
myRealMainFunc()
|
|
||||||
}
|
|
@ -1,29 +0,0 @@
|
|||||||
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!")
|
|
||||||
}
|
|
@ -1,14 +0,0 @@
|
|||||||
// +build android
|
|
||||||
|
|
||||||
package main
|
|
||||||
|
|
||||||
import "C" // Required for export support
|
|
||||||
|
|
||||||
//export AndroidMain
|
|
||||||
func AndroidMain() {
|
|
||||||
myRealMainFunc()
|
|
||||||
}
|
|
||||||
|
|
||||||
func main() {
|
|
||||||
// Must be empty
|
|
||||||
}
|
|
@ -1,7 +0,0 @@
|
|||||||
// +build !android
|
|
||||||
|
|
||||||
package main
|
|
||||||
|
|
||||||
func main() {
|
|
||||||
myRealMainFunc()
|
|
||||||
}
|
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 33 KiB |
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
BIN
examples/lcdclock6/lcdclock6.png
Normal file
After Width: | Height: | Size: 5.1 KiB |
52
examples/lcdclock6/main.go
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
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()
|
||||||
|
}
|
BIN
examples/libraries/qt-pdf/example.pdf
Normal file
27
examples/libraries/qt-pdf/main.go
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
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()
|
||||||
|
}
|
BIN
examples/libraries/qt-pdf/screenshot.png
Normal file
After Width: | Height: | Size: 29 KiB |
BIN
examples/libraries/qt6-pdf/example.pdf
Normal file
27
examples/libraries/qt6-pdf/main.go
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
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()
|
||||||
|
}
|
BIN
examples/libraries/qt6-pdf/screenshot.png
Normal file
After Width: | Height: | Size: 25 KiB |
@ -1,9 +0,0 @@
|
|||||||
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}
|
|
@ -1,9 +0,0 @@
|
|||||||
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}
|
|
@ -1,9 +0,0 @@
|
|||||||
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,6 +315,7 @@ bool Scintilla__Internal__Point_operatorEqual(const Scintilla__Internal__Point*
|
|||||||
bool Scintilla__Internal__Point_operatorNotEqual(const Scintilla__Internal__Point* self, Scintilla__Internal__Point* other);
|
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_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);
|
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);
|
void Scintilla__Internal__Point_delete(Scintilla__Internal__Point* self);
|
||||||
|
|
||||||
bool Scintilla__Internal__Interval_operatorEqual(const Scintilla__Internal__Interval* self, Scintilla__Internal__Interval* other);
|
bool Scintilla__Internal__Interval_operatorEqual(const Scintilla__Internal__Interval* self, Scintilla__Internal__Interval* other);
|
||||||
@ -322,6 +323,7 @@ double Scintilla__Internal__Interval_Width(const Scintilla__Internal__Interval*
|
|||||||
bool Scintilla__Internal__Interval_Empty(const Scintilla__Internal__Interval* self);
|
bool Scintilla__Internal__Interval_Empty(const Scintilla__Internal__Interval* self);
|
||||||
bool Scintilla__Internal__Interval_Intersects(const Scintilla__Internal__Interval* self, Scintilla__Internal__Interval* other);
|
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);
|
Scintilla__Internal__Interval* Scintilla__Internal__Interval_Offset(const Scintilla__Internal__Interval* self, double offset);
|
||||||
|
|
||||||
void Scintilla__Internal__Interval_delete(Scintilla__Internal__Interval* self);
|
void Scintilla__Internal__Interval_delete(Scintilla__Internal__Interval* self);
|
||||||
|
|
||||||
Scintilla__Internal__PRectangle* Scintilla__Internal__PRectangle_new();
|
Scintilla__Internal__PRectangle* Scintilla__Internal__PRectangle_new();
|
||||||
@ -345,6 +347,7 @@ Scintilla__Internal__Point* Scintilla__Internal__PRectangle_Centre(const Scintil
|
|||||||
double Scintilla__Internal__PRectangle_Width(const Scintilla__Internal__PRectangle* self);
|
double Scintilla__Internal__PRectangle_Width(const Scintilla__Internal__PRectangle* self);
|
||||||
double Scintilla__Internal__PRectangle_Height(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);
|
bool Scintilla__Internal__PRectangle_Empty(const Scintilla__Internal__PRectangle* self);
|
||||||
|
|
||||||
void Scintilla__Internal__PRectangle_delete(Scintilla__Internal__PRectangle* self);
|
void Scintilla__Internal__PRectangle_delete(Scintilla__Internal__PRectangle* self);
|
||||||
|
|
||||||
Scintilla__Internal__ColourRGBA* Scintilla__Internal__ColourRGBA_new();
|
Scintilla__Internal__ColourRGBA* Scintilla__Internal__ColourRGBA_new();
|
||||||
@ -374,12 +377,14 @@ 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);
|
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);
|
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);
|
Scintilla__Internal__ColourRGBA* Scintilla__Internal__ColourRGBA_Grey2(unsigned int grey, unsigned int alpha);
|
||||||
|
|
||||||
void Scintilla__Internal__ColourRGBA_delete(Scintilla__Internal__ColourRGBA* self);
|
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_new(Scintilla__Internal__ColourRGBA* colour_);
|
||||||
Scintilla__Internal__Stroke* Scintilla__Internal__Stroke_new2(Scintilla__Internal__Stroke* param1);
|
Scintilla__Internal__Stroke* Scintilla__Internal__Stroke_new2(Scintilla__Internal__Stroke* param1);
|
||||||
Scintilla__Internal__Stroke* Scintilla__Internal__Stroke_new3(Scintilla__Internal__ColourRGBA* colour_, double width_);
|
Scintilla__Internal__Stroke* Scintilla__Internal__Stroke_new3(Scintilla__Internal__ColourRGBA* colour_, double width_);
|
||||||
float Scintilla__Internal__Stroke_WidthF(const Scintilla__Internal__Stroke* self);
|
float Scintilla__Internal__Stroke_WidthF(const Scintilla__Internal__Stroke* self);
|
||||||
|
|
||||||
void Scintilla__Internal__Stroke_delete(Scintilla__Internal__Stroke* self);
|
void Scintilla__Internal__Stroke_delete(Scintilla__Internal__Stroke* self);
|
||||||
|
|
||||||
Scintilla__Internal__Fill* Scintilla__Internal__Fill_new(Scintilla__Internal__ColourRGBA* colour_);
|
Scintilla__Internal__Fill* Scintilla__Internal__Fill_new(Scintilla__Internal__ColourRGBA* colour_);
|
||||||
@ -441,11 +446,13 @@ 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_RepresentationWidth(const Scintilla__Internal__IScreenLine* self, size_t position);
|
||||||
double Scintilla__Internal__IScreenLine_TabPositionAfter(const Scintilla__Internal__IScreenLine* self, double xPosition);
|
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_operatorAssign(Scintilla__Internal__IScreenLine* self, Scintilla__Internal__IScreenLine* param1);
|
||||||
|
|
||||||
void Scintilla__Internal__IScreenLine_delete(Scintilla__Internal__IScreenLine* self);
|
void Scintilla__Internal__IScreenLine_delete(Scintilla__Internal__IScreenLine* self);
|
||||||
|
|
||||||
size_t Scintilla__Internal__IScreenLineLayout_PositionFromX(Scintilla__Internal__IScreenLineLayout* self, double xDistance, bool charPosition);
|
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);
|
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_operatorAssign(Scintilla__Internal__IScreenLineLayout* self, Scintilla__Internal__IScreenLineLayout* param1);
|
||||||
|
|
||||||
void Scintilla__Internal__IScreenLineLayout_delete(Scintilla__Internal__IScreenLineLayout* self);
|
void Scintilla__Internal__IScreenLineLayout_delete(Scintilla__Internal__IScreenLineLayout* self);
|
||||||
|
|
||||||
Scintilla__Internal__SurfaceMode* Scintilla__Internal__SurfaceMode_new();
|
Scintilla__Internal__SurfaceMode* Scintilla__Internal__SurfaceMode_new();
|
||||||
@ -484,6 +491,7 @@ void Scintilla__Internal__Surface_SetClip(Scintilla__Internal__Surface* self, Sc
|
|||||||
void Scintilla__Internal__Surface_PopClip(Scintilla__Internal__Surface* self);
|
void Scintilla__Internal__Surface_PopClip(Scintilla__Internal__Surface* self);
|
||||||
void Scintilla__Internal__Surface_FlushCachedState(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_FlushDrawing(Scintilla__Internal__Surface* self);
|
||||||
|
|
||||||
void Scintilla__Internal__Surface_delete(Scintilla__Internal__Surface* self);
|
void Scintilla__Internal__Surface_delete(Scintilla__Internal__Surface* self);
|
||||||
|
|
||||||
Scintilla__Internal__Window* Scintilla__Internal__Window_new();
|
Scintilla__Internal__Window* Scintilla__Internal__Window_new();
|
||||||
@ -501,6 +509,7 @@ void Scintilla__Internal__Window_InvalidateRectangle(Scintilla__Internal__Window
|
|||||||
void Scintilla__Internal__Window_SetCursor(Scintilla__Internal__Window* self, int curs);
|
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);
|
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_ShowWithShow(Scintilla__Internal__Window* self, bool show);
|
||||||
|
|
||||||
void Scintilla__Internal__Window_delete(Scintilla__Internal__Window* self);
|
void Scintilla__Internal__Window_delete(Scintilla__Internal__Window* self);
|
||||||
|
|
||||||
Scintilla__Internal__ListBoxEvent* Scintilla__Internal__ListBoxEvent_new(int event_);
|
Scintilla__Internal__ListBoxEvent* Scintilla__Internal__ListBoxEvent_new(int event_);
|
||||||
@ -508,6 +517,7 @@ 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_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_operatorAssign(Scintilla__Internal__IListBoxDelegate* self, Scintilla__Internal__IListBoxDelegate* param1);
|
||||||
|
|
||||||
void Scintilla__Internal__IListBoxDelegate_delete(Scintilla__Internal__IListBoxDelegate* self);
|
void Scintilla__Internal__IListBoxDelegate_delete(Scintilla__Internal__IListBoxDelegate* self);
|
||||||
|
|
||||||
void Scintilla__Internal__ListOptions_delete(Scintilla__Internal__ListOptions* self);
|
void Scintilla__Internal__ListOptions_delete(Scintilla__Internal__ListOptions* self);
|
||||||
@ -532,6 +542,7 @@ 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_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_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_SetOptions(Scintilla__Internal__ListBox* self, Scintilla__Internal__ListOptions* options_);
|
||||||
|
|
||||||
void Scintilla__Internal__ListBox_delete(Scintilla__Internal__ListBox* self);
|
void Scintilla__Internal__ListBox_delete(Scintilla__Internal__ListBox* self);
|
||||||
|
|
||||||
Scintilla__Internal__Menu* Scintilla__Internal__Menu_new();
|
Scintilla__Internal__Menu* Scintilla__Internal__Menu_new();
|
||||||
@ -539,6 +550,7 @@ void* Scintilla__Internal__Menu_GetID(const Scintilla__Internal__Menu* self);
|
|||||||
void Scintilla__Internal__Menu_CreatePopUp(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_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_Show(Scintilla__Internal__Menu* self, Scintilla__Internal__Point* pt, Scintilla__Internal__Window* w);
|
||||||
|
|
||||||
void Scintilla__Internal__Menu_delete(Scintilla__Internal__Menu* self);
|
void Scintilla__Internal__Menu_delete(Scintilla__Internal__Menu* self);
|
||||||
|
|
||||||
void Sci_CharacterRange_delete(Sci_CharacterRange* self);
|
void Sci_CharacterRange_delete(Sci_CharacterRange* self);
|
||||||
@ -673,6 +685,7 @@ 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_tr3(const char* s, const char* c, int n);
|
||||||
struct miqt_string ScintillaEditBase_trUtf82(const char* s, const char* c);
|
struct miqt_string ScintillaEditBase_trUtf82(const char* s, const char* c);
|
||||||
struct miqt_string ScintillaEditBase_trUtf83(const char* s, const char* c, int n);
|
struct miqt_string ScintillaEditBase_trUtf83(const char* s, const char* c, int n);
|
||||||
|
|
||||||
bool ScintillaEditBase_override_virtual_send(void* self, intptr_t slot);
|
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);
|
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);
|
bool ScintillaEditBase_override_virtual_sends(void* self, intptr_t slot);
|
||||||
@ -779,6 +792,7 @@ bool ScintillaEditBase_override_virtual_connectNotify(void* self, intptr_t slot)
|
|||||||
void ScintillaEditBase_virtualbase_connectNotify(void* self, QMetaMethod* signal);
|
void ScintillaEditBase_virtualbase_connectNotify(void* self, QMetaMethod* signal);
|
||||||
bool ScintillaEditBase_override_virtual_disconnectNotify(void* self, intptr_t slot);
|
bool ScintillaEditBase_override_virtual_disconnectNotify(void* self, intptr_t slot);
|
||||||
void ScintillaEditBase_virtualbase_disconnectNotify(void* self, QMetaMethod* signal);
|
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);
|
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);
|
QMargins* ScintillaEditBase_protectedbase_viewportMargins(bool* _dynamic_cast_ok, const void* self);
|
||||||
void ScintillaEditBase_protectedbase_drawFrame(bool* _dynamic_cast_ok, void* self, QPainter* param1);
|
void ScintillaEditBase_protectedbase_drawFrame(bool* _dynamic_cast_ok, void* self, QPainter* param1);
|
||||||
@ -792,6 +806,7 @@ QObject* ScintillaEditBase_protectedbase_sender(bool* _dynamic_cast_ok, const vo
|
|||||||
int ScintillaEditBase_protectedbase_senderSignalIndex(bool* _dynamic_cast_ok, const void* self);
|
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);
|
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);
|
bool ScintillaEditBase_protectedbase_isSignalConnected(bool* _dynamic_cast_ok, const void* self, QMetaMethod* signal);
|
||||||
|
|
||||||
void ScintillaEditBase_delete(ScintillaEditBase* self);
|
void ScintillaEditBase_delete(ScintillaEditBase* self);
|
||||||
|
|
||||||
ScintillaDocument* ScintillaDocument_new();
|
ScintillaDocument* ScintillaDocument_new();
|
||||||
@ -857,6 +872,7 @@ 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_trUtf82(const char* s, const char* c);
|
||||||
struct miqt_string ScintillaDocument_trUtf83(const char* s, const char* c, int n);
|
struct miqt_string ScintillaDocument_trUtf83(const char* s, const char* c, int n);
|
||||||
void ScintillaDocument_beginUndoActionWithCoalesceWithPrior(ScintillaDocument* self, bool coalesceWithPrior);
|
void ScintillaDocument_beginUndoActionWithCoalesceWithPrior(ScintillaDocument* self, bool coalesceWithPrior);
|
||||||
|
|
||||||
bool ScintillaDocument_override_virtual_event(void* self, intptr_t slot);
|
bool ScintillaDocument_override_virtual_event(void* self, intptr_t slot);
|
||||||
bool ScintillaDocument_virtualbase_event(void* self, QEvent* event);
|
bool ScintillaDocument_virtualbase_event(void* self, QEvent* event);
|
||||||
bool ScintillaDocument_override_virtual_eventFilter(void* self, intptr_t slot);
|
bool ScintillaDocument_override_virtual_eventFilter(void* self, intptr_t slot);
|
||||||
@ -871,10 +887,12 @@ bool ScintillaDocument_override_virtual_connectNotify(void* self, intptr_t slot)
|
|||||||
void ScintillaDocument_virtualbase_connectNotify(void* self, QMetaMethod* signal);
|
void ScintillaDocument_virtualbase_connectNotify(void* self, QMetaMethod* signal);
|
||||||
bool ScintillaDocument_override_virtual_disconnectNotify(void* self, intptr_t slot);
|
bool ScintillaDocument_override_virtual_disconnectNotify(void* self, intptr_t slot);
|
||||||
void ScintillaDocument_virtualbase_disconnectNotify(void* self, QMetaMethod* signal);
|
void ScintillaDocument_virtualbase_disconnectNotify(void* self, QMetaMethod* signal);
|
||||||
|
|
||||||
QObject* ScintillaDocument_protectedbase_sender(bool* _dynamic_cast_ok, const void* self);
|
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_senderSignalIndex(bool* _dynamic_cast_ok, const void* self);
|
||||||
int ScintillaDocument_protectedbase_receivers(bool* _dynamic_cast_ok, const void* self, const char* signal);
|
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);
|
bool ScintillaDocument_protectedbase_isSignalConnected(bool* _dynamic_cast_ok, const void* self, QMetaMethod* signal);
|
||||||
|
|
||||||
void ScintillaDocument_delete(ScintillaDocument* self);
|
void ScintillaDocument_delete(ScintillaDocument* self);
|
||||||
|
|
||||||
ScintillaEdit* ScintillaEdit_new(QWidget* parent);
|
ScintillaEdit* ScintillaEdit_new(QWidget* parent);
|
||||||
@ -1697,6 +1715,7 @@ 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_tr3(const char* s, const char* c, int n);
|
||||||
struct miqt_string ScintillaEdit_trUtf82(const char* s, const char* c);
|
struct miqt_string ScintillaEdit_trUtf82(const char* s, const char* c);
|
||||||
struct miqt_string ScintillaEdit_trUtf83(const char* s, const char* c, int n);
|
struct miqt_string ScintillaEdit_trUtf83(const char* s, const char* c, int n);
|
||||||
|
|
||||||
bool ScintillaEdit_override_virtual_send(void* self, intptr_t slot);
|
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);
|
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);
|
bool ScintillaEdit_override_virtual_sends(void* self, intptr_t slot);
|
||||||
@ -1803,6 +1822,7 @@ bool ScintillaEdit_override_virtual_connectNotify(void* self, intptr_t slot);
|
|||||||
void ScintillaEdit_virtualbase_connectNotify(void* self, QMetaMethod* signal);
|
void ScintillaEdit_virtualbase_connectNotify(void* self, QMetaMethod* signal);
|
||||||
bool ScintillaEdit_override_virtual_disconnectNotify(void* self, intptr_t slot);
|
bool ScintillaEdit_override_virtual_disconnectNotify(void* self, intptr_t slot);
|
||||||
void ScintillaEdit_virtualbase_disconnectNotify(void* self, QMetaMethod* signal);
|
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);
|
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);
|
QMargins* ScintillaEdit_protectedbase_viewportMargins(bool* _dynamic_cast_ok, const void* self);
|
||||||
void ScintillaEdit_protectedbase_drawFrame(bool* _dynamic_cast_ok, void* self, QPainter* param1);
|
void ScintillaEdit_protectedbase_drawFrame(bool* _dynamic_cast_ok, void* self, QPainter* param1);
|
||||||
@ -1816,6 +1836,7 @@ QObject* ScintillaEdit_protectedbase_sender(bool* _dynamic_cast_ok, const void*
|
|||||||
int ScintillaEdit_protectedbase_senderSignalIndex(bool* _dynamic_cast_ok, const void* self);
|
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);
|
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);
|
bool ScintillaEdit_protectedbase_isSignalConnected(bool* _dynamic_cast_ok, const void* self, QMetaMethod* signal);
|
||||||
|
|
||||||
void ScintillaEdit_delete(ScintillaEdit* self);
|
void ScintillaEdit_delete(ScintillaEdit* self);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
@ -171,6 +171,7 @@ void QAbstractAxis_setShadesVisibleWithVisible(QAbstractAxis* self, bool visible
|
|||||||
void QAbstractAxis_setReverseWithReverse(QAbstractAxis* self, bool reverse);
|
void QAbstractAxis_setReverseWithReverse(QAbstractAxis* self, bool reverse);
|
||||||
void QAbstractAxis_setLabelsEditableWithEditable(QAbstractAxis* self, bool editable);
|
void QAbstractAxis_setLabelsEditableWithEditable(QAbstractAxis* self, bool editable);
|
||||||
void QAbstractAxis_setTruncateLabelsWithTruncateLabels(QAbstractAxis* self, bool truncateLabels);
|
void QAbstractAxis_setTruncateLabelsWithTruncateLabels(QAbstractAxis* self, bool truncateLabels);
|
||||||
|
|
||||||
void QAbstractAxis_delete(QAbstractAxis* self);
|
void QAbstractAxis_delete(QAbstractAxis* self);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
@ -83,6 +83,7 @@ void QAbstractBarSeries_connect_barsetsRemoved(QAbstractBarSeries* self, intptr_
|
|||||||
struct miqt_string QAbstractBarSeries_tr2(const char* s, const char* c);
|
struct miqt_string QAbstractBarSeries_tr2(const char* s, const char* c);
|
||||||
struct miqt_string QAbstractBarSeries_tr3(const char* s, const char* c, int n);
|
struct miqt_string QAbstractBarSeries_tr3(const char* s, const char* c, int n);
|
||||||
void QAbstractBarSeries_setLabelsVisibleWithVisible(QAbstractBarSeries* self, bool visible);
|
void QAbstractBarSeries_setLabelsVisibleWithVisible(QAbstractBarSeries* self, bool visible);
|
||||||
|
|
||||||
void QAbstractBarSeries_delete(QAbstractBarSeries* self);
|
void QAbstractBarSeries_delete(QAbstractBarSeries* self);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
@ -61,6 +61,7 @@ struct miqt_string QAbstractSeries_tr2(const char* s, const char* c);
|
|||||||
struct miqt_string QAbstractSeries_tr3(const char* s, const char* c, int n);
|
struct miqt_string QAbstractSeries_tr3(const char* s, const char* c, int n);
|
||||||
void QAbstractSeries_setVisibleWithVisible(QAbstractSeries* self, bool visible);
|
void QAbstractSeries_setVisibleWithVisible(QAbstractSeries* self, bool visible);
|
||||||
void QAbstractSeries_setUseOpenGLWithEnable(QAbstractSeries* self, bool enable);
|
void QAbstractSeries_setUseOpenGLWithEnable(QAbstractSeries* self, bool enable);
|
||||||
|
|
||||||
void QAbstractSeries_delete(QAbstractSeries* self);
|
void QAbstractSeries_delete(QAbstractSeries* self);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
@ -34,8 +34,8 @@ void miqt_exec_callback_QAreaLegendMarker_disconnectNotify(QAreaLegendMarker*, i
|
|||||||
class MiqtVirtualQAreaLegendMarker final : public QAreaLegendMarker {
|
class MiqtVirtualQAreaLegendMarker final : public QAreaLegendMarker {
|
||||||
public:
|
public:
|
||||||
|
|
||||||
MiqtVirtualQAreaLegendMarker(QAreaSeries* series, QLegend* legend): QAreaLegendMarker(series, legend) {};
|
MiqtVirtualQAreaLegendMarker(QAreaSeries* series, QLegend* legend): QAreaLegendMarker(series, legend) {}
|
||||||
MiqtVirtualQAreaLegendMarker(QAreaSeries* series, QLegend* legend, QObject* parent): QAreaLegendMarker(series, legend, parent) {};
|
MiqtVirtualQAreaLegendMarker(QAreaSeries* series, QLegend* legend, QObject* parent): QAreaLegendMarker(series, legend, parent) {}
|
||||||
|
|
||||||
virtual ~MiqtVirtualQAreaLegendMarker() override = default;
|
virtual ~MiqtVirtualQAreaLegendMarker() override = default;
|
||||||
|
|
||||||
@ -48,9 +48,7 @@ public:
|
|||||||
return QAreaLegendMarker::type();
|
return QAreaLegendMarker::type();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int callback_return_value = miqt_exec_callback_QAreaLegendMarker_type(this, handle__type);
|
int callback_return_value = miqt_exec_callback_QAreaLegendMarker_type(this, handle__type);
|
||||||
|
|
||||||
return static_cast<QLegendMarker::LegendMarkerType>(callback_return_value);
|
return static_cast<QLegendMarker::LegendMarkerType>(callback_return_value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -65,9 +63,7 @@ public:
|
|||||||
return QAreaLegendMarker::series();
|
return QAreaLegendMarker::series();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QAreaSeries* callback_return_value = miqt_exec_callback_QAreaLegendMarker_series(this, handle__series);
|
QAreaSeries* callback_return_value = miqt_exec_callback_QAreaLegendMarker_series(this, handle__series);
|
||||||
|
|
||||||
return callback_return_value;
|
return callback_return_value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -83,9 +79,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
QEvent* sigval1 = event;
|
QEvent* sigval1 = event;
|
||||||
|
|
||||||
bool callback_return_value = miqt_exec_callback_QAreaLegendMarker_event(this, handle__event, sigval1);
|
bool callback_return_value = miqt_exec_callback_QAreaLegendMarker_event(this, handle__event, sigval1);
|
||||||
|
|
||||||
return callback_return_value;
|
return callback_return_value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -102,9 +96,7 @@ public:
|
|||||||
|
|
||||||
QObject* sigval1 = watched;
|
QObject* sigval1 = watched;
|
||||||
QEvent* sigval2 = event;
|
QEvent* sigval2 = event;
|
||||||
|
|
||||||
bool callback_return_value = miqt_exec_callback_QAreaLegendMarker_eventFilter(this, handle__eventFilter, sigval1, sigval2);
|
bool callback_return_value = miqt_exec_callback_QAreaLegendMarker_eventFilter(this, handle__eventFilter, sigval1, sigval2);
|
||||||
|
|
||||||
return callback_return_value;
|
return callback_return_value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -121,10 +113,8 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
QTimerEvent* sigval1 = event;
|
QTimerEvent* sigval1 = event;
|
||||||
|
|
||||||
miqt_exec_callback_QAreaLegendMarker_timerEvent(this, handle__timerEvent, sigval1);
|
miqt_exec_callback_QAreaLegendMarker_timerEvent(this, handle__timerEvent, sigval1);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
friend void QAreaLegendMarker_virtualbase_timerEvent(void* self, QTimerEvent* event);
|
friend void QAreaLegendMarker_virtualbase_timerEvent(void* self, QTimerEvent* event);
|
||||||
@ -140,10 +130,8 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
QChildEvent* sigval1 = event;
|
QChildEvent* sigval1 = event;
|
||||||
|
|
||||||
miqt_exec_callback_QAreaLegendMarker_childEvent(this, handle__childEvent, sigval1);
|
miqt_exec_callback_QAreaLegendMarker_childEvent(this, handle__childEvent, sigval1);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
friend void QAreaLegendMarker_virtualbase_childEvent(void* self, QChildEvent* event);
|
friend void QAreaLegendMarker_virtualbase_childEvent(void* self, QChildEvent* event);
|
||||||
@ -159,10 +147,8 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
QEvent* sigval1 = event;
|
QEvent* sigval1 = event;
|
||||||
|
|
||||||
miqt_exec_callback_QAreaLegendMarker_customEvent(this, handle__customEvent, sigval1);
|
miqt_exec_callback_QAreaLegendMarker_customEvent(this, handle__customEvent, sigval1);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
friend void QAreaLegendMarker_virtualbase_customEvent(void* self, QEvent* event);
|
friend void QAreaLegendMarker_virtualbase_customEvent(void* self, QEvent* event);
|
||||||
@ -180,10 +166,8 @@ public:
|
|||||||
const QMetaMethod& signal_ret = signal;
|
const QMetaMethod& signal_ret = signal;
|
||||||
// Cast returned reference into pointer
|
// Cast returned reference into pointer
|
||||||
QMetaMethod* sigval1 = const_cast<QMetaMethod*>(&signal_ret);
|
QMetaMethod* sigval1 = const_cast<QMetaMethod*>(&signal_ret);
|
||||||
|
|
||||||
miqt_exec_callback_QAreaLegendMarker_connectNotify(this, handle__connectNotify, sigval1);
|
miqt_exec_callback_QAreaLegendMarker_connectNotify(this, handle__connectNotify, sigval1);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
friend void QAreaLegendMarker_virtualbase_connectNotify(void* self, QMetaMethod* signal);
|
friend void QAreaLegendMarker_virtualbase_connectNotify(void* self, QMetaMethod* signal);
|
||||||
@ -201,10 +185,8 @@ public:
|
|||||||
const QMetaMethod& signal_ret = signal;
|
const QMetaMethod& signal_ret = signal;
|
||||||
// Cast returned reference into pointer
|
// Cast returned reference into pointer
|
||||||
QMetaMethod* sigval1 = const_cast<QMetaMethod*>(&signal_ret);
|
QMetaMethod* sigval1 = const_cast<QMetaMethod*>(&signal_ret);
|
||||||
|
|
||||||
miqt_exec_callback_QAreaLegendMarker_disconnectNotify(this, handle__disconnectNotify, sigval1);
|
miqt_exec_callback_QAreaLegendMarker_disconnectNotify(this, handle__disconnectNotify, sigval1);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
friend void QAreaLegendMarker_virtualbase_disconnectNotify(void* self, QMetaMethod* signal);
|
friend void QAreaLegendMarker_virtualbase_disconnectNotify(void* self, QMetaMethod* signal);
|
||||||
@ -217,11 +199,11 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
QAreaLegendMarker* QAreaLegendMarker_new(QAreaSeries* series, QLegend* legend) {
|
QAreaLegendMarker* QAreaLegendMarker_new(QAreaSeries* series, QLegend* legend) {
|
||||||
return new MiqtVirtualQAreaLegendMarker(series, legend);
|
return new (std::nothrow) MiqtVirtualQAreaLegendMarker(series, legend);
|
||||||
}
|
}
|
||||||
|
|
||||||
QAreaLegendMarker* QAreaLegendMarker_new2(QAreaSeries* series, QLegend* legend, QObject* parent) {
|
QAreaLegendMarker* QAreaLegendMarker_new2(QAreaSeries* series, QLegend* legend, QObject* parent) {
|
||||||
return new MiqtVirtualQAreaLegendMarker(series, legend, parent);
|
return new (std::nothrow) MiqtVirtualQAreaLegendMarker(series, legend, parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QAreaLegendMarker_virtbase(QAreaLegendMarker* src, QLegendMarker** outptr_QLegendMarker) {
|
void QAreaLegendMarker_virtbase(QAreaLegendMarker* src, QLegendMarker** outptr_QLegendMarker) {
|
||||||
@ -289,10 +271,8 @@ bool QAreaLegendMarker_override_virtual_type(void* self, intptr_t slot) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int QAreaLegendMarker_virtualbase_type(void* self) {
|
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);
|
return static_cast<int>(_ret);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QAreaLegendMarker_override_virtual_series(void* self, intptr_t slot) {
|
bool QAreaLegendMarker_override_virtual_series(void* self, intptr_t slot) {
|
||||||
@ -306,9 +286,7 @@ bool QAreaLegendMarker_override_virtual_series(void* self, intptr_t slot) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
QAreaSeries* QAreaLegendMarker_virtualbase_series(void* self) {
|
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) {
|
bool QAreaLegendMarker_override_virtual_event(void* self, intptr_t slot) {
|
||||||
@ -322,9 +300,7 @@ bool QAreaLegendMarker_override_virtual_event(void* self, intptr_t slot) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool QAreaLegendMarker_virtualbase_event(void* self, QEvent* event) {
|
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) {
|
bool QAreaLegendMarker_override_virtual_eventFilter(void* self, intptr_t slot) {
|
||||||
@ -338,9 +314,7 @@ bool QAreaLegendMarker_override_virtual_eventFilter(void* self, intptr_t slot) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool QAreaLegendMarker_virtualbase_eventFilter(void* self, QObject* watched, QEvent* event) {
|
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) {
|
bool QAreaLegendMarker_override_virtual_timerEvent(void* self, intptr_t slot) {
|
||||||
@ -354,9 +328,7 @@ bool QAreaLegendMarker_override_virtual_timerEvent(void* self, intptr_t slot) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void QAreaLegendMarker_virtualbase_timerEvent(void* self, QTimerEvent* event) {
|
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) {
|
bool QAreaLegendMarker_override_virtual_childEvent(void* self, intptr_t slot) {
|
||||||
@ -370,9 +342,7 @@ bool QAreaLegendMarker_override_virtual_childEvent(void* self, intptr_t slot) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void QAreaLegendMarker_virtualbase_childEvent(void* self, QChildEvent* event) {
|
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) {
|
bool QAreaLegendMarker_override_virtual_customEvent(void* self, intptr_t slot) {
|
||||||
@ -386,9 +356,7 @@ bool QAreaLegendMarker_override_virtual_customEvent(void* self, intptr_t slot) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void QAreaLegendMarker_virtualbase_customEvent(void* self, QEvent* event) {
|
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) {
|
bool QAreaLegendMarker_override_virtual_connectNotify(void* self, intptr_t slot) {
|
||||||
@ -402,9 +370,7 @@ bool QAreaLegendMarker_override_virtual_connectNotify(void* self, intptr_t slot)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void QAreaLegendMarker_virtualbase_connectNotify(void* self, QMetaMethod* signal) {
|
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) {
|
bool QAreaLegendMarker_override_virtual_disconnectNotify(void* self, intptr_t slot) {
|
||||||
@ -418,9 +384,7 @@ bool QAreaLegendMarker_override_virtual_disconnectNotify(void* self, intptr_t sl
|
|||||||
}
|
}
|
||||||
|
|
||||||
void QAreaLegendMarker_virtualbase_disconnectNotify(void* self, QMetaMethod* signal) {
|
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) {
|
QObject* QAreaLegendMarker_protectedbase_sender(bool* _dynamic_cast_ok, const void* self) {
|
||||||
@ -431,9 +395,7 @@ QObject* QAreaLegendMarker_protectedbase_sender(bool* _dynamic_cast_ok, const vo
|
|||||||
}
|
}
|
||||||
|
|
||||||
*_dynamic_cast_ok = true;
|
*_dynamic_cast_ok = true;
|
||||||
|
|
||||||
return self_cast->sender();
|
return self_cast->sender();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int QAreaLegendMarker_protectedbase_senderSignalIndex(bool* _dynamic_cast_ok, const void* self) {
|
int QAreaLegendMarker_protectedbase_senderSignalIndex(bool* _dynamic_cast_ok, const void* self) {
|
||||||
@ -444,9 +406,7 @@ int QAreaLegendMarker_protectedbase_senderSignalIndex(bool* _dynamic_cast_ok, co
|
|||||||
}
|
}
|
||||||
|
|
||||||
*_dynamic_cast_ok = true;
|
*_dynamic_cast_ok = true;
|
||||||
|
|
||||||
return self_cast->senderSignalIndex();
|
return self_cast->senderSignalIndex();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int QAreaLegendMarker_protectedbase_receivers(bool* _dynamic_cast_ok, const void* self, const char* signal) {
|
int QAreaLegendMarker_protectedbase_receivers(bool* _dynamic_cast_ok, const void* self, const char* signal) {
|
||||||
@ -457,9 +417,7 @@ int QAreaLegendMarker_protectedbase_receivers(bool* _dynamic_cast_ok, const void
|
|||||||
}
|
}
|
||||||
|
|
||||||
*_dynamic_cast_ok = true;
|
*_dynamic_cast_ok = true;
|
||||||
|
|
||||||
return self_cast->receivers(signal);
|
return self_cast->receivers(signal);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QAreaLegendMarker_protectedbase_isSignalConnected(bool* _dynamic_cast_ok, const void* self, QMetaMethod* signal) {
|
bool QAreaLegendMarker_protectedbase_isSignalConnected(bool* _dynamic_cast_ok, const void* self, QMetaMethod* signal) {
|
||||||
@ -470,9 +428,7 @@ bool QAreaLegendMarker_protectedbase_isSignalConnected(bool* _dynamic_cast_ok, c
|
|||||||
}
|
}
|
||||||
|
|
||||||
*_dynamic_cast_ok = true;
|
*_dynamic_cast_ok = true;
|
||||||
|
|
||||||
return self_cast->isSignalConnected(*signal);
|
return self_cast->isSignalConnected(*signal);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void QAreaLegendMarker_delete(QAreaLegendMarker* self) {
|
void QAreaLegendMarker_delete(QAreaLegendMarker* self) {
|
||||||
|
@ -48,6 +48,7 @@ int QAreaLegendMarker_type(QAreaLegendMarker* self);
|
|||||||
QAreaSeries* QAreaLegendMarker_series(QAreaLegendMarker* self);
|
QAreaSeries* QAreaLegendMarker_series(QAreaLegendMarker* self);
|
||||||
struct miqt_string QAreaLegendMarker_tr2(const char* s, const char* c);
|
struct miqt_string QAreaLegendMarker_tr2(const char* s, const char* c);
|
||||||
struct miqt_string QAreaLegendMarker_tr3(const char* s, const char* c, int n);
|
struct miqt_string QAreaLegendMarker_tr3(const char* s, const char* c, int n);
|
||||||
|
|
||||||
bool QAreaLegendMarker_override_virtual_type(void* self, intptr_t slot);
|
bool QAreaLegendMarker_override_virtual_type(void* self, intptr_t slot);
|
||||||
int QAreaLegendMarker_virtualbase_type(void* self);
|
int QAreaLegendMarker_virtualbase_type(void* self);
|
||||||
bool QAreaLegendMarker_override_virtual_series(void* self, intptr_t slot);
|
bool QAreaLegendMarker_override_virtual_series(void* self, intptr_t slot);
|
||||||
@ -66,10 +67,12 @@ bool QAreaLegendMarker_override_virtual_connectNotify(void* self, intptr_t slot)
|
|||||||
void QAreaLegendMarker_virtualbase_connectNotify(void* self, QMetaMethod* signal);
|
void QAreaLegendMarker_virtualbase_connectNotify(void* self, QMetaMethod* signal);
|
||||||
bool QAreaLegendMarker_override_virtual_disconnectNotify(void* self, intptr_t slot);
|
bool QAreaLegendMarker_override_virtual_disconnectNotify(void* self, intptr_t slot);
|
||||||
void QAreaLegendMarker_virtualbase_disconnectNotify(void* self, QMetaMethod* signal);
|
void QAreaLegendMarker_virtualbase_disconnectNotify(void* self, QMetaMethod* signal);
|
||||||
|
|
||||||
QObject* QAreaLegendMarker_protectedbase_sender(bool* _dynamic_cast_ok, const void* self);
|
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_senderSignalIndex(bool* _dynamic_cast_ok, const void* self);
|
||||||
int QAreaLegendMarker_protectedbase_receivers(bool* _dynamic_cast_ok, const void* self, const char* signal);
|
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);
|
bool QAreaLegendMarker_protectedbase_isSignalConnected(bool* _dynamic_cast_ok, const void* self, QMetaMethod* signal);
|
||||||
|
|
||||||
void QAreaLegendMarker_delete(QAreaLegendMarker* self);
|
void QAreaLegendMarker_delete(QAreaLegendMarker* self);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
@ -50,10 +50,10 @@ void miqt_exec_callback_QAreaSeries_disconnectNotify(QAreaSeries*, intptr_t, QMe
|
|||||||
class MiqtVirtualQAreaSeries final : public QAreaSeries {
|
class MiqtVirtualQAreaSeries final : public QAreaSeries {
|
||||||
public:
|
public:
|
||||||
|
|
||||||
MiqtVirtualQAreaSeries(): QAreaSeries() {};
|
MiqtVirtualQAreaSeries(): QAreaSeries() {}
|
||||||
MiqtVirtualQAreaSeries(QLineSeries* upperSeries): QAreaSeries(upperSeries) {};
|
MiqtVirtualQAreaSeries(QLineSeries* upperSeries): QAreaSeries(upperSeries) {}
|
||||||
MiqtVirtualQAreaSeries(QObject* parent): QAreaSeries(parent) {};
|
MiqtVirtualQAreaSeries(QObject* parent): QAreaSeries(parent) {}
|
||||||
MiqtVirtualQAreaSeries(QLineSeries* upperSeries, QLineSeries* lowerSeries): QAreaSeries(upperSeries, lowerSeries) {};
|
MiqtVirtualQAreaSeries(QLineSeries* upperSeries, QLineSeries* lowerSeries): QAreaSeries(upperSeries, lowerSeries) {}
|
||||||
|
|
||||||
virtual ~MiqtVirtualQAreaSeries() override = default;
|
virtual ~MiqtVirtualQAreaSeries() override = default;
|
||||||
|
|
||||||
@ -66,9 +66,7 @@ public:
|
|||||||
return QAreaSeries::type();
|
return QAreaSeries::type();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int callback_return_value = miqt_exec_callback_QAreaSeries_type(this, handle__type);
|
int callback_return_value = miqt_exec_callback_QAreaSeries_type(this, handle__type);
|
||||||
|
|
||||||
return static_cast<QAbstractSeries::SeriesType>(callback_return_value);
|
return static_cast<QAbstractSeries::SeriesType>(callback_return_value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -84,9 +82,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
QEvent* sigval1 = event;
|
QEvent* sigval1 = event;
|
||||||
|
|
||||||
bool callback_return_value = miqt_exec_callback_QAreaSeries_event(this, handle__event, sigval1);
|
bool callback_return_value = miqt_exec_callback_QAreaSeries_event(this, handle__event, sigval1);
|
||||||
|
|
||||||
return callback_return_value;
|
return callback_return_value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -103,9 +99,7 @@ public:
|
|||||||
|
|
||||||
QObject* sigval1 = watched;
|
QObject* sigval1 = watched;
|
||||||
QEvent* sigval2 = event;
|
QEvent* sigval2 = event;
|
||||||
|
|
||||||
bool callback_return_value = miqt_exec_callback_QAreaSeries_eventFilter(this, handle__eventFilter, sigval1, sigval2);
|
bool callback_return_value = miqt_exec_callback_QAreaSeries_eventFilter(this, handle__eventFilter, sigval1, sigval2);
|
||||||
|
|
||||||
return callback_return_value;
|
return callback_return_value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -122,10 +116,8 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
QTimerEvent* sigval1 = event;
|
QTimerEvent* sigval1 = event;
|
||||||
|
|
||||||
miqt_exec_callback_QAreaSeries_timerEvent(this, handle__timerEvent, sigval1);
|
miqt_exec_callback_QAreaSeries_timerEvent(this, handle__timerEvent, sigval1);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
friend void QAreaSeries_virtualbase_timerEvent(void* self, QTimerEvent* event);
|
friend void QAreaSeries_virtualbase_timerEvent(void* self, QTimerEvent* event);
|
||||||
@ -141,10 +133,8 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
QChildEvent* sigval1 = event;
|
QChildEvent* sigval1 = event;
|
||||||
|
|
||||||
miqt_exec_callback_QAreaSeries_childEvent(this, handle__childEvent, sigval1);
|
miqt_exec_callback_QAreaSeries_childEvent(this, handle__childEvent, sigval1);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
friend void QAreaSeries_virtualbase_childEvent(void* self, QChildEvent* event);
|
friend void QAreaSeries_virtualbase_childEvent(void* self, QChildEvent* event);
|
||||||
@ -160,10 +150,8 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
QEvent* sigval1 = event;
|
QEvent* sigval1 = event;
|
||||||
|
|
||||||
miqt_exec_callback_QAreaSeries_customEvent(this, handle__customEvent, sigval1);
|
miqt_exec_callback_QAreaSeries_customEvent(this, handle__customEvent, sigval1);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
friend void QAreaSeries_virtualbase_customEvent(void* self, QEvent* event);
|
friend void QAreaSeries_virtualbase_customEvent(void* self, QEvent* event);
|
||||||
@ -181,10 +169,8 @@ public:
|
|||||||
const QMetaMethod& signal_ret = signal;
|
const QMetaMethod& signal_ret = signal;
|
||||||
// Cast returned reference into pointer
|
// Cast returned reference into pointer
|
||||||
QMetaMethod* sigval1 = const_cast<QMetaMethod*>(&signal_ret);
|
QMetaMethod* sigval1 = const_cast<QMetaMethod*>(&signal_ret);
|
||||||
|
|
||||||
miqt_exec_callback_QAreaSeries_connectNotify(this, handle__connectNotify, sigval1);
|
miqt_exec_callback_QAreaSeries_connectNotify(this, handle__connectNotify, sigval1);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
friend void QAreaSeries_virtualbase_connectNotify(void* self, QMetaMethod* signal);
|
friend void QAreaSeries_virtualbase_connectNotify(void* self, QMetaMethod* signal);
|
||||||
@ -202,10 +188,8 @@ public:
|
|||||||
const QMetaMethod& signal_ret = signal;
|
const QMetaMethod& signal_ret = signal;
|
||||||
// Cast returned reference into pointer
|
// Cast returned reference into pointer
|
||||||
QMetaMethod* sigval1 = const_cast<QMetaMethod*>(&signal_ret);
|
QMetaMethod* sigval1 = const_cast<QMetaMethod*>(&signal_ret);
|
||||||
|
|
||||||
miqt_exec_callback_QAreaSeries_disconnectNotify(this, handle__disconnectNotify, sigval1);
|
miqt_exec_callback_QAreaSeries_disconnectNotify(this, handle__disconnectNotify, sigval1);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
friend void QAreaSeries_virtualbase_disconnectNotify(void* self, QMetaMethod* signal);
|
friend void QAreaSeries_virtualbase_disconnectNotify(void* self, QMetaMethod* signal);
|
||||||
@ -218,19 +202,19 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
QAreaSeries* QAreaSeries_new() {
|
QAreaSeries* QAreaSeries_new() {
|
||||||
return new MiqtVirtualQAreaSeries();
|
return new (std::nothrow) MiqtVirtualQAreaSeries();
|
||||||
}
|
}
|
||||||
|
|
||||||
QAreaSeries* QAreaSeries_new2(QLineSeries* upperSeries) {
|
QAreaSeries* QAreaSeries_new2(QLineSeries* upperSeries) {
|
||||||
return new MiqtVirtualQAreaSeries(upperSeries);
|
return new (std::nothrow) MiqtVirtualQAreaSeries(upperSeries);
|
||||||
}
|
}
|
||||||
|
|
||||||
QAreaSeries* QAreaSeries_new3(QObject* parent) {
|
QAreaSeries* QAreaSeries_new3(QObject* parent) {
|
||||||
return new MiqtVirtualQAreaSeries(parent);
|
return new (std::nothrow) MiqtVirtualQAreaSeries(parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
QAreaSeries* QAreaSeries_new4(QLineSeries* upperSeries, QLineSeries* lowerSeries) {
|
QAreaSeries* QAreaSeries_new4(QLineSeries* upperSeries, QLineSeries* lowerSeries) {
|
||||||
return new MiqtVirtualQAreaSeries(upperSeries, lowerSeries);
|
return new (std::nothrow) MiqtVirtualQAreaSeries(upperSeries, lowerSeries);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QAreaSeries_virtbase(QAreaSeries* src, QAbstractSeries** outptr_QAbstractSeries) {
|
void QAreaSeries_virtbase(QAreaSeries* src, QAbstractSeries** outptr_QAbstractSeries) {
|
||||||
@ -370,7 +354,7 @@ void QAreaSeries_clicked(QAreaSeries* self, QPointF* point) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void QAreaSeries_connect_clicked(QAreaSeries* self, intptr_t slot) {
|
void QAreaSeries_connect_clicked(QAreaSeries* self, intptr_t slot) {
|
||||||
MiqtVirtualQAreaSeries::connect(self, static_cast<void (QAreaSeries::*)(const QPointF&)>(&QAreaSeries::clicked), self, [=](const QPointF& point) {
|
QAreaSeries::connect(self, static_cast<void (QAreaSeries::*)(const QPointF&)>(&QAreaSeries::clicked), self, [=](const QPointF& point) {
|
||||||
const QPointF& point_ret = point;
|
const QPointF& point_ret = point;
|
||||||
// Cast returned reference into pointer
|
// Cast returned reference into pointer
|
||||||
QPointF* sigval1 = const_cast<QPointF*>(&point_ret);
|
QPointF* sigval1 = const_cast<QPointF*>(&point_ret);
|
||||||
@ -383,7 +367,7 @@ void QAreaSeries_hovered(QAreaSeries* self, QPointF* point, bool state) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void QAreaSeries_connect_hovered(QAreaSeries* self, intptr_t slot) {
|
void QAreaSeries_connect_hovered(QAreaSeries* self, intptr_t slot) {
|
||||||
MiqtVirtualQAreaSeries::connect(self, static_cast<void (QAreaSeries::*)(const QPointF&, bool)>(&QAreaSeries::hovered), self, [=](const QPointF& point, bool state) {
|
QAreaSeries::connect(self, static_cast<void (QAreaSeries::*)(const QPointF&, bool)>(&QAreaSeries::hovered), self, [=](const QPointF& point, bool state) {
|
||||||
const QPointF& point_ret = point;
|
const QPointF& point_ret = point;
|
||||||
// Cast returned reference into pointer
|
// Cast returned reference into pointer
|
||||||
QPointF* sigval1 = const_cast<QPointF*>(&point_ret);
|
QPointF* sigval1 = const_cast<QPointF*>(&point_ret);
|
||||||
@ -397,7 +381,7 @@ void QAreaSeries_pressed(QAreaSeries* self, QPointF* point) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void QAreaSeries_connect_pressed(QAreaSeries* self, intptr_t slot) {
|
void QAreaSeries_connect_pressed(QAreaSeries* self, intptr_t slot) {
|
||||||
MiqtVirtualQAreaSeries::connect(self, static_cast<void (QAreaSeries::*)(const QPointF&)>(&QAreaSeries::pressed), self, [=](const QPointF& point) {
|
QAreaSeries::connect(self, static_cast<void (QAreaSeries::*)(const QPointF&)>(&QAreaSeries::pressed), self, [=](const QPointF& point) {
|
||||||
const QPointF& point_ret = point;
|
const QPointF& point_ret = point;
|
||||||
// Cast returned reference into pointer
|
// Cast returned reference into pointer
|
||||||
QPointF* sigval1 = const_cast<QPointF*>(&point_ret);
|
QPointF* sigval1 = const_cast<QPointF*>(&point_ret);
|
||||||
@ -410,7 +394,7 @@ void QAreaSeries_released(QAreaSeries* self, QPointF* point) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void QAreaSeries_connect_released(QAreaSeries* self, intptr_t slot) {
|
void QAreaSeries_connect_released(QAreaSeries* self, intptr_t slot) {
|
||||||
MiqtVirtualQAreaSeries::connect(self, static_cast<void (QAreaSeries::*)(const QPointF&)>(&QAreaSeries::released), self, [=](const QPointF& point) {
|
QAreaSeries::connect(self, static_cast<void (QAreaSeries::*)(const QPointF&)>(&QAreaSeries::released), self, [=](const QPointF& point) {
|
||||||
const QPointF& point_ret = point;
|
const QPointF& point_ret = point;
|
||||||
// Cast returned reference into pointer
|
// Cast returned reference into pointer
|
||||||
QPointF* sigval1 = const_cast<QPointF*>(&point_ret);
|
QPointF* sigval1 = const_cast<QPointF*>(&point_ret);
|
||||||
@ -423,7 +407,7 @@ void QAreaSeries_doubleClicked(QAreaSeries* self, QPointF* point) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void QAreaSeries_connect_doubleClicked(QAreaSeries* self, intptr_t slot) {
|
void QAreaSeries_connect_doubleClicked(QAreaSeries* self, intptr_t slot) {
|
||||||
MiqtVirtualQAreaSeries::connect(self, static_cast<void (QAreaSeries::*)(const QPointF&)>(&QAreaSeries::doubleClicked), self, [=](const QPointF& point) {
|
QAreaSeries::connect(self, static_cast<void (QAreaSeries::*)(const QPointF&)>(&QAreaSeries::doubleClicked), self, [=](const QPointF& point) {
|
||||||
const QPointF& point_ret = point;
|
const QPointF& point_ret = point;
|
||||||
// Cast returned reference into pointer
|
// Cast returned reference into pointer
|
||||||
QPointF* sigval1 = const_cast<QPointF*>(&point_ret);
|
QPointF* sigval1 = const_cast<QPointF*>(&point_ret);
|
||||||
@ -436,7 +420,7 @@ void QAreaSeries_selected(QAreaSeries* self) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void QAreaSeries_connect_selected(QAreaSeries* self, intptr_t slot) {
|
void QAreaSeries_connect_selected(QAreaSeries* self, intptr_t slot) {
|
||||||
MiqtVirtualQAreaSeries::connect(self, static_cast<void (QAreaSeries::*)()>(&QAreaSeries::selected), self, [=]() {
|
QAreaSeries::connect(self, static_cast<void (QAreaSeries::*)()>(&QAreaSeries::selected), self, [=]() {
|
||||||
miqt_exec_callback_QAreaSeries_selected(slot);
|
miqt_exec_callback_QAreaSeries_selected(slot);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -446,7 +430,7 @@ void QAreaSeries_colorChanged(QAreaSeries* self, QColor* color) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void QAreaSeries_connect_colorChanged(QAreaSeries* self, intptr_t slot) {
|
void QAreaSeries_connect_colorChanged(QAreaSeries* self, intptr_t slot) {
|
||||||
MiqtVirtualQAreaSeries::connect(self, static_cast<void (QAreaSeries::*)(QColor)>(&QAreaSeries::colorChanged), self, [=](QColor color) {
|
QAreaSeries::connect(self, static_cast<void (QAreaSeries::*)(QColor)>(&QAreaSeries::colorChanged), self, [=](QColor color) {
|
||||||
QColor* sigval1 = new QColor(color);
|
QColor* sigval1 = new QColor(color);
|
||||||
miqt_exec_callback_QAreaSeries_colorChanged(slot, sigval1);
|
miqt_exec_callback_QAreaSeries_colorChanged(slot, sigval1);
|
||||||
});
|
});
|
||||||
@ -457,7 +441,7 @@ void QAreaSeries_borderColorChanged(QAreaSeries* self, QColor* color) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void QAreaSeries_connect_borderColorChanged(QAreaSeries* self, intptr_t slot) {
|
void QAreaSeries_connect_borderColorChanged(QAreaSeries* self, intptr_t slot) {
|
||||||
MiqtVirtualQAreaSeries::connect(self, static_cast<void (QAreaSeries::*)(QColor)>(&QAreaSeries::borderColorChanged), self, [=](QColor color) {
|
QAreaSeries::connect(self, static_cast<void (QAreaSeries::*)(QColor)>(&QAreaSeries::borderColorChanged), self, [=](QColor color) {
|
||||||
QColor* sigval1 = new QColor(color);
|
QColor* sigval1 = new QColor(color);
|
||||||
miqt_exec_callback_QAreaSeries_borderColorChanged(slot, sigval1);
|
miqt_exec_callback_QAreaSeries_borderColorChanged(slot, sigval1);
|
||||||
});
|
});
|
||||||
@ -469,7 +453,7 @@ void QAreaSeries_pointLabelsFormatChanged(QAreaSeries* self, struct miqt_string
|
|||||||
}
|
}
|
||||||
|
|
||||||
void QAreaSeries_connect_pointLabelsFormatChanged(QAreaSeries* self, intptr_t slot) {
|
void QAreaSeries_connect_pointLabelsFormatChanged(QAreaSeries* self, intptr_t slot) {
|
||||||
MiqtVirtualQAreaSeries::connect(self, static_cast<void (QAreaSeries::*)(const QString&)>(&QAreaSeries::pointLabelsFormatChanged), self, [=](const QString& format) {
|
QAreaSeries::connect(self, static_cast<void (QAreaSeries::*)(const QString&)>(&QAreaSeries::pointLabelsFormatChanged), self, [=](const QString& format) {
|
||||||
const QString format_ret = format;
|
const QString format_ret = format;
|
||||||
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
||||||
QByteArray format_b = format_ret.toUtf8();
|
QByteArray format_b = format_ret.toUtf8();
|
||||||
@ -487,7 +471,7 @@ void QAreaSeries_pointLabelsVisibilityChanged(QAreaSeries* self, bool visible) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void QAreaSeries_connect_pointLabelsVisibilityChanged(QAreaSeries* self, intptr_t slot) {
|
void QAreaSeries_connect_pointLabelsVisibilityChanged(QAreaSeries* self, intptr_t slot) {
|
||||||
MiqtVirtualQAreaSeries::connect(self, static_cast<void (QAreaSeries::*)(bool)>(&QAreaSeries::pointLabelsVisibilityChanged), self, [=](bool visible) {
|
QAreaSeries::connect(self, static_cast<void (QAreaSeries::*)(bool)>(&QAreaSeries::pointLabelsVisibilityChanged), self, [=](bool visible) {
|
||||||
bool sigval1 = visible;
|
bool sigval1 = visible;
|
||||||
miqt_exec_callback_QAreaSeries_pointLabelsVisibilityChanged(slot, sigval1);
|
miqt_exec_callback_QAreaSeries_pointLabelsVisibilityChanged(slot, sigval1);
|
||||||
});
|
});
|
||||||
@ -498,7 +482,7 @@ void QAreaSeries_pointLabelsFontChanged(QAreaSeries* self, QFont* font) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void QAreaSeries_connect_pointLabelsFontChanged(QAreaSeries* self, intptr_t slot) {
|
void QAreaSeries_connect_pointLabelsFontChanged(QAreaSeries* self, intptr_t slot) {
|
||||||
MiqtVirtualQAreaSeries::connect(self, static_cast<void (QAreaSeries::*)(const QFont&)>(&QAreaSeries::pointLabelsFontChanged), self, [=](const QFont& font) {
|
QAreaSeries::connect(self, static_cast<void (QAreaSeries::*)(const QFont&)>(&QAreaSeries::pointLabelsFontChanged), self, [=](const QFont& font) {
|
||||||
const QFont& font_ret = font;
|
const QFont& font_ret = font;
|
||||||
// Cast returned reference into pointer
|
// Cast returned reference into pointer
|
||||||
QFont* sigval1 = const_cast<QFont*>(&font_ret);
|
QFont* sigval1 = const_cast<QFont*>(&font_ret);
|
||||||
@ -511,7 +495,7 @@ void QAreaSeries_pointLabelsColorChanged(QAreaSeries* self, QColor* color) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void QAreaSeries_connect_pointLabelsColorChanged(QAreaSeries* self, intptr_t slot) {
|
void QAreaSeries_connect_pointLabelsColorChanged(QAreaSeries* self, intptr_t slot) {
|
||||||
MiqtVirtualQAreaSeries::connect(self, static_cast<void (QAreaSeries::*)(const QColor&)>(&QAreaSeries::pointLabelsColorChanged), self, [=](const QColor& color) {
|
QAreaSeries::connect(self, static_cast<void (QAreaSeries::*)(const QColor&)>(&QAreaSeries::pointLabelsColorChanged), self, [=](const QColor& color) {
|
||||||
const QColor& color_ret = color;
|
const QColor& color_ret = color;
|
||||||
// Cast returned reference into pointer
|
// Cast returned reference into pointer
|
||||||
QColor* sigval1 = const_cast<QColor*>(&color_ret);
|
QColor* sigval1 = const_cast<QColor*>(&color_ret);
|
||||||
@ -524,7 +508,7 @@ void QAreaSeries_pointLabelsClippingChanged(QAreaSeries* self, bool clipping) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void QAreaSeries_connect_pointLabelsClippingChanged(QAreaSeries* self, intptr_t slot) {
|
void QAreaSeries_connect_pointLabelsClippingChanged(QAreaSeries* self, intptr_t slot) {
|
||||||
MiqtVirtualQAreaSeries::connect(self, static_cast<void (QAreaSeries::*)(bool)>(&QAreaSeries::pointLabelsClippingChanged), self, [=](bool clipping) {
|
QAreaSeries::connect(self, static_cast<void (QAreaSeries::*)(bool)>(&QAreaSeries::pointLabelsClippingChanged), self, [=](bool clipping) {
|
||||||
bool sigval1 = clipping;
|
bool sigval1 = clipping;
|
||||||
miqt_exec_callback_QAreaSeries_pointLabelsClippingChanged(slot, sigval1);
|
miqt_exec_callback_QAreaSeries_pointLabelsClippingChanged(slot, sigval1);
|
||||||
});
|
});
|
||||||
@ -575,10 +559,8 @@ bool QAreaSeries_override_virtual_type(void* self, intptr_t slot) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int QAreaSeries_virtualbase_type(const void* self) {
|
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);
|
return static_cast<int>(_ret);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QAreaSeries_override_virtual_event(void* self, intptr_t slot) {
|
bool QAreaSeries_override_virtual_event(void* self, intptr_t slot) {
|
||||||
@ -592,9 +574,7 @@ bool QAreaSeries_override_virtual_event(void* self, intptr_t slot) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool QAreaSeries_virtualbase_event(void* self, QEvent* event) {
|
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) {
|
bool QAreaSeries_override_virtual_eventFilter(void* self, intptr_t slot) {
|
||||||
@ -608,9 +588,7 @@ bool QAreaSeries_override_virtual_eventFilter(void* self, intptr_t slot) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool QAreaSeries_virtualbase_eventFilter(void* self, QObject* watched, QEvent* event) {
|
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) {
|
bool QAreaSeries_override_virtual_timerEvent(void* self, intptr_t slot) {
|
||||||
@ -624,9 +602,7 @@ bool QAreaSeries_override_virtual_timerEvent(void* self, intptr_t slot) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void QAreaSeries_virtualbase_timerEvent(void* self, QTimerEvent* event) {
|
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) {
|
bool QAreaSeries_override_virtual_childEvent(void* self, intptr_t slot) {
|
||||||
@ -640,9 +616,7 @@ bool QAreaSeries_override_virtual_childEvent(void* self, intptr_t slot) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void QAreaSeries_virtualbase_childEvent(void* self, QChildEvent* event) {
|
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) {
|
bool QAreaSeries_override_virtual_customEvent(void* self, intptr_t slot) {
|
||||||
@ -656,9 +630,7 @@ bool QAreaSeries_override_virtual_customEvent(void* self, intptr_t slot) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void QAreaSeries_virtualbase_customEvent(void* self, QEvent* event) {
|
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) {
|
bool QAreaSeries_override_virtual_connectNotify(void* self, intptr_t slot) {
|
||||||
@ -672,9 +644,7 @@ bool QAreaSeries_override_virtual_connectNotify(void* self, intptr_t slot) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void QAreaSeries_virtualbase_connectNotify(void* self, QMetaMethod* signal) {
|
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) {
|
bool QAreaSeries_override_virtual_disconnectNotify(void* self, intptr_t slot) {
|
||||||
@ -688,9 +658,7 @@ bool QAreaSeries_override_virtual_disconnectNotify(void* self, intptr_t slot) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void QAreaSeries_virtualbase_disconnectNotify(void* self, QMetaMethod* signal) {
|
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) {
|
QObject* QAreaSeries_protectedbase_sender(bool* _dynamic_cast_ok, const void* self) {
|
||||||
@ -701,9 +669,7 @@ QObject* QAreaSeries_protectedbase_sender(bool* _dynamic_cast_ok, const void* se
|
|||||||
}
|
}
|
||||||
|
|
||||||
*_dynamic_cast_ok = true;
|
*_dynamic_cast_ok = true;
|
||||||
|
|
||||||
return self_cast->sender();
|
return self_cast->sender();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int QAreaSeries_protectedbase_senderSignalIndex(bool* _dynamic_cast_ok, const void* self) {
|
int QAreaSeries_protectedbase_senderSignalIndex(bool* _dynamic_cast_ok, const void* self) {
|
||||||
@ -714,9 +680,7 @@ int QAreaSeries_protectedbase_senderSignalIndex(bool* _dynamic_cast_ok, const vo
|
|||||||
}
|
}
|
||||||
|
|
||||||
*_dynamic_cast_ok = true;
|
*_dynamic_cast_ok = true;
|
||||||
|
|
||||||
return self_cast->senderSignalIndex();
|
return self_cast->senderSignalIndex();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int QAreaSeries_protectedbase_receivers(bool* _dynamic_cast_ok, const void* self, const char* signal) {
|
int QAreaSeries_protectedbase_receivers(bool* _dynamic_cast_ok, const void* self, const char* signal) {
|
||||||
@ -727,9 +691,7 @@ int QAreaSeries_protectedbase_receivers(bool* _dynamic_cast_ok, const void* self
|
|||||||
}
|
}
|
||||||
|
|
||||||
*_dynamic_cast_ok = true;
|
*_dynamic_cast_ok = true;
|
||||||
|
|
||||||
return self_cast->receivers(signal);
|
return self_cast->receivers(signal);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QAreaSeries_protectedbase_isSignalConnected(bool* _dynamic_cast_ok, const void* self, QMetaMethod* signal) {
|
bool QAreaSeries_protectedbase_isSignalConnected(bool* _dynamic_cast_ok, const void* self, QMetaMethod* signal) {
|
||||||
@ -740,9 +702,7 @@ bool QAreaSeries_protectedbase_isSignalConnected(bool* _dynamic_cast_ok, const v
|
|||||||
}
|
}
|
||||||
|
|
||||||
*_dynamic_cast_ok = true;
|
*_dynamic_cast_ok = true;
|
||||||
|
|
||||||
return self_cast->isSignalConnected(*signal);
|
return self_cast->isSignalConnected(*signal);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void QAreaSeries_delete(QAreaSeries* self) {
|
void QAreaSeries_delete(QAreaSeries* self) {
|
||||||
|
@ -110,6 +110,7 @@ struct miqt_string QAreaSeries_tr3(const char* s, const char* c, int n);
|
|||||||
void QAreaSeries_setPointsVisibleWithVisible(QAreaSeries* self, bool visible);
|
void QAreaSeries_setPointsVisibleWithVisible(QAreaSeries* self, bool visible);
|
||||||
void QAreaSeries_setPointLabelsVisibleWithVisible(QAreaSeries* self, bool visible);
|
void QAreaSeries_setPointLabelsVisibleWithVisible(QAreaSeries* self, bool visible);
|
||||||
void QAreaSeries_setPointLabelsClippingWithEnabled(QAreaSeries* self, bool enabled);
|
void QAreaSeries_setPointLabelsClippingWithEnabled(QAreaSeries* self, bool enabled);
|
||||||
|
|
||||||
bool QAreaSeries_override_virtual_type(void* self, intptr_t slot);
|
bool QAreaSeries_override_virtual_type(void* self, intptr_t slot);
|
||||||
int QAreaSeries_virtualbase_type(const void* self);
|
int QAreaSeries_virtualbase_type(const void* self);
|
||||||
bool QAreaSeries_override_virtual_event(void* self, intptr_t slot);
|
bool QAreaSeries_override_virtual_event(void* self, intptr_t slot);
|
||||||
@ -126,10 +127,12 @@ bool QAreaSeries_override_virtual_connectNotify(void* self, intptr_t slot);
|
|||||||
void QAreaSeries_virtualbase_connectNotify(void* self, QMetaMethod* signal);
|
void QAreaSeries_virtualbase_connectNotify(void* self, QMetaMethod* signal);
|
||||||
bool QAreaSeries_override_virtual_disconnectNotify(void* self, intptr_t slot);
|
bool QAreaSeries_override_virtual_disconnectNotify(void* self, intptr_t slot);
|
||||||
void QAreaSeries_virtualbase_disconnectNotify(void* self, QMetaMethod* signal);
|
void QAreaSeries_virtualbase_disconnectNotify(void* self, QMetaMethod* signal);
|
||||||
|
|
||||||
QObject* QAreaSeries_protectedbase_sender(bool* _dynamic_cast_ok, const void* self);
|
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_senderSignalIndex(bool* _dynamic_cast_ok, const void* self);
|
||||||
int QAreaSeries_protectedbase_receivers(bool* _dynamic_cast_ok, const void* self, const char* signal);
|
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);
|
bool QAreaSeries_protectedbase_isSignalConnected(bool* _dynamic_cast_ok, const void* self, QMetaMethod* signal);
|
||||||
|
|
||||||
void QAreaSeries_delete(QAreaSeries* self);
|
void QAreaSeries_delete(QAreaSeries* self);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
@ -37,8 +37,8 @@ void miqt_exec_callback_QBarCategoryAxis_disconnectNotify(QBarCategoryAxis*, int
|
|||||||
class MiqtVirtualQBarCategoryAxis final : public QBarCategoryAxis {
|
class MiqtVirtualQBarCategoryAxis final : public QBarCategoryAxis {
|
||||||
public:
|
public:
|
||||||
|
|
||||||
MiqtVirtualQBarCategoryAxis(): QBarCategoryAxis() {};
|
MiqtVirtualQBarCategoryAxis(): QBarCategoryAxis() {}
|
||||||
MiqtVirtualQBarCategoryAxis(QObject* parent): QBarCategoryAxis(parent) {};
|
MiqtVirtualQBarCategoryAxis(QObject* parent): QBarCategoryAxis(parent) {}
|
||||||
|
|
||||||
virtual ~MiqtVirtualQBarCategoryAxis() override = default;
|
virtual ~MiqtVirtualQBarCategoryAxis() override = default;
|
||||||
|
|
||||||
@ -51,9 +51,7 @@ public:
|
|||||||
return QBarCategoryAxis::type();
|
return QBarCategoryAxis::type();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int callback_return_value = miqt_exec_callback_QBarCategoryAxis_type(this, handle__type);
|
int callback_return_value = miqt_exec_callback_QBarCategoryAxis_type(this, handle__type);
|
||||||
|
|
||||||
return static_cast<QAbstractAxis::AxisType>(callback_return_value);
|
return static_cast<QAbstractAxis::AxisType>(callback_return_value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -69,9 +67,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
QEvent* sigval1 = event;
|
QEvent* sigval1 = event;
|
||||||
|
|
||||||
bool callback_return_value = miqt_exec_callback_QBarCategoryAxis_event(this, handle__event, sigval1);
|
bool callback_return_value = miqt_exec_callback_QBarCategoryAxis_event(this, handle__event, sigval1);
|
||||||
|
|
||||||
return callback_return_value;
|
return callback_return_value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -88,9 +84,7 @@ public:
|
|||||||
|
|
||||||
QObject* sigval1 = watched;
|
QObject* sigval1 = watched;
|
||||||
QEvent* sigval2 = event;
|
QEvent* sigval2 = event;
|
||||||
|
|
||||||
bool callback_return_value = miqt_exec_callback_QBarCategoryAxis_eventFilter(this, handle__eventFilter, sigval1, sigval2);
|
bool callback_return_value = miqt_exec_callback_QBarCategoryAxis_eventFilter(this, handle__eventFilter, sigval1, sigval2);
|
||||||
|
|
||||||
return callback_return_value;
|
return callback_return_value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -107,10 +101,8 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
QTimerEvent* sigval1 = event;
|
QTimerEvent* sigval1 = event;
|
||||||
|
|
||||||
miqt_exec_callback_QBarCategoryAxis_timerEvent(this, handle__timerEvent, sigval1);
|
miqt_exec_callback_QBarCategoryAxis_timerEvent(this, handle__timerEvent, sigval1);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
friend void QBarCategoryAxis_virtualbase_timerEvent(void* self, QTimerEvent* event);
|
friend void QBarCategoryAxis_virtualbase_timerEvent(void* self, QTimerEvent* event);
|
||||||
@ -126,10 +118,8 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
QChildEvent* sigval1 = event;
|
QChildEvent* sigval1 = event;
|
||||||
|
|
||||||
miqt_exec_callback_QBarCategoryAxis_childEvent(this, handle__childEvent, sigval1);
|
miqt_exec_callback_QBarCategoryAxis_childEvent(this, handle__childEvent, sigval1);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
friend void QBarCategoryAxis_virtualbase_childEvent(void* self, QChildEvent* event);
|
friend void QBarCategoryAxis_virtualbase_childEvent(void* self, QChildEvent* event);
|
||||||
@ -145,10 +135,8 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
QEvent* sigval1 = event;
|
QEvent* sigval1 = event;
|
||||||
|
|
||||||
miqt_exec_callback_QBarCategoryAxis_customEvent(this, handle__customEvent, sigval1);
|
miqt_exec_callback_QBarCategoryAxis_customEvent(this, handle__customEvent, sigval1);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
friend void QBarCategoryAxis_virtualbase_customEvent(void* self, QEvent* event);
|
friend void QBarCategoryAxis_virtualbase_customEvent(void* self, QEvent* event);
|
||||||
@ -166,10 +154,8 @@ public:
|
|||||||
const QMetaMethod& signal_ret = signal;
|
const QMetaMethod& signal_ret = signal;
|
||||||
// Cast returned reference into pointer
|
// Cast returned reference into pointer
|
||||||
QMetaMethod* sigval1 = const_cast<QMetaMethod*>(&signal_ret);
|
QMetaMethod* sigval1 = const_cast<QMetaMethod*>(&signal_ret);
|
||||||
|
|
||||||
miqt_exec_callback_QBarCategoryAxis_connectNotify(this, handle__connectNotify, sigval1);
|
miqt_exec_callback_QBarCategoryAxis_connectNotify(this, handle__connectNotify, sigval1);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
friend void QBarCategoryAxis_virtualbase_connectNotify(void* self, QMetaMethod* signal);
|
friend void QBarCategoryAxis_virtualbase_connectNotify(void* self, QMetaMethod* signal);
|
||||||
@ -187,10 +173,8 @@ public:
|
|||||||
const QMetaMethod& signal_ret = signal;
|
const QMetaMethod& signal_ret = signal;
|
||||||
// Cast returned reference into pointer
|
// Cast returned reference into pointer
|
||||||
QMetaMethod* sigval1 = const_cast<QMetaMethod*>(&signal_ret);
|
QMetaMethod* sigval1 = const_cast<QMetaMethod*>(&signal_ret);
|
||||||
|
|
||||||
miqt_exec_callback_QBarCategoryAxis_disconnectNotify(this, handle__disconnectNotify, sigval1);
|
miqt_exec_callback_QBarCategoryAxis_disconnectNotify(this, handle__disconnectNotify, sigval1);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
friend void QBarCategoryAxis_virtualbase_disconnectNotify(void* self, QMetaMethod* signal);
|
friend void QBarCategoryAxis_virtualbase_disconnectNotify(void* self, QMetaMethod* signal);
|
||||||
@ -203,11 +187,11 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
QBarCategoryAxis* QBarCategoryAxis_new() {
|
QBarCategoryAxis* QBarCategoryAxis_new() {
|
||||||
return new MiqtVirtualQBarCategoryAxis();
|
return new (std::nothrow) MiqtVirtualQBarCategoryAxis();
|
||||||
}
|
}
|
||||||
|
|
||||||
QBarCategoryAxis* QBarCategoryAxis_new2(QObject* parent) {
|
QBarCategoryAxis* QBarCategoryAxis_new2(QObject* parent) {
|
||||||
return new MiqtVirtualQBarCategoryAxis(parent);
|
return new (std::nothrow) MiqtVirtualQBarCategoryAxis(parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QBarCategoryAxis_virtbase(QBarCategoryAxis* src, QAbstractAxis** outptr_QAbstractAxis) {
|
void QBarCategoryAxis_virtbase(QBarCategoryAxis* src, QAbstractAxis** outptr_QAbstractAxis) {
|
||||||
@ -363,7 +347,7 @@ void QBarCategoryAxis_categoriesChanged(QBarCategoryAxis* self) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void QBarCategoryAxis_connect_categoriesChanged(QBarCategoryAxis* self, intptr_t slot) {
|
void QBarCategoryAxis_connect_categoriesChanged(QBarCategoryAxis* self, intptr_t slot) {
|
||||||
MiqtVirtualQBarCategoryAxis::connect(self, static_cast<void (QBarCategoryAxis::*)()>(&QBarCategoryAxis::categoriesChanged), self, [=]() {
|
QBarCategoryAxis::connect(self, static_cast<void (QBarCategoryAxis::*)()>(&QBarCategoryAxis::categoriesChanged), self, [=]() {
|
||||||
miqt_exec_callback_QBarCategoryAxis_categoriesChanged(slot);
|
miqt_exec_callback_QBarCategoryAxis_categoriesChanged(slot);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -374,7 +358,7 @@ void QBarCategoryAxis_minChanged(QBarCategoryAxis* self, struct miqt_string min)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void QBarCategoryAxis_connect_minChanged(QBarCategoryAxis* self, intptr_t slot) {
|
void QBarCategoryAxis_connect_minChanged(QBarCategoryAxis* self, intptr_t slot) {
|
||||||
MiqtVirtualQBarCategoryAxis::connect(self, static_cast<void (QBarCategoryAxis::*)(const QString&)>(&QBarCategoryAxis::minChanged), self, [=](const QString& min) {
|
QBarCategoryAxis::connect(self, static_cast<void (QBarCategoryAxis::*)(const QString&)>(&QBarCategoryAxis::minChanged), self, [=](const QString& min) {
|
||||||
const QString min_ret = min;
|
const QString min_ret = min;
|
||||||
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
||||||
QByteArray min_b = min_ret.toUtf8();
|
QByteArray min_b = min_ret.toUtf8();
|
||||||
@ -393,7 +377,7 @@ void QBarCategoryAxis_maxChanged(QBarCategoryAxis* self, struct miqt_string max)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void QBarCategoryAxis_connect_maxChanged(QBarCategoryAxis* self, intptr_t slot) {
|
void QBarCategoryAxis_connect_maxChanged(QBarCategoryAxis* self, intptr_t slot) {
|
||||||
MiqtVirtualQBarCategoryAxis::connect(self, static_cast<void (QBarCategoryAxis::*)(const QString&)>(&QBarCategoryAxis::maxChanged), self, [=](const QString& max) {
|
QBarCategoryAxis::connect(self, static_cast<void (QBarCategoryAxis::*)(const QString&)>(&QBarCategoryAxis::maxChanged), self, [=](const QString& max) {
|
||||||
const QString max_ret = max;
|
const QString max_ret = max;
|
||||||
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
||||||
QByteArray max_b = max_ret.toUtf8();
|
QByteArray max_b = max_ret.toUtf8();
|
||||||
@ -413,7 +397,7 @@ void QBarCategoryAxis_rangeChanged(QBarCategoryAxis* self, struct miqt_string mi
|
|||||||
}
|
}
|
||||||
|
|
||||||
void QBarCategoryAxis_connect_rangeChanged(QBarCategoryAxis* self, intptr_t slot) {
|
void QBarCategoryAxis_connect_rangeChanged(QBarCategoryAxis* self, intptr_t slot) {
|
||||||
MiqtVirtualQBarCategoryAxis::connect(self, static_cast<void (QBarCategoryAxis::*)(const QString&, const QString&)>(&QBarCategoryAxis::rangeChanged), self, [=](const QString& min, const QString& max) {
|
QBarCategoryAxis::connect(self, static_cast<void (QBarCategoryAxis::*)(const QString&, const QString&)>(&QBarCategoryAxis::rangeChanged), self, [=](const QString& min, const QString& max) {
|
||||||
const QString min_ret = min;
|
const QString min_ret = min;
|
||||||
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
||||||
QByteArray min_b = min_ret.toUtf8();
|
QByteArray min_b = min_ret.toUtf8();
|
||||||
@ -439,7 +423,7 @@ void QBarCategoryAxis_countChanged(QBarCategoryAxis* self) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void QBarCategoryAxis_connect_countChanged(QBarCategoryAxis* self, intptr_t slot) {
|
void QBarCategoryAxis_connect_countChanged(QBarCategoryAxis* self, intptr_t slot) {
|
||||||
MiqtVirtualQBarCategoryAxis::connect(self, static_cast<void (QBarCategoryAxis::*)()>(&QBarCategoryAxis::countChanged), self, [=]() {
|
QBarCategoryAxis::connect(self, static_cast<void (QBarCategoryAxis::*)()>(&QBarCategoryAxis::countChanged), self, [=]() {
|
||||||
miqt_exec_callback_QBarCategoryAxis_countChanged(slot);
|
miqt_exec_callback_QBarCategoryAxis_countChanged(slot);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -477,10 +461,8 @@ bool QBarCategoryAxis_override_virtual_type(void* self, intptr_t slot) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int QBarCategoryAxis_virtualbase_type(const void* self) {
|
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);
|
return static_cast<int>(_ret);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QBarCategoryAxis_override_virtual_event(void* self, intptr_t slot) {
|
bool QBarCategoryAxis_override_virtual_event(void* self, intptr_t slot) {
|
||||||
@ -494,9 +476,7 @@ bool QBarCategoryAxis_override_virtual_event(void* self, intptr_t slot) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool QBarCategoryAxis_virtualbase_event(void* self, QEvent* event) {
|
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) {
|
bool QBarCategoryAxis_override_virtual_eventFilter(void* self, intptr_t slot) {
|
||||||
@ -510,9 +490,7 @@ bool QBarCategoryAxis_override_virtual_eventFilter(void* self, intptr_t slot) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool QBarCategoryAxis_virtualbase_eventFilter(void* self, QObject* watched, QEvent* event) {
|
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) {
|
bool QBarCategoryAxis_override_virtual_timerEvent(void* self, intptr_t slot) {
|
||||||
@ -526,9 +504,7 @@ bool QBarCategoryAxis_override_virtual_timerEvent(void* self, intptr_t slot) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void QBarCategoryAxis_virtualbase_timerEvent(void* self, QTimerEvent* event) {
|
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) {
|
bool QBarCategoryAxis_override_virtual_childEvent(void* self, intptr_t slot) {
|
||||||
@ -542,9 +518,7 @@ bool QBarCategoryAxis_override_virtual_childEvent(void* self, intptr_t slot) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void QBarCategoryAxis_virtualbase_childEvent(void* self, QChildEvent* event) {
|
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) {
|
bool QBarCategoryAxis_override_virtual_customEvent(void* self, intptr_t slot) {
|
||||||
@ -558,9 +532,7 @@ bool QBarCategoryAxis_override_virtual_customEvent(void* self, intptr_t slot) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void QBarCategoryAxis_virtualbase_customEvent(void* self, QEvent* event) {
|
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) {
|
bool QBarCategoryAxis_override_virtual_connectNotify(void* self, intptr_t slot) {
|
||||||
@ -574,9 +546,7 @@ bool QBarCategoryAxis_override_virtual_connectNotify(void* self, intptr_t slot)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void QBarCategoryAxis_virtualbase_connectNotify(void* self, QMetaMethod* signal) {
|
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) {
|
bool QBarCategoryAxis_override_virtual_disconnectNotify(void* self, intptr_t slot) {
|
||||||
@ -590,9 +560,7 @@ bool QBarCategoryAxis_override_virtual_disconnectNotify(void* self, intptr_t slo
|
|||||||
}
|
}
|
||||||
|
|
||||||
void QBarCategoryAxis_virtualbase_disconnectNotify(void* self, QMetaMethod* signal) {
|
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) {
|
QObject* QBarCategoryAxis_protectedbase_sender(bool* _dynamic_cast_ok, const void* self) {
|
||||||
@ -603,9 +571,7 @@ QObject* QBarCategoryAxis_protectedbase_sender(bool* _dynamic_cast_ok, const voi
|
|||||||
}
|
}
|
||||||
|
|
||||||
*_dynamic_cast_ok = true;
|
*_dynamic_cast_ok = true;
|
||||||
|
|
||||||
return self_cast->sender();
|
return self_cast->sender();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int QBarCategoryAxis_protectedbase_senderSignalIndex(bool* _dynamic_cast_ok, const void* self) {
|
int QBarCategoryAxis_protectedbase_senderSignalIndex(bool* _dynamic_cast_ok, const void* self) {
|
||||||
@ -616,9 +582,7 @@ int QBarCategoryAxis_protectedbase_senderSignalIndex(bool* _dynamic_cast_ok, con
|
|||||||
}
|
}
|
||||||
|
|
||||||
*_dynamic_cast_ok = true;
|
*_dynamic_cast_ok = true;
|
||||||
|
|
||||||
return self_cast->senderSignalIndex();
|
return self_cast->senderSignalIndex();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int QBarCategoryAxis_protectedbase_receivers(bool* _dynamic_cast_ok, const void* self, const char* signal) {
|
int QBarCategoryAxis_protectedbase_receivers(bool* _dynamic_cast_ok, const void* self, const char* signal) {
|
||||||
@ -629,9 +593,7 @@ int QBarCategoryAxis_protectedbase_receivers(bool* _dynamic_cast_ok, const void*
|
|||||||
}
|
}
|
||||||
|
|
||||||
*_dynamic_cast_ok = true;
|
*_dynamic_cast_ok = true;
|
||||||
|
|
||||||
return self_cast->receivers(signal);
|
return self_cast->receivers(signal);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QBarCategoryAxis_protectedbase_isSignalConnected(bool* _dynamic_cast_ok, const void* self, QMetaMethod* signal) {
|
bool QBarCategoryAxis_protectedbase_isSignalConnected(bool* _dynamic_cast_ok, const void* self, QMetaMethod* signal) {
|
||||||
@ -642,9 +604,7 @@ bool QBarCategoryAxis_protectedbase_isSignalConnected(bool* _dynamic_cast_ok, co
|
|||||||
}
|
}
|
||||||
|
|
||||||
*_dynamic_cast_ok = true;
|
*_dynamic_cast_ok = true;
|
||||||
|
|
||||||
return self_cast->isSignalConnected(*signal);
|
return self_cast->isSignalConnected(*signal);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void QBarCategoryAxis_delete(QBarCategoryAxis* self) {
|
void QBarCategoryAxis_delete(QBarCategoryAxis* self) {
|
||||||
|
@ -68,6 +68,7 @@ void QBarCategoryAxis_countChanged(QBarCategoryAxis* self);
|
|||||||
void QBarCategoryAxis_connect_countChanged(QBarCategoryAxis* self, intptr_t slot);
|
void QBarCategoryAxis_connect_countChanged(QBarCategoryAxis* self, intptr_t slot);
|
||||||
struct miqt_string QBarCategoryAxis_tr2(const char* s, const char* c);
|
struct miqt_string QBarCategoryAxis_tr2(const char* s, const char* c);
|
||||||
struct miqt_string QBarCategoryAxis_tr3(const char* s, const char* c, int n);
|
struct miqt_string QBarCategoryAxis_tr3(const char* s, const char* c, int n);
|
||||||
|
|
||||||
bool QBarCategoryAxis_override_virtual_type(void* self, intptr_t slot);
|
bool QBarCategoryAxis_override_virtual_type(void* self, intptr_t slot);
|
||||||
int QBarCategoryAxis_virtualbase_type(const void* self);
|
int QBarCategoryAxis_virtualbase_type(const void* self);
|
||||||
bool QBarCategoryAxis_override_virtual_event(void* self, intptr_t slot);
|
bool QBarCategoryAxis_override_virtual_event(void* self, intptr_t slot);
|
||||||
@ -84,10 +85,12 @@ bool QBarCategoryAxis_override_virtual_connectNotify(void* self, intptr_t slot);
|
|||||||
void QBarCategoryAxis_virtualbase_connectNotify(void* self, QMetaMethod* signal);
|
void QBarCategoryAxis_virtualbase_connectNotify(void* self, QMetaMethod* signal);
|
||||||
bool QBarCategoryAxis_override_virtual_disconnectNotify(void* self, intptr_t slot);
|
bool QBarCategoryAxis_override_virtual_disconnectNotify(void* self, intptr_t slot);
|
||||||
void QBarCategoryAxis_virtualbase_disconnectNotify(void* self, QMetaMethod* signal);
|
void QBarCategoryAxis_virtualbase_disconnectNotify(void* self, QMetaMethod* signal);
|
||||||
|
|
||||||
QObject* QBarCategoryAxis_protectedbase_sender(bool* _dynamic_cast_ok, const void* self);
|
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_senderSignalIndex(bool* _dynamic_cast_ok, const void* self);
|
||||||
int QBarCategoryAxis_protectedbase_receivers(bool* _dynamic_cast_ok, const void* self, const char* signal);
|
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);
|
bool QBarCategoryAxis_protectedbase_isSignalConnected(bool* _dynamic_cast_ok, const void* self, QMetaMethod* signal);
|
||||||
|
|
||||||
void QBarCategoryAxis_delete(QBarCategoryAxis* self);
|
void QBarCategoryAxis_delete(QBarCategoryAxis* self);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|