当前位置:网站首页>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
边栏推荐
- Unity metaverse (I). Ready player me & blender customize your Avatar
- Detailed explanation of data warehouse standard -2022
- Classic example of C language - loan balance
- GBase 8c 字符串操作符
- Development of main applet for business card traffic near the map
- High number_ Chapter 2 differential calculus of multivariate functions__ Geometric application of partial derivatives_ Tangent and normal plane of space curve
- Classic example of C language - convert the input two digits into English
- Database connection pool & dbutils
- Inode, soft link, hard link
- Gbase 8C session information function (II)
猜你喜欢

Reverse linked list drawing demonstration

Flutter | specifies the type of page return value

如何提升数据质量

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

Redis | very important Middleware

Expérience du système réseau: résoudre les problèmes de ping

First knowledge of C language functions

Coloring old photos - deoldify get started quickly

Generic mechanism and enhanced for loop

数据标准详细概述-2022
随机推荐
GBase 8c 字符串操作符
Intelligent OCR identification of express documents helps the logistics industry to upgrade Digitalization
Redis distributed lock to be continued
入职3个月的测试员面临转正,领导:1年工作经验包装成5年,试用期淘汰
Interviewer: if the order is not paid within 30 minutes after it is generated, it will be automatically cancelled. How to realize it?
Bean validation custom container validation chapter ----06
Gbase 8C string Operator
How to use SAP intelligent robotic process automation to automate Excel
Accelerating matrix vector multiplication of special matrices with FFT
Pbootcms database conversion tutorial (SQLite to MySQL detailed tutorial)
GBase 8c 会话信息函数(三)
Educational Codeforces Round 132 (Rated for Div. 2)(A-D)
PostgreSQL snapshot optimization globalvis new system analysis (greatly enhanced performance)
Distributed cap principle
Blockbuster | certik: Web3.0 industry safety report release in the second quarter of 2022 (PDF download link attached)
Gbase 8C bit string operator (I)
SAP 电商云 Spartacus UI Store 相关的设计明细
GBase 8c 访问权限查询函数(一)
暑假第四周总结
Dataframe.groupby learning materials