Как установить qt offline
Перейти к содержимому

Как установить qt offline

  • автор:

Name already in use

If nothing happens, download GitHub Desktop and try again.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching Xcode

If nothing happens, download Xcode and try again.

Launching Visual Studio Code

Your codespace will open once ready.

There was a problem preparing your codespace, please try again.

Latest commit

Git stats

Files

Failed to load latest commit information.

README.adoc

Non-interactive Qt Installer

This project is discontinued.

Since Qt installer requires users to sign in, this project no longer works. Yes, I suppose it can be fixed, but I will not do that.

I recommend switching to qt-downloader by engnr which simply downloads and extracts packages from Qt repositories, eliminating need for using online installer. At the time I have checked it for the last time, it was not capable of installing additional modules (like Web Engine), but this is something what can be done easily — just fork or download that script, edit it, remove CLI arguments parsing, and hardcode exactly what you want.

If you are using GitHub Actions, you may also take a look at install-qt-action by jurplel. It looks very promising.

Moreover, this thread in Qt bug tracker may reveal other approaches: https://bugreports.qt.io/browse/QTIFW-166.

Finally, if you see value in online installer scripting, then you can take over this project. Either fork it or contact me via issues. Be informed though that occasionally (let’s say, every few months) Qt team updates their installer in a way that requires this script to be updated.

This repository contains a collection of scripts which automate Qt installation from official unified online installers. It is designed with CI/CD services in mind, and tested in Travis CI.

Windows, MacOS, and Linux systems are supported. Note that GUI capabilities are required — it’s just an automation script, which iterates through install wizard screens. That implies that X Window System is needed to run the script on Linux. Xvfb should do the trick on headless servers (see .travis.yml ).

Tip: Use .travis.yml as an example.

Step 1: Choosing online installer

Decide which online installer should be used. They all are listed here: https://download.qt.io/official_releases/online_installers/.

Step 2: Finding Updates.xml

Obtain identifiers of components which will be installed. The easiest way to do so is to seek them in proper Updates.xml file, which is located at URL like:

Because of odd naming format, it is suggested to crawl subdirectories starting from https://download.qt.io/online/qtsdkrepository.

For example, for Windows installer and Qt 5.12.3, respective Updates.xml is located at https://download.qt.io/online/qtsdkrepository/windows_x86/desktop/qt5_5123/Updates.xml. Note that windows_x86 here is matching the installer name ( qt-unified-windows-x86-online.exe ), not necessarily the target platform architecture — this file describes packages for x64 platforms as well.

Step 3: Finding package identifiers

The Updates.xml files contain identifiers of all packages that online installers can handle.

For example, in order to install Qt 5.12.3 on Windows for MSVC 2017 64-bit compiler, the appropriate identifier is qt.qt5.5123.win64_msvc2017_64 , as it is defined in https://download.qt.io/online/qtsdkrepository/windows_x86/desktop/qt5_5123/Updates.xml. And for Qt WebEngine package, the identifier is qt.qt5.5123.qtwebengine . Note that there is also a package qt.qt5.5123.qtwebengine.win64_msvc2017_64 — you should skip it, as well as any other package which has a non-empty <AutoDependOn> element. These are selected automatically, depending on your other choices.

Step 4: Creating configuration script

Having learned package identifiers, create a configuration file, which in fact is a piece of JavaScript with two global variable definitions: InstallComponents with a list of package identifiers and InstallPath with installation path. For example:

Как установить qt offline

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.

Qt installer, account

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):

Windows 10 SDKs

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:

Qt Creator installer, connection

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:

Qt Creator installer, no connection

Qt Creator installer, no connection

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:

Qt Creator installer 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:

Qt Creator, link installation

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:

Qt Creator, kit is missing debugger

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:

Qt Creator, kit has wrong compiler

And if everything is good, then the kit won’t have any yellow/red warnings/errors:

Qt Creator, kit is ok

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:

The Qt Company confirms blocking russian IP addresses

The Qt Company confirms blocking russian IP addresses

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.

Установка Qt под Visual Studio, MinGW и для разработки под Android

Подготовка для работы с компилятором Visual Studio

Раздел «Обновление и безопасность»

Вкладка «Для разработчиков»

Выбор настроек Visual Studio

