当前位置:网站首页>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
边栏推荐
- What is the difference between sudo apt install and sudo apt -get install?
- Excel is not as good as jnpf form for 3 minutes in an hour. Leaders must praise it when making reports like this!
- Gaussian elimination acwing 883 Gauss elimination for solving linear equations
- How to delete CSDN after sending a wrong blog? How to operate quickly
- Instant messaging IM is the countercurrent of the progress of the times? See what jnpf says
- The difference between if -n and -z in shell
- Arbre DP acwing 285. Un bal sans patron.
- 一个优秀速开发框架是什么样的?
- On the difference and connection between find and select in TP5 framework
- AcWing 788. 逆序对的数量
猜你喜欢
Binary tree sorting (C language, char type)
求组合数 AcWing 886. 求组合数 II
传统企业数字化转型需要经过哪几个阶段?
MySQL three logs
State compression DP acwing 291 Mondrian's dream
Binary tree traversal (first order traversal. Output results according to first order, middle order, and last order)
LeetCode 438. 找到字符串中所有字母异位词
Digital statistics DP acwing 338 Counting problem
Format - C language project sub file
AcWing 788. Number of pairs in reverse order
随机推荐
AcWing 788. Number of pairs in reverse order
PIC16F648A-E/SS PIC16 8位 微控制器,7KB(4Kx14)
【点云处理之论文狂读前沿版10】—— MVTN: Multi-View Transformation Network for 3D Shape Recognition
Baidu editor ueeditor changes style
LeetCode 75. Color classification
LeetCode 515. 在每个树行中找最大值
Parameters of convolutional neural network
Recommend a low code open source project of yyds
LeetCode 513. Find the value in the lower left corner of the tree
What is the difference between sudo apt install and sudo apt -get install?
LeetCode 1089. 复写零
LeetCode 30. 串联所有单词的子串
Deep parsing JVM memory model
记忆化搜索 AcWing 901. 滑雪
Wonderful review | i/o extended 2022 activity dry goods sharing
Escape from heaven and forget what he suffered. In ancient times, it was called the punishment of escape from heaven. Article collection
PHP mnemonic code full text 400 words to extract the first letter of each Chinese character
LeetCode 438. Find all letter ectopic words in the string
LeetCode 1089. Duplicate zero
The method for win10 system to enter the control panel is as follows: