当前位置:网站首页>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调试法和断点调试法
边栏推荐
- (JS) iterator mode
- Course design for the end of the semester: product sales management system based on SSM
- The first "cyborg" in the world died, and he only transformed himself to "change his life against the sky"
- When a technician becomes a CEO, what "bugs" should be modified?
- Pipeline aggregations管道聚合-Sibling-1
- MySQL query table field information
- Ikvm Net project progress
- 【每日3题(2)】生成交替二进制字符串的最少操作数
- [various * * question series] what are OLTP and OLAP?
- (JS) status mode
猜你喜欢

数据分析方法与思维:漏斗分析

(JS) filter out keys with value greater than 2 in the object

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?

Limit introduction summary

The use of Fibonacci sequence and bubble sort in C language

安全 创新 实践|海泰方圆受邀参加“数字时代的网信创新与价值共创”技术交流研讨会
![[daily 3 questions (1)] judge the color of a grid on the chess board](/img/bd/064058f917554237b741795d405189.png)
[daily 3 questions (1)] judge the color of a grid on the chess board

Graduation season · advanced technology Er - workers in the workplace

【每日3题(3)】重新格式化电话号码
随机推荐
Several types of MySQL index invalidation and their solutions
【HBZ分享】Semaphore 与 CountDownLatch原理
Bs-gx-018 student examination system based on SSM
Course design for the end of the semester: product sales management system based on SSM
Multithreaded high concurrency server: three problems
X-FRAME-OPTIONS web page hijacking vulnerability
Online text filter less than specified length tool
期未课程设计:基于SSM的产品销售管理系统
Modbustcp protocol network learning single channel infrared module (medium shell version)
Pipeline aggregations管道聚合-Sibling-1
Ikvm Net project progress
ModbusTCP协议网络学习型单路红外模块(中壳版)
Modbustcp protocol WiFi wireless learning single channel infrared module (round shell version)
安全 创新 实践|海泰方圆受邀参加“数字时代的网信创新与价值共创”技术交流研讨会
LeetCode 535 TinyURL的加密与解密[map] HERODING的LeetCode之路
高效远程办公的基石:有效沟通 |社区征文
西门子S7-200SMART控制步进电机的具体方法及示例程序
[3 questions per day (2)] minimum operand for generating alternate binary strings
数据分析方法与思维:漏斗分析
斐波那锲数列与冒泡排序法在C语言中的用法