当前位置:网站首页>Introduction to QT (2.1 the first procedure for the beginning of QT)
Introduction to QT (2.1 the first procedure for the beginning of QT)
2022-07-24 00:43:00 【Forgotten dreams】
Take care of
One . Project creation steps
1. Click on QT In the software New Project( New projects )
2. Click on Application( application )->Qt Widgets Application(Qt Widget application )->choos( choice )
3. Create a name and path -> next step . Name cannot be Chinese
4. next step
5. next step
6. complete
Two . The function of each file generates
mainwindows.h The header file
main.cpp The main function
mainwindows.cpp The function corresponding to the header file
mainwindows.ui Interface file
3、 ... and . Code
mainwindows.h
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
private:
Ui::MainWindow *ui;
};
#endif // MAINWINDOW_H
mainwindows.cpp
#include "mainwindow.h"
#include "ui_mainwindow.h"
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
}
MainWindow::~MainWindow()
{
delete ui;
}
main.cpp
#include "mainwindow.h"
#include <QApplication>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
w.show();
return a.exec();
}
Running results

Finally, you get a dialog box
边栏推荐
- Understanding polymorphism and letting different "people" do the same thing will produce different results
- GBase 8c 会话信息函数(六)
- Difference between data index and label system of data warehouse
- GBase 8c 字符串操作符
- Classic example of C language - commodity inspection code
- 采坑websocket總結
- Gbase 8C bit string operator (I)
- AWS Part 4 one machine and one secret
- Gbase 8C system table information function (III)
- Sed in-depth understanding and use
猜你喜欢

Blockbuster | certik: Web3.0 industry safety report release in the second quarter of 2022 (PDF download link attached)

Beifeng communication appeared in China (Xiamen) emergency exhibition | intelligent communication means are strong and eye-catching!

The high-quality digital collection of guochuang's "children's song line" is on sale, and you are invited to create a young martial arts Jianghu dream

Intelligent OCR identification of express documents helps the logistics industry to upgrade Digitalization

Classic example of C language - convert the input two digits into English

Summary of polynomial commitment schemes

Classic examples of C language switch case statement conversion date format

網絡系統實驗:ping不通的問題解决

Printf function - conversion description

Interviewer: if the order is not paid within 30 minutes after it is generated, it will be automatically cancelled. How to realize it?
随机推荐
数仓数据标准详解-2022
Installation and use of appscan
MariaDB database upgrade version
Don't let Fujin Yibo see this
High number_ Chapter 1 space analytic geometry and vector algebra__ Two point distance
Problem note - unable to open include file: "direct.h": no such file or directory
MySQL之数据查询(SELECT)
Gbase 8C string operator
Expérience du système réseau: résoudre les problèmes de ping
Printf function - conversion description
postman测试接口在URL配置正确的情况下出现404或者500错误
网络系统实验:ping不通的问题解决
Semaphore
Difference between data index and label system of data warehouse
Redis persistence mechanism RDB, AOF
工作3年的测试员跳槽后工资是原来的2倍,秘诀原来是......
这是一道大水题
C language book recommendation
MySQL's heart index
How to speed up matrix multiplication -- optimizing GEMM (CPU single thread)