diff --git a/AboutDlg.cpp b/AboutDlg.cpp new file mode 100644 index 0000000..cd095e6 --- /dev/null +++ b/AboutDlg.cpp @@ -0,0 +1,27 @@ +#include "AboutDlg.h" +#include "ui_AboutDlg.h" + +#include + +AboutDlg::AboutDlg(QWidget *parent) : + QDialog(parent), + ui(new Ui::AboutDlg) +{ + ui->setupUi(this); +} + +AboutDlg::~AboutDlg() +{ + delete ui; +} + +void AboutDlg::on_toolButton_AboutQt_clicked() +{ + QMessageBox::aboutQt(this); +} + +void AboutDlg::on_pushButton_Ok_clicked() +{ + accept(); +} + diff --git a/AboutDlg.h b/AboutDlg.h new file mode 100644 index 0000000..270ff5b --- /dev/null +++ b/AboutDlg.h @@ -0,0 +1,27 @@ +#ifndef ABOUTDLG_H +#define ABOUTDLG_H + +#include + +namespace Ui { +class AboutDlg; +} + +class AboutDlg : public QDialog +{ + Q_OBJECT + +public: + explicit AboutDlg(QWidget *parent = nullptr); + ~AboutDlg(); + +private slots: + void on_toolButton_AboutQt_clicked(); + + void on_pushButton_Ok_clicked(); + +private: + Ui::AboutDlg *ui; +}; + +#endif // ABOUTDLG_H diff --git a/AboutDlg.ui b/AboutDlg.ui new file mode 100644 index 0000000..d9100eb --- /dev/null +++ b/AboutDlg.ui @@ -0,0 +1,64 @@ + + + AboutDlg + + + + 0 + 0 + 600 + 200 + + + + 关于软件 + + + + + + Email: LiaoChengO@qq.com +https://github.com/CharlesLiaoO/EncodingConverter +Build with Qt/C++ + + + Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + + + + + + + + + About Qt + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + 确认 + + + + + + + + + + diff --git a/EncodingConverter.pro b/EncodingConverter.pro index f9a10a3..95361b0 100644 --- a/EncodingConverter.pro +++ b/EncodingConverter.pro @@ -17,13 +17,16 @@ else: unix:!android: target.path = /opt/$${TARGET}/bin #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 SOURCES += \ + AboutDlg.cpp \ NotPrjRel.cpp \ main.cpp \ MainWindow.cpp HEADERS += \ + AboutDlg.h \ MainWindow.h \ NotPrjRel.h FORMS += \ + AboutDlg.ui \ MainWindow.ui diff --git a/MainWindow.cpp b/MainWindow.cpp index 9e27f3e..133641b 100644 --- a/MainWindow.cpp +++ b/MainWindow.cpp @@ -24,6 +24,7 @@ MainWindow::MainWindow(QWidget *parent) , ui(new Ui::MainWindow) { ui->setupUi(this); + ui->toolButton_About->setIcon(style()->standardIcon(QStyle::SP_MessageBoxInformation)); iBigFileSizeMB = (double)iBigFileSize / (1024*1024); iMaxFileSizeGB = (double)iMaxFileSize / (1024*1024*1024); @@ -317,3 +318,10 @@ void MainWindow::UpdateProgress(int lineNum, float percentage) ui->plainTextEdit_MsgOutput->appendPlainText(sOutputLine); } +#include +void MainWindow::on_toolButton_About_clicked() +{ + AboutDlg aboutDlg(this); + aboutDlg.exec(); +} + diff --git a/MainWindow.h b/MainWindow.h index 75f91bf..e8b2a53 100644 --- a/MainWindow.h +++ b/MainWindow.h @@ -25,6 +25,8 @@ private slots: void on_comboBox_EncodingDest_currentTextChanged(const QString &arg1); void closeEvent(QCloseEvent *e); + void on_toolButton_About_clicked(); + private: Ui::MainWindow *ui; diff --git a/MainWindow.ui b/MainWindow.ui index fb0e69d..1da7100 100644 --- a/MainWindow.ui +++ b/MainWindow.ui @@ -300,6 +300,13 @@ + + + + + + + @@ -341,16 +348,6 @@ - - - - 0 - 0 - 800 - 18 - - -