当前位置: 首页 > wzjs >正文

南山商城网站建设多少钱怎么样做免费的百度seo

南山商城网站建设多少钱,怎么样做免费的百度seo,推广文章,企业网站建站元素此教程基于: Qt 6.7.4Qt Creator 15.0.1CMake 3.26.4 Qt 6 以下的版本使用 CMake 构建可能会存在一些问题. 目录 新建窗体工程更新翻译添加资源软件部署(Deploy) 此教程描述了如何一步步在 Qt Creator 中使用 CMake 构建应用程序工程. 涉及 新建窗体工程, 更新翻译, 添加资源, …

此教程基于:

  • Qt 6.7.4
  • Qt Creator 15.0.1
  • CMake 3.26.4

Qt 6 以下的版本使用 CMake 构建可能会存在一些问题.

目录

  • 新建窗体工程
  • 更新翻译
  • 添加资源
  • 软件部署(Deploy)

此教程描述了如何一步步在 Qt Creator 中使用 CMake 构建应用程序工程. 涉及 新建窗体工程, 更新翻译, 添加资源, 以及软件部署等环节.

新建窗体工程

此过程描述如何在Qt Creator中新建一个使用 CMake 构建的窗体应用程序.

  • 运行 Qt Creator, 点击Welcome页中的 Create Project... 按钮.
  • 在新建工程对话框中选择: Application(Qt) | Qt Widgets Application, 点击右下角 Choose… 按钮.

在这里插入图片描述

  • 设置新建工程的名称和路径, 点击 Next.

在这里插入图片描述

  • 构建系统选择: CMake, 点击 Next.

在这里插入图片描述

  • 类信息页不做修改, 点击 Next.

在这里插入图片描述

  • 翻译文件页, 选择: Chinese(China), 点击 Next.

在这里插入图片描述

  • 点击 Finish 按钮, 完成新建工程.

在这里插入图片描述

  • 新建工程完毕后, 开发界面如下图所示. 工程的构建, 调试, 运行, 以及编译套件和编译配置的切换分别对应图中的1,2,3,4.

在这里插入图片描述

  • 这里我们选择 Desktop_Qt_6_7_3_MSVC2019_64bit.

在这里插入图片描述

  • 点击 构建 按钮, 完成工程的编译; 点击 运行 按钮, 运行示例程序.

更新翻译

  • 使用 Linguist 打开 helloworld_zh_CN.ts(建议将 .ts 文件的打开方式直接设置为 Linguist)

在这里插入图片描述

  • 设置 MainWindow 的中文翻译为: 主窗体, 确认并保存.

在这里插入图片描述

  • 注释掉: qt_create_translation(QM_FILES ${CMAKE_SOURCE_DIR} ${TS_FILES}), 并添加: qt_add_translations(TARGETS helloworld TS_FILES ${TS_FILES}) (helloworld 是此工程的构建目标), 然后保存.

在这里插入图片描述

  • 切换到Projects 模式页, 点击 Add Build Step 工具按钮, 选择 CMake Build 菜单.

在这里插入图片描述- 勾选 update_translations目标, 去除勾选 all目标, 并将此构建步骤向上移动 (或直接修改构建步骤中的第一个)

在这里插入图片描述

  • 点击 Build 按钮, 重新构建. 从编译输出窗口中, 可以看到程序的构建过程为:
    1. 更新 helloworld_zh_CN.ts;
    2. 生成 helloworld_zh_CN.qm;
    3. 链接生成 helloworld.exe.

在这里插入图片描述- 点击 Run按钮运行此程序, 可以看到主窗体的标题栏已经显示为中文.

在这里插入图片描述

添加资源

此过程, 我们将添加一个图标资源, 并将此图标设置为主窗体的窗口图标.

  • 使用资源管理器打开工程所在目录, 新建名为 images 的文件夹, 并将图标logo.png放置到此文件夹下.
  • CMakeLists.txt 文件中添加:
 # qt_add_resources(<TARGET> <RESOURCE_NAME> [PREFIX <PATH>] [FILES ...])qt_add_resources(helloworld imageresourcesPREFIX "/"FILES images/logo.png)

其中, FILES参数指定要添加的文件

  • 点击 Build 按钮, 完成构建. 此时在工程视图中可以看到logo.png已添加到工程的资源文件中.

在这里插入图片描述

  • 修改 MainWindow.cpp, 在其中指定窗体图标.
MainWindow::MainWindow(QWidget *parent): QMainWindow(parent), ui(new Ui::MainWindow)
{ui->setupUi(this);setWindowIcon(QIcon(":/images/logo.png")); // TODO:
}
  • 再次构建, 并运行. 此时窗口图标已更换为我们指定的图标文件.

在这里插入图片描述

软件部署(Deploy)

构建生成的 helloworld.exe 在目标计算机上运行, 还需要一系列依赖的动态库. Qt 提供了 qt_generate_deploy_app_script() 命令, 可以方便的打包应用程序所需的运行环境.

  • CMakeLists.txt 中添加以下代码, 生成部署脚本:
qt_generate_deploy_app_script(TARGET helloworldOUTPUT_SCRIPT deploy_scriptNO_UNSUPPORTED_PLATFORM_ERROR
)
install(SCRIPT ${deploy_script})
  • CMakeLists.txt 中设置安装目录前缀 (CMAKE_INSTALL_PREFIX )为 ${PROJECT_BINARY_DIR}/install:
