I develop software with and for people.

Getting Started with Qt 6.x

Jan 28, 2025

In this article, we are going to install Qt and create the sample Qt application on a GNU/Linux Debian system.

  1. Install the required dependencies needed for Qt
    $ sudo apt install libxcb-cursor0 \ 
    libxcb-cursor-dev cmake \
    libgl1-mesa-dev libxkbcommon-x11-dev
    
  2. Create an account on Qt.
  3. Download Qt for open source from this link. This will download a file named qt-online-installer-linux-x64-4.8.1.run. The version in the file name might change based on when you are reading.
  4. Make the downloaded file executable using using following command.
    $ chmod +x qt-online-installer-linux-x64-4.8.1.run
    
  5. Run the executable
    $ ./qt-online-installer-linux-x64-4.8.1.run
    

    and follow the process, such as providing login details, selecting components to install, agreeing to the license, etc.

If you encounter an error for the mirror, try running the executable with a different mirror, such as
$ ./qt-online-installer-linux-x64-4.8.1.run --mirror http://qt.mirror.constant.com
Wait for the process to complete, as it downloads more than 1GB of data.

---

After the successful installation of Qt, you should see that Qt Creator is installed.

  1. Go ahead and open Qt Creator. Qt Creator Welcome Screen
  2. Click on the ‘Create Project…’ button and choose ‘Qt Widgets Application’. Highlighted Create Project... button for click New Project > Qt Widgets Application
  3. Give a name to the application (e.g., hello_world) and select a location where you’d like to save the project on your computer. hello_world as a project name and selection of the location
  4. Next, it will ask you to choose the Build System. Go with CMake. CMake as selected build system
  5. It will then ask for the Class Information. Select ‘QWidget’ for the Base class and click Next. QWidget is selected as Base class in Class Information screen
  6. For now, we’re not interested in translations, so just click Next without making any changes. Translation file screen, do not modifies it here and click Next
  7. Again, don’t make modifications in Kit Selection screen and click Next. Kit Selection screen, do not modifies the default and click Next
  8. Finally, you can add version control if you want, or click Finish. Project Management screen, version control is default to None
  9. Wait for the process to complete. Then you should be able to run the application. Indicating that the background process is onging in right-bottom corner of the Qt Creator
  10. Run the application by pressing the green play icon from the panel or menu, or by pressing Ctrl+R. Play icon is highlighted from left-bottom panel
  11. You should see a blank window as output. Blank window with Widget title as output
Tags: qt