安装 Qt Quick Components for Desktop 以与 Qt Creator 一起使用 [英] Installing Qt Quick Components for Desktop for use with Qt Creator

查看:45
本文介绍了安装 Qt Quick Components for Desktop 以与 Qt Creator 一起使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用来自 http://labs.qt.nokia.com/2011/03/10/qml-components-for-desktop/

我可以很好地构建并安装到它自己的文件夹中,并使用 qmlviewer 查看 qml,但是如何在 Qt Creator 中使用我其他项目中的这些 qml 组件?

I can build and install it just fine into it's own folder, and view the qmls with qmlviewer, but how do I use these qml components from my other projects in Qt Creator?

例如,我希望能够使用 Qt Quick Components for Desktop 中的 Dial.qml 在我的项目的 qml 文件中创建 Dial 元素.

For example, I'd like to be able to use Dial.qml from the Qt Quick Components for Desktop to make a Dial element in a qml file in my project.

推荐答案

我使用了这个问题的答案中的说明:Qt 如何制作和安装插件? 并且能够成功使用 qt creator qml 文件中的 qt 快速桌面组件.以下是我所做的更详细的说明:

I used the instructions from the answer for this question: Qt How to make and install plugins? and was able to successfully use the qt quick desktop components within qt creator qml files. Here are more detailed instructions that I made:

  1. http://qt.gitorious.org 下载 tar.gz/qt-components/desktop/trees/master
  2. 在任意位置提取组件(例如 C:\qt-components-desktop).
  3. 打开命令提示符.
  4. 在命令提示符下从您的 Visual Studio"\VC\bin\ 目录...(通常是 C:\Program Files\Microsoft Visual Studio 9.0\VC\bin)运行 vcvars32.bat.例如C:\Program Files\Microsoft Visual Studio 9.0\VC\bin\vcvars32.bat"您应该会收到类似于以下内容的消息:为使用 Microsoft Visual Studio 2008 x86 工具设置环境"
  5. 设置命令提示符以使用 Qt Creator 的 bin 路径...(通常为 C:\Qt\qtcreator-2.1.0\bin).例如SET PATH=%PATH%;C:\Qt\qtcreator-2.1.0\bin
  6. 设置命令提示符以使用 Qt 的 bin 路径...(通常为 C:\Qt\4.7.2\bin).例如SET PATH=%PATH%;C:\Qt\4.7.2\bin
  7. 在命令提示符下导航到您提取 qt 桌面组件的文件夹.
  8. 运行以下命令:qmake调试安装
  9. 复制您提取 qt 桌面组件的components"文件夹.
  10. 把它放在你的 Qt 目录"\imports\Qt\labs ...(通常是 C:\Qt\4.7.2\imports\Qt\labs)
  11. 在任何文本编辑器中打开 components 文件夹中的 qmldir 文件,并观察每一行的版本号(例如 0.1)
  12. 将以下导入语句放在任何 qml 文件中以使用 Qt 桌面组件:导入 Qt.labs.components #.#其中#.# 是您的版本号(例如 0.1)

这篇关于安装 Qt Quick Components for Desktop 以与 Qt Creator 一起使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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