Qt Design Viewer for Android
About
Launch Design Studio projects in your Android device. The viewer that helps you do this is done with Qt for Android.
Qt Design Viewer works with minimum Android 33.
Prerequisites
- CMake 3.16 or newer
- Qt6.5.0 or newer
- OpenSSL (https://github.com/KDAB/android_openssl)
- Android SDK and NDK (https://developer.android.com/studio)
Code Map
- cicd: GitLab pipeline files
- resources: UI related files
- android: Files needed for Android build system
- src: Backend source files
- ui: UI source files
- qtquickdesigner-components: Required 3rd party QML components
Building
Build instructions are provided for Linux and macOS hosts. Windows should work as well but is not tested.
Note: If you're building in a Docker container and you've mounted the source directory into the container, you may need to change the build path pointing out somewhere out of the source directory. Otherwise you may get errors like the following;
CMake Error at /opt/qt-v.6.5.0/android-arm64-v8a/lib/cmake/Qt6/QtSyncQtHelpers.cmake:235 (message): syncqt.cpp failed for module QtQuickStudioApplication: Unable to remove file ...
Note: Android build instructions can also be used on desktop (or host) for testing purposes. Just replace the
CMAKE_TOOLCHAIN_FILE
path with the path to your Qt host installation.
First build and install QtQuickDesigner Components for Android:
cd qtquickdesigner-components
cmake \
-S . \
-B build \
-G Ninja \
-DCMAKE_TOOLCHAIN_FILE=<qt-android-path>/lib/cmake/Qt6/qt.toolchain.cmake \
-DCMAKE_INSTALL_PREFIX=<qt-android-path> \
-DCMAKE_PREFIX_PATH=<qt-android-path> \
-DANDROID_SDK_ROOT=<android-sdk-path> \
-DANDROID_NDK_ROOT=<android-sdk-path>/ndk/<ndk-version> \
-DANDROID_OPENSSL_PATH=<openssl-path>
cmake --build build
cmake --install build
cd ..
Then build the Qt Design Viewer:
cmake \
-S . \
-B build \
-G Ninja \
-DCMAKE_TOOLCHAIN_FILE=<qt-android-path>/lib/cmake/Qt6/qt.toolchain.cmake \
-DANDROID_SDK_ROOT=<android-sdk-path> \
-DANDROID_NDK_ROOT=<android-sdk-path>/ndk/<ndk-version> \
-DANDROID_OPENSSL_PATH=<openssl-path>
cmake --build build
Usage
Upload the final APK file to your Android device and run. Then follow the instructions within the app.