One ,

QT += core gui greaterThan(QT_MAJOR_VERSION, 4): QT += widgets CONFIG += c++11
DEFINES += QT_DEPRECATED_WARNINGS SOURCES += \ main.cpp \ mainwidget.cpp
HEADERS += \ mainwidget.h qnx: target.path = /tmp/$${TARGET}/bin else:
unix:!android: target.path = /opt/$${TARGET}/bin !isEmpty(target.path):
INSTALLS += target
introduce :
1.
QT += core gui

Add module , Different modules can be added by themselves
Qt Widgets It was separated from the fifth edition
2.
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
greater than 4 Version above , contain widget modular
3. stay debug Can't run in the file , The following figure appears

resolvent : Go to the software installation bin Copy under folder bin file

Configuring system variables in a computer

You can open it again in the folder state exe It's a document
4.
CONFIG += c++11
use C++11 To compile
5.
DEFINES += QT_DEPRECATED_WARNINGS
Define compilation options .QT_DEPRECATED_WARNINGS When Qt Some features of are marked as obsolete , The compiler will issue a warning .
6.
SOURCES += \ main.cpp \ widget.cpp

sources Source file under file
7.
HEADERS += \ widget.h

Headers Source file under file
8.
TARGET = "guoguo"
generate exe File name of
9.
qnx: target.path = /tmp/$${TARGET}/bin else: unix:!android: target.path =
/opt/$${TARGET}/bin !isEmpty(target.path): INSTALLS += target
Add library files dynamically
Two ,

#ifndef WIDGET_H #define WIDGET_H #include <QWidget> class Widget : public
QWidget { Q_OBJECT public: Widget(QWidget *parent = nullptr); ~Widget(); };
#endif // WIDGET_H
* #ifndef WIDGET_H #define WIDGET_H
Header file
2.
#endif // WIDGET_H //#ifndef
Prevent renaming
3.
#include <QWidget>
Contains a window header class
4.
class Widget : public QWidget { }
Window class inheritance QWiget class
5.
Q_OBJECT
Mechanisms to allow signals and slots in classes
6.
public: Widget(QWidget *parent = nullptr); ~Widget();
Constructors and Destructors

Technology
©2019-2020 Toolsou All rights reserved,
What are the protection measures for website security ? Talking about uni-app Page value transfer problem Remember once EventBus Project issues caused by memory leaks I've been drinking soft water for three years ? What is the use of soft water and water softener Time conversion front desk will 2020-07-17T03:07:02.000+0000 Into 2020-07-17 11:07:02 Chuan Shen Count the number of letters (java Language implementation ) Time format 2020-01-13T16:00:00.000Z Medium T and Z What do they mean , How to deal with it msf Generate Trojan horse attack android mobile phone The world's first free open source ERP Odoo Ubuntu The best development environment What's the difference in server prices ?