set(CMAKE_INSTALL_PREFIX ${PROJECT_BINARY_DIR}/install)
  • 切换到工程模式, 添加构建步骤, 设置构建目标为install:

在这里插入图片描述

  • 点击Build 按钮, 完成构建, 在编译输出窗口可以看到如下信息:
12:36:02: Starting: "C:\Program Files\CMake\bin\cmake.exe" --build D:/workspace/qt/helloworld/build/Desktop_Qt_6_7_3_MSVC2019_64bit-Debug --target install
[0/1 ?/sec] Install the project...
-- Install configuration: "Debug"
-- Writing D:/workspace/qt/helloworld/build/Desktop_Qt_6_7_3_MSVC2019_64bit-Debug/install/bin/qt.conf
-- Running Qt deploy tool for D:/workspace/qt/helloworld/build/Desktop_Qt_6_7_3_MSVC2019_64bit-Debug/helloworld.exe in working directory 'D:/workspace/qt/helloworld/build/Desktop_Qt_6_7_3_MSVC2019_64bit-Debug/install'
'C:/Qt/6.7.3/msvc2019_64/bin/windeployqt.exe' 'D:/workspace/qt/helloworld/build/Desktop_Qt_6_7_3_MSVC2019_64bit-Debug/helloworld.exe' '--dir' '.' '--libdir' 'bin' '--plugindir' 'plugins' '--qml-deploy-dir' 'qml' '--translationdir' 'translations' '--force' '--qtpaths' 'C:/Qt/6.7.3/msvc2019_64/bin/qtpaths6.exe'
D:\workspace\qt\helloworld\build\Desktop_Qt_6_7_3_MSVC2019_64bit-Debug\helloworld.exe 64 bit, debug executable
Adding in plugin type generic for module: Qt6Gui
Skipping plugin qinsighttrackerd.dll. Use -deploy-insighttracker if you want to use it.
Adding Qt6Network for qtuiotouchplugind.dll from plugin type: generic
Adding in plugin type iconengines for module: Qt6Gui
Adding Qt6Svg for qsvgicond.dll from plugin type: iconengines
Adding in plugin type imageformats for module: Qt6Gui
Adding Qt6Pdf for qpdfd.dll from plugin type: imageformats
Adding in plugin type networkinformation for module: Qt6Network
Adding in plugin type platforminputcontexts for module: Qt6Gui
Skipping plugin qtvirtualkeyboardplugind.dll due to disabled dependencies (Qt6Qml Qt6Quick).
Adding in plugin type platforms for module: Qt6Gui
Adding in plugin type styles for module: Qt6Widgets
Adding in plugin type tls for module: Qt6Network
Direct dependencies: Qt6Core Qt6Gui Qt6Widgets
All dependencies   : Qt6Core Qt6Gui Qt6Widgets
To be deployed     : Qt6Core Qt6Gui Qt6Network Qt6Pdf Qt6Svg Qt6Widgets
Updating Qt6Cored.dll.
Updating Qt6Guid.dll.
.........
Creating qt_zh_CN.qm...
Creating qt_zh_TW.qm...
-- Installing: D:/workspace/qt/helloworld/build/Desktop_Qt_6_7_3_MSVC2019_64bit-Debug/install/bin/helloworld.exe
12:36:03: The process "C:\Program Files\CMake\bin\cmake.exe" exited normally.
12:36:03: Elapsed time: 00:03.
  • 在资源管理器中打开 D:/workspace/qt/helloworld/build/Desktop_Qt_6_7_3_MSVC2019_64bit-Debug/install/bin目录, 运行 hello world.exe, 此时程序可以正常运行.
http://www.dtcms.com/wzjs/93267.html

相关文章:

  • 温江做网站公司一个新产品怎么推广
  • 网站建设支付网站建设详细方案
  • 怎么通过建站来赚钱游戏推广赚钱
  • 公司网站建设策划培训seo去哪家机构最好
  • 梁朝伟做汤唯视频网站如何优化搜索引擎
  • 做国际网站要多少钱建网站教学
  • 恩施网站制作公司百度搜索引擎推广收费标准
  • 网站手机网站怎么建立手机系统优化工具
  • 怎么做淘宝网站赚钱吗网络营销推广方案3篇
  • asp.net做的网站要放到网上空间去要放哪些文件上去百度竞价开户哪家好
  • 树形菜单的网站代码建立个人网站
  • 调研园区网站建设工作总结女教师遭网课入侵直播录屏曝光视频
  • 网站免费的有没有今日新闻十大头条内容
  • 信阳哪里做网站谷歌浏览器下载手机版最新版
  • 建站代理赚钱吗bt磁力兔子引擎
  • 成品软件源码网站大全广州白云区疫情实时动态
  • 洛卡博网站谁做的宁波seo网络推广外包报价
  • 宁波建设厅网站天津seo外包
  • 阿里邮箱登录入口百度seo权重
  • 网站代码是多少打造龙头建设示范
  • 做外围网站代理合法不seochan是什么意思
  • 风险网站怎么解决方法厦门百度竞价推广
  • 公司网站制作汇报会拓客最有效方案
  • 亚马逊雨林深处网站seo方案案例
  • 济南网站建设培训学校网络营销计划包括哪七个步骤
  • 网站页面策划怎么做济南网站优化
  • 做照片书的网站网店推广的作用
  • 第三方编辑网站怎么做短期职业技能培训班
  • 郴州seo服务泰安网站seo推广
  • 攀枝花网站网站建设搜索指数查询平台