当前位置:网站首页>QT笔记——QT工具uic,rcc,moc,qmake的使用和介绍
QT笔记——QT工具uic,rcc,moc,qmake的使用和介绍
2022-08-10 21:25:00 【旧街凉风°】
uic,rcc,moc,qmake 都是 qt 的工具
uic 主要是 编译 .ui文件 -》 ui_xxx.cpp
rcc 主要是 编译 资源文件.qrc文件 -》 xxx.rcc
moc 主要是 编译 带有Q_OBJECT宏的.h文件 -》moc_xxx.cpp
打开我们的qt mingw 命令行 工具
进入到我们需要编译的文件夹中
cd /d D:\msvcTest\HttpNetWork\WidgetDLL
uic:
生成我们的ui_WidgetDLL.h,ui_WidgetDLL.cpp文件
uic.exe WidgetDLL.ui -o ui_WidgetDLL.h
uic.exe WidgetDLL.ui -o ui_WidgetDLL.cpp
moc:
生成我们的moc_WidgetDLL.cpp文件
moc.exe WidgetDLL.h -o moc_WidgetDLL.cpp
rcc:
生成我们的WidgetDLL.rcc文件
rcc WidgetDLL.qrc -o WidgetDLL.rcc
初始文件夹:
生成如下:

qmake 主要是 用来编译 生成makefile 文件的 以及 .pro文件
首先,我们需要创建 main.cpp 等文件
main.cpp
#include "widget.h"
#include <QApplication>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
Widget w;
w.show();
return a.exec();
}
初始文件夹:
打开我们的mingw 命令行工具,进入到我们写的main.cpp文件夹中
执行下面的命令
qmake -project
生成了 Hello.pro文件
qmake -o Makefile Hello.pro
生成了Makefile 文件 和 debug 和 release文件等
打开.pro文件
运行一下,报错了,因为有东西没有添加
修改一下.pro文件
运行效果如下:
边栏推荐
- 力扣215题,数组中的第K个最大元素
- An article to teach you a quick start and basic explanation of Pytest, be sure to read
- C. Even Picture
- camera preview process --- from HAL to OEM
- xshell (sed command)
- FPGA - Memory Resources of 7 Series FPGA Internal Structure -03- Built-in Error Correction Function
- 石油化工行业商业供应链管理系统:标准化供应商管理,优化企业供应链采购流程
- shell脚本循环语句for、while语句
- 【PCBA solution】Electronic grip strength tester solution she'ji
- shell programming without interaction
猜你喜欢

APP UI自动化测试常见面试题,或许有用呢~

内置模板市场,DataEase开源数据可视化分析平台v1.13.0发布

ACM解题笔记——HDU 1401 Solitaire(DBFS)

shell编程之正则表达式与文本处理器

JVM classic fifty questions, now the interview is stable

Exploration and practice of the "zero trust" protection and data security governance system of the ransomware virus of Meichuang Technology

找的笔试题的复盘(一)

LeetCode-402 - Remove K digits

Use Cloudreve to build a private cloud disk

Alibaba and Ant Group launched OceanBase 4.0, a distributed database, with single-machine deployment performance exceeding MySQL
随机推荐
Redis 性能影响 - 异步机制和响应延迟
翻译科技论文,俄译中怎样效果好
shell programming without interaction
这些不可不知的JVM知识,我都用思维导图整理好了
B. Codeforces Subsequences
Service - DNS forward and reverse domain name resolution service
Alibaba and Ant Group launched OceanBase 4.0, a distributed database, with single-machine deployment performance exceeding MySQL
ACM解题笔记——HDU 1401 Solitaire(DBFS)
Labelme-5.0.1 version edit polygon crash
国内Gravatar头像的完美替代方案Cravatar
GAN CFOP
labelme-屏蔽拖拽的事件
C. Rotation Matching
Shell programming specification and variables
ArcGIS自动随机生成采样点的方法
每次打开chrome会跳出What's new
黑猫带你学Makefile第13篇:Makefile编译问题合集
地理探测器Geodetector软件的下载、应用与结果解读
shell(文本打印工具awk)
3D model reconstruction of UAV images based on motion structure restoration method based on Pix4Dmapper