Having to build Musescore from sources, I try to install the dependencies. Far from simple. I could not find any documentation on Fedora’ s way related to Qt. (No qt5-default
package typically)
First, qmake
is nowhere to be found. Looks like all Linux distributions uses qmake-qt5
. Fine, but they provide a qt5-default
package that solve the issue. Except Fedora.
I installed qtchooser
. But you cannot run qtchooser
that easily. You have to logout/login or source /etc/profile.d/qtchooser.sh
. Only then can you run it.
qtchooser -print-env
QT_SELECT="default"
QTTOOLDIR="/usr/lib64/qt4/bin"
QTLIBDIR="/usr/lib64/qt4"
Why does it default to Qt4? How can I set the default? Let’s play …
I already ran alternative
but that was before installing qtchooser
(it was not in the dependencies). Now after installation:
alternatives --list | grep ^qt
qtchooser-default auto /etc/xdg/qtchooser/4.conf
qtchooser-4 auto /etc/xdg/qtchooser/4-64.conf
qtchooser-5 auto /etc/xdg/qtchooser/5-64.conf
Looks good. Now remember alternative
syntax …
sudo alternatives --config qtchooser-default
and you can select Qt5 ! Great.
This is better:
> qtchooser -print-env
QT_SELECT="default"
QTTOOLDIR="/usr/lib64/qt5/bin"
QTLIBDIR="/usr"
And now:
> which qmake
/usr/lib/qtchooser/qmake
> qmake -version
QMake version 3.1
Using Qt version 5.15.2 in /usr/lib64
Glad I am using toolbox to isolate all this packages.
Note: I googled and looked at lots of resources. It is not uncommon that people just abandon or strongly advice to remove Fedora packages and install directly from Qt installer. That is not an issue to me, but at least it should be documented. That would help.
2 Likes
I guess @ngompa - may be the expert to help you.
Also, I had qt-devel
in the dependencies and it is the one that brought Qt4. Now I will try without qtchooser
. Maybe it is only required when the 2 versions are present.
As usual I had multiple issues. Another one was cmake finding that QT_VERSION: usr
… and some other strange things, but I override the BUILD_FOLDER and that was OK.
My main concern is not finding a documentation for QT development. I vaguely remember there was a web site for development, kind of portal for PHP, Ruby … but I cannot find it anymore.
First of all: I don’t have marketing-contracts with the publishers.
The online documentation of Qt is good for looking up something, for example the standard library is well explained and can be integrated into the Qt-creator, but it is not suitable for learning.
A training provider I know recently had built his entire course on the Qt- online documentation and it was quite a failure.
I learn from books. At Packt, you can look into the books for very little money. There is a lot available for Qt. Unfortunately, I can’t find my way around my device at the moment, but I’ve read a book with many examples covering graphical log-in screens and things like that. Such things are easily done with Qt.
Languages & databases — Fedora Developer Portal another day another Google … but no Qt here. (And maybe some clean up would be required https://devassistant.github.io/ …)
Other, tests show that if qtchooser
is not installed (and sourced) you need to manually add qmake to the path. export PATH=$PATH:/usr/lib64/qt5/bin
=> Build and run successful !
But it gives some curious indications:
Using Qt version 5.15.2 in /usr/lib64
-- QT_LOCATION: /usr
-- QT_VERSION: lib64
-- QT_COMPILER: qt5
I guess it expects Qt to be installed in /opt
from Qt, with a fixed directory structure and not anything else. Not Fedora fault obviously, but what to expect, how to mitigate, that would be useful to document … 