“未安装QtQuick.Controls 1.2版"为 QMLRS 编译示例时 [英] "QtQuick.Controls version 1.2 is not installed" when compiling the example for QMLRS

查看:34
本文介绍了“未安装QtQuick.Controls 1.2版"为 QMLRS 编译示例时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

While trying to use qmlrs, I encountered this issue:

~/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 版的错误:

After searching, I installed libqt5qml-quickcontrols. I now get errors about requiring version 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,它解决了我的版本)

So I figured out in the qmlrs project find the file called factorial_ui.qml and change the line where it says: change the version of QtQuick.Controls: import QtQuick.Controls 1.1 (in my case was 1.1 which solved my version)

否则退房: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

安装他们位于项目中的需求;

to install the requirements they are located in the project;

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

I know my solution is quick hack to make it work; but hey I'm on the ground running with GUIs in Rust :)

这篇关于“未安装QtQuick.Controls 1.2版"为 QMLRS 编译示例时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