当前位置:网站首页>Qt学习04 Hello Qt
Qt学习04 Hello Qt
2022-06-29 10:30:00 【一个小黑酱】
Qt学习04 Hello Qt
Qt是什么?
- Qt是一套跨平台的GUI开发库
- Qt是一套C++继承开发环境
- Qt是一套开源的殿堂级架构技术教程
进入Qt的世界
- 第一个Qt程序
#include <QApplication>
#include <QMainWindow>
#include <QPushButton>
int main(int argc, char *argv[])
{
QApplication a(argc, arv);
QMainWindow w;
QPushButton b(&w);
b.setText("Hello QT!");
w.show();
return a.exec();
}
Qt开发环境
- 通过命令行的方式编译Qt源程序
- 启动Qt命令行
- 进入源程序所在的目录
- 命令:
1.qmake -project // 根据目录中的源码生成工程文件
2.qmake // 根据工程文件生成makefile文件
3.make // 根据makefile进行编译
Qt Creator
- Qt Creator是一套可视化的集成开发环境
- 使用Qt Creator可以高效的进行Qt开发
- Qt Creator提供了强大的代码编辑功能
- Qt Creator提供了强大的调试功能
调试的基本方法
Log调试法:
在代码中加入一定的打印语句
打印程序状态和关键变量的值
断点调试法
在开发环境中的对应代码行上加上断点
当程序运行到断点行时,程序暂停运行
需要时可加上条件断点,当条件满足才暂停程序的运行
小结
- Qt时一套跨平台的C++界面开发库
- 可以通过命令行的方式开发Qt应用程序
- 也可以通过Qt Creator进行Qt开发
- Qt Creator同时支持Log调试法和断点调试法
边栏推荐
- [daily 3 questions (3)] reformat the phone number
- Modbustcp protocol WiFi wireless learning single channel infrared module (round shell version)
- 期未课程设计:基于SSM的产品销售管理系统
- When a technician becomes a CEO, what "bugs" should be modified?
- When the "Ai x scientific computing" is in progress, Huawei's mindspore competition question is hot, waiting for you!
- (JS) array flat
- How to obtain method parameter values through WinDbg
- 影响LED封装散热主要因素有哪些?
- Bs-gx-018 student examination system based on SSM
- 在日本的 IT 公司工作是怎样一番体验?
猜你喜欢

csdn涨薪秘籍之腾讯自动化软件测试面试题(含答案)

Graduation season · advanced technology Er - workers in the workplace

【各种**问题系列】OLTP和OLAP是啥?

Babbitt | yuancosmos daily must read: HTC announced the launch of the first yuancosmos mobile phone, which costs about 2700 yuan. What are the new ways to play

What are the main factors that affect the heat dissipation of LED packaging?

How to obtain method parameter values through WinDbg

中国计算语言学大会、全国知识图谱与语义计算大会赛题火热进行中

CTO专访:合见工软深化产品布局 加速国产EDA技术革新

The first "cyborg" in the world died, and he only transformed himself to "change his life against the sky"

Today in history: musk was born; Microsoft launches office 365; The inventor of Chua's circuit was born
随机推荐
MySQL 索引失效的几种类型以及解决方式
Graduation season · advanced technology Er - workers in the workplace
(JS) array de duplication
Pipeline aggregations管道聚合-Sibling-1
西门子S7-200SMART控制步进电机的具体方法及示例程序
微博评论架构设计
Creating postgre enterprise database by ArcGIS
多线程实现客户端与服务端通信(初级版本)
BS-GX-017基于SSM实现的在线考试管理系统
(JS) imitate the indexof method to find the position of a character in the string
(JS) iterator mode
Using EasyX configuration in clion
[untitled] I am plotting a big event
Modbustcp protocol WiFi wireless learning single channel infrared module (round shell version)
(JS) handwritten bind function
ModbusTCP协议WIFI无线学习型单路红外模块(圆壳版)
What are the pop, push, unshift, and shift of the (JS) array?
【每日3题(2)】生成交替二进制字符串的最少操作数
Multithreaded high concurrency server: three problems
Today in history: musk was born; Microsoft launches office 365; The inventor of Chua's circuit was born