qmlsceneでQtインストールが見つかりません。

qmlsceneでQtインストールが見つかりません。

main.qml qmlscene main.qml qmlscene: 「Qt インストールが見つかりません」フォルダーで実行します。

それから確認しました。

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

そして試してみてください

sudo qmlscene -qt=qt5-x86_64_linux-gnu main.qml
qmlscene: could not find a Qt installation of 'qt5-x86_64_linux-gnu'

ベストアンサー1

走れないQMLシナリオ最近、新しいUbuntu 22.04 jammyシステムがリリースされました。

最初に次のエラーが発生しました。

qmlscene: could not find a Qt installation of ''

その後、一連の追加の適切なコマンドを実行した後にエラーを削除しましたが、より長いエラーが発生しました。

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

私がインストールした適切なパッケージは次のとおりです。

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

whichqmlscene が開始された場所を照会するために使用すると、qtchooser ユーティリティーへのシンボリックリンクであることがわかります。

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

結局私は私に合った解決策を見つけました(Ubuntu 22.04 jammyで述べたように)。

/usr/share/qtchooser/qt5-x86_64-linux-gnu.confqtchooserが自分で作成した特別なインストールディレクトリからQt5バイナリを選択するように編集する必要がありました。

私は非公式のインストーラAQTを使用して、私が選択したディレクトリにQt5をインストールしました。https://github.com/miurahr/aqtinstall

これは私のAQT呼び出しです。

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

(私はここにスクリプトも書きました。https://github.com/219-design/qt-qml-project-template-with-ci/blob/master/tools/ci/get_qt_libs.sh)

新機能は次のとおりです/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

おすすめ記事