mafulechka
mafulechkaFeb. 21, 2020, 5:03 a.m.

Qt can now be moved!

Since version 5.14.0 Qt is roamable , i.e. you can move your Qt installation to another directory without breaking functionality or loading plugins.


What does this mean to me?

Let's move on to the role of the Qt Build Master in a Windows project. You are the one who knows all the argument settings by heart. You know which optimization screw to turn and which unnecessary feature to turn off.
Your build of Qt is perfectly tailored to the project, and you provide a zip file containing the Qt installation.

configure -prefix C:/Qt/5.12.6 ...more options...
jom
jom install
zip -r X:\shared_stuff\qt-5.12.6.zip C:\Qt\5.12.6

Then your teammates extract the archive to the same location and everything works great.
Now, for whatever reason, Joe Developer must unpack the Qt installation into some other drive/directory.
Qt does not work in this other directory. QMake will not work properly. Plugins cannot be loaded. Qt assets not found.

Why is everything broken?

Historically, the Qt configuration has embedded the installation directory in the qmake executable and the Qt5Core library. The logic in QLibraryInfo tries to find plugins, assets, and mkspecs under a hard-coded prefix, which is always what you passed in for configuration with the -prefix argument.

Does moving the installation directory work in Qt 5.14?

Oh yeah! Starting with Qt 5.14.0, the installation prefix can be automatically determined by the location of the Qt5Core library or the executable itself, without using hardcoded paths.
This automatism is controlled at the time Qt is configured via the move function .
This feature is enabled by default for non-static builds of Qt.
If you need a relocatable static assembly, enable this feature manually:

onfigure -static -feature-relocatable ...

The caveat about relocatable static assemblies is that Qt's internal translations are not handled automatically.
You will need to deploy the Qt translation files along with your application.
This difference from a non-relocatable assembly is the reason why relocation is disabled by default for static assemblies.

If I don't like it, can I turn this feature off?

Of course you can.

configure -no-feature-relocatable ...

will return the old behavior.
For example, Linux distributions do not need relocatable Qt and may disable this feature.

We recommend hosting TIMEWEB
We recommend hosting TIMEWEB
Stable hosting, on which the social network EVILEG is located. For projects on Django we recommend VDS hosting.

Do you like it? Share on social networks!

Comments

Only authorized users can post comments.
Please, Log in or Sign up
AD

C ++ - Test 004. Pointers, Arrays and Loops

  • Result:50points,
  • Rating points-4
m

C ++ - Test 004. Pointers, Arrays and Loops

  • Result:80points,
  • Rating points4
m

C ++ - Test 004. Pointers, Arrays and Loops

  • Result:20points,
  • Rating points-10
Last comments
ИМ
Игорь МаксимовNov. 22, 2024, 9:51 p.m.
Django - Tutorial 017. Customize the login page to Django Добрый вечер Евгений! Я сделал себе авторизацию аналогичную вашей, все работает, кроме возврата к предидущей странице. Редеректит всегда на главную, хотя в логах сервера вижу запросы на правильн…
Evgenii Legotckoi
Evgenii LegotckoiOct. 31, 2024, 11:37 p.m.
Django - Lesson 064. How to write a Python Markdown extension Добрый день. Да, можно. Либо через такие же плагины, либо с постобработкой через python библиотеку Beautiful Soup
A
ALO1ZEOct. 19, 2024, 5:19 p.m.
Fb3 file reader on Qt Creator Подскажите как это запустить? Я не шарю в программировании и кодинге. Скачал и установаил Qt, но куча ошибок выдается и не запустить. А очень надо fb3 переконвертировать в html
ИМ
Игорь МаксимовOct. 5, 2024, 4:51 p.m.
Django - Lesson 064. How to write a Python Markdown extension Приветствую Евгений! У меня вопрос. Можно ли вставлять свои классы в разметку редактора markdown? Допустим имея стандартную разметку: <ul> <li></li> <li></l…
d
dblas5July 5, 2024, 8:02 p.m.
QML - Lesson 016. SQLite database and the working with it in QML Qt Здравствуйте, возникает такая проблема (я новичок): ApplicationWindow неизвестный элемент. (М300) для TextField и Button аналогично. Могу предположить, что из-за более новой верси…
Now discuss on the forum
Evgenii Legotckoi
Evgenii LegotckoiJune 25, 2024, 12:11 a.m.
добавить qlineseries в функции Я тут. Работы оень много. Отправил его в бан.
t
tonypeachey1Nov. 15, 2024, 4:04 p.m.
google domain [url=https://google.com/]domain[/url] domain [http://www.example.com link title]
NSProject
NSProjectJune 4, 2022, 12:49 p.m.
Всё ещё разбираюсь с кешем. В следствии прочтения данной статьи. Я принял для себя решение сделать кеширование свойств менеджера модели LikeDislike. И так как установка evileg_core для меня не была возможна, ибо он писался…
9
9AnonimOct. 25, 2024, 6:10 p.m.
Машина тьюринга // Начальное состояние 0 0, ,<,1 // Переход в состояние 1 при пустом символе 0,0,>,0 // Остаемся в состоянии 0, двигаясь вправо при встрече 0 0,1,>…

Follow us in social networks