Template for creating applications for Linux, Windows and macOS with the Qt Widgets framework.
The following software is required to compile this application:
- A compiler that supports C++17
- CMake >= 3.19
- Qt >= 6.2
git clone https://github.com/stemoretti/qt-desktop-template.git
cd qt-desktop-template
mkdir build
cd build
cmake ..
make
make install
The default CMake installation prefix is /usr/local
. You can change it by
redefining the option CMAKE_INSTALL_PREFIX in the configuration stage.
(e.g. cmake -DCMAKE_INSTALL_PREFIX=/usr ..
)
Clone the repository with git software like Github Desktop.
It's easier to compile the program using an IDE such as Qt Creator. Instructions on how to download and install it can be found here. Information on how to use it to build and run programs can be found here.
git clone https://github.com/stemoretti/qt-desktop-template.git
cd qt-desktop-template
cmake -B build -G "Ninja"
cmake --build build
The bundle directory is automatically created inside the build directory. However, it doesn't contain the libraries that the program needs to run. To deploy the required Qt libraries into the bundle, run the following command.
macdeployqt "Qt Desktop Template.app" [-dmg]
The optional -dmg option is for creating a dmg disk image file.
Translations are stored in .ts
files inside the translations
folder.
Their name contains the language code of the translation they provide.
To add languages, follow the steps below.
Add the translation's file path of the language you wish to support to the variable
TS_FILES
inside the file CMakeLists.txt.Configure the project by running CMake.
Run the following command to generate the
.ts
file of each language:make update_translations
Open the newly created file with the Qt tool
linguist
. Translate the program's texts and save the file.
The binary translation files will be created automatically during the compilation.
Software used for CI deployment:
Other similar templates: