创建Qt Interface Framework 项目

使用 Qt Interface Framework工具和核心 API 来实现中间件 API、后端和服务。通过Qt Interface Framework Generator,您可以使用 QFace 接口定义语言(IDL)定义新的 API 并生成 Qt C++ 类和 QML 类型。

Qt Interface Framework QFace 生成器包括

  • 核心模块,它为您创建的所有 API 提供基类和通用代码。
  • 功能的前端 API。
  • 功能的后端接口,以及实现该接口的一个或多个后端,以便连接到底层服务或模拟服务。

Qt Interface Framework 功能 API 分成两层:前端和后端,这样既可以重复使用以前项目的代码,又可以整合许多团队开发的代码。您可以将一个前端连接到多个后端,因为核心模块可以方便地找到相应的后端。

要为具有前台和后台的功能创建Qt Interface Framework 项目,请执行以下操作

  1. 转到File >New Project >Other Project ,然后选择 Qt Interface Framework Project.
  2. 指定应用程序的名称和位置。
  3. 选择Next
  4. Project name 中,键入项目名称。

    配置接口对话框

  5. Interface name 中,键入描述功能前端和后端之间数据交换的接口名称。
  6. 选择Add sample code to the project 为项目生成模板代码。
  7. 选择Generate a zoned interface 可为多个点创建单个 API,例如操作汽车的车窗、后视镜和空调。
  8. Backend setup 中,选择生成后台的选项。
  9. 选择Next ,选择用于构建和运行项目的工具包。
  10. 选择Next 创建项目。

更改项目中的模板代码以实现功能。

另请参阅 如何:创建项目

Copyright © The Qt Company Ltd. and other contributors. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.