From 903083183866b68df959d63db8af42745ba897a8 Mon Sep 17 00:00:00 2001 From: touwoyimuli Date: Wed, 20 Nov 2019 23:02:41 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=88=9B=E5=BB=BA=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E7=A9=BA=E7=9A=84=20TcpClient=20=E7=9A=84=E9=A1=B9=E7=9B=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- QtTcpEx/ExTcpClient/ExTcpClient.cpp | 14 ++++++++++ QtTcpEx/ExTcpClient/ExTcpClient.h | 22 ++++++++++++++++ QtTcpEx/ExTcpClient/ExTcpClient.pro | 40 +++++++++++++++++++++++++++++ QtTcpEx/ExTcpClient/ExTcpClient.ui | 24 +++++++++++++++++ QtTcpEx/ExTcpClient/main.cpp | 11 ++++++++ 5 files changed, 111 insertions(+) create mode 100644 QtTcpEx/ExTcpClient/ExTcpClient.cpp create mode 100644 QtTcpEx/ExTcpClient/ExTcpClient.h create mode 100644 QtTcpEx/ExTcpClient/ExTcpClient.pro create mode 100644 QtTcpEx/ExTcpClient/ExTcpClient.ui create mode 100644 QtTcpEx/ExTcpClient/main.cpp diff --git a/QtTcpEx/ExTcpClient/ExTcpClient.cpp b/QtTcpEx/ExTcpClient/ExTcpClient.cpp new file mode 100644 index 0000000..2240a6f --- /dev/null +++ b/QtTcpEx/ExTcpClient/ExTcpClient.cpp @@ -0,0 +1,14 @@ +#include "ExTcpClient.h" +#include "ui_ExTcpClient.h" + +ExTcpClient::ExTcpClient(QWidget *parent) : + QMainWindow(parent), + ui(new Ui::ExTcpClient) +{ + ui->setupUi(this); +} + +ExTcpClient::~ExTcpClient() +{ + delete ui; +} diff --git a/QtTcpEx/ExTcpClient/ExTcpClient.h b/QtTcpEx/ExTcpClient/ExTcpClient.h new file mode 100644 index 0000000..309353a --- /dev/null +++ b/QtTcpEx/ExTcpClient/ExTcpClient.h @@ -0,0 +1,22 @@ +#ifndef EXTCPCLIENT_H +#define EXTCPCLIENT_H + +#include + +namespace Ui { +class ExTcpClient; +} + +class ExTcpClient : public QMainWindow +{ + Q_OBJECT + +public: + explicit ExTcpClient(QWidget *parent = nullptr); + ~ExTcpClient(); + +private: + Ui::ExTcpClient *ui; +}; + +#endif // EXTCPCLIENT_H diff --git a/QtTcpEx/ExTcpClient/ExTcpClient.pro b/QtTcpEx/ExTcpClient/ExTcpClient.pro new file mode 100644 index 0000000..94f8e54 --- /dev/null +++ b/QtTcpEx/ExTcpClient/ExTcpClient.pro @@ -0,0 +1,40 @@ +#------------------------------------------------- +# +# Project created by QtCreator 2019-11-20T23:01:48 +# +#------------------------------------------------- + +QT += core gui + +greaterThan(QT_MAJOR_VERSION, 4): QT += widgets + +TARGET = ExTcpClient +TEMPLATE = app + +# The following define makes your compiler emit warnings if you use +# any feature of Qt which has been marked as deprecated (the exact warnings +# depend on your compiler). Please consult the documentation of the +# deprecated API in order to know how to port your code away from it. +DEFINES += QT_DEPRECATED_WARNINGS + +# You can also make your code fail to compile if you use deprecated APIs. +# In order to do so, uncomment the following line. +# You can also select to disable deprecated APIs only up to a certain version of Qt. +#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 + +CONFIG += c++11 + +SOURCES += \ + main.cpp \ + ExTcpClient.cpp + +HEADERS += \ + ExTcpClient.h + +FORMS += \ + ExTcpClient.ui + +# Default rules for deployment. +qnx: target.path = /tmp/$${TARGET}/bin +else: unix:!android: target.path = /opt/$${TARGET}/bin +!isEmpty(target.path): INSTALLS += target diff --git a/QtTcpEx/ExTcpClient/ExTcpClient.ui b/QtTcpEx/ExTcpClient/ExTcpClient.ui new file mode 100644 index 0000000..ecebee9 --- /dev/null +++ b/QtTcpEx/ExTcpClient/ExTcpClient.ui @@ -0,0 +1,24 @@ + + ExTcpClient + + + + 0 + 0 + 400 + 300 + + + + ExTcpClient + + + + + + + + + + + diff --git a/QtTcpEx/ExTcpClient/main.cpp b/QtTcpEx/ExTcpClient/main.cpp new file mode 100644 index 0000000..4c6206d --- /dev/null +++ b/QtTcpEx/ExTcpClient/main.cpp @@ -0,0 +1,11 @@ +#include "ExTcpClient.h" +#include + +int main(int argc, char *argv[]) +{ + QApplication a(argc, argv); + ExTcpClient w; + w.show(); + + return a.exec(); +}