Skip to content

stemoretti/Qt-Desktop-Template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

image

image

image

image

image

Qt Desktop Template

Template for creating applications for Linux, Windows and macOS with the Qt Widgets framework.

How to build

Requirements

The following software is required to compile this application:

  • A compiler that supports C++17
  • CMake >= 3.19
  • Qt >= 6.2

Compiling and installing under Linux

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 ..)

Compiling and running under Windows

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.

Compiling and creating a bundle under macOS

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

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.

Credits

Software used for CI deployment:

See also

Other similar templates:

About

Template for creating applications for Linux, Windows and MacOS using the Qt widgets framework

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published