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,
【 Explain in detail 】 Interview must ask :SpringBoot Automatic configuration principle 【 Hyper detail 】Java Realization of student information management system 2020 The 11th National Blue Bridge Cup Python group JavaScript note ( five )---- Branch statement MYSQL database SQL Sentence practice experiment EXERCISES. 1 SIMPLE COMMANDSMySQL Basics Commonly used sentence ( Add / delete / modify query )C++ of string of compare usage vue limit input Only positive numbers can be entered C Language of a Gobang game implementation Programmer refused due to low salary offer,HR become shame , Netizens instantly blew up ..