未找到 QML 模块QtQuick.Studio.Components 1.0

问题描述

我在 Ubuntu 18.04 上为我的 RaspBerry pi 4 交叉编译了 Qt 5.14.1,

对于我的应用程序,我在搜索时需要弧,我发现弧属于 QtQuick.Studio.Components 1.0 https://doc.qt.io/qtdesignstudio/qml-qtquick-studio-components-arc.html

但是当我在 import QtQuick.Studio.Components 1.0添加 main.qml 时出现错误 QML module not found (QtQuick.Studio.Components 1.0 ) import paths : /opt/RaspBerryQt/sysroot/usr/local/RaspBerryQt/qml

所以在我的 .pro 文件中我添加QML_IMPORT_PATH = /opt/RaspBerryQt/sysroot/usr/local/RaspBerryQt/qml

但我仍然有这个错误

这些是我在交叉编译之前安装在 RaspBerry pi 4 上的库。你能告诉我缺少哪一个吗?

sudo apt-get build-dep qt5-qmake
sudo apt-get build-dep libqt5gui5
sudo apt-get build-dep libqt5webengine-data
sudo apt-get build-dep libqt5webkit5
sudo apt-get install libudev-dev libinput-dev libts-dev libxcb-xinerama0-dev libxcb-xinerama0 gdbserver

这是我的配置

cd /opt/RaspBerryQt/build
../qt-everywhere-src-5.14.1/configure -release -opengl es2  -eglfs -device linux-rasp-pi4-v3d-g++ -device-option CROSS_COMPILE=/opt/RaspBerryQt/tools/rpi-gcc-8.3.0/bin/arm-linux-gnueabihf- -sysroot /opt/RaspBerryQt/sysroot -prefix /usr/local/RaspBerryQt -opensource -confirm-license -skip qtscript -skip qtwayland -skip qtwebengine -nomake tests -nomake examples -make libs -pkg-config -no-use-gold-linker -v -recheck

提前致谢

解决方法

您正在从额外的 qt 模块获取导入。所以编译 https://codereview.qt-project.org/gitweb?p=qt-labs/qtquickdesigner-components.git;a=tree 并将其安装到您的 raoberry 上的 qt 安装中。