QtCreator 中没有为 QML 项目启用 RUN 按钮 [英] RUN button no enable in QtCreator for QML project

查看:54
本文介绍了QtCreator 中没有为 QML 项目启用 RUN 按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Windows XP 上使用基于 QT 4.7.4(32 位)的 QTCreator 2.2.1.我从 new -> QML 项目菜单创建了一个 QML 项目,但未启用 RUN 按钮.我如何运行 QML 项目.

I am using QTCreator 2.2.1, based on QT 4.7.4(32 bit) on Windows XP. I made a QML project from new -> QML project menu but the RUN button is not enable. How do I run QML project.

推荐答案

您是否创建了新的 QML 文件而不是 Qt Quick Project?如果您只创建了一个普通的 QML 文件,则它无法自行构建和运行.

Have you created a new QML file instead of a Qt Quick Project? If you have created just a plain QML file it cannot be built and ran by itself.

  1. 如果您想从头开始创建一个新项目,您可以尝试选择:文件 -> 新建 -> 从左侧面板顶部的Qt Quick Project",然后选择Qt Quick Application"或右侧面板中的Qt Quick UI"取决于其中哪一个最适合您的需求.Qt Quick Application 是指包含 QML 和 C++ 代码并包含 QDeclarativeView 的整个应用程序,它可以部署到桌面或移动平台及其各自的模拟器,而 Qt Quick UI 在 QML Viewer 中运行项目,因此不需要为审查而构建,也不需要安装开发环境.

  1. If you are trying to create a new project from scratch, you can try selecting: File -> New -> "Qt Quick Project" from the top of the left panel and select either "Qt Quick Application" or "Qt Quick UI" from right panel depending, which one of these suits best your needs. Qt Quick Application refers to a whole application that contains both QML and C++ code and includes QDeclarativeView, and it can be deployed to a desktop or mobile platform and their respective simulators, whereas Qt Quick UI runs projects in QML Viewer and thus does not need to be built for reviewing, neither does it need development environment to be installed.

您是否安装了 Qt 模拟器?另外,您是否正在尝试将项目构建到 Qt Simulator 或移动平台?您可以通过将项目打开到 Qt Creator 来检查这一点-> 从 Qt Creator 窗口的左侧面板中选择项目"-> 从该视图中,您应该看到为项目选择的当前目标平台,Qt Simulator 应列在目标"中' 控制板.如果它似乎包含在内,请选择它.如果不是,请单击加号将新的目标平台添加到您的项目中,并检查 Qt Simulator 是否在那里列出.如果未列出,您可以尝试重新安装 Qt SDK.请记住进行自定义安装而不是默认安装,并通过转到组件选择屏幕中的开发工具"面板并检查是否选择了模拟器"来确保正在安装 Qt 模拟器.此外,每次创建新项目时,请记住选择 Qt Simulator 作为应用程序审查的目标平台之一.

Do you have the Qt Simulator installed? Also, are you trying to build your project to Qt Simulator or a mobile platform? You can check this by opening your project to Qt Creator -> select "Projects" from left panel of the Qt Creator window -> From this view you should see the current target platforms selected for the project and Qt Simulator should be listed in 'Targets' panel. Select it if it appears to be included. If it isn't, click the plus mark to add a new target platform to your project, and check if Qt Simulator is listed there. If it isn't listed, you could try reinstalling the Qt SDK. Remember to make a custom installation instead of default install, and reassure that the Qt Simulator is being installed by going to "Development Tools" panel in Component selection screen and check that 'Simulator' is selected. Also, every time you create a new project, remember to select Qt Simulator as one of your target platform for application reviewing.

希望这能解决您的问题.

I hope this solves your issue.

这篇关于QtCreator 中没有为 QML 项目启用 RUN 按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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