当前位置:网站首页>QT elementary notes
QT elementary notes
2022-06-30 07:11:00 【Delta-delta】
List of articles
Shortcut key
Quick annotation
ctrl+/
function
ctrl+r
Automatic alignment
ctrl+i
compile
ctrl+b
Move the whole line
ctrl+shift+↑/↓
The same name .h/.cpp Switch
F4
Header file declaration
#pragma once
Common macros in classes
Use Q_OBJECT macro , Allow classes to use signal and slot mechanisms
Pro file
QT engineering pro File template variables (TEMPLATE)

“app” Templates
“app” Template tell qmake Generate a... For building an application makefile. When using this template , Below these qmake System variables are recognized . You should be in your .pro Use them in files to specify specific information for your application .

“lib” Templates
“lib” Template tell qmake To create a library makefile. When using this template , except “app” System variables are mentioned in the template , One more VERSION Is supported by . You need to specify specific information for the library .pro Use them in files .
“subdirs” Templates
“subdirs” Template tell qmake Generate a makefile, It can go to a specific subdirectory and generate... For the project files in that directory makefile And call... For it make.
There is only one system variable in this template SUBDIRS Can be identified . This variable contains the list of subdirectories containing project files to be processed . The name of this project file is the same as the subdirectory , such qmake You can find it . for example , If it's in the subhead “myapp”, So the project file in this directory should be called myapp.pro.
CONFIG Variable


pro The variable of the directory where the file is located
- Variable
_PRO_FILE_PWD_Can be said Qt In the project pro File directory .
TARGET
Generate exe The name of
SOURCES
Add source file
HEADERS
Header file
Button
#include "QPushButton"
```c
// Create a button
QPushButton* btn =new QPushButton();
// Give Way btn Objects depend on Widget
btn->setParent(this);
// Set button text
btn->setText("Btn1");
QPushButton* btn2=new QPushButton("Btn2",this);
// Reset window size
this->resize(600,400);
// Move Btn2
btn2->move(100,100);
// Set the window title
this->setWindowTitle("Hello Qt");
// Set window fixed size
this->setFixedSize(600,400);
# Two 、 Use steps
## 1. Import and stock in
# Reference documents
[QT engineering pro file TEMPLATE Variable description ](https://blog.csdn.net/qinpanke/article/details/22199271)
边栏推荐
- Use of sscanf function
- The maximum expression in Oracle database message list is 1000 error
- QT wmic command obtains some hardware information
- Daemon and user threads
- Deploying web projects using idea
- Determine whether the picture is in JPG picture format
- Grep command usage
- 汇编语言学习一(有栈协程铺垫,32位寄存器和相关指令学习,未完待续06/29)
- [Hot100]回文子串 与 最长回文子串
- How to determine the size of the platform byte order?
猜你喜欢

Qtcreator debug code after configuring CDB debugger view variable value display card

Connection flood attack principle

app quits unexpectedly

Class templates and friends

踩坑记录:supervisor 日志返回信息:redis扩展未安装

编写并运行第一个Go语言程序

How to use string branches for switch case

Skillfully use 5 keys to improve office efficiency

Merge: extension click the El table table data to expand

Google Earth Engine(GEE)——墨累全球潮汐湿地变化 v1 (1999-2019) 数据集
随机推荐
[Hot100]10. Regular Expression Matching
Grep command usage
Egret engine P2 physics engine (2) - Funny physical phenomenon of small balls hitting the ground
对占用多字节和位的报文信号解析详解
js创建pdf文件
The first up Master of station B paid to watch the video still came! Price "Persuading" netizens
元宇宙由哪些底层技术支撑?
编写并运行第一个Go语言程序
Finished product upgrade procedure
Write and run the first go language program
[implemented] server jar package startup script and shell script
Promise async/await
How crazy are young people in sideline industry: 3000 monthly salary and 3W sideline income
Linux server installation redis
Linux服務器安裝Redis
Cluster distributed
Golan common shortcut key settings
如果我在珠海,到哪里开户比较好?另外,手机开户安全么?
QT common macro definitions
Go语言指针介绍