Getting Started with Qt
You can install the Qt Framework and tools by using an online or offline installer, or by building the source packages yourself.
The installers allow you to download and install the following components:
- Qt libraries, prebuilt for a particular development platform (operating system and compiler)
- Qt Creator integrated development environment (IDE)
- Reference Documentation and examples
- Qt in source code form (needed only if you want to build the framework and tools yourself)
- Add-On components that are relevant for different platforms
Online Installation
In the online installer, you can select commercial or open source versions of Qt, tools, and Add-On components to install. Using the online installer requires signing in to your Qt Account. The installer retrieves the license attached to the account from a server and provides a list of available components corresponding to the license.
The online installer is available from the Qt Downloads page.
Offline Installation
An offline installer is a single package that contains all of Qt and Add-Ons relevant for a target platform. Users with a commercial license can either sign in with their Qt account or with their Qt license key during the installation process. The license key is available in the Qt Account Web portal.
The offline installer is available here.
Installation Process
To run the installer, you need a Qt Account. You can use your Qt Account credentials to sign-in to all Qt services, including the forums and wiki. If you do not already have a Qt Account, you can create one during the installation process.
To complete the installation, select the components that you want to install and follow the instructions of the installation program.
The following YouTube video gives a complete walk-through of the installation process:
Updating or Removing Qt
Once Qt is installed, you can use the Maintenance Tool under <install_dir> to add components and to update or remove installed components.
Platform Requirements
Specific requirements and instructions for developing applications on different platforms are covered in the platform pages.
For more information, visit the supported platforms page.
Create Your First Applications
Learn the basics of Qt and Qt Quick development by following the two tutorials below that illustrate how to create simple applications and build and run them on target platforms:
Qt Widgets provides a library of UI elements which allow you to create classic desktop-style user interfaces. Qt Quick is a library providing types and functionalities for building modern, fluid, animated UIs.
For a more thorough walkthrough of the different aspects of developing applications with Qt 5, see the QML Book. It focuses on Qt Quick, but also provides the information needed to use QML together with C++.
Explore Qt
We invite you to explore the rest of Qt. We prepared overviews which help you decide which APIs to use and our examples demonstrate how to use them.
To view a list of all Qt examples, visit the List of Qt Examples page.
Setting Up Projects
Developing with Qt Creator
Reference Documentation
-
— list of topics about application development — code samples and tutorials — a listing of C++ and QML APIs
Qt Project Community
Qt’s vibrant and active community site, http://qt.io houses a wiki, a forum, and additional learning guides and presentations.
© 2022 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.
Где теперь взять offline установщик Qt5 под Linux?
Друзья, вопрос актуальный, начиная с февраля-марта этого года: где теперь взять offline установщик Qt5.15+ (ну или Qt6, чего уж там) под Linux (Debian, Ubuntu, Mint)?
Вариант со сборкой из исходников оказался для меня пока что неподъемным: где-то допускаю ошибку и в итоге классы в проекте обозначаются как неизвестные, а WebEngine вообще не собрался, ругнувшись: could not find all necessary libraries for qpa-xcb support in qtwebengine , кроме того ругался после make install еще чем-то «не могу создать каталог такой-то: отказано в доступе» и т.п. . (собирать из исходников пытался под свежей Mint, клонируя из репозитория по инструкции Building_Qt_5_from_Git).
Вариант установить через snapd подкупал своей простотой (казалось бы, всего-то нужно: включить поддержку snaps, переместив файлик nosnap.pref куда-нибудь в HOME), однако после установки snapd и запуска соответствующей команды на установку снапа qt515-core20, он вроде установился, но куда — обнаружить не удалось, даже через Qt Creator. Видимо, снова не тот путь.
Собственно, вопрос актуальный в нашей стране со времен Чернышевского, а может и до него: что делать? Если есть проверенные идеи и пошаговые инструкции по поиску/установке Qt5.15+ (ну или Qt6, чего уж там) — you are welcome!
Installing Qt without installer
At some point (beginning of 2020 year) Qt installer started to require users to have Qt Account (again), otherwise you can’t proceed with the installation. More details in the Qt’s official blog post.
That’s something that already happened before, but back then community got really mad about it, so The Qt Company reverted that, and installer started to work without Qt Account. And now they fucking did it again, and apparently this time community wasn’t that mad (or there is nothing left of that community after all the stunts The Qt Company has been pulling over the past years).
Anyway, I won’t tolerate such anal-probing, so The Qt Company (or rather its management) can go fuck itself, and I’ll be just building Qt from sources — it’s not that scary as it sounds.
In the very same blog post The Qt Company stated that LTS releases will be only available to commercial users, so The Qt Company can go fuck itself twice at this point. But don’t even trip, dawg, as we’ll still be able to build LTS releases from sources without Qt Account and/or commercial license. Aw, geez!
Just to clarify and to TLDR the article: it’s not about pirating the binaries, it’s not about some hack or anything shady at all — everyone can get the Qt sources and build whatever version they want. And certainly, you’ll still need to comply with GPL/LGPL terms (depending on components that you’ll be using).
Getting the Qt sources
Clone Git repository
Go to the Qt’s Git repository. Find the latest (or whichever you need) release — it’s hard not to notice that branches match releases, so 5.15.2 branch is the latest release at the moment (03.12.2020).
That’s not the entire source code just yet, as Qt is divided into modules and first you need to initialize/download them. This is done with init-repository Perl script, so you’ll need to have Perl installed and available in your PATH .
By default it will initialize a lot of modules ( essential , addon , preview , deprecated ), and it will take quite some disk space (and time) to initialize all of them. Here’s the full list of default modules (the script prints it out):
I don’t want preview , deprecated and obsolete groups, and also I don’t want quite a lot of some other stuff, so I ran it like this:
It took 40 minutes (with my 3 MB/s connection) and 3 GB to initialize such a list. Be sure to check it in case you might actually need some modules which I excluded here.
Download source package
Or you can just get a source package ZIP archive from the download page. That will be actually much faster, and even though you can’t choose modules here, later you’ll be able to skip building unwanted modules with -skip option ( -skip qtwebengine , -skip qtactiveqt , -skip qt3d and so on).
Building Qt from sources
Now when you have the sources, you can just build Qt and get the same binaries that are installed using installer.
I’ll describe the process for Windows 10 and Visual Studio 2019 / MSVC 142 (assuming that you have all that), but it will be almost the same with different toolchains and on other platforms too.
5.x with qmake
Let’s say you have downloaded/cloned sources to d:\programs\qt\src\5.15.2 and you would like to install Qt to d:\programs\qt\5.15.2 . Open x64 Native Tools Command Prompt for VS 2019 and there:
Choose and accept Open Source license terms (if you do accept those) and wait for the configuration to finish. Note that this will give you release build, so don’t forget to set your projects to release configuration too. Also be aware that by default Qt is built for dynamic linking, and if you need static linking, then you need to add -static option too.
By the way, I have a more detailed article about building static Qt from sources, although the only difference there is basically just this -static option.
Anyway, once it’s configured, run the build and then install using jom (you do have jom, don’t you):
It took about 1 hour to build and 10 minutes to build and install the binaries. The resulting size of the installation folder ( d:\programs\qt\5.15.2 ) is 143 MB.
Out of curiosity, I also built Qt with sources from source package ZIP archive and the same configuration options (so it built also all the stuff that I excluded with modules), and there it took a bit longer than 1 hour and resulted in 193 MB of installation folder. So actually simply downloading the source package and keeping all the modules can save you quite some time, and 50 MB of difference doesn’t seem to be significant enough to not to do so.
6.x with CMake
Starting with Qt 6, you can build it with CMake. The process is almost the same as with qmake. I tried it with Qt 6.0.1 (downloaded to d:\programs\qt\src\6.0.1 ).
At first I wanted to see if I can now run everything from Git BASH:
and that failed:
After a brief googling I found that Visual Studio 16 2019 generator is not supported. I’ve set it here because otherwise by default with Ninja it discovers Clang toolchain, which I also have in my environment, but I want to build Qt with MSVC toolchain.
And while I could’ve tried to set cl.exe for CMAKE_C_COMPILER and CMAKE_CXX_COMPILER explicitly, I decided not to and just switched back to x64 Native Tools Command Prompt for VS 2019. There MSVC toolchain is detected just fine:
Apparently, -nomake tools is not implemented yet (or was renamed), but that’s okay-ish. The configuration successfully completes, though with some more warnings:
So, first of all Desktop OpenGL is not detected, which is a bit concerning, as I seem to remember that it should be. However, having built and run a couple of Qt Quick application, I didn’t see any issues.
Then BUILD_qtwebengine is ignored, so does it mean that WebEngine will be also built? How does one disable it then?
And finally, QDoc and lupdate will not be compiled, but that’s also a minor issue.
Let’s run the build and install now:
For me that took 1 hour and resulted in 159 MB of installation folder ( d:\programs\qt\6.0.1 ). So WebEngine wasn’t built after all.
Failed pcre2_jit_compile.c.obj, oaidl.h
If your build fails with something like this:
Then perhaps you have an “old” Windows 10 SDK installed. In my case it was 10.0.17763 , so I deleted that one and installed 10.0.18362 instead (using Visual Studio Installer):
It might be a good idea to reboot the system just in case before starting a new build.
Alternatively, perhaps, you can get PCRE2, make it visible to Qt configuration and pass -system-pcre . Or maybe even configure Qt without PCRE ( -no-pcre ).
Using your own Qt build
This is it, you can already use this your very own Qt distribution to build your projects.
With CMake and bare CLI
I have an article about that already, but there it’s more about CMake and Visual Studio Code, so here will be a shorter CLI-only version.
Be aware that with Qt 6 you might need to explicitly set Ninja as your generator (and help it discover cl.exe ), otherwise it might fail with the same error as on configuring/building the Qt itself.
Say, you have some Qt Quick project with CMake and the following CMakeLists.txt :
Configure and build the project:
So it’s all good: CMake found your Qt installation and successfully built the project.
But you might, however, get the following error:
Try to re-configure the project with explicitly set x32/x86 architecture:
If that works fine, then it means that you built Qt in x86 Native Tools Command Prompt, so your Qt build is x32/x86. If you need x64, then you’ll need to build Qt again, but this time in x64 Native Tools Command Prompt.
In Qt Creator
Most likely you’ll want to use your Qt build in Qt Creator.
Install Qt Creator
The Qt Creator installer is also available at the official download page. Good news that installer does not require Qt Account (yet?). Actually, it does, but only if it discovers internet connection — it that case the first installer view looks like this at the moment:
So you can just disconnect from the internet or block any network access for the installer before launching it, and then the first view will look like this:
So you’ll be able to proceed without Qt Account.
And if you are brave enough, you can of course build it from sources as well.
If you, like me, are using MSVC toolchain and CDB, then it is important to check CDB Debugger Support and Debugging Tools for Windows components:
Add a new kit
First time you launch Qt Creator, it will suggest you to “link” existing Qt installation, which is nice. But what does it actually want — I have no fucking idea, because when I pointed it to my Qt build, it didn’t enable Link with Qt button:
To hell with this thing then.
Just in case, note that I’ve updated the Qt paths in my system after adding a section about Qt 6, so now I have two Qt versions, but screenshots below still point to old paths. The screenshots also have 5.12.2 version, but that’s just a typo — it should be 5.15.2 there.
Open Qt Creator settings, go to Kits and there to Qt Versions. Add your Qt build here (you’ll need to provide path to d:\programs\qt\VERSION\bin\qmake.exe ). Click on Apply button, otherwise versions list on the Kits tab won’t have it.
Now go to Kits tab and add a new kit. Select your Qt version, C and C++ compilers (in my case it’s amd64 variant) and debugger ( CDB ). If you haven’t installed CDB Debugger Support and Debugging Tools for Windows, then you won’t have CDB option available.
If you won’t set debugger, you’ll get a yellow warning. To get details about what’s wrong, hover your mouse over it and there will be a pop-up tooltip with some explanation:
Despite it’s just a warning, you nevertheless won’t be able to select this kit in your projects.
If you’ll set a wrong compiler, then you’ll get a red error and the following explanation in the pop-up tooltip:
And if everything is good, then the kit won’t have any yellow/red warnings/errors:
So here you’ve got a perfectly splendid Qt installation without using the installer and creating Qt Account. And The Qt Company’s management can go fuck itself for the third time now.
Updates
03.03.2022
The Qt Company has blocked installing Qt from installer and logging-in to Qt Account using russian IP addresses.
So far this has been mentioned only in this thread on Qt forum and also in comments under Qt Design Studio 3.1 Released blog post. Company representatives confirmed the blocking:
So reporting bugs and editing wiki will become unavailable too? It’s strange that posting on forum is still available, as it is also tied to Qt Account, but perhaps they used VPN.
What an unexpected way for this article to suddenly become more in demand.
Offline Qt Downloads
We recommend you use the Qt Online Installer for first time installations and the Qt Maintenance Tool for changes to a current install.
- Qt6 source packages
- 5.15.x source packages
- 5.12.x Offline Installers
- Qt Creator
- Other downloads
- Pre-releases
Qt6 Source Packages
Qt 6.4.2 Source Packages:
The source code is available:
- For Windows users as a single zip file (1.1 G) ( Info )
- For Linux/macOS users as a tar.xz file (703 MB) ( Info )
You can get split source packages from here. Or visit the repository at code.qt.io.
Qt 6.2.4 Source Packages:
The source code is available:
- For Windows users as a single zip file (1.0 G) ( Info )
- For Linux/macOS users as a tar.xz file (631 MB) ( Info )
You can get split source packages from here. Or visit the repository at code.qt.io.
Older Qt Versions
All older versions of Qt are available in the archive .
Qt 5.15.x Source Packages
The source code is available:
- For Windows users as a single zip file (962 MB) ( Info )
- For Linux/macOS users as a tar.xz file (560 MB) ( Info )
You can get split source packages from here. Or visit the repository at code.qt.io.
5.12.x Offline Installers
Qt offline installer is a stand-alone binary package including Qt libraries and Qt Creator.
Source packages & Other releases
The source code is available:
- For Windows users as a single zip file (831 MB) ( Info )
- For Linux/macOS users as a tar.xz file (486 MB) ( Info )
You can get split source packages from here. Or visit the repository at code.qt.io.
Qt Creator
Qt Creator 9.0.2 is released and it is available via Qt online installer. If you need a standalone installer, please select the file according to your operating system from the list below to get the latest Qt Creator for your computer.
The source code is available as a zip (70 MB) ( Info ) or a tar.gz (58 MB) ( Info ). Or visit the repository at code.qt.io.
Be sure to check if Qt is supported on your platform and read the installation notes that are located in the Qt Documentation .
Please check the individual downloads for licensing information.
Pre-releases
Looking for Qt 6.5 Beta? Packages are available in Qt Online Installer. Additionally source packages are available here.