4

I'm running this in folder with main.qml qmlscene main.qml qmlscene: could not find a Qt installation of ''

Then I checked

qtchooser -list-versions
4
5
qt4-x86_64-linux-gnu
qt4
qt5-x86_64-linux-gnu
qt5

and try

sudo qmlscene -qt=qt5-x86_64_linux-gnu main.qml
qmlscene: could not find a Qt installation of 'qt5-x86_64_linux-gnu'
1
  • Where is it located? Have you tried using the full path or just qt5? Commented Aug 7, 2018 at 17:45

1 Answer 1

0

I was unable to run qmlscene on a new Ubuntu 22.04 jammy system recently.

First I ran into this error:

qmlscene: could not find a Qt installation of ''

Then after some series of further apt commands, I eliminated that error but landed on an even longer one:

plugin cannot be loaded for module "QtQuick.Controls": Cannot protect module QtQuick.Controls 2 as it was never registered

The apt packages that I had installed were:

qtbase5-dev
qtchooser
qt5-qmake
qtbase5-dev-tools
qtcreator

When I used which to query where qmlscene was being launched from, I saw that it was a symlink to the qtchooser utility:

ls -l /usr/bin/qmlscene
lrwxrwxrwx 1 root root 9 Mar 22  2020 /usr/bin/qmlscene -> qtchooser

Ultimately, I found a solution that is working for me (on Ubuntu 22.04 jammy, as I mentioned).

I had to edit /usr/share/qtchooser/qt5-x86_64-linux-gnu.conf so that qtchooser would select Qt5 binaries from a special install directory of my own creation.

I installed Qt5 into my own chosen directory, using the unofficial installer AQT. https://github.com/miurahr/aqtinstall

Here is my AQT invocation:

python3 -m aqt install-qt --base http://ftp.fau.de/qtproject --outputdir /opt/repositories/Qt_desktop linux desktop 5.15.0 --archives icu qtbase qtconnectivity qtdeclarative qtgraphicaleffects qtimageformats qtquickcontrols qtquickcontrols2 qtsvg qttools

(I also have scripted it here: https://github.com/219-design/qt-qml-project-template-with-ci/blob/master/tools/ci/get_qt_libs.sh )

Here is the new content of /usr/share/qtchooser/qt5-x86_64-linux-gnu.conf:

/opt/repositories/Qt_desktop/5.15.0/gcc_64/bin
/opt/repositories/Qt_desktop/5.15.0/gcc_64/lib
#/usr/lib/qt5/bin
#/usr/lib/x86_64-linux-gnu

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .