- Install Qt Creator on Linux
- 1) Install prerequisites
- 2) Download the Qt installer
- 3) Run the Qt installer
- 3) Install CS106-specific package
- Download CS106 package and extract
- Open and configure CS106 project
- Build the program
- Run the program
- 5) Configure settings (optional)
- Qt creator
- Общее
- Работа с программой из дистрибутива
- Настройка работы примеров
- Работа с обновленной программой
- Компилирование примеров
- Запуск программ если установлено несколько версий QT
- How to run Qtcreator from terminal in Ubuntu?
- 4 Answers 4
Install Qt Creator on Linux
Below are basic instructions for installing Qt on Linux that may work for your system, however, we are unable to provide further Linux support. If you are unable to get Qt Creator working on your Linux system, please consider using another computer or working on a campus cluster computer.
1) Install prerequisites
If you’re running Ubuntu, Debian, Mint, or any other Debian derivative, you can install the needed preqreuisites using the apt package manager. Issue the following commands below in your shell.
This command ensures your package manager is up-to-date:
sudo apt-get update && sudo apt-get upgrade
This command installs the tools and libraries needed for Qt (be sure to copy/paste the entire line, it is long!)
sudo apt-get -y install build-essential openssl libssl-dev libssl1.0 libgl1-mesa-dev libqt5x11extras5
If you’re running some other variant of Linux, figure out a way to install the tools make , g ++ , and gdb . (For example, on Fedora / Red Hat systems, you may be able to use the yum package manager.)
2) Download the Qt installer
Download the Qt installer from its official download site at https://www.qt.io/download-qt-installer. The site should detect that your computer is running linux and recommend «Qt Online Installer for linux». Click the green «Download» button to download the installer.
3) Run the Qt installer
The downloaded installer is named something like qt — unified — linux — x64 — version — online . run and is likely located in your ~/ Downloads directory. Use chmod + x qt * . run to make the file executable, then run it by typing . / qt * . run .
The Qt installer will walk you through a set of steps. For most steps, you can use the default settings and simply click «Next» or «Agree» to move on, with the following exceptions:
- At the Welcome step, sign up (or sign in) for your own Qt Account. Go ahead and put in your @stanford.edu email and verify your account via email. When setting up your account, you do not have to put in your phone number or city.
- Register as an individual user, not as part of a company / organization and not for commercial use.
- At the Installation Folder step (see screenshot below):
- Select the option Qt 6.x for desktop development, Qt libraries for GCC.
- Do not change the name or location of the directory where Qt will be installed.
Note: if your installer does not offer the option shown above, stop here. Your system is going to require a non-standard install. Contact the staff with your system information and we’ll see if we can help. Depending on how esoteric your situation, this may not be successful. We recommend a backup plan to use a different computer or work on a campus cluster computer.
3) Install CS106-specific package
After installing Qt, you must install the CS106-specific package and do a complete build and run cycle to confirm all is working properly.
Download CS106 package and extract
- Download this archive file: 📦 CS106.zip
- Un-zip the download contents (on a Windows computer, click «Extract all») to a location of your choice. You should have a folder named CS106 with several files and folders inside.
Open and configure CS106 project
A Qt Creator project includes a file named with a . pro extension. Double-clicking the . pro file opens the project in Qt Creator.
- Find the CS106 . pro file and open it now.
- When opening a project for the first time, Qt Creator will ask you to configure the project build kit. The «Configure Project» panel shows the list of available build kits (see screenshot below). The default kit should already be selected; it will match the desktop kit you selected when installing Qt Creator (version Qt 6.x.x).
- Accept the default by clicking the «Configure Project» button.
If your Qt Creator shows no kits are available, review the Qt install instructions. You can repeat the steps to re-install Qt if you missed selecting the correct option.
Build the program
C++ code must be compiled or built before it is run; this means converting the source code into executable binary code.
- Click the Build icon in the lower-left of the Qt Creator window.
- Watch the build progress meter in the lower-right. The first time you build a project, it can take a minute or more to compile the library code. When the bar turns green, it indicates the program successfully built.
Run the program
Now that the program is built, you are ready to run it.
- Click the Play/Run icon in lower-left of window.
- As shown in the screenshot below, the welcome program prints a message to the console window and draws the Stanford logo on graphics window.
✔️ Congratulations, your installation is good to go! You may now discard the CS106 project, you will not need it again.
5) Configure settings (optional)
For a better experience, we suggest changing some of the default settings, see our recommended configuration settings.
All content © Stanford University 2022 Website programming by Julie Zelenski • This page last updated 2022-Sep-24
Qt creator
Это программа для разработке программ на qt, qml, c++, html5.
Общее
Для компилирования проектов могут понадобится файлы разработки. Например эти:
sudo apt-get install build-essential libgl1-mesa-dev sudo apt-get install libqt5webkit5-dev
Работа с программой из дистрибутива
sudo apt-get install qtcreator
sudo apt-get install ubuntu-sdk-dev
Настройка работы примеров
Создаем папку куда будем сохранять проекты, например в ~/qtprojects. И создать ссылку на общую папку shared чтоб работал путь »../../shared.h».
mkdir ~/qtprojects sudo apt-get install qtbase5-examples qtdeclarative5-examples ln -s /usr/lib/x86_64-linux-gnu/qt5/examples/quick/shared/ ~/shared
Работа с обновленной программой
Программу qt creator можно обновить скачав последнюю версию с сайта qt
chmod u+x ~/Загрузки/qt-unified-linux-x64-2.0.1-online.run ~/Загрузки/qt-unified-linux-x64-2.0.1-online.run
Программы ставятся по умолчанию в каталог ~/Qt . Для запуска qtcreator сделаем ссылку на рабочем столе:
ln -s ~/Qt/Tools/QtCreator/bin/qtcreator ~/"Рабочий стол"/qtcreator
Для предотвращения конфликтов установим настройки по умолчанию. Меню Инструменты, Параметры, раздел Комплекты, выбрать Автоопределенная Desktop Qt 5.4.x GCC 64bit, нажать кнопку Сделать по умолчанию.
Компилирование примеров
Для начала программирования неплохо ознакомится с примерами программ. Для понимания стиля программирования и изучения языка и фраймворков.
Создаем папку куда будем сохранять проекты, например в ~/qtprojects. И создать ссылку на общую папку shared чтоб работал путь «../../shared.h».
mkdir ~/qtprojects ln -s ~/Qt/Examples/Qt-5.4/quick/shared ~/shared
Выбираем слева Начало, Примеры, кликаем и запускаем.
Запуск программ если установлено несколько версий QT
https://forum.qt.io/topic/55100/linux-run-program-if-install-two-version-qt
How to run Qtcreator from terminal in Ubuntu?
Hi I have QtInstalled with the official qt installer (I haven’t used the package with the name «qtcreator»). I need to run QtCreator from terminal but I can’t locate the executable. I’m using Ubuntu 16.04.
@Arpit I used Qt Installer downloaded from their Website I didn’t use the package installer with apt-get. QtCreator is a deprecated package.
@underscore_d I used Qt Installer downloaded from their Website I didn’t use the package installer with apt-get. QtCreator is a deprecated package.
@C.Xammar Expected qt location will be:»/opt/qt-director name» move in that folder then run ./qtcreator.
4 Answers 4
Probably you can find the executable in opt directory the location will be as this /opt/Qt/Tools/QtCreator/bin and you can run it through terminal as ./qtcreator
Latest QtCreator should by default be installed in
And you have two start-up options, the executable qtcreator or the shell script qtcreator.sh
To run the executable, type
~/Qt/Tools/QtCreator/bin/qtcreator
To run the shell script, type
~/Qt/Tools/QtCreator/bin/qtcreator.sh
Whic one to use: From the top portion of qtcreator.sh , it states that if you have library name conflicts (such as having same library names used by qtcreator with your own LD_LIBRARY_PATH ), you may want to start with the shell script, rather than the bare executable.
Windows linux subsystem users
In case you have ubuntu as a subsystem for win10, it’s located in your AppData folder (installing with sudo apt install command): Also, you cannot run qtcreator from terminal as graphical interface is not supported by defeault. You need to instal X-server app first (https://sourceforge.net/projects/xming/) and then you can run QT from terminal.
C:\Users\[YOUR_USERNAME]\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\rootfs\usr\share\qtcreator
Or, it’s in usr/lintian/overrides
But you should not modify anything inside this linux root, as it may lead to data loss.