Guidelines for App Development under QT
As one of the main frameworks for UnionTech OS System, Qt framework is a popular choice for many developers. Below development guidelines are established to avoid incompatibilities during the system development process and circumvent compatibility issues for apps.
All Qt private modules are not allowed to use
Random use of Qt private modules might lead to interface incompatibility after system upgrade. Developers shall take app incompatibility risks if private modules are used. Any apps using Qt private modules might be removed from App Store.
Test script for private modules
Developers can use below test script to identify if private modules are included.
#!/bin/bash
if [[ $1 == "" ]]; then
echo "Plase set source directory"
exit -1
fi
echo "check \"$1\"..."
find $1 -regex "\(.+\.pro\|.+\.pri\)" | xargs grep -e "QT.*+=.*-private"
qmake=$?
find $1 -name CMakeLists.txt | xargs grep -e "Qt5\\w\+PRIVATE_INCLUDE_DIRS"
cmake=$?
if [[ $qmake == 0 || $cmake == 0 ]]; then
echo "Warning: found Qt private module!!!"
exit 1
fi
exit 0
How to use the test script: 1 Save the script as check_qt_private.sh 2 chmod +x check_qt_private.sh 3 ./check_qt_private.sh ~/projects/qt-project-path If“Warning: found Qt private module!!!”is shown in the output result, it means Qt private module(s) is/are used, and you should remove the dependency on the private module(s) in the project. If not, private module is not used by project and no changes shall be made. Only one project can be tested for each execution. If you need to run tests for multiple projects, you can run multiple times and check the output result for each test.