“QtQuick.Controls version 1.2 is not installed” wh

2019-06-09 15:08发布

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

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

标签: qml qt5 rust
1条回答
ら.Afraid
2楼-- · 2019-06-09 15:22

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)

Otherwise check out: 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;

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

查看更多
登录 后发表回答