Смена языка Visual Studio

Изменение пакетов Visual Studio

Удаление русского языка и установка английского языка в Visual Studio

Подготовка для программирования под Android

Ошибка при использовании Java 12

Открытие SDK Manager

Открытие SDK Manager

Выбор NDK

Диалоговое окно для подтверждения установки

Процесс установки

Открытие SDK Manager

Страница скачивания Qt

Страница скачивания Qt

Скачивание online установщика

Скачивание online установщика (второе окно)

Скачивание offline установщика

Начальное окно установки

Ввод данных учетки

Приветственное окно установки

Процесс сбора информации о сборках

Выбор папки для установки

Выбор компонентов для установки

  • MSVC — это компилятор под Visual Studio. Например, MSVC 2017 64 bit означает версию компилятора по Visual Studio 2017 в виде 64-битной версии. Выбирайте пакеты согласно вашей версии Visual Studio и битности операционной системы.
  • UWP — это версия пакета под компилятор Visual Studio для написания универсальных приложений Windows 10
  • MinGW — компилятор MinGW для написания десктопных приложений. Для работы с ним не нужно ничего дополнительного устанавливать, как с другими пакетами.
  • Android ARMv7 и Android x86 — позволят компилировать приложения под Android на разных семействах процессоров.
  • Sources — Если вам нужны исходники классов Qt библиотек, то выбирайте этот пункт.

Выбор компонентов для установки

Выбор компонентов для установки

Выбор компонентов для установки

Соглашение с условиями

Выбор названия в меню Пуск

Окно перед установкой

Процесс установки

Выбор пункта меню Параметры

Выбор английского языка для интерфейса

Интерфейс теперь на английском

Папки с скомпилированными проектами

Изменение пути для компиляции проектов

Измененный путь для компиляции проектов

Настройка для работы с компилятором Visual Studio

Сообщение об ошибке

Сообщение об ошибке

Настройка для программирования под Android

Настройки Qt

Параметр Android SDK Location

Параметр Android SDK Location

Параметр Android NDK Location

Параметр Android NDK Location

Удаление Android SDK Build-Tools 29

Установка Android SDK Build-Tools 28

Установка Android SDK Build-Tools 28

Старая версия NDK

Старая версия NDK в настройках Qt

Создание нового проекта

Выбор шаблона проекта

Выбор названия проекта и его расположения

Выбор системы сборки проекта

Выбор версии QML

Выбор компиляторов

Окончание создания проекта

Выбор компилятора MinGW

Запуск проекта

Запущенное приложение

Выбор компилятора Visual Studio

Ошибка при компиляции проекта

Запущенное приложение

Выбор компилятора под Android

Выбор эмулятора

Запущенное приложение

Выбор компилятора для UWP приложений

Запущенное UWP приложение

Ошибка с приложениями UWP

Изменение параметра «Display right margin at column»

Создание нового стиля кода для Qt Quick

Ввод названия нового стиля кода

Изменение количество пробелов для отступа

Создание нового стиля кода для C++

Ввод названия нового стиля кода

Изменение количество пробелов для отступа

Команда CopyLineDown

Конфликт в горячих клавишах

Удаление комбинации клавиш у команды DeleteSelectedElements

Отсутствие конфликта в горячих клавишах

Изменение шрифта

Стандартный шрифт

Шрифт Roboto Mono

Настройка автосохранения<ul><li>Qt logo 2016.svg by Qt Project / (2019-01-26)</li></ul>

Получить и установить Qt

Qt Online Installer дает вам возможность установить только те модули и инструменты,которые необходимы для разработки на определенной настольной платформе,и запускать свои приложения на одной или нескольких настольных платформах,мобильных или встраиваемых устройствах,или MCU.

1.Создайте учетную запись Qt

Для начала создайте учетную запись Qt . Эта учетная запись дает вам доступ к веб-порталу, где вы можете управлять своими лицензиями, а также доступ к форумам и вики. Кроме того, убедитесь, что вы прочитали страницу лицензирования Qt относительно выбранной вами лицензии.

2.Загрузите программу установки

