Install Qt 6.x

Jan 28, 2025

In this article, we are going to install Qt 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. You also need to create an account on Qt. Go ahead and create one.
  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 this name might change based on when you are reading. Make this file executable using chmod +x qt-online-installer-linux-x64-4.8.1.run.
  4. 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.
  2. Click on the ‘Create Project’ button and choose ‘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.
  4. Next, it will ask you to choose the Build System. Go with CMake.
  5. It will then ask for the Class Information. Select ‘QWidget’ for the Base class and click Next.
  6. For now, we’re not interested in translations, so just click Next without making any changes.
  7. Again, don’t make modifications in Kit Selection and click Next.
  8. Finally, you can add version control if you want, or click Finish.
  9. Wait for the process to complete. Then you should be able to run the application.
  10. Run the application by pressing the green play icon from the panel or menu, or by pressing Ctrl+R. You should see a blank window.
Tags: qt