gpt4 book ai didi

qml - 为 QMLRS 编译示例时为 "QtQuick.Controls version 1.2 is not installed"

转载 作者:行者123 更新时间:2023-11-29 08:30:14 25 4
gpt4 key购买 nike

尝试使用 qmlrs 时,我遇到了这个问题:

~/rustqml/qmlrs$ cargo run --example factorial
Compiling qmlrs v0.0.1 (file:///home/dally/rustqml/qmlrs)
Running target/debug/examples/factorial
QQmlApplicationEngine failed to load component
file:///home/dally/rustqml/qmlrs/examples/factorial_ui.qml:2 module "QtQuick.Controls" is not installed
file:///home/dally/rustqml/qmlrs/examples/factorial_ui.qml:3 module "QtQuick.Layouts" is not installed
file:///home/dally/rustqml/qmlrs/examples/factorial_ui.qml:2 module "QtQuick.Controls" is not installed
file:///home/dally/rustqml/qmlrs/examples/factorial_ui.qml:3 module "QtQuick.Layouts" is not installed

经过搜索,我安装了libqt5qml-quickcontrols。我现在收到有关需要 1.2 版的错误消息:

~/rustqml/qmlrs$ cargo run --example factorial
Running target/debug/examples/factorial
QQmlApplicationEngine failed to load component
file:///home/dally/rustqml/qmlrs/examples/factorial_ui.qml:2 module "QtQuick.Controls" version 1.2 is not installed

最佳答案

所以我发现在 qmlrs 项目中找到名为 factorial_ui.qml 的文件并更改它说的行:更改 QtQuick.Controls 的版本:import QtQuick.Controls 1.1(在我的例子中是 1.1,它解决了我的版本问题)

否则检查: https://github.com/cyndis/qmlrs/blob/master/.travis.yml

language: rust
install:
- sudo add-apt-repository "deb mirror://mirrors.ubuntu.com/mirrors.txt trusty main restricted universe multiverse" -y
- sudo apt-get update -qq
- sudo apt-get install -qq libqt5core5a libqt5gui5 libqt5quick5 libqt5qml5 qtbase5-dev qtdeclarative5-dev cmake

安装他们在项目中的需求;

我知道我的解决方案是快速修改以使其工作;但是嘿,我正在实地使用 Rust 中的 GUI 运行 :)

关于qml - 为 QMLRS 编译示例时为 "QtQuick.Controls version 1.2 is not installed",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30010184/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com