Перейдите на страницу загрузки вашей учетной записи Qt.Выбрав подходящий унифицированный онлайн-установщик Qt для вашей ОС,вы можете установить коммерческие или открытые версии Qt,инструменты разработки и другие компоненты.Программа установки запрашивает учетные данные вашей учетной записи Qt.Программа установки получает с сервера лицензию,привязанную к учетной записи,и предоставляет список доступных компонентов,соответствующих этой лицензии.

3.Установите Qt

Для завершения установки выберите компоненты,которые вы хотите установить,и следуйте инструкциям программы установки.

Вы должны выбрать хотя бы одну версию Qt для одной платформы,на которой вы хотите запускать свои приложения.Например,если вы установили Microsoft Visual Studio 2019 на 64-битную Windows,вы можете выбрать MSVC 2019 64-bit под версией Qt,с которой вы хотите разрабатывать.

Однако самый простой способ установить Qt для разработки настольных систем-это выбрать установку по умолчанию.Дополнительные модули можно установить позже.

Если вы также хотите запускать свои приложения,например,на устройствах Android,вам следует выбрать пользовательскую установку,а затем выбрать версию Qt для Android в списке компонентов в дополнение к Qt для вашей настольной платформы.

В следующей таблице приведены примеры того,какие компоненты необходимо установить в зависимости от платформ,на которых вы хотите запускать свои приложения.

Развивать для Choose
Desktop Default installation.
Mobile Devices Пользовательская установка с Qt для вашей ОС и платформы мобильного устройства, на которой вы хотите запускать приложения. Например, Qt для Android или Qt для iOS .
Embedded Devices Выборочная установка с необходимыми модулями и наборами инструментов Qt из раздела Qt для создания устройств , в зависимости от типов устройств, на которых вы хотите запускать приложения.
Automotive Выборочная установка с необходимыми модулями и наборами инструментов Qt из раздела Qt для создания устройств , в зависимости от типов устройств, на которых вы хотите запускать приложения.
Automation Выборочная установка с необходимыми модулями и наборами инструментов Qt из раздела Qt для автоматизации , в зависимости от типов устройств, на которых вы хотите запускать приложения.
MCUs Выборочная установка с Qt для микроконтроллеров .

Чтобы проверить требования к платформе, см. Поддерживаемые платформы .

Следующее видео на YouTube дает полный обзор процесса установки:

Как только Qt будет установлен,вы можете использовать Maintenance Tool under <install_dir> для добавления компонентов,обновления или удаления установленных компонентов.

Getting Help

Пользователи ознакомительных версий и программ с открытым исходным кодом могут получить помощь на форуме Qt . См. также справку по использованию вики-страницы Форума .

Некоммерческие пользователи могут получить ограниченную помощь в процессе установки через службу поддержки Qt .

Основным каналом поддержки для коммерческих клиентов является их учетная запись Qt .

4.Создание приложений

После установки открывается Qt Creator . Вы можете использовать шаблоны мастера проектов, чтобы начать создавать приложения, работающие на выбранной вами платформе.

Если вы хотите разработать Qt Quick UI, откройте Qt Design Studio и используйте там шаблоны мастера проекта.

Русские Блоги

Возможно, начиная с 5.15, больше не поддерживает автономную установку. Если вам нужно установить офлайн, вам может потребоваться купить коммерческую версию.

Затем мы установим его онлайн бесплатно.

Скачать адрес установки строки

Откройте адрес, чтобы выбрать QT-Unify-Windows-x86-online.exe 03-NOV -2020 13:34 22M

Просто загрузите его.

5.15.2 Установка

1. Бегите напрямую qt-unified-windows-x86-online.exe 。


2. Введите номер учетной записи и пароль, нажмите Don` Не Accout? Зарегистрируйтесь, если нет
3. Заполните пароль учетной записи и нажмите Next

4. Вот выбор компонентов в соответствии с вашим собственным проектом разработки.

Pure QT-программирование выбирает Mingw 8.1.0 32-битный и Mingw 8.1.0 64-бит

Мы используем компилятор VS2019, который мы выбираем, 32-бит MSVC 2019 и MSVC 2019 64-бит

5. Выберите его, нажмите Next , После установки установки, все будет в порядке.

Следуйте нашей публичной учетной записи WeChat: Qtkaifa Name Development, регулярно обновляйте некоторые знания о разработке QT и интересные вещи.

Или сканировать код: пожалуйста, распознайте разработку QT

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *