当前位置:网站首页>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)
边栏推荐
- 【已解决】Failed! Error: Unknown error 1130
- [resolved] error 1290 (HY000): unknown error 1290
- Basic fragmentary thoughts
- Keil serial port redirection
- Google Earth Engine(GEE)——墨累全球潮汐湿地变化 v1 (1999-2019) 数据集
- Write about your feelings about love and express your emotions
- Grep command usage
- Win10 step pit - power on 0xc0000225
- js创建pdf文件
- What if I forget my account number after opening an account? Is it safe to open an account online?
猜你喜欢
[daily question] 535 Encryption and decryption of tinyurl
Xshell传输文件
【我的OpenGL学习进阶之旅】关于OpenGL的着色器的向量和矩阵分类的访问方式: xyzw/rgba/stpq以及数组下标
Skillfully use 5 keys to improve office efficiency
1285_ Expand macros defined by AUTOSAR functions and variables with scripts to improve readability
QT generate random number qrandomgenerator
How crazy are young people in sideline industry: 3000 monthly salary and 3W sideline income
Connection Flood攻击原理
Go语言指针介绍
[JSON tutorial] Chapter 1 learning notes
随机推荐
Win10 step pit - power on 0xc0000225
Resolved: initialize specified but the data directory has files in it Aborting
[datawhale team learning] task02: mathematical operation, string and text, list
Finished product upgrade procedure
Idea running run and services
Qstring to const char*
网络安全-VLAN和Tunk方法详解
Jingwei Hengrun won the 10ppm quality award of paccar group again
【我的OpenGL学习进阶之旅】关于OpenGL的着色器的向量和矩阵分类的访问方式: xyzw/rgba/stpq以及数组下标
leetcode:98. Validate binary search tree
grep命令用法
Linu foundation - zoning planning and use
Introduction to go project directory structure
1285_把AUTOSAR函数以及变量等定义的宏用脚本展开以提高可读性
[solved] failed! Error: Unknown error 1130
年轻人搞副业有多疯狂:月薪3000,副业收入3W
六,购物⻋与订单
Xshell transfer file
grep命令用法
What underlying technologies support the metauniverse?