当前位置:网站首页>Introduction to the basic application and skills of QT
Introduction to the basic application and skills of QT
2022-07-03 09:06:00 【R-G-B】
qt Introduction to basic application and skills
1 .pro file
In the use of Qt Wizard generated applications .pro The file format is as follows :
QT += core gui // Included modules
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets // Greater than Qt4 edition To include widget modular
TARGET = QtFirst // Application name Generated .exe Program name
TEMPLATE = app // Template type Application template
SOURCES += main.cpp\ // Source file
mywidget.cpp
HEADERS += mywidget.h // The header file
.pro It's engineering documents (project), It is qmake Automatically generated for production makefile Configuration file for ..pro The document is written as follows :
• notes
from “#” Start , By the end of the line .
• The template variable tells qmake What kind of... Is generated for this application makefile. Here are the options available :TEMPLATE = app
◦ app - Build an application of makefile. This is the default , So if the template is not specified , This will be used .
◦ lib - Build a library of makefile.
◦ vcapp - Build an application of VisualStudio Project documents .
◦ vclib - Build a library of VisualStudio Project documents .
◦ subdirs - This is a special template , It can create a directory that can enter a specific directory and generate... For a project file makefile And call... For it make Of makefile.
•# Specify the name of the generated application :
TARGET = QtDemo
• # The header file included in the project
HEADERS += include/painter.h
• # The project includes .ui Design documents
FORMS += forms/painter.ui
• # Source files included in the project
SOURCES += sources/main.cpp sources
• # Resource files included in the project
RESOURCES += qrc/painter.qrc
• greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
The meaning of this sentence is , If QT_MAJOR_VERSION Greater than 4( That is, the current Qt5 And higher ) Need to increase the widgets modular . If the project only needs support Qt5, You can also add “QT += widgets” A word of . But to keep the code compatible , It's better to follow QtCreator The generated statements are written .
• # Configuration information
CONFIG To tell qmake Configuration information about the application .
CONFIG += c++11 // Use c++11 Characteristics of
Use it here “+=”, It's because we add our configuration options to any one that already exists . This is better than using “=” So it's safer to replace all the options that have been specified .
2 One of the simplest Qt Applications
3 Naming conventions and shortcut keys
边栏推荐
- LeetCode 513. 找树左下角的值
- AcWing 785. Quick sort (template)
- 常见渗透测试靶场
- MySQL three logs
- 数字化管理中台+低代码,JNPF开启企业数字化转型的新引擎
- State compression DP acwing 291 Mondrian's dream
- Sending and receiving of request parameters
- AcWing 787. 归并排序(模板)
- 树形DP AcWing 285. 没有上司的舞会
- Deeply understand the underlying data structure of MySQL index
猜你喜欢
Education informatization has stepped into 2.0. How can jnpf help teachers reduce their burden and improve efficiency?
Parameters of convolutional neural network
教育信息化步入2.0,看看JNPF如何帮助教师减负,提高效率?
【点云处理之论文狂读经典版14】—— Dynamic Graph CNN for Learning on Point Clouds
Concurrent programming (VI) ABA problems and solutions under CAS
【点云处理之论文狂读经典版8】—— O-CNN: Octree-based Convolutional Neural Networks for 3D Shape Analysis
AcWing 785. 快速排序(模板)
excel一小时不如JNPF表单3分钟,这样做报表,领导都得点赞!
AcWing 788. 逆序对的数量
How to use Jupiter notebook
随机推荐
Arbre DP acwing 285. Un bal sans patron.
Facial expression recognition based on pytorch convolution -- graduation project
LeetCode 1089. Duplicate zero
AcWing 788. 逆序对的数量
常见渗透测试靶场
AcWing 787. Merge sort (template)
LeetCode 324. 摆动排序 II
Deep parsing (picture and text) JVM garbage collector (II)
Save the drama shortage, programmers' favorite high-score American drama TOP10
20220630 learning clock in
使用dlv分析golang进程cpu占用高问题
AcWing 786. Number k
LeetCode 30. 串联所有单词的子串
On a un nom en commun, maître XX.
高斯消元 AcWing 883. 高斯消元解线性方程组
Mortgage Calculator
MySQL three logs
AcWing 787. 归并排序(模板)
数字化管理中台+低代码,JNPF开启企业数字化转型的新引擎
DOM render mount patch responsive system