From feb6e05c47fb0421ab2dcc0a9e5d355a75e8cb2b Mon Sep 17 00:00:00 2001 From: iridiumR Date: Tue, 29 Mar 2022 23:03:33 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=8F=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Code/2-2-5_enhanced/mainwindow.ui | 2 +- SoftwareDesign/Code/2-3-3/mainwindow.ui | 2 +- SoftwareDesign/Code/2-3-4/2-3-4.pro | 24 ++++++++ SoftwareDesign/Code/2-3-4/main.cpp | 11 ++++ SoftwareDesign/Code/2-3-4/mainwindow.cpp | 15 +++++ SoftwareDesign/Code/2-3-4/mainwindow.h | 27 +++++++++ SoftwareDesign/Code/2-3-4/mainwindow.ui | 58 +++++++++++++++++++ 7 files changed, 137 insertions(+), 2 deletions(-) create mode 100644 SoftwareDesign/Code/2-3-4/2-3-4.pro create mode 100644 SoftwareDesign/Code/2-3-4/main.cpp create mode 100644 SoftwareDesign/Code/2-3-4/mainwindow.cpp create mode 100644 SoftwareDesign/Code/2-3-4/mainwindow.h create mode 100644 SoftwareDesign/Code/2-3-4/mainwindow.ui diff --git a/SoftwareDesign/Code/2-2-5_enhanced/mainwindow.ui b/SoftwareDesign/Code/2-2-5_enhanced/mainwindow.ui index 8c05681..e34d7d4 100644 --- a/SoftwareDesign/Code/2-2-5_enhanced/mainwindow.ui +++ b/SoftwareDesign/Code/2-2-5_enhanced/mainwindow.ui @@ -60,7 +60,7 @@ - Clear + Back diff --git a/SoftwareDesign/Code/2-3-3/mainwindow.ui b/SoftwareDesign/Code/2-3-3/mainwindow.ui index 293f439..a4e445d 100644 --- a/SoftwareDesign/Code/2-3-3/mainwindow.ui +++ b/SoftwareDesign/Code/2-3-3/mainwindow.ui @@ -11,7 +11,7 @@ - MainWindow + 4490 diff --git a/SoftwareDesign/Code/2-3-4/2-3-4.pro b/SoftwareDesign/Code/2-3-4/2-3-4.pro new file mode 100644 index 0000000..b915c09 --- /dev/null +++ b/SoftwareDesign/Code/2-3-4/2-3-4.pro @@ -0,0 +1,24 @@ +QT += core gui + +greaterThan(QT_MAJOR_VERSION, 4): QT += widgets + +CONFIG += c++17 + +# You can make your code fail to compile if it uses deprecated APIs. +# In order to do so, uncomment the following line. +#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 + +SOURCES += \ + main.cpp \ + mainwindow.cpp + +HEADERS += \ + mainwindow.h + +FORMS += \ + mainwindow.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/SoftwareDesign/Code/2-3-4/main.cpp b/SoftwareDesign/Code/2-3-4/main.cpp new file mode 100644 index 0000000..fd3e533 --- /dev/null +++ b/SoftwareDesign/Code/2-3-4/main.cpp @@ -0,0 +1,11 @@ +#include "mainwindow.h" + +#include + +int main(int argc, char *argv[]) +{ + QApplication a(argc, argv); + MainWindow w; + w.show(); + return a.exec(); +} diff --git a/SoftwareDesign/Code/2-3-4/mainwindow.cpp b/SoftwareDesign/Code/2-3-4/mainwindow.cpp new file mode 100644 index 0000000..41a26bd --- /dev/null +++ b/SoftwareDesign/Code/2-3-4/mainwindow.cpp @@ -0,0 +1,15 @@ +#include "mainwindow.h" +#include "ui_mainwindow.h" + +MainWindow::MainWindow(QWidget *parent) + : QMainWindow(parent) + , ui(new Ui::MainWindow) +{ + ui->setupUi(this); +} + +MainWindow::~MainWindow() +{ + delete ui; +} + diff --git a/SoftwareDesign/Code/2-3-4/mainwindow.h b/SoftwareDesign/Code/2-3-4/mainwindow.h new file mode 100644 index 0000000..f904d83 --- /dev/null +++ b/SoftwareDesign/Code/2-3-4/mainwindow.h @@ -0,0 +1,27 @@ +#ifndef MAINWINDOW_H +#define MAINWINDOW_H + +#include +#include +#include + +QT_BEGIN_NAMESPACE +namespace Ui { +class MainWindow; +} +QT_END_NAMESPACE + +class MainWindow : public QMainWindow { + Q_OBJECT + +public: + MainWindow(QWidget *parent = nullptr); + ~MainWindow(); + +private: + Ui::MainWindow *ui; + +protected: + void mouseEvent(QMouseEvent *e); +}; +#endif // MAINWINDOW_H diff --git a/SoftwareDesign/Code/2-3-4/mainwindow.ui b/SoftwareDesign/Code/2-3-4/mainwindow.ui new file mode 100644 index 0000000..ac966a0 --- /dev/null +++ b/SoftwareDesign/Code/2-3-4/mainwindow.ui @@ -0,0 +1,58 @@ + + + MainWindow + + + + 0 + 0 + 800 + 600 + + + + 4490 + + + + + + 110 + 160 + 77 + 25 + + + + TextLabel + + + + + + 330 + 160 + 77 + 25 + + + + TextLabel + + + + + + + 0 + 0 + 800 + 30 + + + + + + + +