【问题标题】:Ubuntu QT install qt quick controls 2.1Ubuntu QT安装qt快速控件2.1
【发布时间】:2018-01-12 13:36:24
【问题描述】:

我有一个 Qt 5.7.0 应用程序。当我运行我的应用程序时,它没有启动,并且有一条终端消息说:

QQmlApplicationEngine failed to load component
qrc:/main.qml:2 module "QtQuick.Controls" version 2.1 is not installed

我该如何解决这个问题?

谢谢!!

【问题讨论】:

  • 你的qt版本是多少?
  • @eyllanesc Qt 5.7.0
  • 你是怎么安装qt的?
  • 为此需要最新版Qt,下载5.9版:download.qt.io/official_releases/qt/5.9/5.9.1/…
  • Ubuntu 18.04,这为我修复了它:sudo apt-get install qml-module-qtquick-controls2

标签: linux qt ubuntu terminal qml


【解决方案1】:

正如您在the "Versions" section of the Qt Quick Controls 2 documentation 中看到的,如果您使用的是 Qt 5.7,则必须导入 2.0 版的 Quick Controls,不是 2.1 版的 Quick Controls。

或者,您可以更新到最新版本的 Qt (5.9),然后您可以使用 Quick Controls 2.1。

【讨论】:

  • 您的回答没有说​​明有人将如何更新到 Qt 5.9
猜你喜欢
  • 1970-01-01
  • 2018-06-17
  • 2014-03-22
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多