### Install Dependencies on FreeBSD Source: https://github.com/mappu/miqt/blob/master/README.md Installs Git, pkgconf, Go, and Qt6 development packages on FreeBSD. ```bash pkg install git pkg install devel/pkgconf pkg install go pkg install qt6-base qt6-charts qt6-multimedia qt6-pdf qt6-positioning qt6-svg qt6-tools qt6-webchannel qt6-webengine qt6-declarative qscintilla2-qt6 ``` -------------------------------- ### Install Static Qt5 on MSYS2 Source: https://github.com/mappu/miqt/blob/master/README.md Installs the static version of Qt 5 for Windows development. ```bash pacman -S mingw-w64-ucrt-x86_64-qt5-static ``` -------------------------------- ### Install MIQT UIC and RCC Tools Source: https://github.com/mappu/miqt/blob/master/README.md Installs the MIQT tools for Qt Designer form design and resource management. Ensure your Go bin directory is in your PATH. ```bash go install github.com/mappu/miqt/cmd/miqt-uic@latest go install github.com/mappu/miqt/cmd/miqt-rcc@latest ``` -------------------------------- ### Example miqt-docker Build Commands Source: https://github.com/mappu/miqt/blob/master/cmd/miqt-docker/README.md Demonstrates various ways to use miqt-docker for building projects across different platforms and configurations, including interactive shells. ```bash miqt-docker macos go build -ldflags '-s -w' ``` ```bash miqt-docker native -minify-build ``` ```bash miqt-docker win64-qt6-static -windows-build ``` ```bash miqt-docker win64-qt6-static /bin/bash ``` ```bash miqt-docker android-qt6 -android-build ``` -------------------------------- ### Install Dependencies on macOS with Homebrew Source: https://github.com/mappu/miqt/blob/master/README.md Installs Xcode command-line tools, Go, pkg-config, and Qt5 using Homebrew on macOS. ```bash xcode-select --install brew install golang brew install pkg-config brew install qt@5 ``` -------------------------------- ### Install Qt 5 Dependencies for Debian/Ubuntu (Minimal) Source: https://github.com/mappu/miqt/blob/master/README.md Installs minimal Qt 5 development dependencies and build tools for Debian/Ubuntu systems. ```bash # Debian / Ubuntu (Minimal) apt install qtbase5-dev build-essential golang-go ``` -------------------------------- ### Install Qt 5 Dependencies for Debian/Ubuntu (Full) Source: https://github.com/mappu/miqt/blob/master/README.md Installs a comprehensive set of Qt 5 development dependencies and build tools for Debian/Ubuntu systems. ```bash # Debian / Ubuntu (Full) apt install qtbase5-dev libqscintilla2-qt5-dev libqt5svg5-dev libqt5webchannel5-dev libqt5webkit5-dev qtbase5-private-dev qtmultimedia5-dev qtpdf5-dev qtpositioning5-dev qttools5 qtwebengine5-dev qtwebengine5-private-dev build-essential golang-go ``` -------------------------------- ### Supported Translation Syntax in Go Source: https://github.com/mappu/miqt/blob/master/cmd/miqt-lupdate/README.md Shows examples of Go code using QLabel3 and QPushButton3 with translatable strings, demonstrating supported syntax structures. ```go l := NewQLabel3(QCoreApplication_Translate("Context", "My string to translate")) p := NewQPushButton3(QPushButton_Tr("My string to translate")) ``` -------------------------------- ### Build MIQT Application on Windows using miqt-docker Source: https://github.com/mappu/miqt/blob/master/README.md Demonstrates building MIQT applications for Windows using the miqt-docker tool, with examples for Qt 5 dynamic, Qt 5 static, and Qt 6 static linking. ```bash go install github.com/mappu/miqt/cmd/miqt-docker@latest # Many docker templates are available by running `miqt-docker -Help` miqt-docker win32-qt5-dynamic -windows-build miqt-docker win32-qt5-static -windows-build --tags=windowsqtstatic miqt-docker win64-qt6-static -windows-build --tags=windowsqtstatic ``` -------------------------------- ### Full pkg-config file for QScintilla (Qt 5) Source: https://github.com/mappu/miqt/blob/master/doc/pkg-config.md An example of a complete .pc file for the QScintilla library, including include directories and library linking information. ```pkgconfig 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} ``` -------------------------------- ### Install Qt 6 Dependencies for Debian/Ubuntu (Full) Source: https://github.com/mappu/miqt/blob/master/README.md Installs a comprehensive set of Qt 6 development dependencies and build tools for Debian/Ubuntu systems. ```bash # Debian / Ubuntu (Full) apt install qt6-base-dev qt6-base-private-dev qt6-charts-dev qt6-multimedia-dev qt6-pdf-dev qt6-positioning-dev qt6-svg-dev qt6-tools-dev qt6-webchannel-dev qt6-webengine-dev qt6-declarative-dev qml6-module-qtquick-controls qml6-module-qtquick-shapes qml6-module-qtquick-layouts qml6-module-qtquick-templates qml6-module-qtquick-window build-essential golang-go ``` -------------------------------- ### Install Qt 6 Dependencies for Fedora Source: https://github.com/mappu/miqt/blob/master/README.md Installs Qt 6 development dependencies and build tools for Fedora systems. ```bash # Fedora dnf install qt6-qtbase-devel qscintilla-qt6-devel qt6-qtcharts-devel qt6-qtmultimedia-devel qt6-qtpdf-devel qt6-qtpositioning-devel qt6-qtsvg-devel qt6-qttools-devel qt6-qtwebchannel-devel qt6-qtwebengine-devel qt6-qtdeclarative-devel golang ``` -------------------------------- ### Install Qt 6 Dependencies for Debian/Ubuntu (Minimal) Source: https://github.com/mappu/miqt/blob/master/README.md Installs minimal Qt 6 development dependencies and build tools for Debian/Ubuntu systems. ```bash # Debian / Ubuntu (Minimal) apt install qt6-base-dev build-essential golang-go ``` -------------------------------- ### Install Qt 6 Dependencies for Arch Linux (Full) Source: https://github.com/mappu/miqt/blob/master/README.md Installs a comprehensive set of Qt 6 development dependencies and build tools for Arch Linux systems. ```bash # Arch Linux (Full) pacman -S pkg-config gcc go qt6-base qscintilla-qt6 qt6-charts qt6-multimedia qt6-positioning qt6-svg qt6-tools qt6-webchannel qt6-webengine qt6-declarative ``` -------------------------------- ### Install Qt 6 Dependencies for Arch Linux (Minimal) Source: https://github.com/mappu/miqt/blob/master/README.md Installs minimal Qt 6 development dependencies and build tools for Arch Linux systems. ```bash # Arch Linux (Minimal) pacman -S pkg-config gcc go qt6-base ``` -------------------------------- ### Install Qt 6 Dependencies for Manjaro Source: https://github.com/mappu/miqt/blob/master/README.md Installs Qt 6 development dependencies and build tools for Manjaro systems. ```bash # Manjaro pamac install qt6-base qscintilla-qt6 qt6-charts qt6-multimedia qt6-positioning qt6-svg qt6-tools qt6-webchannel qt6-webengine qt6-declarative go ``` -------------------------------- ### Install Go and C++ Toolchains on MSYS2 Source: https://github.com/mappu/miqt/blob/master/README.md Installs necessary Go and C++ compilers and build tools for Windows development using MSYS2. ```bash pacman -S mingw-w64-ucrt-x86_64-{go,gcc,pkg-config} ``` -------------------------------- ### Build Android APK with miqt-docker Source: https://github.com/mappu/miqt/blob/master/README.md Installs the miqt-docker tool and then uses it to build an Android APK for Qt5 or Qt6. A default manifest, icon, and keystore are generated, and custom files will be used in subsequent builds. ```bash go install github.com/mappu/miqt/cmd/miqt-docker miqt-docker android-qt5 -android-build # or android-qt6 ``` -------------------------------- ### Install MSYS2 Dependencies for Windows Build (Qt 5) Source: https://github.com/mappu/miqt/blob/master/README.md Installs Go, GCC, pkg-config, and Qt 5 base development packages for the UCRT64 environment within MSYS2. ```bash # Install Go and C++ toolchains pacman -S mingw-w64-ucrt-x86_64-{go,gcc,pkg-config} export GOROOT=/ucrt64/lib/go # Needed only if this is the first time installing Go in MSYS2. Otherwise it would be automatically applied when opening a new Bash terminal. # Install Qt pacman -S mingw-w64-ucrt-x86_64-qt5-base # For Qt 5 (UCRT64 GCC toolchain) ``` -------------------------------- ### Install MSYS2 Dependencies for Windows Build (Qt 6 - CLANG64) Source: https://github.com/mappu/miqt/blob/master/README.md Installs Go, GCC, pkg-config, and Qt 6 base development packages for the CLANG64 environment within MSYS2. ```bash # Install Go and C++ toolchains pacman -S mingw-w64-ucrt-x86_64-{go,gcc,pkg-config} export GOROOT=/ucrt64/lib/go # Needed only if this is the first time installing Go in MSYS2. Otherwise it would be automatically applied when opening a new Bash terminal. # Install Qt pacman -S mingw-w64-clang-x86_64-qt6-base # For Qt 6 (CLANG64 toolchain) ``` -------------------------------- ### Install MSYS2 Dependencies for Windows Build (Qt 6 - UCRT64) Source: https://github.com/mappu/miqt/blob/master/README.md Installs Go, GCC, pkg-config, and Qt 6 base development packages for the UCRT64 environment within MSYS2. ```bash # Install Go and C++ toolchains pacman -S mingw-w64-ucrt-x86_64-{go,gcc,pkg-config} export GOROOT=/ucrt64/lib/go # Needed only if this is the first time installing Go in MSYS2. Otherwise it would be automatically applied when opening a new Bash terminal. # Install Qt pacman -S mingw-w64-ucrt-x86_64-qt6-base # For Qt 6 (UCRT64 GCC toolchain) ``` -------------------------------- ### Configure Pkg-config for Static Qt5 Source: https://github.com/mappu/miqt/blob/master/README.md Sets the PKG_CONFIG_PATH environment variable to point to the static Qt5 installation's pkg-config files. ```bash export PKG_CONFIG_PATH=/ucrt64/qt5-static/lib/pkgconfig ``` -------------------------------- ### Set Go Root Path in MSYS2 Source: https://github.com/mappu/miqt/blob/master/README.md Sets the GOROOT environment variable, typically needed only on the first Go installation in MSYS2. ```bash export GOROOT=/ucrt64/lib/go ``` -------------------------------- ### Overriding Qt Install Location with PKG_CONFIG_PATH Source: https://github.com/mappu/miqt/blob/master/README.md Configures CGO to find Qt libraries in a custom location by setting the PKG_CONFIG_PATH environment variable. A clean cache may be required after changing this variable. ```bash # Example: export PKG_CONFIG_PATH=/path/to/your/qt/lib/pkgconfig # After changing, run: go clean -cache ``` -------------------------------- ### miqt-docker Usage Instructions Source: https://github.com/mappu/miqt/blob/master/cmd/miqt-docker/README.md Run `miqt-docker` with no arguments to display comprehensive usage instructions, including available commands and environment variables. ```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) [...] ``` -------------------------------- ### Build Mappu/Miqt with Static Qt5 on Windows Source: https://github.com/mappu/miqt/blob/master/README.md Compiles the Mappu/Miqt application using Go, with flags for static Qt5 linking and Windows GUI. ```bash go build -ldflags "-s -w -H windowsgui" --tags=windowsqtstatic ``` -------------------------------- ### Build Mappu/Miqt using Docker for Windows Static Cross-Compilation Source: https://github.com/mappu/miqt/blob/master/README.md Runs a Docker container to build the Mappu/Miqt application with static Qt5 linking for Windows. ```bash docker run --rm -v $(pwd):/src -w /src miqt/win64-cross:latest go build --tags=windowsqtstatic -ldflags '-s -w -H windowsgui' ``` -------------------------------- ### Compile UI file with miqt-uic Source: https://github.com/mappu/miqt/blob/master/examples/uidesigner/README.md Use the `miqt-uic` command-line tool to convert a Qt Designer `.ui` XML file into Go source code. Run `miqt-uic -Help` for advanced configuration options. ```bash miqt-uic -InFile design.ui -OutFile design.go ``` -------------------------------- ### Build Mappu/Miqt using Docker for Windows Dynamic Cross-Compilation Source: https://github.com/mappu/miqt/blob/master/README.md Runs a Docker container to build the Mappu/Miqt application with dynamic Qt5 linking for Windows. ```bash docker run --rm -v $(pwd):/src -w /src miqt/win64-dynamic:latest go build -ldflags '-s -w -H windowsgui' ``` -------------------------------- ### Build Docker Container for Windows Static Cross-Compilation Source: https://github.com/mappu/miqt/blob/master/README.md Builds a Docker image for cross-compiling Mappu/Miqt with static Qt5 on Windows. ```bash docker build -t miqt/win64-cross:latest -f win64-cross-go1.23-qt5.15-static.Dockerfile . ``` -------------------------------- ### Build Docker Container for Windows Dynamic Cross-Compilation Source: https://github.com/mappu/miqt/blob/master/README.md Builds a Docker image for cross-compiling Mappu/Miqt with dynamic Qt5 linking on Windows. ```bash docker build -t miqt/win64-dynamic:latest -f win64-cross-go1.23-qt5.15-dynamic.Dockerfile . ``` -------------------------------- ### miqt-uic Command-Line Usage Source: https://github.com/mappu/miqt/blob/master/cmd/miqt-uic/README.md Displays the available command-line flags for the miqt-uic program. Use these flags to specify input and output files, package names, and Qt version. ```bash Usage of ./miqt-uic: -InFile string Input .ui file -OutFile string Output .go file, or - for stdout (default "-") -Package string Custom package name (default "main") -Qt6 Use Qt 6 instead of Qt 5 ``` -------------------------------- ### Build Mappu/Miqt using Docker for macOS Cross-Compilation Source: https://github.com/mappu/miqt/blob/master/README.md Runs a Docker container to build the Mappu/Miqt application for macOS cross-compilation. ```bash docker run --rm -v $(pwd):/src -w /src miqt/osxcross:latest go build -ldflags '-s -w' ``` -------------------------------- ### miqt-lupdate Command-Line Usage Source: https://github.com/mappu/miqt/blob/master/cmd/miqt-lupdate/README.md Displays the available command-line flags and their descriptions for the miqt-lupdate tool. ```text Usage of ./miqt-lupdate: -AddComments (Optional) Include code comments in the output file, defaults to false -InFile string Input file (.go) or directory -KeepObsolete (Optional) Keep obsolete and vanished strings, defaults to false -Language string (Optional) Language code, defaults to empty -NoRecursive (Optional) Disable recursively parsing all subdirectories, defaults to recurse if input is a directory -OutFile string (Optional) Path to .ts output file; if omitted, inferred from the input file or directory path ``` -------------------------------- ### Compile MIQT Application Natively on Linux Source: https://github.com/mappu/miqt/blob/master/README.md Compiles your MIQT application using Go's build command with linker flags for stripping symbols and debugging information. ```bash go build -ldflags '-s -w' ``` -------------------------------- ### miqt-rcc Usage Flags Source: https://github.com/mappu/miqt/blob/master/cmd/miqt-rcc/README.md Lists the available command-line flags for the miqt-rcc tool, including input/output file paths, package naming, Qt version selection, and custom rcc binary path. ```bash Usage of ./miqt-rcc: -Input string Path to .qrc input file -OutputGo string (Optional) Path to .go output file. If omitted, interred from the input file path -OutputRcc string (Optional) Path to .rcc output file. If omitted, inferred from the output Go file path -Package string Package to use in generated Go files (default "main") -Qt6 Use Qt 6 instead of Qt 5 -RccBinary string (Optional) Custom path to the Qt rcc program (default "rcc") -VariableName string Temporary global variable name for loading embedded data (default "_resourceRcc") ``` -------------------------------- ### Configure Environment Variables for Native Windows Build (Clang) Source: https://github.com/mappu/miqt/blob/master/README.md Sets up essential environment variables for CGO compilation on Windows using Clang, specifying the C compiler, C++ compiler, pkg-config, and CGO CXXFLAGS. ```powershell $env:CGO_ENABLED = 1 $env:CC = 'C:\dev\rootfs\bin\clang.exe' $env:CXX = 'C:\dev\rootfs\bin\clang++.exe' $env:PKG_CONFIG = 'C:\dev\rootfs\bin\pkg-config.exe' $env:CGO_CXXFLAGS = '-Wno-ignored-attributes' # Clang 18 recommendation ``` -------------------------------- ### Custom pkg-config file for a library Source: https://github.com/mappu/miqt/blob/master/doc/pkg-config.md Create a .pc file to define flags for a specific library. This allows CGO to find the library when building. ```pkgconfig Name: My Library Requires: Qt6Widgets Libs: -lfoo Cflags: -I/path/ ``` -------------------------------- ### Compile MIQT Application Natively on Windows (GUI) Source: https://github.com/mappu/miqt/blob/master/README.md Compiles your MIQT application on Windows with linker flags to strip symbols, remove debug information, and create a Windows GUI subsystem executable. ```bash go build -ldflags "-s -w -H windowsgui" ``` -------------------------------- ### Build Docker Container for macOS Cross-Compilation Source: https://github.com/mappu/miqt/blob/master/README.md Builds a Docker image for cross-compiling Mappu/Miqt for macOS using osxcross. ```bash docker build -t miqt/osxcross:latest -f macos-cross-x86_64-sdk14.5-go1.19-qt5.15-dynamic.Dockerfile . ``` -------------------------------- ### Copy Static Libraries for Pkg-config Source: https://github.com/mappu/miqt/blob/master/README.md Copies libzstd.a and libz.a to the Qt static library path to ensure they are found by pkg-config. ```bash cp -vn /ucrt64/lib/libzstd.a /ucrt64/qt5-static/lib/libzstd cp -vn /ucrt64/lib/libz.a /ucrt64/qt5-static/lib/libz ``` -------------------------------- ### List all available packages known to pkg-config Source: https://github.com/mappu/miqt/blob/master/doc/pkg-config.md This command lists all packages that pkg-config is aware of on the system. ```bash pkg-config --list-all ``` -------------------------------- ### Upgrade MIQT Imports from Qt 5 to Qt 6 Source: https://github.com/mappu/miqt/blob/master/README.md Use this command to automatically update import paths in your project when migrating from Qt 5 to Qt 6. ```bash find . -type f -name .go -exec sed -i 's_"github.com/mappu/miqt/qt"_"github.com/mappu/miqt/qt6"_' {} \; ``` -------------------------------- ### Find pkg-config system library paths Source: https://github.com/mappu/miqt/blob/master/doc/pkg-config.md Use this command to see where pkg-config searches for system libraries. ```bash 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 ``` -------------------------------- ### Translator Comment Syntax Source: https://github.com/mappu/miqt/blob/master/cmd/miqt-lupdate/README.md Illustrates comment syntaxes recognized by miqt-lupdate for translator notes, similar to native Qt support. ```go // an ignored/private comment /* an ignored/private comment block */ //: a comment for translators /*: an included comment block for translators */ ``` -------------------------------- ### Export CGO LDFLAGS for Static Qt5 Source: https://github.com/mappu/miqt/blob/master/README.md Exports CGO_LDFLAGS with necessary flags and libraries for static linking with Qt5 on Windows. ```bash export CGO_LDFLAGS='-LC:/msys64/ucrt64/qt5-static/share/qt5/plugins/platforms -lqwindows -lQt5FontDatabaseSupport -lQt5EventDispatcherSupport -lQt5ThemeSupport -lQt5PlatformCompositorSupport -lQt5AccessibilitySupport -lQt5WindowsUIAutomationSupport -lwtsapi32 -LC:/msys64/ucrt64/qt5-static/share/qt5/plugins/styles -lqwindowsvistastyle -lQt5VulkanSupport -lqtfreetype -static -static-libgcc -static-libstdc++' ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.