How to Deploy Your Qt Cross-Platform Applications to Linux Operating System With the Qt Installer Framework

This tutorial explains the manner to deploy cross-platform projects you made with the Qt framework ( Qt Core, Qt Widgets, and Qt Quick alike) to Linux Operating Systems using the Qt Installer Framework.

Image for post
Image for post

Set up the necessary environment

  • Operating System information
Image for post
Image for post
  • a set up of Qt Creator IDE
Image for post
Image for post
  • a code sample in a simple app that draws a tank and a traffic light. The traffic light changes its colour according to the level of the liquid in the tank

The lines of code show the construction appear in the following Udemy course:

If you wish to get conversant with the Qt cross-platform framework, I recommend following along the courses on Udemy from the following authors:

  • check if the Qt Installer Framework is installed on your machine, if not add this component via “Qt Maintenance Tool” utility
Image for post
Image for post
Image for post
Image for post
Note: depending upon your Qt Maintenance Tool version colors and UI layout might vary. Though, the flow and the options are similar accross versions
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post

Check for the installation of the Qt Installation Framework inside its directory:

Image for post
Image for post
The directory is the example on my machine
Image for post
Image for post
Image for post
Image for post

At this point, the preparations are completed. Let’s deploy our Qt made application using the Qt Installer Framework.

Go deploy using the Qt Installer Framework

Step 0. Build the Qt code on Linux in Release Mode

Image for post
Image for post
Image for post
Image for post

Locate the Qt Application in the Release Build Directory:

Image for post
Image for post
This screenshot example refers to paths on my machine
Image for post
Image for post

Step 1. Create a directory where you are going to keep the Qt Installer Framework deployment files

Image for post
Image for post

Step 2. Copy the ‘examples/tutorial’ directory in the newly created directory

Image for post
Image for post

Step 3. Make the needed adjustment according to your Qt Installer needs

At this step, you need to modify the names of directories and content inside several files. This directory structure and content of the file is interpreted by the Qt Installer Framework to build the installer of the Qt Application.

Image for post
Image for post

Modify the content of ‘config/config.xml’

Image for post
Image for post

Modify the name of ‘packages/com.vendor.app’

Image for post
Image for post
Modify the name of the directory as you wish

Modify the files inside ‘packages/meta/’

Here you can modify the files “license.txt” and “package.xml”

Image for post
Image for post
Image for post
Image for post

Step 4. Copy anything you want to pass to the final user inside ‘packages/data/’

If you are new at this point, you have to follow along this article to generate the relevant files for the deployment of a Qt cross-platform application using linuxdeployqt:

Image for post
Image for post
Copy all the directories and files generated with linuxdeployqt in ‘packages/data’.
Image for post
Image for post

Step 5. Call the executable ‘binarycreator’ from terminal to construct the Qt Installer

Image for post
Image for post
Image for post
Image for post
path to ‘binarycreator’ goes like ‘../bin/binarycreator'

After this step, the application installer is generated on your machine.

Test run the installer file of your Qt application

Image for post
Image for post
Make sure your user has the relevant rights for the execution of the .run file
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Make sure the file is marked as binary and you have the relevant user rights to execute it.

Written by

10+ years of experience in a blend of mentoring, programming, business intelligence, people and logistics management :: https://www.linkedin.com/in/cgeorge1978/

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store