diff --git a/AutoCalibrationXC.pro b/AutoCalibrationXC.pro index 6bcb335..7790b37 100644 --- a/AutoCalibrationXC.pro +++ b/AutoCalibrationXC.pro @@ -24,11 +24,6 @@ include(QPagedTable/QPagedTable.pri) SOURCES += main.cpp -SOURCES += MainWindow.cpp - -HEADERS += MainWindow.h - -FORMS += MainWindow.ui RC_ICONS = res/autoCalibration.ico diff --git a/AutoCalibrationXC.pro b/AutoCalibrationXC.pro index 6bcb335..7790b37 100644 --- a/AutoCalibrationXC.pro +++ b/AutoCalibrationXC.pro @@ -24,11 +24,6 @@ include(QPagedTable/QPagedTable.pri) SOURCES += main.cpp -SOURCES += MainWindow.cpp - -HEADERS += MainWindow.h - -FORMS += MainWindow.ui RC_ICONS = res/autoCalibration.ico diff --git a/MainWindow.cpp b/MainWindow.cpp deleted file mode 100644 index ff126e8..0000000 --- a/MainWindow.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#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/AutoCalibrationXC.pro b/AutoCalibrationXC.pro index 6bcb335..7790b37 100644 --- a/AutoCalibrationXC.pro +++ b/AutoCalibrationXC.pro @@ -24,11 +24,6 @@ include(QPagedTable/QPagedTable.pri) SOURCES += main.cpp -SOURCES += MainWindow.cpp - -HEADERS += MainWindow.h - -FORMS += MainWindow.ui RC_ICONS = res/autoCalibration.ico diff --git a/MainWindow.cpp b/MainWindow.cpp deleted file mode 100644 index ff126e8..0000000 --- a/MainWindow.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#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/MainWindow.h b/MainWindow.h deleted file mode 100644 index 4643e32..0000000 --- a/MainWindow.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#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; -}; -#endif // MAINWINDOW_H diff --git a/AutoCalibrationXC.pro b/AutoCalibrationXC.pro index 6bcb335..7790b37 100644 --- a/AutoCalibrationXC.pro +++ b/AutoCalibrationXC.pro @@ -24,11 +24,6 @@ include(QPagedTable/QPagedTable.pri) SOURCES += main.cpp -SOURCES += MainWindow.cpp - -HEADERS += MainWindow.h - -FORMS += MainWindow.ui RC_ICONS = res/autoCalibration.ico diff --git a/MainWindow.cpp b/MainWindow.cpp deleted file mode 100644 index ff126e8..0000000 --- a/MainWindow.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#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/MainWindow.h b/MainWindow.h deleted file mode 100644 index 4643e32..0000000 --- a/MainWindow.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#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; -}; -#endif // MAINWINDOW_H diff --git a/MainWindow.ui b/MainWindow.ui deleted file mode 100644 index b232854..0000000 --- a/MainWindow.ui +++ /dev/null @@ -1,22 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 800 - 600 - - - - MainWindow - - - - - - - - diff --git a/AutoCalibrationXC.pro b/AutoCalibrationXC.pro index 6bcb335..7790b37 100644 --- a/AutoCalibrationXC.pro +++ b/AutoCalibrationXC.pro @@ -24,11 +24,6 @@ include(QPagedTable/QPagedTable.pri) SOURCES += main.cpp -SOURCES += MainWindow.cpp - -HEADERS += MainWindow.h - -FORMS += MainWindow.ui RC_ICONS = res/autoCalibration.ico diff --git a/MainWindow.cpp b/MainWindow.cpp deleted file mode 100644 index ff126e8..0000000 --- a/MainWindow.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#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/MainWindow.h b/MainWindow.h deleted file mode 100644 index 4643e32..0000000 --- a/MainWindow.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#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; -}; -#endif // MAINWINDOW_H diff --git a/MainWindow.ui b/MainWindow.ui deleted file mode 100644 index b232854..0000000 --- a/MainWindow.ui +++ /dev/null @@ -1,22 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 800 - 600 - - - - MainWindow - - - - - - - - diff --git a/frame/CustomMessageBox.ui b/frame/CustomMessageBox.ui index 336be54..b545d74 100644 --- a/frame/CustomMessageBox.ui +++ b/frame/CustomMessageBox.ui @@ -84,8 +84,8 @@ - - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + + :/image/msgbox/icon_box_close.png:/image/msgbox/icon_box_close.png @@ -134,7 +134,7 @@ - :/image/msgbox/icon_box_success.png + :/image/msgbox/icon_box_success.png Qt::AlignCenter @@ -265,6 +265,8 @@ - + + + diff --git a/AutoCalibrationXC.pro b/AutoCalibrationXC.pro index 6bcb335..7790b37 100644 --- a/AutoCalibrationXC.pro +++ b/AutoCalibrationXC.pro @@ -24,11 +24,6 @@ include(QPagedTable/QPagedTable.pri) SOURCES += main.cpp -SOURCES += MainWindow.cpp - -HEADERS += MainWindow.h - -FORMS += MainWindow.ui RC_ICONS = res/autoCalibration.ico diff --git a/MainWindow.cpp b/MainWindow.cpp deleted file mode 100644 index ff126e8..0000000 --- a/MainWindow.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#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/MainWindow.h b/MainWindow.h deleted file mode 100644 index 4643e32..0000000 --- a/MainWindow.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#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; -}; -#endif // MAINWINDOW_H diff --git a/MainWindow.ui b/MainWindow.ui deleted file mode 100644 index b232854..0000000 --- a/MainWindow.ui +++ /dev/null @@ -1,22 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 800 - 600 - - - - MainWindow - - - - - - - - diff --git a/frame/CustomMessageBox.ui b/frame/CustomMessageBox.ui index 336be54..b545d74 100644 --- a/frame/CustomMessageBox.ui +++ b/frame/CustomMessageBox.ui @@ -84,8 +84,8 @@ - - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + + :/image/msgbox/icon_box_close.png:/image/msgbox/icon_box_close.png @@ -134,7 +134,7 @@ - :/image/msgbox/icon_box_success.png + :/image/msgbox/icon_box_success.png Qt::AlignCenter @@ -265,6 +265,8 @@ - + + + diff --git a/frame/MainWindowForm.cpp b/frame/MainWindowForm.cpp index 2ded44b..ec82cd7 100644 --- a/frame/MainWindowForm.cpp +++ b/frame/MainWindowForm.cpp @@ -1,6 +1,8 @@ #include "MainWindowForm.h" #include "ui_MainWindowForm.h" +#include + MainWindowForm::MainWindowForm(QWidget *parent) : FramelessWindow(parent), ui(new Ui::MainWindowForm) @@ -12,7 +14,7 @@ initMenuWidgets(); initFunctionButtons(); - // 每秒更新 界面上没有地方能摆 暂时先不启动定时器 + // 每秒更新 connect(TimeCounterUtil::getInstance().clockTimer, &QTimer::timeout, this, &MainWindowForm::onUpdateTimestampHandler); TimeCounterUtil::getInstance().clockTimer->start(1000); @@ -34,6 +36,7 @@ void MainWindowForm::initForm() { setWindowFlags(Qt::FramelessWindowHint); // 设置全屏 + setWindowState(Qt::WindowState::WindowMaximized); this->setTitleBar(ui->wdgtTop); // 设置窗口位置和大小 move(0, 0); @@ -120,6 +123,22 @@ setWindowState(Qt::WindowMinimized | windowState()); } +void MainWindowForm::on_btnMaxWin_clicked() +{ + QScreen *screen = QGuiApplication::primaryScreen(); + QRect screenSize = screen->availableGeometry(); // 可用区域(排除任务栏) + + if (this->isMaximized()) { + resize(screenSize.width() * 0.8, screenSize.height() * 0.8); + move(QRandomGenerator::global()->bounded(10, 100), QRandomGenerator::global()->bounded(10, 50)); + this->showNormal(); + } else { + resize(screenSize.width(), screenSize.height()); + move(0, 0); + this->showMaximized(); + } +} + void MainWindowForm::on_btnCloseWin_clicked() { // 创建一个消息框 @@ -146,18 +165,9 @@ ui->labelTime->setText(now.toString("yyyy-MM-dd HH:mm:ss")); } -void MainWindowForm::on_btnMenuMax_clicked() -{ - if (this->isMaximized()) { - this->showNormal(); - } else { - this->showMaximized(); - } -} - void MainWindowForm::titleDblClick() { - on_btnMenuMax_clicked(); + on_btnMaxWin_clicked(); } void MainWindowForm::onMenuButtonsEabled(bool enable) { diff --git a/AutoCalibrationXC.pro b/AutoCalibrationXC.pro index 6bcb335..7790b37 100644 --- a/AutoCalibrationXC.pro +++ b/AutoCalibrationXC.pro @@ -24,11 +24,6 @@ include(QPagedTable/QPagedTable.pri) SOURCES += main.cpp -SOURCES += MainWindow.cpp - -HEADERS += MainWindow.h - -FORMS += MainWindow.ui RC_ICONS = res/autoCalibration.ico diff --git a/MainWindow.cpp b/MainWindow.cpp deleted file mode 100644 index ff126e8..0000000 --- a/MainWindow.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#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/MainWindow.h b/MainWindow.h deleted file mode 100644 index 4643e32..0000000 --- a/MainWindow.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#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; -}; -#endif // MAINWINDOW_H diff --git a/MainWindow.ui b/MainWindow.ui deleted file mode 100644 index b232854..0000000 --- a/MainWindow.ui +++ /dev/null @@ -1,22 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 800 - 600 - - - - MainWindow - - - - - - - - diff --git a/frame/CustomMessageBox.ui b/frame/CustomMessageBox.ui index 336be54..b545d74 100644 --- a/frame/CustomMessageBox.ui +++ b/frame/CustomMessageBox.ui @@ -84,8 +84,8 @@ - - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + + :/image/msgbox/icon_box_close.png:/image/msgbox/icon_box_close.png @@ -134,7 +134,7 @@ - :/image/msgbox/icon_box_success.png + :/image/msgbox/icon_box_success.png Qt::AlignCenter @@ -265,6 +265,8 @@ - + + + diff --git a/frame/MainWindowForm.cpp b/frame/MainWindowForm.cpp index 2ded44b..ec82cd7 100644 --- a/frame/MainWindowForm.cpp +++ b/frame/MainWindowForm.cpp @@ -1,6 +1,8 @@ #include "MainWindowForm.h" #include "ui_MainWindowForm.h" +#include + MainWindowForm::MainWindowForm(QWidget *parent) : FramelessWindow(parent), ui(new Ui::MainWindowForm) @@ -12,7 +14,7 @@ initMenuWidgets(); initFunctionButtons(); - // 每秒更新 界面上没有地方能摆 暂时先不启动定时器 + // 每秒更新 connect(TimeCounterUtil::getInstance().clockTimer, &QTimer::timeout, this, &MainWindowForm::onUpdateTimestampHandler); TimeCounterUtil::getInstance().clockTimer->start(1000); @@ -34,6 +36,7 @@ void MainWindowForm::initForm() { setWindowFlags(Qt::FramelessWindowHint); // 设置全屏 + setWindowState(Qt::WindowState::WindowMaximized); this->setTitleBar(ui->wdgtTop); // 设置窗口位置和大小 move(0, 0); @@ -120,6 +123,22 @@ setWindowState(Qt::WindowMinimized | windowState()); } +void MainWindowForm::on_btnMaxWin_clicked() +{ + QScreen *screen = QGuiApplication::primaryScreen(); + QRect screenSize = screen->availableGeometry(); // 可用区域(排除任务栏) + + if (this->isMaximized()) { + resize(screenSize.width() * 0.8, screenSize.height() * 0.8); + move(QRandomGenerator::global()->bounded(10, 100), QRandomGenerator::global()->bounded(10, 50)); + this->showNormal(); + } else { + resize(screenSize.width(), screenSize.height()); + move(0, 0); + this->showMaximized(); + } +} + void MainWindowForm::on_btnCloseWin_clicked() { // 创建一个消息框 @@ -146,18 +165,9 @@ ui->labelTime->setText(now.toString("yyyy-MM-dd HH:mm:ss")); } -void MainWindowForm::on_btnMenuMax_clicked() -{ - if (this->isMaximized()) { - this->showNormal(); - } else { - this->showMaximized(); - } -} - void MainWindowForm::titleDblClick() { - on_btnMenuMax_clicked(); + on_btnMaxWin_clicked(); } void MainWindowForm::onMenuButtonsEabled(bool enable) { diff --git a/frame/MainWindowForm.h b/frame/MainWindowForm.h index 4d206b1..9b4eae4 100644 --- a/frame/MainWindowForm.h +++ b/frame/MainWindowForm.h @@ -45,11 +45,11 @@ private slots: void on_btnMinWin_clicked(); + void on_btnMaxWin_clicked(); void on_btnCloseWin_clicked(); void onFunctionButtonsAction(); void onUpdateTimestampHandler(); - void on_btnMenuMax_clicked(); void titleDblClick(); void onMenuButtonsEabled(bool enable); diff --git a/AutoCalibrationXC.pro b/AutoCalibrationXC.pro index 6bcb335..7790b37 100644 --- a/AutoCalibrationXC.pro +++ b/AutoCalibrationXC.pro @@ -24,11 +24,6 @@ include(QPagedTable/QPagedTable.pri) SOURCES += main.cpp -SOURCES += MainWindow.cpp - -HEADERS += MainWindow.h - -FORMS += MainWindow.ui RC_ICONS = res/autoCalibration.ico diff --git a/MainWindow.cpp b/MainWindow.cpp deleted file mode 100644 index ff126e8..0000000 --- a/MainWindow.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#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/MainWindow.h b/MainWindow.h deleted file mode 100644 index 4643e32..0000000 --- a/MainWindow.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#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; -}; -#endif // MAINWINDOW_H diff --git a/MainWindow.ui b/MainWindow.ui deleted file mode 100644 index b232854..0000000 --- a/MainWindow.ui +++ /dev/null @@ -1,22 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 800 - 600 - - - - MainWindow - - - - - - - - diff --git a/frame/CustomMessageBox.ui b/frame/CustomMessageBox.ui index 336be54..b545d74 100644 --- a/frame/CustomMessageBox.ui +++ b/frame/CustomMessageBox.ui @@ -84,8 +84,8 @@ - - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + + :/image/msgbox/icon_box_close.png:/image/msgbox/icon_box_close.png @@ -134,7 +134,7 @@ - :/image/msgbox/icon_box_success.png + :/image/msgbox/icon_box_success.png Qt::AlignCenter @@ -265,6 +265,8 @@ - + + + diff --git a/frame/MainWindowForm.cpp b/frame/MainWindowForm.cpp index 2ded44b..ec82cd7 100644 --- a/frame/MainWindowForm.cpp +++ b/frame/MainWindowForm.cpp @@ -1,6 +1,8 @@ #include "MainWindowForm.h" #include "ui_MainWindowForm.h" +#include + MainWindowForm::MainWindowForm(QWidget *parent) : FramelessWindow(parent), ui(new Ui::MainWindowForm) @@ -12,7 +14,7 @@ initMenuWidgets(); initFunctionButtons(); - // 每秒更新 界面上没有地方能摆 暂时先不启动定时器 + // 每秒更新 connect(TimeCounterUtil::getInstance().clockTimer, &QTimer::timeout, this, &MainWindowForm::onUpdateTimestampHandler); TimeCounterUtil::getInstance().clockTimer->start(1000); @@ -34,6 +36,7 @@ void MainWindowForm::initForm() { setWindowFlags(Qt::FramelessWindowHint); // 设置全屏 + setWindowState(Qt::WindowState::WindowMaximized); this->setTitleBar(ui->wdgtTop); // 设置窗口位置和大小 move(0, 0); @@ -120,6 +123,22 @@ setWindowState(Qt::WindowMinimized | windowState()); } +void MainWindowForm::on_btnMaxWin_clicked() +{ + QScreen *screen = QGuiApplication::primaryScreen(); + QRect screenSize = screen->availableGeometry(); // 可用区域(排除任务栏) + + if (this->isMaximized()) { + resize(screenSize.width() * 0.8, screenSize.height() * 0.8); + move(QRandomGenerator::global()->bounded(10, 100), QRandomGenerator::global()->bounded(10, 50)); + this->showNormal(); + } else { + resize(screenSize.width(), screenSize.height()); + move(0, 0); + this->showMaximized(); + } +} + void MainWindowForm::on_btnCloseWin_clicked() { // 创建一个消息框 @@ -146,18 +165,9 @@ ui->labelTime->setText(now.toString("yyyy-MM-dd HH:mm:ss")); } -void MainWindowForm::on_btnMenuMax_clicked() -{ - if (this->isMaximized()) { - this->showNormal(); - } else { - this->showMaximized(); - } -} - void MainWindowForm::titleDblClick() { - on_btnMenuMax_clicked(); + on_btnMaxWin_clicked(); } void MainWindowForm::onMenuButtonsEabled(bool enable) { diff --git a/frame/MainWindowForm.h b/frame/MainWindowForm.h index 4d206b1..9b4eae4 100644 --- a/frame/MainWindowForm.h +++ b/frame/MainWindowForm.h @@ -45,11 +45,11 @@ private slots: void on_btnMinWin_clicked(); + void on_btnMaxWin_clicked(); void on_btnCloseWin_clicked(); void onFunctionButtonsAction(); void onUpdateTimestampHandler(); - void on_btnMenuMax_clicked(); void titleDblClick(); void onMenuButtonsEabled(bool enable); diff --git a/frame/MainWindowForm.ui b/frame/MainWindowForm.ui index bd42122..f37d171 100644 --- a/frame/MainWindowForm.ui +++ b/frame/MainWindowForm.ui @@ -41,7 +41,7 @@ 0 - 120 + 100 @@ -58,7 +58,7 @@ 20 - 0 + 20 @@ -88,8 +88,8 @@ - 120 - 120 + 150 + 100 @@ -107,6 +107,22 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + @@ -158,7 +174,7 @@ 100 - 84 + 72 @@ -166,7 +182,8 @@ - :/image/main/calibration.png:/image/main/calibration.png + :/image/main/icon_menu_calibration.png + :/image/main/icon_menu_calibration_selected.png:/image/main/icon_menu_calibration.png @@ -184,7 +201,7 @@ 100 - 84 + 72 @@ -192,7 +209,8 @@ - :/image/main/rawDataRecord.png:/image/main/rawDataRecord.png + :/image/main/icon_menu_check.png + :/image/main/icon_menu_check_selected.png:/image/main/icon_menu_check.png @@ -210,7 +228,7 @@ 100 - 84 + 72 @@ -218,7 +236,8 @@ - :/image/main/fileRes.png:/image/main/fileRes.png + :/image/main/icon_menu_infomation.png + :/image/main/icon_menu_infomation_checked.png:/image/main/icon_menu_infomation.png @@ -235,10 +254,147 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 50 + 20 + + + + + - 320 + 240 + 16777215 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 5 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + :/image/main/iconTemp.png + + + + + + + 34.5℃ + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + + + + :/image/main/iconHumi.png + + + + + + + 25%Rh + + + + + + + + + + + + + + 240 16777215 @@ -308,7 +464,7 @@ - :/image/main/icon_setting_p.png:/image/main/icon_setting_p.png + :/image/main/icon_setting.png:/image/main/icon_setting.png @@ -334,7 +490,33 @@ - :/image/main/icon_min_p.png:/image/main/icon_min_p.png + :/image/main/icon_min.png:/image/main/icon_min.png + + + + 32 + 32 + + + + + + + + + 40 + 40 + + + + 最小化 + + + + + + + :/image/main/icon_max.png:/image/main/icon_max.png @@ -360,7 +542,7 @@ - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + :/image/main/icon_close.png:/image/main/icon_close.png @@ -426,87 +608,9 @@ - - - - - 0 - 30 - - - - - 20 - - - 0 - - - 0 - - - 40 - - - 0 - - - - - Qt::Horizontal - - - - 1289 - 20 - - - - - - - - - - - - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 20 - - - - - - - - - - - - - - wdgtContent wdgtTop - wdgtFoot diff --git a/AutoCalibrationXC.pro b/AutoCalibrationXC.pro index 6bcb335..7790b37 100644 --- a/AutoCalibrationXC.pro +++ b/AutoCalibrationXC.pro @@ -24,11 +24,6 @@ include(QPagedTable/QPagedTable.pri) SOURCES += main.cpp -SOURCES += MainWindow.cpp - -HEADERS += MainWindow.h - -FORMS += MainWindow.ui RC_ICONS = res/autoCalibration.ico diff --git a/MainWindow.cpp b/MainWindow.cpp deleted file mode 100644 index ff126e8..0000000 --- a/MainWindow.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#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/MainWindow.h b/MainWindow.h deleted file mode 100644 index 4643e32..0000000 --- a/MainWindow.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#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; -}; -#endif // MAINWINDOW_H diff --git a/MainWindow.ui b/MainWindow.ui deleted file mode 100644 index b232854..0000000 --- a/MainWindow.ui +++ /dev/null @@ -1,22 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 800 - 600 - - - - MainWindow - - - - - - - - diff --git a/frame/CustomMessageBox.ui b/frame/CustomMessageBox.ui index 336be54..b545d74 100644 --- a/frame/CustomMessageBox.ui +++ b/frame/CustomMessageBox.ui @@ -84,8 +84,8 @@ - - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + + :/image/msgbox/icon_box_close.png:/image/msgbox/icon_box_close.png @@ -134,7 +134,7 @@ - :/image/msgbox/icon_box_success.png + :/image/msgbox/icon_box_success.png Qt::AlignCenter @@ -265,6 +265,8 @@ - + + + diff --git a/frame/MainWindowForm.cpp b/frame/MainWindowForm.cpp index 2ded44b..ec82cd7 100644 --- a/frame/MainWindowForm.cpp +++ b/frame/MainWindowForm.cpp @@ -1,6 +1,8 @@ #include "MainWindowForm.h" #include "ui_MainWindowForm.h" +#include + MainWindowForm::MainWindowForm(QWidget *parent) : FramelessWindow(parent), ui(new Ui::MainWindowForm) @@ -12,7 +14,7 @@ initMenuWidgets(); initFunctionButtons(); - // 每秒更新 界面上没有地方能摆 暂时先不启动定时器 + // 每秒更新 connect(TimeCounterUtil::getInstance().clockTimer, &QTimer::timeout, this, &MainWindowForm::onUpdateTimestampHandler); TimeCounterUtil::getInstance().clockTimer->start(1000); @@ -34,6 +36,7 @@ void MainWindowForm::initForm() { setWindowFlags(Qt::FramelessWindowHint); // 设置全屏 + setWindowState(Qt::WindowState::WindowMaximized); this->setTitleBar(ui->wdgtTop); // 设置窗口位置和大小 move(0, 0); @@ -120,6 +123,22 @@ setWindowState(Qt::WindowMinimized | windowState()); } +void MainWindowForm::on_btnMaxWin_clicked() +{ + QScreen *screen = QGuiApplication::primaryScreen(); + QRect screenSize = screen->availableGeometry(); // 可用区域(排除任务栏) + + if (this->isMaximized()) { + resize(screenSize.width() * 0.8, screenSize.height() * 0.8); + move(QRandomGenerator::global()->bounded(10, 100), QRandomGenerator::global()->bounded(10, 50)); + this->showNormal(); + } else { + resize(screenSize.width(), screenSize.height()); + move(0, 0); + this->showMaximized(); + } +} + void MainWindowForm::on_btnCloseWin_clicked() { // 创建一个消息框 @@ -146,18 +165,9 @@ ui->labelTime->setText(now.toString("yyyy-MM-dd HH:mm:ss")); } -void MainWindowForm::on_btnMenuMax_clicked() -{ - if (this->isMaximized()) { - this->showNormal(); - } else { - this->showMaximized(); - } -} - void MainWindowForm::titleDblClick() { - on_btnMenuMax_clicked(); + on_btnMaxWin_clicked(); } void MainWindowForm::onMenuButtonsEabled(bool enable) { diff --git a/frame/MainWindowForm.h b/frame/MainWindowForm.h index 4d206b1..9b4eae4 100644 --- a/frame/MainWindowForm.h +++ b/frame/MainWindowForm.h @@ -45,11 +45,11 @@ private slots: void on_btnMinWin_clicked(); + void on_btnMaxWin_clicked(); void on_btnCloseWin_clicked(); void onFunctionButtonsAction(); void onUpdateTimestampHandler(); - void on_btnMenuMax_clicked(); void titleDblClick(); void onMenuButtonsEabled(bool enable); diff --git a/frame/MainWindowForm.ui b/frame/MainWindowForm.ui index bd42122..f37d171 100644 --- a/frame/MainWindowForm.ui +++ b/frame/MainWindowForm.ui @@ -41,7 +41,7 @@ 0 - 120 + 100 @@ -58,7 +58,7 @@ 20 - 0 + 20 @@ -88,8 +88,8 @@ - 120 - 120 + 150 + 100 @@ -107,6 +107,22 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + @@ -158,7 +174,7 @@ 100 - 84 + 72 @@ -166,7 +182,8 @@ - :/image/main/calibration.png:/image/main/calibration.png + :/image/main/icon_menu_calibration.png + :/image/main/icon_menu_calibration_selected.png:/image/main/icon_menu_calibration.png @@ -184,7 +201,7 @@ 100 - 84 + 72 @@ -192,7 +209,8 @@ - :/image/main/rawDataRecord.png:/image/main/rawDataRecord.png + :/image/main/icon_menu_check.png + :/image/main/icon_menu_check_selected.png:/image/main/icon_menu_check.png @@ -210,7 +228,7 @@ 100 - 84 + 72 @@ -218,7 +236,8 @@ - :/image/main/fileRes.png:/image/main/fileRes.png + :/image/main/icon_menu_infomation.png + :/image/main/icon_menu_infomation_checked.png:/image/main/icon_menu_infomation.png @@ -235,10 +254,147 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 50 + 20 + + + + + - 320 + 240 + 16777215 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 5 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + :/image/main/iconTemp.png + + + + + + + 34.5℃ + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + + + + :/image/main/iconHumi.png + + + + + + + 25%Rh + + + + + + + + + + + + + + 240 16777215 @@ -308,7 +464,7 @@ - :/image/main/icon_setting_p.png:/image/main/icon_setting_p.png + :/image/main/icon_setting.png:/image/main/icon_setting.png @@ -334,7 +490,33 @@ - :/image/main/icon_min_p.png:/image/main/icon_min_p.png + :/image/main/icon_min.png:/image/main/icon_min.png + + + + 32 + 32 + + + + + + + + + 40 + 40 + + + + 最小化 + + + + + + + :/image/main/icon_max.png:/image/main/icon_max.png @@ -360,7 +542,7 @@ - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + :/image/main/icon_close.png:/image/main/icon_close.png @@ -426,87 +608,9 @@ - - - - - 0 - 30 - - - - - 20 - - - 0 - - - 0 - - - 40 - - - 0 - - - - - Qt::Horizontal - - - - 1289 - 20 - - - - - - - - - - - - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 20 - - - - - - - - - - - - - - wdgtContent wdgtTop - wdgtFoot diff --git a/infomation/InfoMainForm.cpp b/infomation/InfoMainForm.cpp index c001199..5d0ffc8 100644 --- a/infomation/InfoMainForm.cpp +++ b/infomation/InfoMainForm.cpp @@ -21,9 +21,13 @@ void InfoMainForm::initForm() { + // 加载样式表 + QString qssStyle = QssFileUtils::loadQssFileContent(QApplication::applicationDirPath() + "/qss/infoMain.css"); + if (qssStyle.isEmpty() == false) { + this->setStyleSheet(qssStyle); // 仅本窗口生效 + } - - + ui->scrollArea->setWindowFlags(Qt::FramelessWindowHint); // 设置无边框 } void InfoMainForm::initSubMenuForms() { diff --git a/AutoCalibrationXC.pro b/AutoCalibrationXC.pro index 6bcb335..7790b37 100644 --- a/AutoCalibrationXC.pro +++ b/AutoCalibrationXC.pro @@ -24,11 +24,6 @@ include(QPagedTable/QPagedTable.pri) SOURCES += main.cpp -SOURCES += MainWindow.cpp - -HEADERS += MainWindow.h - -FORMS += MainWindow.ui RC_ICONS = res/autoCalibration.ico diff --git a/MainWindow.cpp b/MainWindow.cpp deleted file mode 100644 index ff126e8..0000000 --- a/MainWindow.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#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/MainWindow.h b/MainWindow.h deleted file mode 100644 index 4643e32..0000000 --- a/MainWindow.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#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; -}; -#endif // MAINWINDOW_H diff --git a/MainWindow.ui b/MainWindow.ui deleted file mode 100644 index b232854..0000000 --- a/MainWindow.ui +++ /dev/null @@ -1,22 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 800 - 600 - - - - MainWindow - - - - - - - - diff --git a/frame/CustomMessageBox.ui b/frame/CustomMessageBox.ui index 336be54..b545d74 100644 --- a/frame/CustomMessageBox.ui +++ b/frame/CustomMessageBox.ui @@ -84,8 +84,8 @@ - - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + + :/image/msgbox/icon_box_close.png:/image/msgbox/icon_box_close.png @@ -134,7 +134,7 @@ - :/image/msgbox/icon_box_success.png + :/image/msgbox/icon_box_success.png Qt::AlignCenter @@ -265,6 +265,8 @@ - + + + diff --git a/frame/MainWindowForm.cpp b/frame/MainWindowForm.cpp index 2ded44b..ec82cd7 100644 --- a/frame/MainWindowForm.cpp +++ b/frame/MainWindowForm.cpp @@ -1,6 +1,8 @@ #include "MainWindowForm.h" #include "ui_MainWindowForm.h" +#include + MainWindowForm::MainWindowForm(QWidget *parent) : FramelessWindow(parent), ui(new Ui::MainWindowForm) @@ -12,7 +14,7 @@ initMenuWidgets(); initFunctionButtons(); - // 每秒更新 界面上没有地方能摆 暂时先不启动定时器 + // 每秒更新 connect(TimeCounterUtil::getInstance().clockTimer, &QTimer::timeout, this, &MainWindowForm::onUpdateTimestampHandler); TimeCounterUtil::getInstance().clockTimer->start(1000); @@ -34,6 +36,7 @@ void MainWindowForm::initForm() { setWindowFlags(Qt::FramelessWindowHint); // 设置全屏 + setWindowState(Qt::WindowState::WindowMaximized); this->setTitleBar(ui->wdgtTop); // 设置窗口位置和大小 move(0, 0); @@ -120,6 +123,22 @@ setWindowState(Qt::WindowMinimized | windowState()); } +void MainWindowForm::on_btnMaxWin_clicked() +{ + QScreen *screen = QGuiApplication::primaryScreen(); + QRect screenSize = screen->availableGeometry(); // 可用区域(排除任务栏) + + if (this->isMaximized()) { + resize(screenSize.width() * 0.8, screenSize.height() * 0.8); + move(QRandomGenerator::global()->bounded(10, 100), QRandomGenerator::global()->bounded(10, 50)); + this->showNormal(); + } else { + resize(screenSize.width(), screenSize.height()); + move(0, 0); + this->showMaximized(); + } +} + void MainWindowForm::on_btnCloseWin_clicked() { // 创建一个消息框 @@ -146,18 +165,9 @@ ui->labelTime->setText(now.toString("yyyy-MM-dd HH:mm:ss")); } -void MainWindowForm::on_btnMenuMax_clicked() -{ - if (this->isMaximized()) { - this->showNormal(); - } else { - this->showMaximized(); - } -} - void MainWindowForm::titleDblClick() { - on_btnMenuMax_clicked(); + on_btnMaxWin_clicked(); } void MainWindowForm::onMenuButtonsEabled(bool enable) { diff --git a/frame/MainWindowForm.h b/frame/MainWindowForm.h index 4d206b1..9b4eae4 100644 --- a/frame/MainWindowForm.h +++ b/frame/MainWindowForm.h @@ -45,11 +45,11 @@ private slots: void on_btnMinWin_clicked(); + void on_btnMaxWin_clicked(); void on_btnCloseWin_clicked(); void onFunctionButtonsAction(); void onUpdateTimestampHandler(); - void on_btnMenuMax_clicked(); void titleDblClick(); void onMenuButtonsEabled(bool enable); diff --git a/frame/MainWindowForm.ui b/frame/MainWindowForm.ui index bd42122..f37d171 100644 --- a/frame/MainWindowForm.ui +++ b/frame/MainWindowForm.ui @@ -41,7 +41,7 @@ 0 - 120 + 100 @@ -58,7 +58,7 @@ 20 - 0 + 20 @@ -88,8 +88,8 @@ - 120 - 120 + 150 + 100 @@ -107,6 +107,22 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + @@ -158,7 +174,7 @@ 100 - 84 + 72 @@ -166,7 +182,8 @@ - :/image/main/calibration.png:/image/main/calibration.png + :/image/main/icon_menu_calibration.png + :/image/main/icon_menu_calibration_selected.png:/image/main/icon_menu_calibration.png @@ -184,7 +201,7 @@ 100 - 84 + 72 @@ -192,7 +209,8 @@ - :/image/main/rawDataRecord.png:/image/main/rawDataRecord.png + :/image/main/icon_menu_check.png + :/image/main/icon_menu_check_selected.png:/image/main/icon_menu_check.png @@ -210,7 +228,7 @@ 100 - 84 + 72 @@ -218,7 +236,8 @@ - :/image/main/fileRes.png:/image/main/fileRes.png + :/image/main/icon_menu_infomation.png + :/image/main/icon_menu_infomation_checked.png:/image/main/icon_menu_infomation.png @@ -235,10 +254,147 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 50 + 20 + + + + + - 320 + 240 + 16777215 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 5 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + :/image/main/iconTemp.png + + + + + + + 34.5℃ + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + + + + :/image/main/iconHumi.png + + + + + + + 25%Rh + + + + + + + + + + + + + + 240 16777215 @@ -308,7 +464,7 @@ - :/image/main/icon_setting_p.png:/image/main/icon_setting_p.png + :/image/main/icon_setting.png:/image/main/icon_setting.png @@ -334,7 +490,33 @@ - :/image/main/icon_min_p.png:/image/main/icon_min_p.png + :/image/main/icon_min.png:/image/main/icon_min.png + + + + 32 + 32 + + + + + + + + + 40 + 40 + + + + 最小化 + + + + + + + :/image/main/icon_max.png:/image/main/icon_max.png @@ -360,7 +542,7 @@ - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + :/image/main/icon_close.png:/image/main/icon_close.png @@ -426,87 +608,9 @@ - - - - - 0 - 30 - - - - - 20 - - - 0 - - - 0 - - - 40 - - - 0 - - - - - Qt::Horizontal - - - - 1289 - 20 - - - - - - - - - - - - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 20 - - - - - - - - - - - - - - wdgtContent wdgtTop - wdgtFoot diff --git a/infomation/InfoMainForm.cpp b/infomation/InfoMainForm.cpp index c001199..5d0ffc8 100644 --- a/infomation/InfoMainForm.cpp +++ b/infomation/InfoMainForm.cpp @@ -21,9 +21,13 @@ void InfoMainForm::initForm() { + // 加载样式表 + QString qssStyle = QssFileUtils::loadQssFileContent(QApplication::applicationDirPath() + "/qss/infoMain.css"); + if (qssStyle.isEmpty() == false) { + this->setStyleSheet(qssStyle); // 仅本窗口生效 + } - - + ui->scrollArea->setWindowFlags(Qt::FramelessWindowHint); // 设置无边框 } void InfoMainForm::initSubMenuForms() { diff --git a/infomation/InfoMainForm.ui b/infomation/InfoMainForm.ui index 958a6b2..d9066dd 100644 --- a/infomation/InfoMainForm.ui +++ b/infomation/InfoMainForm.ui @@ -90,7 +90,7 @@ - 280 + 295 48 @@ -103,7 +103,7 @@ - 280 + 295 48 @@ -116,7 +116,7 @@ - 280 + 295 48 @@ -129,7 +129,7 @@ - 280 + 295 48 @@ -142,7 +142,7 @@ - 280 + 295 48 @@ -155,7 +155,7 @@ - 280 + 295 48 @@ -168,7 +168,7 @@ - 280 + 295 48 @@ -181,7 +181,7 @@ - 280 + 295 48 @@ -194,7 +194,7 @@ - 280 + 295 48 @@ -207,7 +207,7 @@ - 280 + 295 48 @@ -220,7 +220,7 @@ - 280 + 295 48 @@ -233,7 +233,7 @@ - 280 + 295 48 @@ -246,7 +246,7 @@ - 280 + 295 48 diff --git a/AutoCalibrationXC.pro b/AutoCalibrationXC.pro index 6bcb335..7790b37 100644 --- a/AutoCalibrationXC.pro +++ b/AutoCalibrationXC.pro @@ -24,11 +24,6 @@ include(QPagedTable/QPagedTable.pri) SOURCES += main.cpp -SOURCES += MainWindow.cpp - -HEADERS += MainWindow.h - -FORMS += MainWindow.ui RC_ICONS = res/autoCalibration.ico diff --git a/MainWindow.cpp b/MainWindow.cpp deleted file mode 100644 index ff126e8..0000000 --- a/MainWindow.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#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/MainWindow.h b/MainWindow.h deleted file mode 100644 index 4643e32..0000000 --- a/MainWindow.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#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; -}; -#endif // MAINWINDOW_H diff --git a/MainWindow.ui b/MainWindow.ui deleted file mode 100644 index b232854..0000000 --- a/MainWindow.ui +++ /dev/null @@ -1,22 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 800 - 600 - - - - MainWindow - - - - - - - - diff --git a/frame/CustomMessageBox.ui b/frame/CustomMessageBox.ui index 336be54..b545d74 100644 --- a/frame/CustomMessageBox.ui +++ b/frame/CustomMessageBox.ui @@ -84,8 +84,8 @@ - - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + + :/image/msgbox/icon_box_close.png:/image/msgbox/icon_box_close.png @@ -134,7 +134,7 @@ - :/image/msgbox/icon_box_success.png + :/image/msgbox/icon_box_success.png Qt::AlignCenter @@ -265,6 +265,8 @@ - + + + diff --git a/frame/MainWindowForm.cpp b/frame/MainWindowForm.cpp index 2ded44b..ec82cd7 100644 --- a/frame/MainWindowForm.cpp +++ b/frame/MainWindowForm.cpp @@ -1,6 +1,8 @@ #include "MainWindowForm.h" #include "ui_MainWindowForm.h" +#include + MainWindowForm::MainWindowForm(QWidget *parent) : FramelessWindow(parent), ui(new Ui::MainWindowForm) @@ -12,7 +14,7 @@ initMenuWidgets(); initFunctionButtons(); - // 每秒更新 界面上没有地方能摆 暂时先不启动定时器 + // 每秒更新 connect(TimeCounterUtil::getInstance().clockTimer, &QTimer::timeout, this, &MainWindowForm::onUpdateTimestampHandler); TimeCounterUtil::getInstance().clockTimer->start(1000); @@ -34,6 +36,7 @@ void MainWindowForm::initForm() { setWindowFlags(Qt::FramelessWindowHint); // 设置全屏 + setWindowState(Qt::WindowState::WindowMaximized); this->setTitleBar(ui->wdgtTop); // 设置窗口位置和大小 move(0, 0); @@ -120,6 +123,22 @@ setWindowState(Qt::WindowMinimized | windowState()); } +void MainWindowForm::on_btnMaxWin_clicked() +{ + QScreen *screen = QGuiApplication::primaryScreen(); + QRect screenSize = screen->availableGeometry(); // 可用区域(排除任务栏) + + if (this->isMaximized()) { + resize(screenSize.width() * 0.8, screenSize.height() * 0.8); + move(QRandomGenerator::global()->bounded(10, 100), QRandomGenerator::global()->bounded(10, 50)); + this->showNormal(); + } else { + resize(screenSize.width(), screenSize.height()); + move(0, 0); + this->showMaximized(); + } +} + void MainWindowForm::on_btnCloseWin_clicked() { // 创建一个消息框 @@ -146,18 +165,9 @@ ui->labelTime->setText(now.toString("yyyy-MM-dd HH:mm:ss")); } -void MainWindowForm::on_btnMenuMax_clicked() -{ - if (this->isMaximized()) { - this->showNormal(); - } else { - this->showMaximized(); - } -} - void MainWindowForm::titleDblClick() { - on_btnMenuMax_clicked(); + on_btnMaxWin_clicked(); } void MainWindowForm::onMenuButtonsEabled(bool enable) { diff --git a/frame/MainWindowForm.h b/frame/MainWindowForm.h index 4d206b1..9b4eae4 100644 --- a/frame/MainWindowForm.h +++ b/frame/MainWindowForm.h @@ -45,11 +45,11 @@ private slots: void on_btnMinWin_clicked(); + void on_btnMaxWin_clicked(); void on_btnCloseWin_clicked(); void onFunctionButtonsAction(); void onUpdateTimestampHandler(); - void on_btnMenuMax_clicked(); void titleDblClick(); void onMenuButtonsEabled(bool enable); diff --git a/frame/MainWindowForm.ui b/frame/MainWindowForm.ui index bd42122..f37d171 100644 --- a/frame/MainWindowForm.ui +++ b/frame/MainWindowForm.ui @@ -41,7 +41,7 @@ 0 - 120 + 100 @@ -58,7 +58,7 @@ 20 - 0 + 20 @@ -88,8 +88,8 @@ - 120 - 120 + 150 + 100 @@ -107,6 +107,22 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + @@ -158,7 +174,7 @@ 100 - 84 + 72 @@ -166,7 +182,8 @@ - :/image/main/calibration.png:/image/main/calibration.png + :/image/main/icon_menu_calibration.png + :/image/main/icon_menu_calibration_selected.png:/image/main/icon_menu_calibration.png @@ -184,7 +201,7 @@ 100 - 84 + 72 @@ -192,7 +209,8 @@ - :/image/main/rawDataRecord.png:/image/main/rawDataRecord.png + :/image/main/icon_menu_check.png + :/image/main/icon_menu_check_selected.png:/image/main/icon_menu_check.png @@ -210,7 +228,7 @@ 100 - 84 + 72 @@ -218,7 +236,8 @@ - :/image/main/fileRes.png:/image/main/fileRes.png + :/image/main/icon_menu_infomation.png + :/image/main/icon_menu_infomation_checked.png:/image/main/icon_menu_infomation.png @@ -235,10 +254,147 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 50 + 20 + + + + + - 320 + 240 + 16777215 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 5 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + :/image/main/iconTemp.png + + + + + + + 34.5℃ + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + + + + :/image/main/iconHumi.png + + + + + + + 25%Rh + + + + + + + + + + + + + + 240 16777215 @@ -308,7 +464,7 @@ - :/image/main/icon_setting_p.png:/image/main/icon_setting_p.png + :/image/main/icon_setting.png:/image/main/icon_setting.png @@ -334,7 +490,33 @@ - :/image/main/icon_min_p.png:/image/main/icon_min_p.png + :/image/main/icon_min.png:/image/main/icon_min.png + + + + 32 + 32 + + + + + + + + + 40 + 40 + + + + 最小化 + + + + + + + :/image/main/icon_max.png:/image/main/icon_max.png @@ -360,7 +542,7 @@ - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + :/image/main/icon_close.png:/image/main/icon_close.png @@ -426,87 +608,9 @@ - - - - - 0 - 30 - - - - - 20 - - - 0 - - - 0 - - - 40 - - - 0 - - - - - Qt::Horizontal - - - - 1289 - 20 - - - - - - - - - - - - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 20 - - - - - - - - - - - - - - wdgtContent wdgtTop - wdgtFoot diff --git a/infomation/InfoMainForm.cpp b/infomation/InfoMainForm.cpp index c001199..5d0ffc8 100644 --- a/infomation/InfoMainForm.cpp +++ b/infomation/InfoMainForm.cpp @@ -21,9 +21,13 @@ void InfoMainForm::initForm() { + // 加载样式表 + QString qssStyle = QssFileUtils::loadQssFileContent(QApplication::applicationDirPath() + "/qss/infoMain.css"); + if (qssStyle.isEmpty() == false) { + this->setStyleSheet(qssStyle); // 仅本窗口生效 + } - - + ui->scrollArea->setWindowFlags(Qt::FramelessWindowHint); // 设置无边框 } void InfoMainForm::initSubMenuForms() { diff --git a/infomation/InfoMainForm.ui b/infomation/InfoMainForm.ui index 958a6b2..d9066dd 100644 --- a/infomation/InfoMainForm.ui +++ b/infomation/InfoMainForm.ui @@ -90,7 +90,7 @@ - 280 + 295 48 @@ -103,7 +103,7 @@ - 280 + 295 48 @@ -116,7 +116,7 @@ - 280 + 295 48 @@ -129,7 +129,7 @@ - 280 + 295 48 @@ -142,7 +142,7 @@ - 280 + 295 48 @@ -155,7 +155,7 @@ - 280 + 295 48 @@ -168,7 +168,7 @@ - 280 + 295 48 @@ -181,7 +181,7 @@ - 280 + 295 48 @@ -194,7 +194,7 @@ - 280 + 295 48 @@ -207,7 +207,7 @@ - 280 + 295 48 @@ -220,7 +220,7 @@ - 280 + 295 48 @@ -233,7 +233,7 @@ - 280 + 295 48 @@ -246,7 +246,7 @@ - 280 + 295 48 diff --git a/infomation/task/DeptTaskForm.cpp b/infomation/task/DeptTaskForm.cpp index ea21a9f..cc6bf31 100644 --- a/infomation/task/DeptTaskForm.cpp +++ b/infomation/task/DeptTaskForm.cpp @@ -18,12 +18,17 @@ delete ui; } -void DeptTaskForm::showEvent(QShowEvent *event) +void DeptTaskForm::showEvent(QShowEvent * event) { ui->tableDeptTask->adjustTableWidth(); getDeptTaskList(0); } +void DeptTaskForm::resizeEvent(QResizeEvent * event) +{ + ui->tableDeptTask->adjustTableWidth(); +} + void DeptTaskForm::initFormTable() { // 初始化查询条件 diff --git a/AutoCalibrationXC.pro b/AutoCalibrationXC.pro index 6bcb335..7790b37 100644 --- a/AutoCalibrationXC.pro +++ b/AutoCalibrationXC.pro @@ -24,11 +24,6 @@ include(QPagedTable/QPagedTable.pri) SOURCES += main.cpp -SOURCES += MainWindow.cpp - -HEADERS += MainWindow.h - -FORMS += MainWindow.ui RC_ICONS = res/autoCalibration.ico diff --git a/MainWindow.cpp b/MainWindow.cpp deleted file mode 100644 index ff126e8..0000000 --- a/MainWindow.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#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/MainWindow.h b/MainWindow.h deleted file mode 100644 index 4643e32..0000000 --- a/MainWindow.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#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; -}; -#endif // MAINWINDOW_H diff --git a/MainWindow.ui b/MainWindow.ui deleted file mode 100644 index b232854..0000000 --- a/MainWindow.ui +++ /dev/null @@ -1,22 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 800 - 600 - - - - MainWindow - - - - - - - - diff --git a/frame/CustomMessageBox.ui b/frame/CustomMessageBox.ui index 336be54..b545d74 100644 --- a/frame/CustomMessageBox.ui +++ b/frame/CustomMessageBox.ui @@ -84,8 +84,8 @@ - - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + + :/image/msgbox/icon_box_close.png:/image/msgbox/icon_box_close.png @@ -134,7 +134,7 @@ - :/image/msgbox/icon_box_success.png + :/image/msgbox/icon_box_success.png Qt::AlignCenter @@ -265,6 +265,8 @@ - + + + diff --git a/frame/MainWindowForm.cpp b/frame/MainWindowForm.cpp index 2ded44b..ec82cd7 100644 --- a/frame/MainWindowForm.cpp +++ b/frame/MainWindowForm.cpp @@ -1,6 +1,8 @@ #include "MainWindowForm.h" #include "ui_MainWindowForm.h" +#include + MainWindowForm::MainWindowForm(QWidget *parent) : FramelessWindow(parent), ui(new Ui::MainWindowForm) @@ -12,7 +14,7 @@ initMenuWidgets(); initFunctionButtons(); - // 每秒更新 界面上没有地方能摆 暂时先不启动定时器 + // 每秒更新 connect(TimeCounterUtil::getInstance().clockTimer, &QTimer::timeout, this, &MainWindowForm::onUpdateTimestampHandler); TimeCounterUtil::getInstance().clockTimer->start(1000); @@ -34,6 +36,7 @@ void MainWindowForm::initForm() { setWindowFlags(Qt::FramelessWindowHint); // 设置全屏 + setWindowState(Qt::WindowState::WindowMaximized); this->setTitleBar(ui->wdgtTop); // 设置窗口位置和大小 move(0, 0); @@ -120,6 +123,22 @@ setWindowState(Qt::WindowMinimized | windowState()); } +void MainWindowForm::on_btnMaxWin_clicked() +{ + QScreen *screen = QGuiApplication::primaryScreen(); + QRect screenSize = screen->availableGeometry(); // 可用区域(排除任务栏) + + if (this->isMaximized()) { + resize(screenSize.width() * 0.8, screenSize.height() * 0.8); + move(QRandomGenerator::global()->bounded(10, 100), QRandomGenerator::global()->bounded(10, 50)); + this->showNormal(); + } else { + resize(screenSize.width(), screenSize.height()); + move(0, 0); + this->showMaximized(); + } +} + void MainWindowForm::on_btnCloseWin_clicked() { // 创建一个消息框 @@ -146,18 +165,9 @@ ui->labelTime->setText(now.toString("yyyy-MM-dd HH:mm:ss")); } -void MainWindowForm::on_btnMenuMax_clicked() -{ - if (this->isMaximized()) { - this->showNormal(); - } else { - this->showMaximized(); - } -} - void MainWindowForm::titleDblClick() { - on_btnMenuMax_clicked(); + on_btnMaxWin_clicked(); } void MainWindowForm::onMenuButtonsEabled(bool enable) { diff --git a/frame/MainWindowForm.h b/frame/MainWindowForm.h index 4d206b1..9b4eae4 100644 --- a/frame/MainWindowForm.h +++ b/frame/MainWindowForm.h @@ -45,11 +45,11 @@ private slots: void on_btnMinWin_clicked(); + void on_btnMaxWin_clicked(); void on_btnCloseWin_clicked(); void onFunctionButtonsAction(); void onUpdateTimestampHandler(); - void on_btnMenuMax_clicked(); void titleDblClick(); void onMenuButtonsEabled(bool enable); diff --git a/frame/MainWindowForm.ui b/frame/MainWindowForm.ui index bd42122..f37d171 100644 --- a/frame/MainWindowForm.ui +++ b/frame/MainWindowForm.ui @@ -41,7 +41,7 @@ 0 - 120 + 100 @@ -58,7 +58,7 @@ 20 - 0 + 20 @@ -88,8 +88,8 @@ - 120 - 120 + 150 + 100 @@ -107,6 +107,22 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + @@ -158,7 +174,7 @@ 100 - 84 + 72 @@ -166,7 +182,8 @@ - :/image/main/calibration.png:/image/main/calibration.png + :/image/main/icon_menu_calibration.png + :/image/main/icon_menu_calibration_selected.png:/image/main/icon_menu_calibration.png @@ -184,7 +201,7 @@ 100 - 84 + 72 @@ -192,7 +209,8 @@ - :/image/main/rawDataRecord.png:/image/main/rawDataRecord.png + :/image/main/icon_menu_check.png + :/image/main/icon_menu_check_selected.png:/image/main/icon_menu_check.png @@ -210,7 +228,7 @@ 100 - 84 + 72 @@ -218,7 +236,8 @@ - :/image/main/fileRes.png:/image/main/fileRes.png + :/image/main/icon_menu_infomation.png + :/image/main/icon_menu_infomation_checked.png:/image/main/icon_menu_infomation.png @@ -235,10 +254,147 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 50 + 20 + + + + + - 320 + 240 + 16777215 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 5 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + :/image/main/iconTemp.png + + + + + + + 34.5℃ + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + + + + :/image/main/iconHumi.png + + + + + + + 25%Rh + + + + + + + + + + + + + + 240 16777215 @@ -308,7 +464,7 @@ - :/image/main/icon_setting_p.png:/image/main/icon_setting_p.png + :/image/main/icon_setting.png:/image/main/icon_setting.png @@ -334,7 +490,33 @@ - :/image/main/icon_min_p.png:/image/main/icon_min_p.png + :/image/main/icon_min.png:/image/main/icon_min.png + + + + 32 + 32 + + + + + + + + + 40 + 40 + + + + 最小化 + + + + + + + :/image/main/icon_max.png:/image/main/icon_max.png @@ -360,7 +542,7 @@ - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + :/image/main/icon_close.png:/image/main/icon_close.png @@ -426,87 +608,9 @@ - - - - - 0 - 30 - - - - - 20 - - - 0 - - - 0 - - - 40 - - - 0 - - - - - Qt::Horizontal - - - - 1289 - 20 - - - - - - - - - - - - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 20 - - - - - - - - - - - - - - wdgtContent wdgtTop - wdgtFoot diff --git a/infomation/InfoMainForm.cpp b/infomation/InfoMainForm.cpp index c001199..5d0ffc8 100644 --- a/infomation/InfoMainForm.cpp +++ b/infomation/InfoMainForm.cpp @@ -21,9 +21,13 @@ void InfoMainForm::initForm() { + // 加载样式表 + QString qssStyle = QssFileUtils::loadQssFileContent(QApplication::applicationDirPath() + "/qss/infoMain.css"); + if (qssStyle.isEmpty() == false) { + this->setStyleSheet(qssStyle); // 仅本窗口生效 + } - - + ui->scrollArea->setWindowFlags(Qt::FramelessWindowHint); // 设置无边框 } void InfoMainForm::initSubMenuForms() { diff --git a/infomation/InfoMainForm.ui b/infomation/InfoMainForm.ui index 958a6b2..d9066dd 100644 --- a/infomation/InfoMainForm.ui +++ b/infomation/InfoMainForm.ui @@ -90,7 +90,7 @@ - 280 + 295 48 @@ -103,7 +103,7 @@ - 280 + 295 48 @@ -116,7 +116,7 @@ - 280 + 295 48 @@ -129,7 +129,7 @@ - 280 + 295 48 @@ -142,7 +142,7 @@ - 280 + 295 48 @@ -155,7 +155,7 @@ - 280 + 295 48 @@ -168,7 +168,7 @@ - 280 + 295 48 @@ -181,7 +181,7 @@ - 280 + 295 48 @@ -194,7 +194,7 @@ - 280 + 295 48 @@ -207,7 +207,7 @@ - 280 + 295 48 @@ -220,7 +220,7 @@ - 280 + 295 48 @@ -233,7 +233,7 @@ - 280 + 295 48 @@ -246,7 +246,7 @@ - 280 + 295 48 diff --git a/infomation/task/DeptTaskForm.cpp b/infomation/task/DeptTaskForm.cpp index ea21a9f..cc6bf31 100644 --- a/infomation/task/DeptTaskForm.cpp +++ b/infomation/task/DeptTaskForm.cpp @@ -18,12 +18,17 @@ delete ui; } -void DeptTaskForm::showEvent(QShowEvent *event) +void DeptTaskForm::showEvent(QShowEvent * event) { ui->tableDeptTask->adjustTableWidth(); getDeptTaskList(0); } +void DeptTaskForm::resizeEvent(QResizeEvent * event) +{ + ui->tableDeptTask->adjustTableWidth(); +} + void DeptTaskForm::initFormTable() { // 初始化查询条件 diff --git a/infomation/task/DeptTaskForm.h b/infomation/task/DeptTaskForm.h index 1055c36..3c1ad5b 100644 --- a/infomation/task/DeptTaskForm.h +++ b/infomation/task/DeptTaskForm.h @@ -21,7 +21,8 @@ ~DeptTaskForm(); protected: - void showEvent(QShowEvent *event) override; + void showEvent(QShowEvent * event) override; + void resizeEvent(QResizeEvent * event) override; private: Ui::DeptTaskForm *ui; diff --git a/AutoCalibrationXC.pro b/AutoCalibrationXC.pro index 6bcb335..7790b37 100644 --- a/AutoCalibrationXC.pro +++ b/AutoCalibrationXC.pro @@ -24,11 +24,6 @@ include(QPagedTable/QPagedTable.pri) SOURCES += main.cpp -SOURCES += MainWindow.cpp - -HEADERS += MainWindow.h - -FORMS += MainWindow.ui RC_ICONS = res/autoCalibration.ico diff --git a/MainWindow.cpp b/MainWindow.cpp deleted file mode 100644 index ff126e8..0000000 --- a/MainWindow.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#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/MainWindow.h b/MainWindow.h deleted file mode 100644 index 4643e32..0000000 --- a/MainWindow.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#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; -}; -#endif // MAINWINDOW_H diff --git a/MainWindow.ui b/MainWindow.ui deleted file mode 100644 index b232854..0000000 --- a/MainWindow.ui +++ /dev/null @@ -1,22 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 800 - 600 - - - - MainWindow - - - - - - - - diff --git a/frame/CustomMessageBox.ui b/frame/CustomMessageBox.ui index 336be54..b545d74 100644 --- a/frame/CustomMessageBox.ui +++ b/frame/CustomMessageBox.ui @@ -84,8 +84,8 @@ - - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + + :/image/msgbox/icon_box_close.png:/image/msgbox/icon_box_close.png @@ -134,7 +134,7 @@ - :/image/msgbox/icon_box_success.png + :/image/msgbox/icon_box_success.png Qt::AlignCenter @@ -265,6 +265,8 @@ - + + + diff --git a/frame/MainWindowForm.cpp b/frame/MainWindowForm.cpp index 2ded44b..ec82cd7 100644 --- a/frame/MainWindowForm.cpp +++ b/frame/MainWindowForm.cpp @@ -1,6 +1,8 @@ #include "MainWindowForm.h" #include "ui_MainWindowForm.h" +#include + MainWindowForm::MainWindowForm(QWidget *parent) : FramelessWindow(parent), ui(new Ui::MainWindowForm) @@ -12,7 +14,7 @@ initMenuWidgets(); initFunctionButtons(); - // 每秒更新 界面上没有地方能摆 暂时先不启动定时器 + // 每秒更新 connect(TimeCounterUtil::getInstance().clockTimer, &QTimer::timeout, this, &MainWindowForm::onUpdateTimestampHandler); TimeCounterUtil::getInstance().clockTimer->start(1000); @@ -34,6 +36,7 @@ void MainWindowForm::initForm() { setWindowFlags(Qt::FramelessWindowHint); // 设置全屏 + setWindowState(Qt::WindowState::WindowMaximized); this->setTitleBar(ui->wdgtTop); // 设置窗口位置和大小 move(0, 0); @@ -120,6 +123,22 @@ setWindowState(Qt::WindowMinimized | windowState()); } +void MainWindowForm::on_btnMaxWin_clicked() +{ + QScreen *screen = QGuiApplication::primaryScreen(); + QRect screenSize = screen->availableGeometry(); // 可用区域(排除任务栏) + + if (this->isMaximized()) { + resize(screenSize.width() * 0.8, screenSize.height() * 0.8); + move(QRandomGenerator::global()->bounded(10, 100), QRandomGenerator::global()->bounded(10, 50)); + this->showNormal(); + } else { + resize(screenSize.width(), screenSize.height()); + move(0, 0); + this->showMaximized(); + } +} + void MainWindowForm::on_btnCloseWin_clicked() { // 创建一个消息框 @@ -146,18 +165,9 @@ ui->labelTime->setText(now.toString("yyyy-MM-dd HH:mm:ss")); } -void MainWindowForm::on_btnMenuMax_clicked() -{ - if (this->isMaximized()) { - this->showNormal(); - } else { - this->showMaximized(); - } -} - void MainWindowForm::titleDblClick() { - on_btnMenuMax_clicked(); + on_btnMaxWin_clicked(); } void MainWindowForm::onMenuButtonsEabled(bool enable) { diff --git a/frame/MainWindowForm.h b/frame/MainWindowForm.h index 4d206b1..9b4eae4 100644 --- a/frame/MainWindowForm.h +++ b/frame/MainWindowForm.h @@ -45,11 +45,11 @@ private slots: void on_btnMinWin_clicked(); + void on_btnMaxWin_clicked(); void on_btnCloseWin_clicked(); void onFunctionButtonsAction(); void onUpdateTimestampHandler(); - void on_btnMenuMax_clicked(); void titleDblClick(); void onMenuButtonsEabled(bool enable); diff --git a/frame/MainWindowForm.ui b/frame/MainWindowForm.ui index bd42122..f37d171 100644 --- a/frame/MainWindowForm.ui +++ b/frame/MainWindowForm.ui @@ -41,7 +41,7 @@ 0 - 120 + 100 @@ -58,7 +58,7 @@ 20 - 0 + 20 @@ -88,8 +88,8 @@ - 120 - 120 + 150 + 100 @@ -107,6 +107,22 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + @@ -158,7 +174,7 @@ 100 - 84 + 72 @@ -166,7 +182,8 @@ - :/image/main/calibration.png:/image/main/calibration.png + :/image/main/icon_menu_calibration.png + :/image/main/icon_menu_calibration_selected.png:/image/main/icon_menu_calibration.png @@ -184,7 +201,7 @@ 100 - 84 + 72 @@ -192,7 +209,8 @@ - :/image/main/rawDataRecord.png:/image/main/rawDataRecord.png + :/image/main/icon_menu_check.png + :/image/main/icon_menu_check_selected.png:/image/main/icon_menu_check.png @@ -210,7 +228,7 @@ 100 - 84 + 72 @@ -218,7 +236,8 @@ - :/image/main/fileRes.png:/image/main/fileRes.png + :/image/main/icon_menu_infomation.png + :/image/main/icon_menu_infomation_checked.png:/image/main/icon_menu_infomation.png @@ -235,10 +254,147 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 50 + 20 + + + + + - 320 + 240 + 16777215 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 5 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + :/image/main/iconTemp.png + + + + + + + 34.5℃ + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + + + + :/image/main/iconHumi.png + + + + + + + 25%Rh + + + + + + + + + + + + + + 240 16777215 @@ -308,7 +464,7 @@ - :/image/main/icon_setting_p.png:/image/main/icon_setting_p.png + :/image/main/icon_setting.png:/image/main/icon_setting.png @@ -334,7 +490,33 @@ - :/image/main/icon_min_p.png:/image/main/icon_min_p.png + :/image/main/icon_min.png:/image/main/icon_min.png + + + + 32 + 32 + + + + + + + + + 40 + 40 + + + + 最小化 + + + + + + + :/image/main/icon_max.png:/image/main/icon_max.png @@ -360,7 +542,7 @@ - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + :/image/main/icon_close.png:/image/main/icon_close.png @@ -426,87 +608,9 @@ - - - - - 0 - 30 - - - - - 20 - - - 0 - - - 0 - - - 40 - - - 0 - - - - - Qt::Horizontal - - - - 1289 - 20 - - - - - - - - - - - - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 20 - - - - - - - - - - - - - - wdgtContent wdgtTop - wdgtFoot diff --git a/infomation/InfoMainForm.cpp b/infomation/InfoMainForm.cpp index c001199..5d0ffc8 100644 --- a/infomation/InfoMainForm.cpp +++ b/infomation/InfoMainForm.cpp @@ -21,9 +21,13 @@ void InfoMainForm::initForm() { + // 加载样式表 + QString qssStyle = QssFileUtils::loadQssFileContent(QApplication::applicationDirPath() + "/qss/infoMain.css"); + if (qssStyle.isEmpty() == false) { + this->setStyleSheet(qssStyle); // 仅本窗口生效 + } - - + ui->scrollArea->setWindowFlags(Qt::FramelessWindowHint); // 设置无边框 } void InfoMainForm::initSubMenuForms() { diff --git a/infomation/InfoMainForm.ui b/infomation/InfoMainForm.ui index 958a6b2..d9066dd 100644 --- a/infomation/InfoMainForm.ui +++ b/infomation/InfoMainForm.ui @@ -90,7 +90,7 @@ - 280 + 295 48 @@ -103,7 +103,7 @@ - 280 + 295 48 @@ -116,7 +116,7 @@ - 280 + 295 48 @@ -129,7 +129,7 @@ - 280 + 295 48 @@ -142,7 +142,7 @@ - 280 + 295 48 @@ -155,7 +155,7 @@ - 280 + 295 48 @@ -168,7 +168,7 @@ - 280 + 295 48 @@ -181,7 +181,7 @@ - 280 + 295 48 @@ -194,7 +194,7 @@ - 280 + 295 48 @@ -207,7 +207,7 @@ - 280 + 295 48 @@ -220,7 +220,7 @@ - 280 + 295 48 @@ -233,7 +233,7 @@ - 280 + 295 48 @@ -246,7 +246,7 @@ - 280 + 295 48 diff --git a/infomation/task/DeptTaskForm.cpp b/infomation/task/DeptTaskForm.cpp index ea21a9f..cc6bf31 100644 --- a/infomation/task/DeptTaskForm.cpp +++ b/infomation/task/DeptTaskForm.cpp @@ -18,12 +18,17 @@ delete ui; } -void DeptTaskForm::showEvent(QShowEvent *event) +void DeptTaskForm::showEvent(QShowEvent * event) { ui->tableDeptTask->adjustTableWidth(); getDeptTaskList(0); } +void DeptTaskForm::resizeEvent(QResizeEvent * event) +{ + ui->tableDeptTask->adjustTableWidth(); +} + void DeptTaskForm::initFormTable() { // 初始化查询条件 diff --git a/infomation/task/DeptTaskForm.h b/infomation/task/DeptTaskForm.h index 1055c36..3c1ad5b 100644 --- a/infomation/task/DeptTaskForm.h +++ b/infomation/task/DeptTaskForm.h @@ -21,7 +21,8 @@ ~DeptTaskForm(); protected: - void showEvent(QShowEvent *event) override; + void showEvent(QShowEvent * event) override; + void resizeEvent(QResizeEvent * event) override; private: Ui::DeptTaskForm *ui; diff --git a/main.cpp b/main.cpp index 525387e..0b78c87 100644 --- a/main.cpp +++ b/main.cpp @@ -1,5 +1,3 @@ -#include "MainWindow.h" - #include #include diff --git a/AutoCalibrationXC.pro b/AutoCalibrationXC.pro index 6bcb335..7790b37 100644 --- a/AutoCalibrationXC.pro +++ b/AutoCalibrationXC.pro @@ -24,11 +24,6 @@ include(QPagedTable/QPagedTable.pri) SOURCES += main.cpp -SOURCES += MainWindow.cpp - -HEADERS += MainWindow.h - -FORMS += MainWindow.ui RC_ICONS = res/autoCalibration.ico diff --git a/MainWindow.cpp b/MainWindow.cpp deleted file mode 100644 index ff126e8..0000000 --- a/MainWindow.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#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/MainWindow.h b/MainWindow.h deleted file mode 100644 index 4643e32..0000000 --- a/MainWindow.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#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; -}; -#endif // MAINWINDOW_H diff --git a/MainWindow.ui b/MainWindow.ui deleted file mode 100644 index b232854..0000000 --- a/MainWindow.ui +++ /dev/null @@ -1,22 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 800 - 600 - - - - MainWindow - - - - - - - - diff --git a/frame/CustomMessageBox.ui b/frame/CustomMessageBox.ui index 336be54..b545d74 100644 --- a/frame/CustomMessageBox.ui +++ b/frame/CustomMessageBox.ui @@ -84,8 +84,8 @@ - - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + + :/image/msgbox/icon_box_close.png:/image/msgbox/icon_box_close.png @@ -134,7 +134,7 @@ - :/image/msgbox/icon_box_success.png + :/image/msgbox/icon_box_success.png Qt::AlignCenter @@ -265,6 +265,8 @@ - + + + diff --git a/frame/MainWindowForm.cpp b/frame/MainWindowForm.cpp index 2ded44b..ec82cd7 100644 --- a/frame/MainWindowForm.cpp +++ b/frame/MainWindowForm.cpp @@ -1,6 +1,8 @@ #include "MainWindowForm.h" #include "ui_MainWindowForm.h" +#include + MainWindowForm::MainWindowForm(QWidget *parent) : FramelessWindow(parent), ui(new Ui::MainWindowForm) @@ -12,7 +14,7 @@ initMenuWidgets(); initFunctionButtons(); - // 每秒更新 界面上没有地方能摆 暂时先不启动定时器 + // 每秒更新 connect(TimeCounterUtil::getInstance().clockTimer, &QTimer::timeout, this, &MainWindowForm::onUpdateTimestampHandler); TimeCounterUtil::getInstance().clockTimer->start(1000); @@ -34,6 +36,7 @@ void MainWindowForm::initForm() { setWindowFlags(Qt::FramelessWindowHint); // 设置全屏 + setWindowState(Qt::WindowState::WindowMaximized); this->setTitleBar(ui->wdgtTop); // 设置窗口位置和大小 move(0, 0); @@ -120,6 +123,22 @@ setWindowState(Qt::WindowMinimized | windowState()); } +void MainWindowForm::on_btnMaxWin_clicked() +{ + QScreen *screen = QGuiApplication::primaryScreen(); + QRect screenSize = screen->availableGeometry(); // 可用区域(排除任务栏) + + if (this->isMaximized()) { + resize(screenSize.width() * 0.8, screenSize.height() * 0.8); + move(QRandomGenerator::global()->bounded(10, 100), QRandomGenerator::global()->bounded(10, 50)); + this->showNormal(); + } else { + resize(screenSize.width(), screenSize.height()); + move(0, 0); + this->showMaximized(); + } +} + void MainWindowForm::on_btnCloseWin_clicked() { // 创建一个消息框 @@ -146,18 +165,9 @@ ui->labelTime->setText(now.toString("yyyy-MM-dd HH:mm:ss")); } -void MainWindowForm::on_btnMenuMax_clicked() -{ - if (this->isMaximized()) { - this->showNormal(); - } else { - this->showMaximized(); - } -} - void MainWindowForm::titleDblClick() { - on_btnMenuMax_clicked(); + on_btnMaxWin_clicked(); } void MainWindowForm::onMenuButtonsEabled(bool enable) { diff --git a/frame/MainWindowForm.h b/frame/MainWindowForm.h index 4d206b1..9b4eae4 100644 --- a/frame/MainWindowForm.h +++ b/frame/MainWindowForm.h @@ -45,11 +45,11 @@ private slots: void on_btnMinWin_clicked(); + void on_btnMaxWin_clicked(); void on_btnCloseWin_clicked(); void onFunctionButtonsAction(); void onUpdateTimestampHandler(); - void on_btnMenuMax_clicked(); void titleDblClick(); void onMenuButtonsEabled(bool enable); diff --git a/frame/MainWindowForm.ui b/frame/MainWindowForm.ui index bd42122..f37d171 100644 --- a/frame/MainWindowForm.ui +++ b/frame/MainWindowForm.ui @@ -41,7 +41,7 @@ 0 - 120 + 100 @@ -58,7 +58,7 @@ 20 - 0 + 20 @@ -88,8 +88,8 @@ - 120 - 120 + 150 + 100 @@ -107,6 +107,22 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + @@ -158,7 +174,7 @@ 100 - 84 + 72 @@ -166,7 +182,8 @@ - :/image/main/calibration.png:/image/main/calibration.png + :/image/main/icon_menu_calibration.png + :/image/main/icon_menu_calibration_selected.png:/image/main/icon_menu_calibration.png @@ -184,7 +201,7 @@ 100 - 84 + 72 @@ -192,7 +209,8 @@ - :/image/main/rawDataRecord.png:/image/main/rawDataRecord.png + :/image/main/icon_menu_check.png + :/image/main/icon_menu_check_selected.png:/image/main/icon_menu_check.png @@ -210,7 +228,7 @@ 100 - 84 + 72 @@ -218,7 +236,8 @@ - :/image/main/fileRes.png:/image/main/fileRes.png + :/image/main/icon_menu_infomation.png + :/image/main/icon_menu_infomation_checked.png:/image/main/icon_menu_infomation.png @@ -235,10 +254,147 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 50 + 20 + + + + + - 320 + 240 + 16777215 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 5 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + :/image/main/iconTemp.png + + + + + + + 34.5℃ + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + + + + :/image/main/iconHumi.png + + + + + + + 25%Rh + + + + + + + + + + + + + + 240 16777215 @@ -308,7 +464,7 @@ - :/image/main/icon_setting_p.png:/image/main/icon_setting_p.png + :/image/main/icon_setting.png:/image/main/icon_setting.png @@ -334,7 +490,33 @@ - :/image/main/icon_min_p.png:/image/main/icon_min_p.png + :/image/main/icon_min.png:/image/main/icon_min.png + + + + 32 + 32 + + + + + + + + + 40 + 40 + + + + 最小化 + + + + + + + :/image/main/icon_max.png:/image/main/icon_max.png @@ -360,7 +542,7 @@ - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + :/image/main/icon_close.png:/image/main/icon_close.png @@ -426,87 +608,9 @@ - - - - - 0 - 30 - - - - - 20 - - - 0 - - - 0 - - - 40 - - - 0 - - - - - Qt::Horizontal - - - - 1289 - 20 - - - - - - - - - - - - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 20 - - - - - - - - - - - - - - wdgtContent wdgtTop - wdgtFoot diff --git a/infomation/InfoMainForm.cpp b/infomation/InfoMainForm.cpp index c001199..5d0ffc8 100644 --- a/infomation/InfoMainForm.cpp +++ b/infomation/InfoMainForm.cpp @@ -21,9 +21,13 @@ void InfoMainForm::initForm() { + // 加载样式表 + QString qssStyle = QssFileUtils::loadQssFileContent(QApplication::applicationDirPath() + "/qss/infoMain.css"); + if (qssStyle.isEmpty() == false) { + this->setStyleSheet(qssStyle); // 仅本窗口生效 + } - - + ui->scrollArea->setWindowFlags(Qt::FramelessWindowHint); // 设置无边框 } void InfoMainForm::initSubMenuForms() { diff --git a/infomation/InfoMainForm.ui b/infomation/InfoMainForm.ui index 958a6b2..d9066dd 100644 --- a/infomation/InfoMainForm.ui +++ b/infomation/InfoMainForm.ui @@ -90,7 +90,7 @@ - 280 + 295 48 @@ -103,7 +103,7 @@ - 280 + 295 48 @@ -116,7 +116,7 @@ - 280 + 295 48 @@ -129,7 +129,7 @@ - 280 + 295 48 @@ -142,7 +142,7 @@ - 280 + 295 48 @@ -155,7 +155,7 @@ - 280 + 295 48 @@ -168,7 +168,7 @@ - 280 + 295 48 @@ -181,7 +181,7 @@ - 280 + 295 48 @@ -194,7 +194,7 @@ - 280 + 295 48 @@ -207,7 +207,7 @@ - 280 + 295 48 @@ -220,7 +220,7 @@ - 280 + 295 48 @@ -233,7 +233,7 @@ - 280 + 295 48 @@ -246,7 +246,7 @@ - 280 + 295 48 diff --git a/infomation/task/DeptTaskForm.cpp b/infomation/task/DeptTaskForm.cpp index ea21a9f..cc6bf31 100644 --- a/infomation/task/DeptTaskForm.cpp +++ b/infomation/task/DeptTaskForm.cpp @@ -18,12 +18,17 @@ delete ui; } -void DeptTaskForm::showEvent(QShowEvent *event) +void DeptTaskForm::showEvent(QShowEvent * event) { ui->tableDeptTask->adjustTableWidth(); getDeptTaskList(0); } +void DeptTaskForm::resizeEvent(QResizeEvent * event) +{ + ui->tableDeptTask->adjustTableWidth(); +} + void DeptTaskForm::initFormTable() { // 初始化查询条件 diff --git a/infomation/task/DeptTaskForm.h b/infomation/task/DeptTaskForm.h index 1055c36..3c1ad5b 100644 --- a/infomation/task/DeptTaskForm.h +++ b/infomation/task/DeptTaskForm.h @@ -21,7 +21,8 @@ ~DeptTaskForm(); protected: - void showEvent(QShowEvent *event) override; + void showEvent(QShowEvent * event) override; + void resizeEvent(QResizeEvent * event) override; private: Ui::DeptTaskForm *ui; diff --git a/main.cpp b/main.cpp index 525387e..0b78c87 100644 --- a/main.cpp +++ b/main.cpp @@ -1,5 +1,3 @@ -#include "MainWindow.h" - #include #include diff --git a/res/image/Index/u1176.svg b/res/image/Index/u1176.svg deleted file mode 100644 index c81ce8a..0000000 --- a/res/image/Index/u1176.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/AutoCalibrationXC.pro b/AutoCalibrationXC.pro index 6bcb335..7790b37 100644 --- a/AutoCalibrationXC.pro +++ b/AutoCalibrationXC.pro @@ -24,11 +24,6 @@ include(QPagedTable/QPagedTable.pri) SOURCES += main.cpp -SOURCES += MainWindow.cpp - -HEADERS += MainWindow.h - -FORMS += MainWindow.ui RC_ICONS = res/autoCalibration.ico diff --git a/MainWindow.cpp b/MainWindow.cpp deleted file mode 100644 index ff126e8..0000000 --- a/MainWindow.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#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/MainWindow.h b/MainWindow.h deleted file mode 100644 index 4643e32..0000000 --- a/MainWindow.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#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; -}; -#endif // MAINWINDOW_H diff --git a/MainWindow.ui b/MainWindow.ui deleted file mode 100644 index b232854..0000000 --- a/MainWindow.ui +++ /dev/null @@ -1,22 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 800 - 600 - - - - MainWindow - - - - - - - - diff --git a/frame/CustomMessageBox.ui b/frame/CustomMessageBox.ui index 336be54..b545d74 100644 --- a/frame/CustomMessageBox.ui +++ b/frame/CustomMessageBox.ui @@ -84,8 +84,8 @@ - - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + + :/image/msgbox/icon_box_close.png:/image/msgbox/icon_box_close.png @@ -134,7 +134,7 @@ - :/image/msgbox/icon_box_success.png + :/image/msgbox/icon_box_success.png Qt::AlignCenter @@ -265,6 +265,8 @@ - + + + diff --git a/frame/MainWindowForm.cpp b/frame/MainWindowForm.cpp index 2ded44b..ec82cd7 100644 --- a/frame/MainWindowForm.cpp +++ b/frame/MainWindowForm.cpp @@ -1,6 +1,8 @@ #include "MainWindowForm.h" #include "ui_MainWindowForm.h" +#include + MainWindowForm::MainWindowForm(QWidget *parent) : FramelessWindow(parent), ui(new Ui::MainWindowForm) @@ -12,7 +14,7 @@ initMenuWidgets(); initFunctionButtons(); - // 每秒更新 界面上没有地方能摆 暂时先不启动定时器 + // 每秒更新 connect(TimeCounterUtil::getInstance().clockTimer, &QTimer::timeout, this, &MainWindowForm::onUpdateTimestampHandler); TimeCounterUtil::getInstance().clockTimer->start(1000); @@ -34,6 +36,7 @@ void MainWindowForm::initForm() { setWindowFlags(Qt::FramelessWindowHint); // 设置全屏 + setWindowState(Qt::WindowState::WindowMaximized); this->setTitleBar(ui->wdgtTop); // 设置窗口位置和大小 move(0, 0); @@ -120,6 +123,22 @@ setWindowState(Qt::WindowMinimized | windowState()); } +void MainWindowForm::on_btnMaxWin_clicked() +{ + QScreen *screen = QGuiApplication::primaryScreen(); + QRect screenSize = screen->availableGeometry(); // 可用区域(排除任务栏) + + if (this->isMaximized()) { + resize(screenSize.width() * 0.8, screenSize.height() * 0.8); + move(QRandomGenerator::global()->bounded(10, 100), QRandomGenerator::global()->bounded(10, 50)); + this->showNormal(); + } else { + resize(screenSize.width(), screenSize.height()); + move(0, 0); + this->showMaximized(); + } +} + void MainWindowForm::on_btnCloseWin_clicked() { // 创建一个消息框 @@ -146,18 +165,9 @@ ui->labelTime->setText(now.toString("yyyy-MM-dd HH:mm:ss")); } -void MainWindowForm::on_btnMenuMax_clicked() -{ - if (this->isMaximized()) { - this->showNormal(); - } else { - this->showMaximized(); - } -} - void MainWindowForm::titleDblClick() { - on_btnMenuMax_clicked(); + on_btnMaxWin_clicked(); } void MainWindowForm::onMenuButtonsEabled(bool enable) { diff --git a/frame/MainWindowForm.h b/frame/MainWindowForm.h index 4d206b1..9b4eae4 100644 --- a/frame/MainWindowForm.h +++ b/frame/MainWindowForm.h @@ -45,11 +45,11 @@ private slots: void on_btnMinWin_clicked(); + void on_btnMaxWin_clicked(); void on_btnCloseWin_clicked(); void onFunctionButtonsAction(); void onUpdateTimestampHandler(); - void on_btnMenuMax_clicked(); void titleDblClick(); void onMenuButtonsEabled(bool enable); diff --git a/frame/MainWindowForm.ui b/frame/MainWindowForm.ui index bd42122..f37d171 100644 --- a/frame/MainWindowForm.ui +++ b/frame/MainWindowForm.ui @@ -41,7 +41,7 @@ 0 - 120 + 100 @@ -58,7 +58,7 @@ 20 - 0 + 20 @@ -88,8 +88,8 @@ - 120 - 120 + 150 + 100 @@ -107,6 +107,22 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + @@ -158,7 +174,7 @@ 100 - 84 + 72 @@ -166,7 +182,8 @@ - :/image/main/calibration.png:/image/main/calibration.png + :/image/main/icon_menu_calibration.png + :/image/main/icon_menu_calibration_selected.png:/image/main/icon_menu_calibration.png @@ -184,7 +201,7 @@ 100 - 84 + 72 @@ -192,7 +209,8 @@ - :/image/main/rawDataRecord.png:/image/main/rawDataRecord.png + :/image/main/icon_menu_check.png + :/image/main/icon_menu_check_selected.png:/image/main/icon_menu_check.png @@ -210,7 +228,7 @@ 100 - 84 + 72 @@ -218,7 +236,8 @@ - :/image/main/fileRes.png:/image/main/fileRes.png + :/image/main/icon_menu_infomation.png + :/image/main/icon_menu_infomation_checked.png:/image/main/icon_menu_infomation.png @@ -235,10 +254,147 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 50 + 20 + + + + + - 320 + 240 + 16777215 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 5 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + :/image/main/iconTemp.png + + + + + + + 34.5℃ + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + + + + :/image/main/iconHumi.png + + + + + + + 25%Rh + + + + + + + + + + + + + + 240 16777215 @@ -308,7 +464,7 @@ - :/image/main/icon_setting_p.png:/image/main/icon_setting_p.png + :/image/main/icon_setting.png:/image/main/icon_setting.png @@ -334,7 +490,33 @@ - :/image/main/icon_min_p.png:/image/main/icon_min_p.png + :/image/main/icon_min.png:/image/main/icon_min.png + + + + 32 + 32 + + + + + + + + + 40 + 40 + + + + 最小化 + + + + + + + :/image/main/icon_max.png:/image/main/icon_max.png @@ -360,7 +542,7 @@ - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + :/image/main/icon_close.png:/image/main/icon_close.png @@ -426,87 +608,9 @@ - - - - - 0 - 30 - - - - - 20 - - - 0 - - - 0 - - - 40 - - - 0 - - - - - Qt::Horizontal - - - - 1289 - 20 - - - - - - - - - - - - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 20 - - - - - - - - - - - - - - wdgtContent wdgtTop - wdgtFoot diff --git a/infomation/InfoMainForm.cpp b/infomation/InfoMainForm.cpp index c001199..5d0ffc8 100644 --- a/infomation/InfoMainForm.cpp +++ b/infomation/InfoMainForm.cpp @@ -21,9 +21,13 @@ void InfoMainForm::initForm() { + // 加载样式表 + QString qssStyle = QssFileUtils::loadQssFileContent(QApplication::applicationDirPath() + "/qss/infoMain.css"); + if (qssStyle.isEmpty() == false) { + this->setStyleSheet(qssStyle); // 仅本窗口生效 + } - - + ui->scrollArea->setWindowFlags(Qt::FramelessWindowHint); // 设置无边框 } void InfoMainForm::initSubMenuForms() { diff --git a/infomation/InfoMainForm.ui b/infomation/InfoMainForm.ui index 958a6b2..d9066dd 100644 --- a/infomation/InfoMainForm.ui +++ b/infomation/InfoMainForm.ui @@ -90,7 +90,7 @@ - 280 + 295 48 @@ -103,7 +103,7 @@ - 280 + 295 48 @@ -116,7 +116,7 @@ - 280 + 295 48 @@ -129,7 +129,7 @@ - 280 + 295 48 @@ -142,7 +142,7 @@ - 280 + 295 48 @@ -155,7 +155,7 @@ - 280 + 295 48 @@ -168,7 +168,7 @@ - 280 + 295 48 @@ -181,7 +181,7 @@ - 280 + 295 48 @@ -194,7 +194,7 @@ - 280 + 295 48 @@ -207,7 +207,7 @@ - 280 + 295 48 @@ -220,7 +220,7 @@ - 280 + 295 48 @@ -233,7 +233,7 @@ - 280 + 295 48 @@ -246,7 +246,7 @@ - 280 + 295 48 diff --git a/infomation/task/DeptTaskForm.cpp b/infomation/task/DeptTaskForm.cpp index ea21a9f..cc6bf31 100644 --- a/infomation/task/DeptTaskForm.cpp +++ b/infomation/task/DeptTaskForm.cpp @@ -18,12 +18,17 @@ delete ui; } -void DeptTaskForm::showEvent(QShowEvent *event) +void DeptTaskForm::showEvent(QShowEvent * event) { ui->tableDeptTask->adjustTableWidth(); getDeptTaskList(0); } +void DeptTaskForm::resizeEvent(QResizeEvent * event) +{ + ui->tableDeptTask->adjustTableWidth(); +} + void DeptTaskForm::initFormTable() { // 初始化查询条件 diff --git a/infomation/task/DeptTaskForm.h b/infomation/task/DeptTaskForm.h index 1055c36..3c1ad5b 100644 --- a/infomation/task/DeptTaskForm.h +++ b/infomation/task/DeptTaskForm.h @@ -21,7 +21,8 @@ ~DeptTaskForm(); protected: - void showEvent(QShowEvent *event) override; + void showEvent(QShowEvent * event) override; + void resizeEvent(QResizeEvent * event) override; private: Ui::DeptTaskForm *ui; diff --git a/main.cpp b/main.cpp index 525387e..0b78c87 100644 --- a/main.cpp +++ b/main.cpp @@ -1,5 +1,3 @@ -#include "MainWindow.h" - #include #include diff --git a/res/image/Index/u1176.svg b/res/image/Index/u1176.svg deleted file mode 100644 index c81ce8a..0000000 --- a/res/image/Index/u1176.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1180.svg b/res/image/Index/u1180.svg deleted file mode 100644 index 2ef24ab..0000000 --- a/res/image/Index/u1180.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/AutoCalibrationXC.pro b/AutoCalibrationXC.pro index 6bcb335..7790b37 100644 --- a/AutoCalibrationXC.pro +++ b/AutoCalibrationXC.pro @@ -24,11 +24,6 @@ include(QPagedTable/QPagedTable.pri) SOURCES += main.cpp -SOURCES += MainWindow.cpp - -HEADERS += MainWindow.h - -FORMS += MainWindow.ui RC_ICONS = res/autoCalibration.ico diff --git a/MainWindow.cpp b/MainWindow.cpp deleted file mode 100644 index ff126e8..0000000 --- a/MainWindow.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#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/MainWindow.h b/MainWindow.h deleted file mode 100644 index 4643e32..0000000 --- a/MainWindow.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#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; -}; -#endif // MAINWINDOW_H diff --git a/MainWindow.ui b/MainWindow.ui deleted file mode 100644 index b232854..0000000 --- a/MainWindow.ui +++ /dev/null @@ -1,22 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 800 - 600 - - - - MainWindow - - - - - - - - diff --git a/frame/CustomMessageBox.ui b/frame/CustomMessageBox.ui index 336be54..b545d74 100644 --- a/frame/CustomMessageBox.ui +++ b/frame/CustomMessageBox.ui @@ -84,8 +84,8 @@ - - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + + :/image/msgbox/icon_box_close.png:/image/msgbox/icon_box_close.png @@ -134,7 +134,7 @@ - :/image/msgbox/icon_box_success.png + :/image/msgbox/icon_box_success.png Qt::AlignCenter @@ -265,6 +265,8 @@ - + + + diff --git a/frame/MainWindowForm.cpp b/frame/MainWindowForm.cpp index 2ded44b..ec82cd7 100644 --- a/frame/MainWindowForm.cpp +++ b/frame/MainWindowForm.cpp @@ -1,6 +1,8 @@ #include "MainWindowForm.h" #include "ui_MainWindowForm.h" +#include + MainWindowForm::MainWindowForm(QWidget *parent) : FramelessWindow(parent), ui(new Ui::MainWindowForm) @@ -12,7 +14,7 @@ initMenuWidgets(); initFunctionButtons(); - // 每秒更新 界面上没有地方能摆 暂时先不启动定时器 + // 每秒更新 connect(TimeCounterUtil::getInstance().clockTimer, &QTimer::timeout, this, &MainWindowForm::onUpdateTimestampHandler); TimeCounterUtil::getInstance().clockTimer->start(1000); @@ -34,6 +36,7 @@ void MainWindowForm::initForm() { setWindowFlags(Qt::FramelessWindowHint); // 设置全屏 + setWindowState(Qt::WindowState::WindowMaximized); this->setTitleBar(ui->wdgtTop); // 设置窗口位置和大小 move(0, 0); @@ -120,6 +123,22 @@ setWindowState(Qt::WindowMinimized | windowState()); } +void MainWindowForm::on_btnMaxWin_clicked() +{ + QScreen *screen = QGuiApplication::primaryScreen(); + QRect screenSize = screen->availableGeometry(); // 可用区域(排除任务栏) + + if (this->isMaximized()) { + resize(screenSize.width() * 0.8, screenSize.height() * 0.8); + move(QRandomGenerator::global()->bounded(10, 100), QRandomGenerator::global()->bounded(10, 50)); + this->showNormal(); + } else { + resize(screenSize.width(), screenSize.height()); + move(0, 0); + this->showMaximized(); + } +} + void MainWindowForm::on_btnCloseWin_clicked() { // 创建一个消息框 @@ -146,18 +165,9 @@ ui->labelTime->setText(now.toString("yyyy-MM-dd HH:mm:ss")); } -void MainWindowForm::on_btnMenuMax_clicked() -{ - if (this->isMaximized()) { - this->showNormal(); - } else { - this->showMaximized(); - } -} - void MainWindowForm::titleDblClick() { - on_btnMenuMax_clicked(); + on_btnMaxWin_clicked(); } void MainWindowForm::onMenuButtonsEabled(bool enable) { diff --git a/frame/MainWindowForm.h b/frame/MainWindowForm.h index 4d206b1..9b4eae4 100644 --- a/frame/MainWindowForm.h +++ b/frame/MainWindowForm.h @@ -45,11 +45,11 @@ private slots: void on_btnMinWin_clicked(); + void on_btnMaxWin_clicked(); void on_btnCloseWin_clicked(); void onFunctionButtonsAction(); void onUpdateTimestampHandler(); - void on_btnMenuMax_clicked(); void titleDblClick(); void onMenuButtonsEabled(bool enable); diff --git a/frame/MainWindowForm.ui b/frame/MainWindowForm.ui index bd42122..f37d171 100644 --- a/frame/MainWindowForm.ui +++ b/frame/MainWindowForm.ui @@ -41,7 +41,7 @@ 0 - 120 + 100 @@ -58,7 +58,7 @@ 20 - 0 + 20 @@ -88,8 +88,8 @@ - 120 - 120 + 150 + 100 @@ -107,6 +107,22 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + @@ -158,7 +174,7 @@ 100 - 84 + 72 @@ -166,7 +182,8 @@ - :/image/main/calibration.png:/image/main/calibration.png + :/image/main/icon_menu_calibration.png + :/image/main/icon_menu_calibration_selected.png:/image/main/icon_menu_calibration.png @@ -184,7 +201,7 @@ 100 - 84 + 72 @@ -192,7 +209,8 @@ - :/image/main/rawDataRecord.png:/image/main/rawDataRecord.png + :/image/main/icon_menu_check.png + :/image/main/icon_menu_check_selected.png:/image/main/icon_menu_check.png @@ -210,7 +228,7 @@ 100 - 84 + 72 @@ -218,7 +236,8 @@ - :/image/main/fileRes.png:/image/main/fileRes.png + :/image/main/icon_menu_infomation.png + :/image/main/icon_menu_infomation_checked.png:/image/main/icon_menu_infomation.png @@ -235,10 +254,147 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 50 + 20 + + + + + - 320 + 240 + 16777215 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 5 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + :/image/main/iconTemp.png + + + + + + + 34.5℃ + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + + + + :/image/main/iconHumi.png + + + + + + + 25%Rh + + + + + + + + + + + + + + 240 16777215 @@ -308,7 +464,7 @@ - :/image/main/icon_setting_p.png:/image/main/icon_setting_p.png + :/image/main/icon_setting.png:/image/main/icon_setting.png @@ -334,7 +490,33 @@ - :/image/main/icon_min_p.png:/image/main/icon_min_p.png + :/image/main/icon_min.png:/image/main/icon_min.png + + + + 32 + 32 + + + + + + + + + 40 + 40 + + + + 最小化 + + + + + + + :/image/main/icon_max.png:/image/main/icon_max.png @@ -360,7 +542,7 @@ - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + :/image/main/icon_close.png:/image/main/icon_close.png @@ -426,87 +608,9 @@ - - - - - 0 - 30 - - - - - 20 - - - 0 - - - 0 - - - 40 - - - 0 - - - - - Qt::Horizontal - - - - 1289 - 20 - - - - - - - - - - - - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 20 - - - - - - - - - - - - - - wdgtContent wdgtTop - wdgtFoot diff --git a/infomation/InfoMainForm.cpp b/infomation/InfoMainForm.cpp index c001199..5d0ffc8 100644 --- a/infomation/InfoMainForm.cpp +++ b/infomation/InfoMainForm.cpp @@ -21,9 +21,13 @@ void InfoMainForm::initForm() { + // 加载样式表 + QString qssStyle = QssFileUtils::loadQssFileContent(QApplication::applicationDirPath() + "/qss/infoMain.css"); + if (qssStyle.isEmpty() == false) { + this->setStyleSheet(qssStyle); // 仅本窗口生效 + } - - + ui->scrollArea->setWindowFlags(Qt::FramelessWindowHint); // 设置无边框 } void InfoMainForm::initSubMenuForms() { diff --git a/infomation/InfoMainForm.ui b/infomation/InfoMainForm.ui index 958a6b2..d9066dd 100644 --- a/infomation/InfoMainForm.ui +++ b/infomation/InfoMainForm.ui @@ -90,7 +90,7 @@ - 280 + 295 48 @@ -103,7 +103,7 @@ - 280 + 295 48 @@ -116,7 +116,7 @@ - 280 + 295 48 @@ -129,7 +129,7 @@ - 280 + 295 48 @@ -142,7 +142,7 @@ - 280 + 295 48 @@ -155,7 +155,7 @@ - 280 + 295 48 @@ -168,7 +168,7 @@ - 280 + 295 48 @@ -181,7 +181,7 @@ - 280 + 295 48 @@ -194,7 +194,7 @@ - 280 + 295 48 @@ -207,7 +207,7 @@ - 280 + 295 48 @@ -220,7 +220,7 @@ - 280 + 295 48 @@ -233,7 +233,7 @@ - 280 + 295 48 @@ -246,7 +246,7 @@ - 280 + 295 48 diff --git a/infomation/task/DeptTaskForm.cpp b/infomation/task/DeptTaskForm.cpp index ea21a9f..cc6bf31 100644 --- a/infomation/task/DeptTaskForm.cpp +++ b/infomation/task/DeptTaskForm.cpp @@ -18,12 +18,17 @@ delete ui; } -void DeptTaskForm::showEvent(QShowEvent *event) +void DeptTaskForm::showEvent(QShowEvent * event) { ui->tableDeptTask->adjustTableWidth(); getDeptTaskList(0); } +void DeptTaskForm::resizeEvent(QResizeEvent * event) +{ + ui->tableDeptTask->adjustTableWidth(); +} + void DeptTaskForm::initFormTable() { // 初始化查询条件 diff --git a/infomation/task/DeptTaskForm.h b/infomation/task/DeptTaskForm.h index 1055c36..3c1ad5b 100644 --- a/infomation/task/DeptTaskForm.h +++ b/infomation/task/DeptTaskForm.h @@ -21,7 +21,8 @@ ~DeptTaskForm(); protected: - void showEvent(QShowEvent *event) override; + void showEvent(QShowEvent * event) override; + void resizeEvent(QResizeEvent * event) override; private: Ui::DeptTaskForm *ui; diff --git a/main.cpp b/main.cpp index 525387e..0b78c87 100644 --- a/main.cpp +++ b/main.cpp @@ -1,5 +1,3 @@ -#include "MainWindow.h" - #include #include diff --git a/res/image/Index/u1176.svg b/res/image/Index/u1176.svg deleted file mode 100644 index c81ce8a..0000000 --- a/res/image/Index/u1176.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1180.svg b/res/image/Index/u1180.svg deleted file mode 100644 index 2ef24ab..0000000 --- a/res/image/Index/u1180.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1220.svg b/res/image/Index/u1220.svg deleted file mode 100644 index 43452aa..0000000 --- a/res/image/Index/u1220.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/AutoCalibrationXC.pro b/AutoCalibrationXC.pro index 6bcb335..7790b37 100644 --- a/AutoCalibrationXC.pro +++ b/AutoCalibrationXC.pro @@ -24,11 +24,6 @@ include(QPagedTable/QPagedTable.pri) SOURCES += main.cpp -SOURCES += MainWindow.cpp - -HEADERS += MainWindow.h - -FORMS += MainWindow.ui RC_ICONS = res/autoCalibration.ico diff --git a/MainWindow.cpp b/MainWindow.cpp deleted file mode 100644 index ff126e8..0000000 --- a/MainWindow.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#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/MainWindow.h b/MainWindow.h deleted file mode 100644 index 4643e32..0000000 --- a/MainWindow.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#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; -}; -#endif // MAINWINDOW_H diff --git a/MainWindow.ui b/MainWindow.ui deleted file mode 100644 index b232854..0000000 --- a/MainWindow.ui +++ /dev/null @@ -1,22 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 800 - 600 - - - - MainWindow - - - - - - - - diff --git a/frame/CustomMessageBox.ui b/frame/CustomMessageBox.ui index 336be54..b545d74 100644 --- a/frame/CustomMessageBox.ui +++ b/frame/CustomMessageBox.ui @@ -84,8 +84,8 @@ - - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + + :/image/msgbox/icon_box_close.png:/image/msgbox/icon_box_close.png @@ -134,7 +134,7 @@ - :/image/msgbox/icon_box_success.png + :/image/msgbox/icon_box_success.png Qt::AlignCenter @@ -265,6 +265,8 @@ - + + + diff --git a/frame/MainWindowForm.cpp b/frame/MainWindowForm.cpp index 2ded44b..ec82cd7 100644 --- a/frame/MainWindowForm.cpp +++ b/frame/MainWindowForm.cpp @@ -1,6 +1,8 @@ #include "MainWindowForm.h" #include "ui_MainWindowForm.h" +#include + MainWindowForm::MainWindowForm(QWidget *parent) : FramelessWindow(parent), ui(new Ui::MainWindowForm) @@ -12,7 +14,7 @@ initMenuWidgets(); initFunctionButtons(); - // 每秒更新 界面上没有地方能摆 暂时先不启动定时器 + // 每秒更新 connect(TimeCounterUtil::getInstance().clockTimer, &QTimer::timeout, this, &MainWindowForm::onUpdateTimestampHandler); TimeCounterUtil::getInstance().clockTimer->start(1000); @@ -34,6 +36,7 @@ void MainWindowForm::initForm() { setWindowFlags(Qt::FramelessWindowHint); // 设置全屏 + setWindowState(Qt::WindowState::WindowMaximized); this->setTitleBar(ui->wdgtTop); // 设置窗口位置和大小 move(0, 0); @@ -120,6 +123,22 @@ setWindowState(Qt::WindowMinimized | windowState()); } +void MainWindowForm::on_btnMaxWin_clicked() +{ + QScreen *screen = QGuiApplication::primaryScreen(); + QRect screenSize = screen->availableGeometry(); // 可用区域(排除任务栏) + + if (this->isMaximized()) { + resize(screenSize.width() * 0.8, screenSize.height() * 0.8); + move(QRandomGenerator::global()->bounded(10, 100), QRandomGenerator::global()->bounded(10, 50)); + this->showNormal(); + } else { + resize(screenSize.width(), screenSize.height()); + move(0, 0); + this->showMaximized(); + } +} + void MainWindowForm::on_btnCloseWin_clicked() { // 创建一个消息框 @@ -146,18 +165,9 @@ ui->labelTime->setText(now.toString("yyyy-MM-dd HH:mm:ss")); } -void MainWindowForm::on_btnMenuMax_clicked() -{ - if (this->isMaximized()) { - this->showNormal(); - } else { - this->showMaximized(); - } -} - void MainWindowForm::titleDblClick() { - on_btnMenuMax_clicked(); + on_btnMaxWin_clicked(); } void MainWindowForm::onMenuButtonsEabled(bool enable) { diff --git a/frame/MainWindowForm.h b/frame/MainWindowForm.h index 4d206b1..9b4eae4 100644 --- a/frame/MainWindowForm.h +++ b/frame/MainWindowForm.h @@ -45,11 +45,11 @@ private slots: void on_btnMinWin_clicked(); + void on_btnMaxWin_clicked(); void on_btnCloseWin_clicked(); void onFunctionButtonsAction(); void onUpdateTimestampHandler(); - void on_btnMenuMax_clicked(); void titleDblClick(); void onMenuButtonsEabled(bool enable); diff --git a/frame/MainWindowForm.ui b/frame/MainWindowForm.ui index bd42122..f37d171 100644 --- a/frame/MainWindowForm.ui +++ b/frame/MainWindowForm.ui @@ -41,7 +41,7 @@ 0 - 120 + 100 @@ -58,7 +58,7 @@ 20 - 0 + 20 @@ -88,8 +88,8 @@ - 120 - 120 + 150 + 100 @@ -107,6 +107,22 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + @@ -158,7 +174,7 @@ 100 - 84 + 72 @@ -166,7 +182,8 @@ - :/image/main/calibration.png:/image/main/calibration.png + :/image/main/icon_menu_calibration.png + :/image/main/icon_menu_calibration_selected.png:/image/main/icon_menu_calibration.png @@ -184,7 +201,7 @@ 100 - 84 + 72 @@ -192,7 +209,8 @@ - :/image/main/rawDataRecord.png:/image/main/rawDataRecord.png + :/image/main/icon_menu_check.png + :/image/main/icon_menu_check_selected.png:/image/main/icon_menu_check.png @@ -210,7 +228,7 @@ 100 - 84 + 72 @@ -218,7 +236,8 @@ - :/image/main/fileRes.png:/image/main/fileRes.png + :/image/main/icon_menu_infomation.png + :/image/main/icon_menu_infomation_checked.png:/image/main/icon_menu_infomation.png @@ -235,10 +254,147 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 50 + 20 + + + + + - 320 + 240 + 16777215 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 5 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + :/image/main/iconTemp.png + + + + + + + 34.5℃ + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + + + + :/image/main/iconHumi.png + + + + + + + 25%Rh + + + + + + + + + + + + + + 240 16777215 @@ -308,7 +464,7 @@ - :/image/main/icon_setting_p.png:/image/main/icon_setting_p.png + :/image/main/icon_setting.png:/image/main/icon_setting.png @@ -334,7 +490,33 @@ - :/image/main/icon_min_p.png:/image/main/icon_min_p.png + :/image/main/icon_min.png:/image/main/icon_min.png + + + + 32 + 32 + + + + + + + + + 40 + 40 + + + + 最小化 + + + + + + + :/image/main/icon_max.png:/image/main/icon_max.png @@ -360,7 +542,7 @@ - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + :/image/main/icon_close.png:/image/main/icon_close.png @@ -426,87 +608,9 @@ - - - - - 0 - 30 - - - - - 20 - - - 0 - - - 0 - - - 40 - - - 0 - - - - - Qt::Horizontal - - - - 1289 - 20 - - - - - - - - - - - - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 20 - - - - - - - - - - - - - - wdgtContent wdgtTop - wdgtFoot diff --git a/infomation/InfoMainForm.cpp b/infomation/InfoMainForm.cpp index c001199..5d0ffc8 100644 --- a/infomation/InfoMainForm.cpp +++ b/infomation/InfoMainForm.cpp @@ -21,9 +21,13 @@ void InfoMainForm::initForm() { + // 加载样式表 + QString qssStyle = QssFileUtils::loadQssFileContent(QApplication::applicationDirPath() + "/qss/infoMain.css"); + if (qssStyle.isEmpty() == false) { + this->setStyleSheet(qssStyle); // 仅本窗口生效 + } - - + ui->scrollArea->setWindowFlags(Qt::FramelessWindowHint); // 设置无边框 } void InfoMainForm::initSubMenuForms() { diff --git a/infomation/InfoMainForm.ui b/infomation/InfoMainForm.ui index 958a6b2..d9066dd 100644 --- a/infomation/InfoMainForm.ui +++ b/infomation/InfoMainForm.ui @@ -90,7 +90,7 @@ - 280 + 295 48 @@ -103,7 +103,7 @@ - 280 + 295 48 @@ -116,7 +116,7 @@ - 280 + 295 48 @@ -129,7 +129,7 @@ - 280 + 295 48 @@ -142,7 +142,7 @@ - 280 + 295 48 @@ -155,7 +155,7 @@ - 280 + 295 48 @@ -168,7 +168,7 @@ - 280 + 295 48 @@ -181,7 +181,7 @@ - 280 + 295 48 @@ -194,7 +194,7 @@ - 280 + 295 48 @@ -207,7 +207,7 @@ - 280 + 295 48 @@ -220,7 +220,7 @@ - 280 + 295 48 @@ -233,7 +233,7 @@ - 280 + 295 48 @@ -246,7 +246,7 @@ - 280 + 295 48 diff --git a/infomation/task/DeptTaskForm.cpp b/infomation/task/DeptTaskForm.cpp index ea21a9f..cc6bf31 100644 --- a/infomation/task/DeptTaskForm.cpp +++ b/infomation/task/DeptTaskForm.cpp @@ -18,12 +18,17 @@ delete ui; } -void DeptTaskForm::showEvent(QShowEvent *event) +void DeptTaskForm::showEvent(QShowEvent * event) { ui->tableDeptTask->adjustTableWidth(); getDeptTaskList(0); } +void DeptTaskForm::resizeEvent(QResizeEvent * event) +{ + ui->tableDeptTask->adjustTableWidth(); +} + void DeptTaskForm::initFormTable() { // 初始化查询条件 diff --git a/infomation/task/DeptTaskForm.h b/infomation/task/DeptTaskForm.h index 1055c36..3c1ad5b 100644 --- a/infomation/task/DeptTaskForm.h +++ b/infomation/task/DeptTaskForm.h @@ -21,7 +21,8 @@ ~DeptTaskForm(); protected: - void showEvent(QShowEvent *event) override; + void showEvent(QShowEvent * event) override; + void resizeEvent(QResizeEvent * event) override; private: Ui::DeptTaskForm *ui; diff --git a/main.cpp b/main.cpp index 525387e..0b78c87 100644 --- a/main.cpp +++ b/main.cpp @@ -1,5 +1,3 @@ -#include "MainWindow.h" - #include #include diff --git a/res/image/Index/u1176.svg b/res/image/Index/u1176.svg deleted file mode 100644 index c81ce8a..0000000 --- a/res/image/Index/u1176.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1180.svg b/res/image/Index/u1180.svg deleted file mode 100644 index 2ef24ab..0000000 --- a/res/image/Index/u1180.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1220.svg b/res/image/Index/u1220.svg deleted file mode 100644 index 43452aa..0000000 --- a/res/image/Index/u1220.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2158.svg b/res/image/Index/u2158.svg deleted file mode 100644 index fd249e0..0000000 --- a/res/image/Index/u2158.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/AutoCalibrationXC.pro b/AutoCalibrationXC.pro index 6bcb335..7790b37 100644 --- a/AutoCalibrationXC.pro +++ b/AutoCalibrationXC.pro @@ -24,11 +24,6 @@ include(QPagedTable/QPagedTable.pri) SOURCES += main.cpp -SOURCES += MainWindow.cpp - -HEADERS += MainWindow.h - -FORMS += MainWindow.ui RC_ICONS = res/autoCalibration.ico diff --git a/MainWindow.cpp b/MainWindow.cpp deleted file mode 100644 index ff126e8..0000000 --- a/MainWindow.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#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/MainWindow.h b/MainWindow.h deleted file mode 100644 index 4643e32..0000000 --- a/MainWindow.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#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; -}; -#endif // MAINWINDOW_H diff --git a/MainWindow.ui b/MainWindow.ui deleted file mode 100644 index b232854..0000000 --- a/MainWindow.ui +++ /dev/null @@ -1,22 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 800 - 600 - - - - MainWindow - - - - - - - - diff --git a/frame/CustomMessageBox.ui b/frame/CustomMessageBox.ui index 336be54..b545d74 100644 --- a/frame/CustomMessageBox.ui +++ b/frame/CustomMessageBox.ui @@ -84,8 +84,8 @@ - - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + + :/image/msgbox/icon_box_close.png:/image/msgbox/icon_box_close.png @@ -134,7 +134,7 @@ - :/image/msgbox/icon_box_success.png + :/image/msgbox/icon_box_success.png Qt::AlignCenter @@ -265,6 +265,8 @@ - + + + diff --git a/frame/MainWindowForm.cpp b/frame/MainWindowForm.cpp index 2ded44b..ec82cd7 100644 --- a/frame/MainWindowForm.cpp +++ b/frame/MainWindowForm.cpp @@ -1,6 +1,8 @@ #include "MainWindowForm.h" #include "ui_MainWindowForm.h" +#include + MainWindowForm::MainWindowForm(QWidget *parent) : FramelessWindow(parent), ui(new Ui::MainWindowForm) @@ -12,7 +14,7 @@ initMenuWidgets(); initFunctionButtons(); - // 每秒更新 界面上没有地方能摆 暂时先不启动定时器 + // 每秒更新 connect(TimeCounterUtil::getInstance().clockTimer, &QTimer::timeout, this, &MainWindowForm::onUpdateTimestampHandler); TimeCounterUtil::getInstance().clockTimer->start(1000); @@ -34,6 +36,7 @@ void MainWindowForm::initForm() { setWindowFlags(Qt::FramelessWindowHint); // 设置全屏 + setWindowState(Qt::WindowState::WindowMaximized); this->setTitleBar(ui->wdgtTop); // 设置窗口位置和大小 move(0, 0); @@ -120,6 +123,22 @@ setWindowState(Qt::WindowMinimized | windowState()); } +void MainWindowForm::on_btnMaxWin_clicked() +{ + QScreen *screen = QGuiApplication::primaryScreen(); + QRect screenSize = screen->availableGeometry(); // 可用区域(排除任务栏) + + if (this->isMaximized()) { + resize(screenSize.width() * 0.8, screenSize.height() * 0.8); + move(QRandomGenerator::global()->bounded(10, 100), QRandomGenerator::global()->bounded(10, 50)); + this->showNormal(); + } else { + resize(screenSize.width(), screenSize.height()); + move(0, 0); + this->showMaximized(); + } +} + void MainWindowForm::on_btnCloseWin_clicked() { // 创建一个消息框 @@ -146,18 +165,9 @@ ui->labelTime->setText(now.toString("yyyy-MM-dd HH:mm:ss")); } -void MainWindowForm::on_btnMenuMax_clicked() -{ - if (this->isMaximized()) { - this->showNormal(); - } else { - this->showMaximized(); - } -} - void MainWindowForm::titleDblClick() { - on_btnMenuMax_clicked(); + on_btnMaxWin_clicked(); } void MainWindowForm::onMenuButtonsEabled(bool enable) { diff --git a/frame/MainWindowForm.h b/frame/MainWindowForm.h index 4d206b1..9b4eae4 100644 --- a/frame/MainWindowForm.h +++ b/frame/MainWindowForm.h @@ -45,11 +45,11 @@ private slots: void on_btnMinWin_clicked(); + void on_btnMaxWin_clicked(); void on_btnCloseWin_clicked(); void onFunctionButtonsAction(); void onUpdateTimestampHandler(); - void on_btnMenuMax_clicked(); void titleDblClick(); void onMenuButtonsEabled(bool enable); diff --git a/frame/MainWindowForm.ui b/frame/MainWindowForm.ui index bd42122..f37d171 100644 --- a/frame/MainWindowForm.ui +++ b/frame/MainWindowForm.ui @@ -41,7 +41,7 @@ 0 - 120 + 100 @@ -58,7 +58,7 @@ 20 - 0 + 20 @@ -88,8 +88,8 @@ - 120 - 120 + 150 + 100 @@ -107,6 +107,22 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + @@ -158,7 +174,7 @@ 100 - 84 + 72 @@ -166,7 +182,8 @@ - :/image/main/calibration.png:/image/main/calibration.png + :/image/main/icon_menu_calibration.png + :/image/main/icon_menu_calibration_selected.png:/image/main/icon_menu_calibration.png @@ -184,7 +201,7 @@ 100 - 84 + 72 @@ -192,7 +209,8 @@ - :/image/main/rawDataRecord.png:/image/main/rawDataRecord.png + :/image/main/icon_menu_check.png + :/image/main/icon_menu_check_selected.png:/image/main/icon_menu_check.png @@ -210,7 +228,7 @@ 100 - 84 + 72 @@ -218,7 +236,8 @@ - :/image/main/fileRes.png:/image/main/fileRes.png + :/image/main/icon_menu_infomation.png + :/image/main/icon_menu_infomation_checked.png:/image/main/icon_menu_infomation.png @@ -235,10 +254,147 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 50 + 20 + + + + + - 320 + 240 + 16777215 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 5 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + :/image/main/iconTemp.png + + + + + + + 34.5℃ + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + + + + :/image/main/iconHumi.png + + + + + + + 25%Rh + + + + + + + + + + + + + + 240 16777215 @@ -308,7 +464,7 @@ - :/image/main/icon_setting_p.png:/image/main/icon_setting_p.png + :/image/main/icon_setting.png:/image/main/icon_setting.png @@ -334,7 +490,33 @@ - :/image/main/icon_min_p.png:/image/main/icon_min_p.png + :/image/main/icon_min.png:/image/main/icon_min.png + + + + 32 + 32 + + + + + + + + + 40 + 40 + + + + 最小化 + + + + + + + :/image/main/icon_max.png:/image/main/icon_max.png @@ -360,7 +542,7 @@ - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + :/image/main/icon_close.png:/image/main/icon_close.png @@ -426,87 +608,9 @@ - - - - - 0 - 30 - - - - - 20 - - - 0 - - - 0 - - - 40 - - - 0 - - - - - Qt::Horizontal - - - - 1289 - 20 - - - - - - - - - - - - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 20 - - - - - - - - - - - - - - wdgtContent wdgtTop - wdgtFoot diff --git a/infomation/InfoMainForm.cpp b/infomation/InfoMainForm.cpp index c001199..5d0ffc8 100644 --- a/infomation/InfoMainForm.cpp +++ b/infomation/InfoMainForm.cpp @@ -21,9 +21,13 @@ void InfoMainForm::initForm() { + // 加载样式表 + QString qssStyle = QssFileUtils::loadQssFileContent(QApplication::applicationDirPath() + "/qss/infoMain.css"); + if (qssStyle.isEmpty() == false) { + this->setStyleSheet(qssStyle); // 仅本窗口生效 + } - - + ui->scrollArea->setWindowFlags(Qt::FramelessWindowHint); // 设置无边框 } void InfoMainForm::initSubMenuForms() { diff --git a/infomation/InfoMainForm.ui b/infomation/InfoMainForm.ui index 958a6b2..d9066dd 100644 --- a/infomation/InfoMainForm.ui +++ b/infomation/InfoMainForm.ui @@ -90,7 +90,7 @@ - 280 + 295 48 @@ -103,7 +103,7 @@ - 280 + 295 48 @@ -116,7 +116,7 @@ - 280 + 295 48 @@ -129,7 +129,7 @@ - 280 + 295 48 @@ -142,7 +142,7 @@ - 280 + 295 48 @@ -155,7 +155,7 @@ - 280 + 295 48 @@ -168,7 +168,7 @@ - 280 + 295 48 @@ -181,7 +181,7 @@ - 280 + 295 48 @@ -194,7 +194,7 @@ - 280 + 295 48 @@ -207,7 +207,7 @@ - 280 + 295 48 @@ -220,7 +220,7 @@ - 280 + 295 48 @@ -233,7 +233,7 @@ - 280 + 295 48 @@ -246,7 +246,7 @@ - 280 + 295 48 diff --git a/infomation/task/DeptTaskForm.cpp b/infomation/task/DeptTaskForm.cpp index ea21a9f..cc6bf31 100644 --- a/infomation/task/DeptTaskForm.cpp +++ b/infomation/task/DeptTaskForm.cpp @@ -18,12 +18,17 @@ delete ui; } -void DeptTaskForm::showEvent(QShowEvent *event) +void DeptTaskForm::showEvent(QShowEvent * event) { ui->tableDeptTask->adjustTableWidth(); getDeptTaskList(0); } +void DeptTaskForm::resizeEvent(QResizeEvent * event) +{ + ui->tableDeptTask->adjustTableWidth(); +} + void DeptTaskForm::initFormTable() { // 初始化查询条件 diff --git a/infomation/task/DeptTaskForm.h b/infomation/task/DeptTaskForm.h index 1055c36..3c1ad5b 100644 --- a/infomation/task/DeptTaskForm.h +++ b/infomation/task/DeptTaskForm.h @@ -21,7 +21,8 @@ ~DeptTaskForm(); protected: - void showEvent(QShowEvent *event) override; + void showEvent(QShowEvent * event) override; + void resizeEvent(QResizeEvent * event) override; private: Ui::DeptTaskForm *ui; diff --git a/main.cpp b/main.cpp index 525387e..0b78c87 100644 --- a/main.cpp +++ b/main.cpp @@ -1,5 +1,3 @@ -#include "MainWindow.h" - #include #include diff --git a/res/image/Index/u1176.svg b/res/image/Index/u1176.svg deleted file mode 100644 index c81ce8a..0000000 --- a/res/image/Index/u1176.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1180.svg b/res/image/Index/u1180.svg deleted file mode 100644 index 2ef24ab..0000000 --- a/res/image/Index/u1180.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1220.svg b/res/image/Index/u1220.svg deleted file mode 100644 index 43452aa..0000000 --- a/res/image/Index/u1220.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2158.svg b/res/image/Index/u2158.svg deleted file mode 100644 index fd249e0..0000000 --- a/res/image/Index/u2158.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u2188.svg b/res/image/Index/u2188.svg deleted file mode 100644 index 34f53c4..0000000 --- a/res/image/Index/u2188.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/AutoCalibrationXC.pro b/AutoCalibrationXC.pro index 6bcb335..7790b37 100644 --- a/AutoCalibrationXC.pro +++ b/AutoCalibrationXC.pro @@ -24,11 +24,6 @@ include(QPagedTable/QPagedTable.pri) SOURCES += main.cpp -SOURCES += MainWindow.cpp - -HEADERS += MainWindow.h - -FORMS += MainWindow.ui RC_ICONS = res/autoCalibration.ico diff --git a/MainWindow.cpp b/MainWindow.cpp deleted file mode 100644 index ff126e8..0000000 --- a/MainWindow.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#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/MainWindow.h b/MainWindow.h deleted file mode 100644 index 4643e32..0000000 --- a/MainWindow.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#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; -}; -#endif // MAINWINDOW_H diff --git a/MainWindow.ui b/MainWindow.ui deleted file mode 100644 index b232854..0000000 --- a/MainWindow.ui +++ /dev/null @@ -1,22 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 800 - 600 - - - - MainWindow - - - - - - - - diff --git a/frame/CustomMessageBox.ui b/frame/CustomMessageBox.ui index 336be54..b545d74 100644 --- a/frame/CustomMessageBox.ui +++ b/frame/CustomMessageBox.ui @@ -84,8 +84,8 @@ - - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + + :/image/msgbox/icon_box_close.png:/image/msgbox/icon_box_close.png @@ -134,7 +134,7 @@ - :/image/msgbox/icon_box_success.png + :/image/msgbox/icon_box_success.png Qt::AlignCenter @@ -265,6 +265,8 @@ - + + + diff --git a/frame/MainWindowForm.cpp b/frame/MainWindowForm.cpp index 2ded44b..ec82cd7 100644 --- a/frame/MainWindowForm.cpp +++ b/frame/MainWindowForm.cpp @@ -1,6 +1,8 @@ #include "MainWindowForm.h" #include "ui_MainWindowForm.h" +#include + MainWindowForm::MainWindowForm(QWidget *parent) : FramelessWindow(parent), ui(new Ui::MainWindowForm) @@ -12,7 +14,7 @@ initMenuWidgets(); initFunctionButtons(); - // 每秒更新 界面上没有地方能摆 暂时先不启动定时器 + // 每秒更新 connect(TimeCounterUtil::getInstance().clockTimer, &QTimer::timeout, this, &MainWindowForm::onUpdateTimestampHandler); TimeCounterUtil::getInstance().clockTimer->start(1000); @@ -34,6 +36,7 @@ void MainWindowForm::initForm() { setWindowFlags(Qt::FramelessWindowHint); // 设置全屏 + setWindowState(Qt::WindowState::WindowMaximized); this->setTitleBar(ui->wdgtTop); // 设置窗口位置和大小 move(0, 0); @@ -120,6 +123,22 @@ setWindowState(Qt::WindowMinimized | windowState()); } +void MainWindowForm::on_btnMaxWin_clicked() +{ + QScreen *screen = QGuiApplication::primaryScreen(); + QRect screenSize = screen->availableGeometry(); // 可用区域(排除任务栏) + + if (this->isMaximized()) { + resize(screenSize.width() * 0.8, screenSize.height() * 0.8); + move(QRandomGenerator::global()->bounded(10, 100), QRandomGenerator::global()->bounded(10, 50)); + this->showNormal(); + } else { + resize(screenSize.width(), screenSize.height()); + move(0, 0); + this->showMaximized(); + } +} + void MainWindowForm::on_btnCloseWin_clicked() { // 创建一个消息框 @@ -146,18 +165,9 @@ ui->labelTime->setText(now.toString("yyyy-MM-dd HH:mm:ss")); } -void MainWindowForm::on_btnMenuMax_clicked() -{ - if (this->isMaximized()) { - this->showNormal(); - } else { - this->showMaximized(); - } -} - void MainWindowForm::titleDblClick() { - on_btnMenuMax_clicked(); + on_btnMaxWin_clicked(); } void MainWindowForm::onMenuButtonsEabled(bool enable) { diff --git a/frame/MainWindowForm.h b/frame/MainWindowForm.h index 4d206b1..9b4eae4 100644 --- a/frame/MainWindowForm.h +++ b/frame/MainWindowForm.h @@ -45,11 +45,11 @@ private slots: void on_btnMinWin_clicked(); + void on_btnMaxWin_clicked(); void on_btnCloseWin_clicked(); void onFunctionButtonsAction(); void onUpdateTimestampHandler(); - void on_btnMenuMax_clicked(); void titleDblClick(); void onMenuButtonsEabled(bool enable); diff --git a/frame/MainWindowForm.ui b/frame/MainWindowForm.ui index bd42122..f37d171 100644 --- a/frame/MainWindowForm.ui +++ b/frame/MainWindowForm.ui @@ -41,7 +41,7 @@ 0 - 120 + 100 @@ -58,7 +58,7 @@ 20 - 0 + 20 @@ -88,8 +88,8 @@ - 120 - 120 + 150 + 100 @@ -107,6 +107,22 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + @@ -158,7 +174,7 @@ 100 - 84 + 72 @@ -166,7 +182,8 @@ - :/image/main/calibration.png:/image/main/calibration.png + :/image/main/icon_menu_calibration.png + :/image/main/icon_menu_calibration_selected.png:/image/main/icon_menu_calibration.png @@ -184,7 +201,7 @@ 100 - 84 + 72 @@ -192,7 +209,8 @@ - :/image/main/rawDataRecord.png:/image/main/rawDataRecord.png + :/image/main/icon_menu_check.png + :/image/main/icon_menu_check_selected.png:/image/main/icon_menu_check.png @@ -210,7 +228,7 @@ 100 - 84 + 72 @@ -218,7 +236,8 @@ - :/image/main/fileRes.png:/image/main/fileRes.png + :/image/main/icon_menu_infomation.png + :/image/main/icon_menu_infomation_checked.png:/image/main/icon_menu_infomation.png @@ -235,10 +254,147 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 50 + 20 + + + + + - 320 + 240 + 16777215 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 5 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + :/image/main/iconTemp.png + + + + + + + 34.5℃ + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + + + + :/image/main/iconHumi.png + + + + + + + 25%Rh + + + + + + + + + + + + + + 240 16777215 @@ -308,7 +464,7 @@ - :/image/main/icon_setting_p.png:/image/main/icon_setting_p.png + :/image/main/icon_setting.png:/image/main/icon_setting.png @@ -334,7 +490,33 @@ - :/image/main/icon_min_p.png:/image/main/icon_min_p.png + :/image/main/icon_min.png:/image/main/icon_min.png + + + + 32 + 32 + + + + + + + + + 40 + 40 + + + + 最小化 + + + + + + + :/image/main/icon_max.png:/image/main/icon_max.png @@ -360,7 +542,7 @@ - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + :/image/main/icon_close.png:/image/main/icon_close.png @@ -426,87 +608,9 @@ - - - - - 0 - 30 - - - - - 20 - - - 0 - - - 0 - - - 40 - - - 0 - - - - - Qt::Horizontal - - - - 1289 - 20 - - - - - - - - - - - - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 20 - - - - - - - - - - - - - - wdgtContent wdgtTop - wdgtFoot diff --git a/infomation/InfoMainForm.cpp b/infomation/InfoMainForm.cpp index c001199..5d0ffc8 100644 --- a/infomation/InfoMainForm.cpp +++ b/infomation/InfoMainForm.cpp @@ -21,9 +21,13 @@ void InfoMainForm::initForm() { + // 加载样式表 + QString qssStyle = QssFileUtils::loadQssFileContent(QApplication::applicationDirPath() + "/qss/infoMain.css"); + if (qssStyle.isEmpty() == false) { + this->setStyleSheet(qssStyle); // 仅本窗口生效 + } - - + ui->scrollArea->setWindowFlags(Qt::FramelessWindowHint); // 设置无边框 } void InfoMainForm::initSubMenuForms() { diff --git a/infomation/InfoMainForm.ui b/infomation/InfoMainForm.ui index 958a6b2..d9066dd 100644 --- a/infomation/InfoMainForm.ui +++ b/infomation/InfoMainForm.ui @@ -90,7 +90,7 @@ - 280 + 295 48 @@ -103,7 +103,7 @@ - 280 + 295 48 @@ -116,7 +116,7 @@ - 280 + 295 48 @@ -129,7 +129,7 @@ - 280 + 295 48 @@ -142,7 +142,7 @@ - 280 + 295 48 @@ -155,7 +155,7 @@ - 280 + 295 48 @@ -168,7 +168,7 @@ - 280 + 295 48 @@ -181,7 +181,7 @@ - 280 + 295 48 @@ -194,7 +194,7 @@ - 280 + 295 48 @@ -207,7 +207,7 @@ - 280 + 295 48 @@ -220,7 +220,7 @@ - 280 + 295 48 @@ -233,7 +233,7 @@ - 280 + 295 48 @@ -246,7 +246,7 @@ - 280 + 295 48 diff --git a/infomation/task/DeptTaskForm.cpp b/infomation/task/DeptTaskForm.cpp index ea21a9f..cc6bf31 100644 --- a/infomation/task/DeptTaskForm.cpp +++ b/infomation/task/DeptTaskForm.cpp @@ -18,12 +18,17 @@ delete ui; } -void DeptTaskForm::showEvent(QShowEvent *event) +void DeptTaskForm::showEvent(QShowEvent * event) { ui->tableDeptTask->adjustTableWidth(); getDeptTaskList(0); } +void DeptTaskForm::resizeEvent(QResizeEvent * event) +{ + ui->tableDeptTask->adjustTableWidth(); +} + void DeptTaskForm::initFormTable() { // 初始化查询条件 diff --git a/infomation/task/DeptTaskForm.h b/infomation/task/DeptTaskForm.h index 1055c36..3c1ad5b 100644 --- a/infomation/task/DeptTaskForm.h +++ b/infomation/task/DeptTaskForm.h @@ -21,7 +21,8 @@ ~DeptTaskForm(); protected: - void showEvent(QShowEvent *event) override; + void showEvent(QShowEvent * event) override; + void resizeEvent(QResizeEvent * event) override; private: Ui::DeptTaskForm *ui; diff --git a/main.cpp b/main.cpp index 525387e..0b78c87 100644 --- a/main.cpp +++ b/main.cpp @@ -1,5 +1,3 @@ -#include "MainWindow.h" - #include #include diff --git a/res/image/Index/u1176.svg b/res/image/Index/u1176.svg deleted file mode 100644 index c81ce8a..0000000 --- a/res/image/Index/u1176.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1180.svg b/res/image/Index/u1180.svg deleted file mode 100644 index 2ef24ab..0000000 --- a/res/image/Index/u1180.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1220.svg b/res/image/Index/u1220.svg deleted file mode 100644 index 43452aa..0000000 --- a/res/image/Index/u1220.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2158.svg b/res/image/Index/u2158.svg deleted file mode 100644 index fd249e0..0000000 --- a/res/image/Index/u2158.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u2188.svg b/res/image/Index/u2188.svg deleted file mode 100644 index 34f53c4..0000000 --- a/res/image/Index/u2188.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2189.svg b/res/image/Index/u2189.svg deleted file mode 100644 index 01a6bbb..0000000 --- a/res/image/Index/u2189.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/AutoCalibrationXC.pro b/AutoCalibrationXC.pro index 6bcb335..7790b37 100644 --- a/AutoCalibrationXC.pro +++ b/AutoCalibrationXC.pro @@ -24,11 +24,6 @@ include(QPagedTable/QPagedTable.pri) SOURCES += main.cpp -SOURCES += MainWindow.cpp - -HEADERS += MainWindow.h - -FORMS += MainWindow.ui RC_ICONS = res/autoCalibration.ico diff --git a/MainWindow.cpp b/MainWindow.cpp deleted file mode 100644 index ff126e8..0000000 --- a/MainWindow.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#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/MainWindow.h b/MainWindow.h deleted file mode 100644 index 4643e32..0000000 --- a/MainWindow.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#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; -}; -#endif // MAINWINDOW_H diff --git a/MainWindow.ui b/MainWindow.ui deleted file mode 100644 index b232854..0000000 --- a/MainWindow.ui +++ /dev/null @@ -1,22 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 800 - 600 - - - - MainWindow - - - - - - - - diff --git a/frame/CustomMessageBox.ui b/frame/CustomMessageBox.ui index 336be54..b545d74 100644 --- a/frame/CustomMessageBox.ui +++ b/frame/CustomMessageBox.ui @@ -84,8 +84,8 @@ - - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + + :/image/msgbox/icon_box_close.png:/image/msgbox/icon_box_close.png @@ -134,7 +134,7 @@ - :/image/msgbox/icon_box_success.png + :/image/msgbox/icon_box_success.png Qt::AlignCenter @@ -265,6 +265,8 @@ - + + + diff --git a/frame/MainWindowForm.cpp b/frame/MainWindowForm.cpp index 2ded44b..ec82cd7 100644 --- a/frame/MainWindowForm.cpp +++ b/frame/MainWindowForm.cpp @@ -1,6 +1,8 @@ #include "MainWindowForm.h" #include "ui_MainWindowForm.h" +#include + MainWindowForm::MainWindowForm(QWidget *parent) : FramelessWindow(parent), ui(new Ui::MainWindowForm) @@ -12,7 +14,7 @@ initMenuWidgets(); initFunctionButtons(); - // 每秒更新 界面上没有地方能摆 暂时先不启动定时器 + // 每秒更新 connect(TimeCounterUtil::getInstance().clockTimer, &QTimer::timeout, this, &MainWindowForm::onUpdateTimestampHandler); TimeCounterUtil::getInstance().clockTimer->start(1000); @@ -34,6 +36,7 @@ void MainWindowForm::initForm() { setWindowFlags(Qt::FramelessWindowHint); // 设置全屏 + setWindowState(Qt::WindowState::WindowMaximized); this->setTitleBar(ui->wdgtTop); // 设置窗口位置和大小 move(0, 0); @@ -120,6 +123,22 @@ setWindowState(Qt::WindowMinimized | windowState()); } +void MainWindowForm::on_btnMaxWin_clicked() +{ + QScreen *screen = QGuiApplication::primaryScreen(); + QRect screenSize = screen->availableGeometry(); // 可用区域(排除任务栏) + + if (this->isMaximized()) { + resize(screenSize.width() * 0.8, screenSize.height() * 0.8); + move(QRandomGenerator::global()->bounded(10, 100), QRandomGenerator::global()->bounded(10, 50)); + this->showNormal(); + } else { + resize(screenSize.width(), screenSize.height()); + move(0, 0); + this->showMaximized(); + } +} + void MainWindowForm::on_btnCloseWin_clicked() { // 创建一个消息框 @@ -146,18 +165,9 @@ ui->labelTime->setText(now.toString("yyyy-MM-dd HH:mm:ss")); } -void MainWindowForm::on_btnMenuMax_clicked() -{ - if (this->isMaximized()) { - this->showNormal(); - } else { - this->showMaximized(); - } -} - void MainWindowForm::titleDblClick() { - on_btnMenuMax_clicked(); + on_btnMaxWin_clicked(); } void MainWindowForm::onMenuButtonsEabled(bool enable) { diff --git a/frame/MainWindowForm.h b/frame/MainWindowForm.h index 4d206b1..9b4eae4 100644 --- a/frame/MainWindowForm.h +++ b/frame/MainWindowForm.h @@ -45,11 +45,11 @@ private slots: void on_btnMinWin_clicked(); + void on_btnMaxWin_clicked(); void on_btnCloseWin_clicked(); void onFunctionButtonsAction(); void onUpdateTimestampHandler(); - void on_btnMenuMax_clicked(); void titleDblClick(); void onMenuButtonsEabled(bool enable); diff --git a/frame/MainWindowForm.ui b/frame/MainWindowForm.ui index bd42122..f37d171 100644 --- a/frame/MainWindowForm.ui +++ b/frame/MainWindowForm.ui @@ -41,7 +41,7 @@ 0 - 120 + 100 @@ -58,7 +58,7 @@ 20 - 0 + 20 @@ -88,8 +88,8 @@ - 120 - 120 + 150 + 100 @@ -107,6 +107,22 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + @@ -158,7 +174,7 @@ 100 - 84 + 72 @@ -166,7 +182,8 @@ - :/image/main/calibration.png:/image/main/calibration.png + :/image/main/icon_menu_calibration.png + :/image/main/icon_menu_calibration_selected.png:/image/main/icon_menu_calibration.png @@ -184,7 +201,7 @@ 100 - 84 + 72 @@ -192,7 +209,8 @@ - :/image/main/rawDataRecord.png:/image/main/rawDataRecord.png + :/image/main/icon_menu_check.png + :/image/main/icon_menu_check_selected.png:/image/main/icon_menu_check.png @@ -210,7 +228,7 @@ 100 - 84 + 72 @@ -218,7 +236,8 @@ - :/image/main/fileRes.png:/image/main/fileRes.png + :/image/main/icon_menu_infomation.png + :/image/main/icon_menu_infomation_checked.png:/image/main/icon_menu_infomation.png @@ -235,10 +254,147 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 50 + 20 + + + + + - 320 + 240 + 16777215 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 5 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + :/image/main/iconTemp.png + + + + + + + 34.5℃ + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + + + + :/image/main/iconHumi.png + + + + + + + 25%Rh + + + + + + + + + + + + + + 240 16777215 @@ -308,7 +464,7 @@ - :/image/main/icon_setting_p.png:/image/main/icon_setting_p.png + :/image/main/icon_setting.png:/image/main/icon_setting.png @@ -334,7 +490,33 @@ - :/image/main/icon_min_p.png:/image/main/icon_min_p.png + :/image/main/icon_min.png:/image/main/icon_min.png + + + + 32 + 32 + + + + + + + + + 40 + 40 + + + + 最小化 + + + + + + + :/image/main/icon_max.png:/image/main/icon_max.png @@ -360,7 +542,7 @@ - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + :/image/main/icon_close.png:/image/main/icon_close.png @@ -426,87 +608,9 @@ - - - - - 0 - 30 - - - - - 20 - - - 0 - - - 0 - - - 40 - - - 0 - - - - - Qt::Horizontal - - - - 1289 - 20 - - - - - - - - - - - - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 20 - - - - - - - - - - - - - - wdgtContent wdgtTop - wdgtFoot diff --git a/infomation/InfoMainForm.cpp b/infomation/InfoMainForm.cpp index c001199..5d0ffc8 100644 --- a/infomation/InfoMainForm.cpp +++ b/infomation/InfoMainForm.cpp @@ -21,9 +21,13 @@ void InfoMainForm::initForm() { + // 加载样式表 + QString qssStyle = QssFileUtils::loadQssFileContent(QApplication::applicationDirPath() + "/qss/infoMain.css"); + if (qssStyle.isEmpty() == false) { + this->setStyleSheet(qssStyle); // 仅本窗口生效 + } - - + ui->scrollArea->setWindowFlags(Qt::FramelessWindowHint); // 设置无边框 } void InfoMainForm::initSubMenuForms() { diff --git a/infomation/InfoMainForm.ui b/infomation/InfoMainForm.ui index 958a6b2..d9066dd 100644 --- a/infomation/InfoMainForm.ui +++ b/infomation/InfoMainForm.ui @@ -90,7 +90,7 @@ - 280 + 295 48 @@ -103,7 +103,7 @@ - 280 + 295 48 @@ -116,7 +116,7 @@ - 280 + 295 48 @@ -129,7 +129,7 @@ - 280 + 295 48 @@ -142,7 +142,7 @@ - 280 + 295 48 @@ -155,7 +155,7 @@ - 280 + 295 48 @@ -168,7 +168,7 @@ - 280 + 295 48 @@ -181,7 +181,7 @@ - 280 + 295 48 @@ -194,7 +194,7 @@ - 280 + 295 48 @@ -207,7 +207,7 @@ - 280 + 295 48 @@ -220,7 +220,7 @@ - 280 + 295 48 @@ -233,7 +233,7 @@ - 280 + 295 48 @@ -246,7 +246,7 @@ - 280 + 295 48 diff --git a/infomation/task/DeptTaskForm.cpp b/infomation/task/DeptTaskForm.cpp index ea21a9f..cc6bf31 100644 --- a/infomation/task/DeptTaskForm.cpp +++ b/infomation/task/DeptTaskForm.cpp @@ -18,12 +18,17 @@ delete ui; } -void DeptTaskForm::showEvent(QShowEvent *event) +void DeptTaskForm::showEvent(QShowEvent * event) { ui->tableDeptTask->adjustTableWidth(); getDeptTaskList(0); } +void DeptTaskForm::resizeEvent(QResizeEvent * event) +{ + ui->tableDeptTask->adjustTableWidth(); +} + void DeptTaskForm::initFormTable() { // 初始化查询条件 diff --git a/infomation/task/DeptTaskForm.h b/infomation/task/DeptTaskForm.h index 1055c36..3c1ad5b 100644 --- a/infomation/task/DeptTaskForm.h +++ b/infomation/task/DeptTaskForm.h @@ -21,7 +21,8 @@ ~DeptTaskForm(); protected: - void showEvent(QShowEvent *event) override; + void showEvent(QShowEvent * event) override; + void resizeEvent(QResizeEvent * event) override; private: Ui::DeptTaskForm *ui; diff --git a/main.cpp b/main.cpp index 525387e..0b78c87 100644 --- a/main.cpp +++ b/main.cpp @@ -1,5 +1,3 @@ -#include "MainWindow.h" - #include #include diff --git a/res/image/Index/u1176.svg b/res/image/Index/u1176.svg deleted file mode 100644 index c81ce8a..0000000 --- a/res/image/Index/u1176.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1180.svg b/res/image/Index/u1180.svg deleted file mode 100644 index 2ef24ab..0000000 --- a/res/image/Index/u1180.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1220.svg b/res/image/Index/u1220.svg deleted file mode 100644 index 43452aa..0000000 --- a/res/image/Index/u1220.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2158.svg b/res/image/Index/u2158.svg deleted file mode 100644 index fd249e0..0000000 --- a/res/image/Index/u2158.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u2188.svg b/res/image/Index/u2188.svg deleted file mode 100644 index 34f53c4..0000000 --- a/res/image/Index/u2188.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2189.svg b/res/image/Index/u2189.svg deleted file mode 100644 index 01a6bbb..0000000 --- a/res/image/Index/u2189.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2324.svg b/res/image/Index/u2324.svg deleted file mode 100644 index 797f1c5..0000000 --- a/res/image/Index/u2324.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/AutoCalibrationXC.pro b/AutoCalibrationXC.pro index 6bcb335..7790b37 100644 --- a/AutoCalibrationXC.pro +++ b/AutoCalibrationXC.pro @@ -24,11 +24,6 @@ include(QPagedTable/QPagedTable.pri) SOURCES += main.cpp -SOURCES += MainWindow.cpp - -HEADERS += MainWindow.h - -FORMS += MainWindow.ui RC_ICONS = res/autoCalibration.ico diff --git a/MainWindow.cpp b/MainWindow.cpp deleted file mode 100644 index ff126e8..0000000 --- a/MainWindow.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#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/MainWindow.h b/MainWindow.h deleted file mode 100644 index 4643e32..0000000 --- a/MainWindow.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#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; -}; -#endif // MAINWINDOW_H diff --git a/MainWindow.ui b/MainWindow.ui deleted file mode 100644 index b232854..0000000 --- a/MainWindow.ui +++ /dev/null @@ -1,22 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 800 - 600 - - - - MainWindow - - - - - - - - diff --git a/frame/CustomMessageBox.ui b/frame/CustomMessageBox.ui index 336be54..b545d74 100644 --- a/frame/CustomMessageBox.ui +++ b/frame/CustomMessageBox.ui @@ -84,8 +84,8 @@ - - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + + :/image/msgbox/icon_box_close.png:/image/msgbox/icon_box_close.png @@ -134,7 +134,7 @@ - :/image/msgbox/icon_box_success.png + :/image/msgbox/icon_box_success.png Qt::AlignCenter @@ -265,6 +265,8 @@ - + + + diff --git a/frame/MainWindowForm.cpp b/frame/MainWindowForm.cpp index 2ded44b..ec82cd7 100644 --- a/frame/MainWindowForm.cpp +++ b/frame/MainWindowForm.cpp @@ -1,6 +1,8 @@ #include "MainWindowForm.h" #include "ui_MainWindowForm.h" +#include + MainWindowForm::MainWindowForm(QWidget *parent) : FramelessWindow(parent), ui(new Ui::MainWindowForm) @@ -12,7 +14,7 @@ initMenuWidgets(); initFunctionButtons(); - // 每秒更新 界面上没有地方能摆 暂时先不启动定时器 + // 每秒更新 connect(TimeCounterUtil::getInstance().clockTimer, &QTimer::timeout, this, &MainWindowForm::onUpdateTimestampHandler); TimeCounterUtil::getInstance().clockTimer->start(1000); @@ -34,6 +36,7 @@ void MainWindowForm::initForm() { setWindowFlags(Qt::FramelessWindowHint); // 设置全屏 + setWindowState(Qt::WindowState::WindowMaximized); this->setTitleBar(ui->wdgtTop); // 设置窗口位置和大小 move(0, 0); @@ -120,6 +123,22 @@ setWindowState(Qt::WindowMinimized | windowState()); } +void MainWindowForm::on_btnMaxWin_clicked() +{ + QScreen *screen = QGuiApplication::primaryScreen(); + QRect screenSize = screen->availableGeometry(); // 可用区域(排除任务栏) + + if (this->isMaximized()) { + resize(screenSize.width() * 0.8, screenSize.height() * 0.8); + move(QRandomGenerator::global()->bounded(10, 100), QRandomGenerator::global()->bounded(10, 50)); + this->showNormal(); + } else { + resize(screenSize.width(), screenSize.height()); + move(0, 0); + this->showMaximized(); + } +} + void MainWindowForm::on_btnCloseWin_clicked() { // 创建一个消息框 @@ -146,18 +165,9 @@ ui->labelTime->setText(now.toString("yyyy-MM-dd HH:mm:ss")); } -void MainWindowForm::on_btnMenuMax_clicked() -{ - if (this->isMaximized()) { - this->showNormal(); - } else { - this->showMaximized(); - } -} - void MainWindowForm::titleDblClick() { - on_btnMenuMax_clicked(); + on_btnMaxWin_clicked(); } void MainWindowForm::onMenuButtonsEabled(bool enable) { diff --git a/frame/MainWindowForm.h b/frame/MainWindowForm.h index 4d206b1..9b4eae4 100644 --- a/frame/MainWindowForm.h +++ b/frame/MainWindowForm.h @@ -45,11 +45,11 @@ private slots: void on_btnMinWin_clicked(); + void on_btnMaxWin_clicked(); void on_btnCloseWin_clicked(); void onFunctionButtonsAction(); void onUpdateTimestampHandler(); - void on_btnMenuMax_clicked(); void titleDblClick(); void onMenuButtonsEabled(bool enable); diff --git a/frame/MainWindowForm.ui b/frame/MainWindowForm.ui index bd42122..f37d171 100644 --- a/frame/MainWindowForm.ui +++ b/frame/MainWindowForm.ui @@ -41,7 +41,7 @@ 0 - 120 + 100 @@ -58,7 +58,7 @@ 20 - 0 + 20 @@ -88,8 +88,8 @@ - 120 - 120 + 150 + 100 @@ -107,6 +107,22 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + @@ -158,7 +174,7 @@ 100 - 84 + 72 @@ -166,7 +182,8 @@ - :/image/main/calibration.png:/image/main/calibration.png + :/image/main/icon_menu_calibration.png + :/image/main/icon_menu_calibration_selected.png:/image/main/icon_menu_calibration.png @@ -184,7 +201,7 @@ 100 - 84 + 72 @@ -192,7 +209,8 @@ - :/image/main/rawDataRecord.png:/image/main/rawDataRecord.png + :/image/main/icon_menu_check.png + :/image/main/icon_menu_check_selected.png:/image/main/icon_menu_check.png @@ -210,7 +228,7 @@ 100 - 84 + 72 @@ -218,7 +236,8 @@ - :/image/main/fileRes.png:/image/main/fileRes.png + :/image/main/icon_menu_infomation.png + :/image/main/icon_menu_infomation_checked.png:/image/main/icon_menu_infomation.png @@ -235,10 +254,147 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 50 + 20 + + + + + - 320 + 240 + 16777215 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 5 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + :/image/main/iconTemp.png + + + + + + + 34.5℃ + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + + + + :/image/main/iconHumi.png + + + + + + + 25%Rh + + + + + + + + + + + + + + 240 16777215 @@ -308,7 +464,7 @@ - :/image/main/icon_setting_p.png:/image/main/icon_setting_p.png + :/image/main/icon_setting.png:/image/main/icon_setting.png @@ -334,7 +490,33 @@ - :/image/main/icon_min_p.png:/image/main/icon_min_p.png + :/image/main/icon_min.png:/image/main/icon_min.png + + + + 32 + 32 + + + + + + + + + 40 + 40 + + + + 最小化 + + + + + + + :/image/main/icon_max.png:/image/main/icon_max.png @@ -360,7 +542,7 @@ - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + :/image/main/icon_close.png:/image/main/icon_close.png @@ -426,87 +608,9 @@ - - - - - 0 - 30 - - - - - 20 - - - 0 - - - 0 - - - 40 - - - 0 - - - - - Qt::Horizontal - - - - 1289 - 20 - - - - - - - - - - - - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 20 - - - - - - - - - - - - - - wdgtContent wdgtTop - wdgtFoot diff --git a/infomation/InfoMainForm.cpp b/infomation/InfoMainForm.cpp index c001199..5d0ffc8 100644 --- a/infomation/InfoMainForm.cpp +++ b/infomation/InfoMainForm.cpp @@ -21,9 +21,13 @@ void InfoMainForm::initForm() { + // 加载样式表 + QString qssStyle = QssFileUtils::loadQssFileContent(QApplication::applicationDirPath() + "/qss/infoMain.css"); + if (qssStyle.isEmpty() == false) { + this->setStyleSheet(qssStyle); // 仅本窗口生效 + } - - + ui->scrollArea->setWindowFlags(Qt::FramelessWindowHint); // 设置无边框 } void InfoMainForm::initSubMenuForms() { diff --git a/infomation/InfoMainForm.ui b/infomation/InfoMainForm.ui index 958a6b2..d9066dd 100644 --- a/infomation/InfoMainForm.ui +++ b/infomation/InfoMainForm.ui @@ -90,7 +90,7 @@ - 280 + 295 48 @@ -103,7 +103,7 @@ - 280 + 295 48 @@ -116,7 +116,7 @@ - 280 + 295 48 @@ -129,7 +129,7 @@ - 280 + 295 48 @@ -142,7 +142,7 @@ - 280 + 295 48 @@ -155,7 +155,7 @@ - 280 + 295 48 @@ -168,7 +168,7 @@ - 280 + 295 48 @@ -181,7 +181,7 @@ - 280 + 295 48 @@ -194,7 +194,7 @@ - 280 + 295 48 @@ -207,7 +207,7 @@ - 280 + 295 48 @@ -220,7 +220,7 @@ - 280 + 295 48 @@ -233,7 +233,7 @@ - 280 + 295 48 @@ -246,7 +246,7 @@ - 280 + 295 48 diff --git a/infomation/task/DeptTaskForm.cpp b/infomation/task/DeptTaskForm.cpp index ea21a9f..cc6bf31 100644 --- a/infomation/task/DeptTaskForm.cpp +++ b/infomation/task/DeptTaskForm.cpp @@ -18,12 +18,17 @@ delete ui; } -void DeptTaskForm::showEvent(QShowEvent *event) +void DeptTaskForm::showEvent(QShowEvent * event) { ui->tableDeptTask->adjustTableWidth(); getDeptTaskList(0); } +void DeptTaskForm::resizeEvent(QResizeEvent * event) +{ + ui->tableDeptTask->adjustTableWidth(); +} + void DeptTaskForm::initFormTable() { // 初始化查询条件 diff --git a/infomation/task/DeptTaskForm.h b/infomation/task/DeptTaskForm.h index 1055c36..3c1ad5b 100644 --- a/infomation/task/DeptTaskForm.h +++ b/infomation/task/DeptTaskForm.h @@ -21,7 +21,8 @@ ~DeptTaskForm(); protected: - void showEvent(QShowEvent *event) override; + void showEvent(QShowEvent * event) override; + void resizeEvent(QResizeEvent * event) override; private: Ui::DeptTaskForm *ui; diff --git a/main.cpp b/main.cpp index 525387e..0b78c87 100644 --- a/main.cpp +++ b/main.cpp @@ -1,5 +1,3 @@ -#include "MainWindow.h" - #include #include diff --git a/res/image/Index/u1176.svg b/res/image/Index/u1176.svg deleted file mode 100644 index c81ce8a..0000000 --- a/res/image/Index/u1176.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1180.svg b/res/image/Index/u1180.svg deleted file mode 100644 index 2ef24ab..0000000 --- a/res/image/Index/u1180.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1220.svg b/res/image/Index/u1220.svg deleted file mode 100644 index 43452aa..0000000 --- a/res/image/Index/u1220.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2158.svg b/res/image/Index/u2158.svg deleted file mode 100644 index fd249e0..0000000 --- a/res/image/Index/u2158.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u2188.svg b/res/image/Index/u2188.svg deleted file mode 100644 index 34f53c4..0000000 --- a/res/image/Index/u2188.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2189.svg b/res/image/Index/u2189.svg deleted file mode 100644 index 01a6bbb..0000000 --- a/res/image/Index/u2189.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2324.svg b/res/image/Index/u2324.svg deleted file mode 100644 index 797f1c5..0000000 --- a/res/image/Index/u2324.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2325.svg b/res/image/Index/u2325.svg deleted file mode 100644 index fefe01b..0000000 --- a/res/image/Index/u2325.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/AutoCalibrationXC.pro b/AutoCalibrationXC.pro index 6bcb335..7790b37 100644 --- a/AutoCalibrationXC.pro +++ b/AutoCalibrationXC.pro @@ -24,11 +24,6 @@ include(QPagedTable/QPagedTable.pri) SOURCES += main.cpp -SOURCES += MainWindow.cpp - -HEADERS += MainWindow.h - -FORMS += MainWindow.ui RC_ICONS = res/autoCalibration.ico diff --git a/MainWindow.cpp b/MainWindow.cpp deleted file mode 100644 index ff126e8..0000000 --- a/MainWindow.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#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/MainWindow.h b/MainWindow.h deleted file mode 100644 index 4643e32..0000000 --- a/MainWindow.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#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; -}; -#endif // MAINWINDOW_H diff --git a/MainWindow.ui b/MainWindow.ui deleted file mode 100644 index b232854..0000000 --- a/MainWindow.ui +++ /dev/null @@ -1,22 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 800 - 600 - - - - MainWindow - - - - - - - - diff --git a/frame/CustomMessageBox.ui b/frame/CustomMessageBox.ui index 336be54..b545d74 100644 --- a/frame/CustomMessageBox.ui +++ b/frame/CustomMessageBox.ui @@ -84,8 +84,8 @@ - - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + + :/image/msgbox/icon_box_close.png:/image/msgbox/icon_box_close.png @@ -134,7 +134,7 @@ - :/image/msgbox/icon_box_success.png + :/image/msgbox/icon_box_success.png Qt::AlignCenter @@ -265,6 +265,8 @@ - + + + diff --git a/frame/MainWindowForm.cpp b/frame/MainWindowForm.cpp index 2ded44b..ec82cd7 100644 --- a/frame/MainWindowForm.cpp +++ b/frame/MainWindowForm.cpp @@ -1,6 +1,8 @@ #include "MainWindowForm.h" #include "ui_MainWindowForm.h" +#include + MainWindowForm::MainWindowForm(QWidget *parent) : FramelessWindow(parent), ui(new Ui::MainWindowForm) @@ -12,7 +14,7 @@ initMenuWidgets(); initFunctionButtons(); - // 每秒更新 界面上没有地方能摆 暂时先不启动定时器 + // 每秒更新 connect(TimeCounterUtil::getInstance().clockTimer, &QTimer::timeout, this, &MainWindowForm::onUpdateTimestampHandler); TimeCounterUtil::getInstance().clockTimer->start(1000); @@ -34,6 +36,7 @@ void MainWindowForm::initForm() { setWindowFlags(Qt::FramelessWindowHint); // 设置全屏 + setWindowState(Qt::WindowState::WindowMaximized); this->setTitleBar(ui->wdgtTop); // 设置窗口位置和大小 move(0, 0); @@ -120,6 +123,22 @@ setWindowState(Qt::WindowMinimized | windowState()); } +void MainWindowForm::on_btnMaxWin_clicked() +{ + QScreen *screen = QGuiApplication::primaryScreen(); + QRect screenSize = screen->availableGeometry(); // 可用区域(排除任务栏) + + if (this->isMaximized()) { + resize(screenSize.width() * 0.8, screenSize.height() * 0.8); + move(QRandomGenerator::global()->bounded(10, 100), QRandomGenerator::global()->bounded(10, 50)); + this->showNormal(); + } else { + resize(screenSize.width(), screenSize.height()); + move(0, 0); + this->showMaximized(); + } +} + void MainWindowForm::on_btnCloseWin_clicked() { // 创建一个消息框 @@ -146,18 +165,9 @@ ui->labelTime->setText(now.toString("yyyy-MM-dd HH:mm:ss")); } -void MainWindowForm::on_btnMenuMax_clicked() -{ - if (this->isMaximized()) { - this->showNormal(); - } else { - this->showMaximized(); - } -} - void MainWindowForm::titleDblClick() { - on_btnMenuMax_clicked(); + on_btnMaxWin_clicked(); } void MainWindowForm::onMenuButtonsEabled(bool enable) { diff --git a/frame/MainWindowForm.h b/frame/MainWindowForm.h index 4d206b1..9b4eae4 100644 --- a/frame/MainWindowForm.h +++ b/frame/MainWindowForm.h @@ -45,11 +45,11 @@ private slots: void on_btnMinWin_clicked(); + void on_btnMaxWin_clicked(); void on_btnCloseWin_clicked(); void onFunctionButtonsAction(); void onUpdateTimestampHandler(); - void on_btnMenuMax_clicked(); void titleDblClick(); void onMenuButtonsEabled(bool enable); diff --git a/frame/MainWindowForm.ui b/frame/MainWindowForm.ui index bd42122..f37d171 100644 --- a/frame/MainWindowForm.ui +++ b/frame/MainWindowForm.ui @@ -41,7 +41,7 @@ 0 - 120 + 100 @@ -58,7 +58,7 @@ 20 - 0 + 20 @@ -88,8 +88,8 @@ - 120 - 120 + 150 + 100 @@ -107,6 +107,22 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + @@ -158,7 +174,7 @@ 100 - 84 + 72 @@ -166,7 +182,8 @@ - :/image/main/calibration.png:/image/main/calibration.png + :/image/main/icon_menu_calibration.png + :/image/main/icon_menu_calibration_selected.png:/image/main/icon_menu_calibration.png @@ -184,7 +201,7 @@ 100 - 84 + 72 @@ -192,7 +209,8 @@ - :/image/main/rawDataRecord.png:/image/main/rawDataRecord.png + :/image/main/icon_menu_check.png + :/image/main/icon_menu_check_selected.png:/image/main/icon_menu_check.png @@ -210,7 +228,7 @@ 100 - 84 + 72 @@ -218,7 +236,8 @@ - :/image/main/fileRes.png:/image/main/fileRes.png + :/image/main/icon_menu_infomation.png + :/image/main/icon_menu_infomation_checked.png:/image/main/icon_menu_infomation.png @@ -235,10 +254,147 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 50 + 20 + + + + + - 320 + 240 + 16777215 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 5 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + :/image/main/iconTemp.png + + + + + + + 34.5℃ + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + + + + :/image/main/iconHumi.png + + + + + + + 25%Rh + + + + + + + + + + + + + + 240 16777215 @@ -308,7 +464,7 @@ - :/image/main/icon_setting_p.png:/image/main/icon_setting_p.png + :/image/main/icon_setting.png:/image/main/icon_setting.png @@ -334,7 +490,33 @@ - :/image/main/icon_min_p.png:/image/main/icon_min_p.png + :/image/main/icon_min.png:/image/main/icon_min.png + + + + 32 + 32 + + + + + + + + + 40 + 40 + + + + 最小化 + + + + + + + :/image/main/icon_max.png:/image/main/icon_max.png @@ -360,7 +542,7 @@ - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + :/image/main/icon_close.png:/image/main/icon_close.png @@ -426,87 +608,9 @@ - - - - - 0 - 30 - - - - - 20 - - - 0 - - - 0 - - - 40 - - - 0 - - - - - Qt::Horizontal - - - - 1289 - 20 - - - - - - - - - - - - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 20 - - - - - - - - - - - - - - wdgtContent wdgtTop - wdgtFoot diff --git a/infomation/InfoMainForm.cpp b/infomation/InfoMainForm.cpp index c001199..5d0ffc8 100644 --- a/infomation/InfoMainForm.cpp +++ b/infomation/InfoMainForm.cpp @@ -21,9 +21,13 @@ void InfoMainForm::initForm() { + // 加载样式表 + QString qssStyle = QssFileUtils::loadQssFileContent(QApplication::applicationDirPath() + "/qss/infoMain.css"); + if (qssStyle.isEmpty() == false) { + this->setStyleSheet(qssStyle); // 仅本窗口生效 + } - - + ui->scrollArea->setWindowFlags(Qt::FramelessWindowHint); // 设置无边框 } void InfoMainForm::initSubMenuForms() { diff --git a/infomation/InfoMainForm.ui b/infomation/InfoMainForm.ui index 958a6b2..d9066dd 100644 --- a/infomation/InfoMainForm.ui +++ b/infomation/InfoMainForm.ui @@ -90,7 +90,7 @@ - 280 + 295 48 @@ -103,7 +103,7 @@ - 280 + 295 48 @@ -116,7 +116,7 @@ - 280 + 295 48 @@ -129,7 +129,7 @@ - 280 + 295 48 @@ -142,7 +142,7 @@ - 280 + 295 48 @@ -155,7 +155,7 @@ - 280 + 295 48 @@ -168,7 +168,7 @@ - 280 + 295 48 @@ -181,7 +181,7 @@ - 280 + 295 48 @@ -194,7 +194,7 @@ - 280 + 295 48 @@ -207,7 +207,7 @@ - 280 + 295 48 @@ -220,7 +220,7 @@ - 280 + 295 48 @@ -233,7 +233,7 @@ - 280 + 295 48 @@ -246,7 +246,7 @@ - 280 + 295 48 diff --git a/infomation/task/DeptTaskForm.cpp b/infomation/task/DeptTaskForm.cpp index ea21a9f..cc6bf31 100644 --- a/infomation/task/DeptTaskForm.cpp +++ b/infomation/task/DeptTaskForm.cpp @@ -18,12 +18,17 @@ delete ui; } -void DeptTaskForm::showEvent(QShowEvent *event) +void DeptTaskForm::showEvent(QShowEvent * event) { ui->tableDeptTask->adjustTableWidth(); getDeptTaskList(0); } +void DeptTaskForm::resizeEvent(QResizeEvent * event) +{ + ui->tableDeptTask->adjustTableWidth(); +} + void DeptTaskForm::initFormTable() { // 初始化查询条件 diff --git a/infomation/task/DeptTaskForm.h b/infomation/task/DeptTaskForm.h index 1055c36..3c1ad5b 100644 --- a/infomation/task/DeptTaskForm.h +++ b/infomation/task/DeptTaskForm.h @@ -21,7 +21,8 @@ ~DeptTaskForm(); protected: - void showEvent(QShowEvent *event) override; + void showEvent(QShowEvent * event) override; + void resizeEvent(QResizeEvent * event) override; private: Ui::DeptTaskForm *ui; diff --git a/main.cpp b/main.cpp index 525387e..0b78c87 100644 --- a/main.cpp +++ b/main.cpp @@ -1,5 +1,3 @@ -#include "MainWindow.h" - #include #include diff --git a/res/image/Index/u1176.svg b/res/image/Index/u1176.svg deleted file mode 100644 index c81ce8a..0000000 --- a/res/image/Index/u1176.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1180.svg b/res/image/Index/u1180.svg deleted file mode 100644 index 2ef24ab..0000000 --- a/res/image/Index/u1180.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1220.svg b/res/image/Index/u1220.svg deleted file mode 100644 index 43452aa..0000000 --- a/res/image/Index/u1220.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2158.svg b/res/image/Index/u2158.svg deleted file mode 100644 index fd249e0..0000000 --- a/res/image/Index/u2158.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u2188.svg b/res/image/Index/u2188.svg deleted file mode 100644 index 34f53c4..0000000 --- a/res/image/Index/u2188.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2189.svg b/res/image/Index/u2189.svg deleted file mode 100644 index 01a6bbb..0000000 --- a/res/image/Index/u2189.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2324.svg b/res/image/Index/u2324.svg deleted file mode 100644 index 797f1c5..0000000 --- a/res/image/Index/u2324.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2325.svg b/res/image/Index/u2325.svg deleted file mode 100644 index fefe01b..0000000 --- a/res/image/Index/u2325.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u642.svg b/res/image/Index/u642.svg deleted file mode 100644 index 33c9e0a..0000000 --- a/res/image/Index/u642.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/AutoCalibrationXC.pro b/AutoCalibrationXC.pro index 6bcb335..7790b37 100644 --- a/AutoCalibrationXC.pro +++ b/AutoCalibrationXC.pro @@ -24,11 +24,6 @@ include(QPagedTable/QPagedTable.pri) SOURCES += main.cpp -SOURCES += MainWindow.cpp - -HEADERS += MainWindow.h - -FORMS += MainWindow.ui RC_ICONS = res/autoCalibration.ico diff --git a/MainWindow.cpp b/MainWindow.cpp deleted file mode 100644 index ff126e8..0000000 --- a/MainWindow.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#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/MainWindow.h b/MainWindow.h deleted file mode 100644 index 4643e32..0000000 --- a/MainWindow.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#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; -}; -#endif // MAINWINDOW_H diff --git a/MainWindow.ui b/MainWindow.ui deleted file mode 100644 index b232854..0000000 --- a/MainWindow.ui +++ /dev/null @@ -1,22 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 800 - 600 - - - - MainWindow - - - - - - - - diff --git a/frame/CustomMessageBox.ui b/frame/CustomMessageBox.ui index 336be54..b545d74 100644 --- a/frame/CustomMessageBox.ui +++ b/frame/CustomMessageBox.ui @@ -84,8 +84,8 @@ - - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + + :/image/msgbox/icon_box_close.png:/image/msgbox/icon_box_close.png @@ -134,7 +134,7 @@ - :/image/msgbox/icon_box_success.png + :/image/msgbox/icon_box_success.png Qt::AlignCenter @@ -265,6 +265,8 @@ - + + + diff --git a/frame/MainWindowForm.cpp b/frame/MainWindowForm.cpp index 2ded44b..ec82cd7 100644 --- a/frame/MainWindowForm.cpp +++ b/frame/MainWindowForm.cpp @@ -1,6 +1,8 @@ #include "MainWindowForm.h" #include "ui_MainWindowForm.h" +#include + MainWindowForm::MainWindowForm(QWidget *parent) : FramelessWindow(parent), ui(new Ui::MainWindowForm) @@ -12,7 +14,7 @@ initMenuWidgets(); initFunctionButtons(); - // 每秒更新 界面上没有地方能摆 暂时先不启动定时器 + // 每秒更新 connect(TimeCounterUtil::getInstance().clockTimer, &QTimer::timeout, this, &MainWindowForm::onUpdateTimestampHandler); TimeCounterUtil::getInstance().clockTimer->start(1000); @@ -34,6 +36,7 @@ void MainWindowForm::initForm() { setWindowFlags(Qt::FramelessWindowHint); // 设置全屏 + setWindowState(Qt::WindowState::WindowMaximized); this->setTitleBar(ui->wdgtTop); // 设置窗口位置和大小 move(0, 0); @@ -120,6 +123,22 @@ setWindowState(Qt::WindowMinimized | windowState()); } +void MainWindowForm::on_btnMaxWin_clicked() +{ + QScreen *screen = QGuiApplication::primaryScreen(); + QRect screenSize = screen->availableGeometry(); // 可用区域(排除任务栏) + + if (this->isMaximized()) { + resize(screenSize.width() * 0.8, screenSize.height() * 0.8); + move(QRandomGenerator::global()->bounded(10, 100), QRandomGenerator::global()->bounded(10, 50)); + this->showNormal(); + } else { + resize(screenSize.width(), screenSize.height()); + move(0, 0); + this->showMaximized(); + } +} + void MainWindowForm::on_btnCloseWin_clicked() { // 创建一个消息框 @@ -146,18 +165,9 @@ ui->labelTime->setText(now.toString("yyyy-MM-dd HH:mm:ss")); } -void MainWindowForm::on_btnMenuMax_clicked() -{ - if (this->isMaximized()) { - this->showNormal(); - } else { - this->showMaximized(); - } -} - void MainWindowForm::titleDblClick() { - on_btnMenuMax_clicked(); + on_btnMaxWin_clicked(); } void MainWindowForm::onMenuButtonsEabled(bool enable) { diff --git a/frame/MainWindowForm.h b/frame/MainWindowForm.h index 4d206b1..9b4eae4 100644 --- a/frame/MainWindowForm.h +++ b/frame/MainWindowForm.h @@ -45,11 +45,11 @@ private slots: void on_btnMinWin_clicked(); + void on_btnMaxWin_clicked(); void on_btnCloseWin_clicked(); void onFunctionButtonsAction(); void onUpdateTimestampHandler(); - void on_btnMenuMax_clicked(); void titleDblClick(); void onMenuButtonsEabled(bool enable); diff --git a/frame/MainWindowForm.ui b/frame/MainWindowForm.ui index bd42122..f37d171 100644 --- a/frame/MainWindowForm.ui +++ b/frame/MainWindowForm.ui @@ -41,7 +41,7 @@ 0 - 120 + 100 @@ -58,7 +58,7 @@ 20 - 0 + 20 @@ -88,8 +88,8 @@ - 120 - 120 + 150 + 100 @@ -107,6 +107,22 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + @@ -158,7 +174,7 @@ 100 - 84 + 72 @@ -166,7 +182,8 @@ - :/image/main/calibration.png:/image/main/calibration.png + :/image/main/icon_menu_calibration.png + :/image/main/icon_menu_calibration_selected.png:/image/main/icon_menu_calibration.png @@ -184,7 +201,7 @@ 100 - 84 + 72 @@ -192,7 +209,8 @@ - :/image/main/rawDataRecord.png:/image/main/rawDataRecord.png + :/image/main/icon_menu_check.png + :/image/main/icon_menu_check_selected.png:/image/main/icon_menu_check.png @@ -210,7 +228,7 @@ 100 - 84 + 72 @@ -218,7 +236,8 @@ - :/image/main/fileRes.png:/image/main/fileRes.png + :/image/main/icon_menu_infomation.png + :/image/main/icon_menu_infomation_checked.png:/image/main/icon_menu_infomation.png @@ -235,10 +254,147 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 50 + 20 + + + + + - 320 + 240 + 16777215 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 5 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + :/image/main/iconTemp.png + + + + + + + 34.5℃ + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + + + + :/image/main/iconHumi.png + + + + + + + 25%Rh + + + + + + + + + + + + + + 240 16777215 @@ -308,7 +464,7 @@ - :/image/main/icon_setting_p.png:/image/main/icon_setting_p.png + :/image/main/icon_setting.png:/image/main/icon_setting.png @@ -334,7 +490,33 @@ - :/image/main/icon_min_p.png:/image/main/icon_min_p.png + :/image/main/icon_min.png:/image/main/icon_min.png + + + + 32 + 32 + + + + + + + + + 40 + 40 + + + + 最小化 + + + + + + + :/image/main/icon_max.png:/image/main/icon_max.png @@ -360,7 +542,7 @@ - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + :/image/main/icon_close.png:/image/main/icon_close.png @@ -426,87 +608,9 @@ - - - - - 0 - 30 - - - - - 20 - - - 0 - - - 0 - - - 40 - - - 0 - - - - - Qt::Horizontal - - - - 1289 - 20 - - - - - - - - - - - - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 20 - - - - - - - - - - - - - - wdgtContent wdgtTop - wdgtFoot diff --git a/infomation/InfoMainForm.cpp b/infomation/InfoMainForm.cpp index c001199..5d0ffc8 100644 --- a/infomation/InfoMainForm.cpp +++ b/infomation/InfoMainForm.cpp @@ -21,9 +21,13 @@ void InfoMainForm::initForm() { + // 加载样式表 + QString qssStyle = QssFileUtils::loadQssFileContent(QApplication::applicationDirPath() + "/qss/infoMain.css"); + if (qssStyle.isEmpty() == false) { + this->setStyleSheet(qssStyle); // 仅本窗口生效 + } - - + ui->scrollArea->setWindowFlags(Qt::FramelessWindowHint); // 设置无边框 } void InfoMainForm::initSubMenuForms() { diff --git a/infomation/InfoMainForm.ui b/infomation/InfoMainForm.ui index 958a6b2..d9066dd 100644 --- a/infomation/InfoMainForm.ui +++ b/infomation/InfoMainForm.ui @@ -90,7 +90,7 @@ - 280 + 295 48 @@ -103,7 +103,7 @@ - 280 + 295 48 @@ -116,7 +116,7 @@ - 280 + 295 48 @@ -129,7 +129,7 @@ - 280 + 295 48 @@ -142,7 +142,7 @@ - 280 + 295 48 @@ -155,7 +155,7 @@ - 280 + 295 48 @@ -168,7 +168,7 @@ - 280 + 295 48 @@ -181,7 +181,7 @@ - 280 + 295 48 @@ -194,7 +194,7 @@ - 280 + 295 48 @@ -207,7 +207,7 @@ - 280 + 295 48 @@ -220,7 +220,7 @@ - 280 + 295 48 @@ -233,7 +233,7 @@ - 280 + 295 48 @@ -246,7 +246,7 @@ - 280 + 295 48 diff --git a/infomation/task/DeptTaskForm.cpp b/infomation/task/DeptTaskForm.cpp index ea21a9f..cc6bf31 100644 --- a/infomation/task/DeptTaskForm.cpp +++ b/infomation/task/DeptTaskForm.cpp @@ -18,12 +18,17 @@ delete ui; } -void DeptTaskForm::showEvent(QShowEvent *event) +void DeptTaskForm::showEvent(QShowEvent * event) { ui->tableDeptTask->adjustTableWidth(); getDeptTaskList(0); } +void DeptTaskForm::resizeEvent(QResizeEvent * event) +{ + ui->tableDeptTask->adjustTableWidth(); +} + void DeptTaskForm::initFormTable() { // 初始化查询条件 diff --git a/infomation/task/DeptTaskForm.h b/infomation/task/DeptTaskForm.h index 1055c36..3c1ad5b 100644 --- a/infomation/task/DeptTaskForm.h +++ b/infomation/task/DeptTaskForm.h @@ -21,7 +21,8 @@ ~DeptTaskForm(); protected: - void showEvent(QShowEvent *event) override; + void showEvent(QShowEvent * event) override; + void resizeEvent(QResizeEvent * event) override; private: Ui::DeptTaskForm *ui; diff --git a/main.cpp b/main.cpp index 525387e..0b78c87 100644 --- a/main.cpp +++ b/main.cpp @@ -1,5 +1,3 @@ -#include "MainWindow.h" - #include #include diff --git a/res/image/Index/u1176.svg b/res/image/Index/u1176.svg deleted file mode 100644 index c81ce8a..0000000 --- a/res/image/Index/u1176.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1180.svg b/res/image/Index/u1180.svg deleted file mode 100644 index 2ef24ab..0000000 --- a/res/image/Index/u1180.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1220.svg b/res/image/Index/u1220.svg deleted file mode 100644 index 43452aa..0000000 --- a/res/image/Index/u1220.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2158.svg b/res/image/Index/u2158.svg deleted file mode 100644 index fd249e0..0000000 --- a/res/image/Index/u2158.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u2188.svg b/res/image/Index/u2188.svg deleted file mode 100644 index 34f53c4..0000000 --- a/res/image/Index/u2188.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2189.svg b/res/image/Index/u2189.svg deleted file mode 100644 index 01a6bbb..0000000 --- a/res/image/Index/u2189.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2324.svg b/res/image/Index/u2324.svg deleted file mode 100644 index 797f1c5..0000000 --- a/res/image/Index/u2324.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2325.svg b/res/image/Index/u2325.svg deleted file mode 100644 index fefe01b..0000000 --- a/res/image/Index/u2325.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u642.svg b/res/image/Index/u642.svg deleted file mode 100644 index 33c9e0a..0000000 --- a/res/image/Index/u642.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u7406.svg b/res/image/Index/u7406.svg deleted file mode 100644 index 8a7a6d9..0000000 --- a/res/image/Index/u7406.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/AutoCalibrationXC.pro b/AutoCalibrationXC.pro index 6bcb335..7790b37 100644 --- a/AutoCalibrationXC.pro +++ b/AutoCalibrationXC.pro @@ -24,11 +24,6 @@ include(QPagedTable/QPagedTable.pri) SOURCES += main.cpp -SOURCES += MainWindow.cpp - -HEADERS += MainWindow.h - -FORMS += MainWindow.ui RC_ICONS = res/autoCalibration.ico diff --git a/MainWindow.cpp b/MainWindow.cpp deleted file mode 100644 index ff126e8..0000000 --- a/MainWindow.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#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/MainWindow.h b/MainWindow.h deleted file mode 100644 index 4643e32..0000000 --- a/MainWindow.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#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; -}; -#endif // MAINWINDOW_H diff --git a/MainWindow.ui b/MainWindow.ui deleted file mode 100644 index b232854..0000000 --- a/MainWindow.ui +++ /dev/null @@ -1,22 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 800 - 600 - - - - MainWindow - - - - - - - - diff --git a/frame/CustomMessageBox.ui b/frame/CustomMessageBox.ui index 336be54..b545d74 100644 --- a/frame/CustomMessageBox.ui +++ b/frame/CustomMessageBox.ui @@ -84,8 +84,8 @@ - - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + + :/image/msgbox/icon_box_close.png:/image/msgbox/icon_box_close.png @@ -134,7 +134,7 @@ - :/image/msgbox/icon_box_success.png + :/image/msgbox/icon_box_success.png Qt::AlignCenter @@ -265,6 +265,8 @@ - + + + diff --git a/frame/MainWindowForm.cpp b/frame/MainWindowForm.cpp index 2ded44b..ec82cd7 100644 --- a/frame/MainWindowForm.cpp +++ b/frame/MainWindowForm.cpp @@ -1,6 +1,8 @@ #include "MainWindowForm.h" #include "ui_MainWindowForm.h" +#include + MainWindowForm::MainWindowForm(QWidget *parent) : FramelessWindow(parent), ui(new Ui::MainWindowForm) @@ -12,7 +14,7 @@ initMenuWidgets(); initFunctionButtons(); - // 每秒更新 界面上没有地方能摆 暂时先不启动定时器 + // 每秒更新 connect(TimeCounterUtil::getInstance().clockTimer, &QTimer::timeout, this, &MainWindowForm::onUpdateTimestampHandler); TimeCounterUtil::getInstance().clockTimer->start(1000); @@ -34,6 +36,7 @@ void MainWindowForm::initForm() { setWindowFlags(Qt::FramelessWindowHint); // 设置全屏 + setWindowState(Qt::WindowState::WindowMaximized); this->setTitleBar(ui->wdgtTop); // 设置窗口位置和大小 move(0, 0); @@ -120,6 +123,22 @@ setWindowState(Qt::WindowMinimized | windowState()); } +void MainWindowForm::on_btnMaxWin_clicked() +{ + QScreen *screen = QGuiApplication::primaryScreen(); + QRect screenSize = screen->availableGeometry(); // 可用区域(排除任务栏) + + if (this->isMaximized()) { + resize(screenSize.width() * 0.8, screenSize.height() * 0.8); + move(QRandomGenerator::global()->bounded(10, 100), QRandomGenerator::global()->bounded(10, 50)); + this->showNormal(); + } else { + resize(screenSize.width(), screenSize.height()); + move(0, 0); + this->showMaximized(); + } +} + void MainWindowForm::on_btnCloseWin_clicked() { // 创建一个消息框 @@ -146,18 +165,9 @@ ui->labelTime->setText(now.toString("yyyy-MM-dd HH:mm:ss")); } -void MainWindowForm::on_btnMenuMax_clicked() -{ - if (this->isMaximized()) { - this->showNormal(); - } else { - this->showMaximized(); - } -} - void MainWindowForm::titleDblClick() { - on_btnMenuMax_clicked(); + on_btnMaxWin_clicked(); } void MainWindowForm::onMenuButtonsEabled(bool enable) { diff --git a/frame/MainWindowForm.h b/frame/MainWindowForm.h index 4d206b1..9b4eae4 100644 --- a/frame/MainWindowForm.h +++ b/frame/MainWindowForm.h @@ -45,11 +45,11 @@ private slots: void on_btnMinWin_clicked(); + void on_btnMaxWin_clicked(); void on_btnCloseWin_clicked(); void onFunctionButtonsAction(); void onUpdateTimestampHandler(); - void on_btnMenuMax_clicked(); void titleDblClick(); void onMenuButtonsEabled(bool enable); diff --git a/frame/MainWindowForm.ui b/frame/MainWindowForm.ui index bd42122..f37d171 100644 --- a/frame/MainWindowForm.ui +++ b/frame/MainWindowForm.ui @@ -41,7 +41,7 @@ 0 - 120 + 100 @@ -58,7 +58,7 @@ 20 - 0 + 20 @@ -88,8 +88,8 @@ - 120 - 120 + 150 + 100 @@ -107,6 +107,22 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + @@ -158,7 +174,7 @@ 100 - 84 + 72 @@ -166,7 +182,8 @@ - :/image/main/calibration.png:/image/main/calibration.png + :/image/main/icon_menu_calibration.png + :/image/main/icon_menu_calibration_selected.png:/image/main/icon_menu_calibration.png @@ -184,7 +201,7 @@ 100 - 84 + 72 @@ -192,7 +209,8 @@ - :/image/main/rawDataRecord.png:/image/main/rawDataRecord.png + :/image/main/icon_menu_check.png + :/image/main/icon_menu_check_selected.png:/image/main/icon_menu_check.png @@ -210,7 +228,7 @@ 100 - 84 + 72 @@ -218,7 +236,8 @@ - :/image/main/fileRes.png:/image/main/fileRes.png + :/image/main/icon_menu_infomation.png + :/image/main/icon_menu_infomation_checked.png:/image/main/icon_menu_infomation.png @@ -235,10 +254,147 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 50 + 20 + + + + + - 320 + 240 + 16777215 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 5 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + :/image/main/iconTemp.png + + + + + + + 34.5℃ + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + + + + :/image/main/iconHumi.png + + + + + + + 25%Rh + + + + + + + + + + + + + + 240 16777215 @@ -308,7 +464,7 @@ - :/image/main/icon_setting_p.png:/image/main/icon_setting_p.png + :/image/main/icon_setting.png:/image/main/icon_setting.png @@ -334,7 +490,33 @@ - :/image/main/icon_min_p.png:/image/main/icon_min_p.png + :/image/main/icon_min.png:/image/main/icon_min.png + + + + 32 + 32 + + + + + + + + + 40 + 40 + + + + 最小化 + + + + + + + :/image/main/icon_max.png:/image/main/icon_max.png @@ -360,7 +542,7 @@ - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + :/image/main/icon_close.png:/image/main/icon_close.png @@ -426,87 +608,9 @@ - - - - - 0 - 30 - - - - - 20 - - - 0 - - - 0 - - - 40 - - - 0 - - - - - Qt::Horizontal - - - - 1289 - 20 - - - - - - - - - - - - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 20 - - - - - - - - - - - - - - wdgtContent wdgtTop - wdgtFoot diff --git a/infomation/InfoMainForm.cpp b/infomation/InfoMainForm.cpp index c001199..5d0ffc8 100644 --- a/infomation/InfoMainForm.cpp +++ b/infomation/InfoMainForm.cpp @@ -21,9 +21,13 @@ void InfoMainForm::initForm() { + // 加载样式表 + QString qssStyle = QssFileUtils::loadQssFileContent(QApplication::applicationDirPath() + "/qss/infoMain.css"); + if (qssStyle.isEmpty() == false) { + this->setStyleSheet(qssStyle); // 仅本窗口生效 + } - - + ui->scrollArea->setWindowFlags(Qt::FramelessWindowHint); // 设置无边框 } void InfoMainForm::initSubMenuForms() { diff --git a/infomation/InfoMainForm.ui b/infomation/InfoMainForm.ui index 958a6b2..d9066dd 100644 --- a/infomation/InfoMainForm.ui +++ b/infomation/InfoMainForm.ui @@ -90,7 +90,7 @@ - 280 + 295 48 @@ -103,7 +103,7 @@ - 280 + 295 48 @@ -116,7 +116,7 @@ - 280 + 295 48 @@ -129,7 +129,7 @@ - 280 + 295 48 @@ -142,7 +142,7 @@ - 280 + 295 48 @@ -155,7 +155,7 @@ - 280 + 295 48 @@ -168,7 +168,7 @@ - 280 + 295 48 @@ -181,7 +181,7 @@ - 280 + 295 48 @@ -194,7 +194,7 @@ - 280 + 295 48 @@ -207,7 +207,7 @@ - 280 + 295 48 @@ -220,7 +220,7 @@ - 280 + 295 48 @@ -233,7 +233,7 @@ - 280 + 295 48 @@ -246,7 +246,7 @@ - 280 + 295 48 diff --git a/infomation/task/DeptTaskForm.cpp b/infomation/task/DeptTaskForm.cpp index ea21a9f..cc6bf31 100644 --- a/infomation/task/DeptTaskForm.cpp +++ b/infomation/task/DeptTaskForm.cpp @@ -18,12 +18,17 @@ delete ui; } -void DeptTaskForm::showEvent(QShowEvent *event) +void DeptTaskForm::showEvent(QShowEvent * event) { ui->tableDeptTask->adjustTableWidth(); getDeptTaskList(0); } +void DeptTaskForm::resizeEvent(QResizeEvent * event) +{ + ui->tableDeptTask->adjustTableWidth(); +} + void DeptTaskForm::initFormTable() { // 初始化查询条件 diff --git a/infomation/task/DeptTaskForm.h b/infomation/task/DeptTaskForm.h index 1055c36..3c1ad5b 100644 --- a/infomation/task/DeptTaskForm.h +++ b/infomation/task/DeptTaskForm.h @@ -21,7 +21,8 @@ ~DeptTaskForm(); protected: - void showEvent(QShowEvent *event) override; + void showEvent(QShowEvent * event) override; + void resizeEvent(QResizeEvent * event) override; private: Ui::DeptTaskForm *ui; diff --git a/main.cpp b/main.cpp index 525387e..0b78c87 100644 --- a/main.cpp +++ b/main.cpp @@ -1,5 +1,3 @@ -#include "MainWindow.h" - #include #include diff --git a/res/image/Index/u1176.svg b/res/image/Index/u1176.svg deleted file mode 100644 index c81ce8a..0000000 --- a/res/image/Index/u1176.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1180.svg b/res/image/Index/u1180.svg deleted file mode 100644 index 2ef24ab..0000000 --- a/res/image/Index/u1180.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1220.svg b/res/image/Index/u1220.svg deleted file mode 100644 index 43452aa..0000000 --- a/res/image/Index/u1220.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2158.svg b/res/image/Index/u2158.svg deleted file mode 100644 index fd249e0..0000000 --- a/res/image/Index/u2158.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u2188.svg b/res/image/Index/u2188.svg deleted file mode 100644 index 34f53c4..0000000 --- a/res/image/Index/u2188.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2189.svg b/res/image/Index/u2189.svg deleted file mode 100644 index 01a6bbb..0000000 --- a/res/image/Index/u2189.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2324.svg b/res/image/Index/u2324.svg deleted file mode 100644 index 797f1c5..0000000 --- a/res/image/Index/u2324.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2325.svg b/res/image/Index/u2325.svg deleted file mode 100644 index fefe01b..0000000 --- a/res/image/Index/u2325.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u642.svg b/res/image/Index/u642.svg deleted file mode 100644 index 33c9e0a..0000000 --- a/res/image/Index/u642.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u7406.svg b/res/image/Index/u7406.svg deleted file mode 100644 index 8a7a6d9..0000000 --- a/res/image/Index/u7406.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7453.svg b/res/image/Index/u7453.svg deleted file mode 100644 index 603c496..0000000 --- a/res/image/Index/u7453.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/AutoCalibrationXC.pro b/AutoCalibrationXC.pro index 6bcb335..7790b37 100644 --- a/AutoCalibrationXC.pro +++ b/AutoCalibrationXC.pro @@ -24,11 +24,6 @@ include(QPagedTable/QPagedTable.pri) SOURCES += main.cpp -SOURCES += MainWindow.cpp - -HEADERS += MainWindow.h - -FORMS += MainWindow.ui RC_ICONS = res/autoCalibration.ico diff --git a/MainWindow.cpp b/MainWindow.cpp deleted file mode 100644 index ff126e8..0000000 --- a/MainWindow.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#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/MainWindow.h b/MainWindow.h deleted file mode 100644 index 4643e32..0000000 --- a/MainWindow.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#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; -}; -#endif // MAINWINDOW_H diff --git a/MainWindow.ui b/MainWindow.ui deleted file mode 100644 index b232854..0000000 --- a/MainWindow.ui +++ /dev/null @@ -1,22 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 800 - 600 - - - - MainWindow - - - - - - - - diff --git a/frame/CustomMessageBox.ui b/frame/CustomMessageBox.ui index 336be54..b545d74 100644 --- a/frame/CustomMessageBox.ui +++ b/frame/CustomMessageBox.ui @@ -84,8 +84,8 @@ - - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + + :/image/msgbox/icon_box_close.png:/image/msgbox/icon_box_close.png @@ -134,7 +134,7 @@ - :/image/msgbox/icon_box_success.png + :/image/msgbox/icon_box_success.png Qt::AlignCenter @@ -265,6 +265,8 @@ - + + + diff --git a/frame/MainWindowForm.cpp b/frame/MainWindowForm.cpp index 2ded44b..ec82cd7 100644 --- a/frame/MainWindowForm.cpp +++ b/frame/MainWindowForm.cpp @@ -1,6 +1,8 @@ #include "MainWindowForm.h" #include "ui_MainWindowForm.h" +#include + MainWindowForm::MainWindowForm(QWidget *parent) : FramelessWindow(parent), ui(new Ui::MainWindowForm) @@ -12,7 +14,7 @@ initMenuWidgets(); initFunctionButtons(); - // 每秒更新 界面上没有地方能摆 暂时先不启动定时器 + // 每秒更新 connect(TimeCounterUtil::getInstance().clockTimer, &QTimer::timeout, this, &MainWindowForm::onUpdateTimestampHandler); TimeCounterUtil::getInstance().clockTimer->start(1000); @@ -34,6 +36,7 @@ void MainWindowForm::initForm() { setWindowFlags(Qt::FramelessWindowHint); // 设置全屏 + setWindowState(Qt::WindowState::WindowMaximized); this->setTitleBar(ui->wdgtTop); // 设置窗口位置和大小 move(0, 0); @@ -120,6 +123,22 @@ setWindowState(Qt::WindowMinimized | windowState()); } +void MainWindowForm::on_btnMaxWin_clicked() +{ + QScreen *screen = QGuiApplication::primaryScreen(); + QRect screenSize = screen->availableGeometry(); // 可用区域(排除任务栏) + + if (this->isMaximized()) { + resize(screenSize.width() * 0.8, screenSize.height() * 0.8); + move(QRandomGenerator::global()->bounded(10, 100), QRandomGenerator::global()->bounded(10, 50)); + this->showNormal(); + } else { + resize(screenSize.width(), screenSize.height()); + move(0, 0); + this->showMaximized(); + } +} + void MainWindowForm::on_btnCloseWin_clicked() { // 创建一个消息框 @@ -146,18 +165,9 @@ ui->labelTime->setText(now.toString("yyyy-MM-dd HH:mm:ss")); } -void MainWindowForm::on_btnMenuMax_clicked() -{ - if (this->isMaximized()) { - this->showNormal(); - } else { - this->showMaximized(); - } -} - void MainWindowForm::titleDblClick() { - on_btnMenuMax_clicked(); + on_btnMaxWin_clicked(); } void MainWindowForm::onMenuButtonsEabled(bool enable) { diff --git a/frame/MainWindowForm.h b/frame/MainWindowForm.h index 4d206b1..9b4eae4 100644 --- a/frame/MainWindowForm.h +++ b/frame/MainWindowForm.h @@ -45,11 +45,11 @@ private slots: void on_btnMinWin_clicked(); + void on_btnMaxWin_clicked(); void on_btnCloseWin_clicked(); void onFunctionButtonsAction(); void onUpdateTimestampHandler(); - void on_btnMenuMax_clicked(); void titleDblClick(); void onMenuButtonsEabled(bool enable); diff --git a/frame/MainWindowForm.ui b/frame/MainWindowForm.ui index bd42122..f37d171 100644 --- a/frame/MainWindowForm.ui +++ b/frame/MainWindowForm.ui @@ -41,7 +41,7 @@ 0 - 120 + 100 @@ -58,7 +58,7 @@ 20 - 0 + 20 @@ -88,8 +88,8 @@ - 120 - 120 + 150 + 100 @@ -107,6 +107,22 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + @@ -158,7 +174,7 @@ 100 - 84 + 72 @@ -166,7 +182,8 @@ - :/image/main/calibration.png:/image/main/calibration.png + :/image/main/icon_menu_calibration.png + :/image/main/icon_menu_calibration_selected.png:/image/main/icon_menu_calibration.png @@ -184,7 +201,7 @@ 100 - 84 + 72 @@ -192,7 +209,8 @@ - :/image/main/rawDataRecord.png:/image/main/rawDataRecord.png + :/image/main/icon_menu_check.png + :/image/main/icon_menu_check_selected.png:/image/main/icon_menu_check.png @@ -210,7 +228,7 @@ 100 - 84 + 72 @@ -218,7 +236,8 @@ - :/image/main/fileRes.png:/image/main/fileRes.png + :/image/main/icon_menu_infomation.png + :/image/main/icon_menu_infomation_checked.png:/image/main/icon_menu_infomation.png @@ -235,10 +254,147 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 50 + 20 + + + + + - 320 + 240 + 16777215 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 5 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + :/image/main/iconTemp.png + + + + + + + 34.5℃ + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + + + + :/image/main/iconHumi.png + + + + + + + 25%Rh + + + + + + + + + + + + + + 240 16777215 @@ -308,7 +464,7 @@ - :/image/main/icon_setting_p.png:/image/main/icon_setting_p.png + :/image/main/icon_setting.png:/image/main/icon_setting.png @@ -334,7 +490,33 @@ - :/image/main/icon_min_p.png:/image/main/icon_min_p.png + :/image/main/icon_min.png:/image/main/icon_min.png + + + + 32 + 32 + + + + + + + + + 40 + 40 + + + + 最小化 + + + + + + + :/image/main/icon_max.png:/image/main/icon_max.png @@ -360,7 +542,7 @@ - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + :/image/main/icon_close.png:/image/main/icon_close.png @@ -426,87 +608,9 @@ - - - - - 0 - 30 - - - - - 20 - - - 0 - - - 0 - - - 40 - - - 0 - - - - - Qt::Horizontal - - - - 1289 - 20 - - - - - - - - - - - - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 20 - - - - - - - - - - - - - - wdgtContent wdgtTop - wdgtFoot diff --git a/infomation/InfoMainForm.cpp b/infomation/InfoMainForm.cpp index c001199..5d0ffc8 100644 --- a/infomation/InfoMainForm.cpp +++ b/infomation/InfoMainForm.cpp @@ -21,9 +21,13 @@ void InfoMainForm::initForm() { + // 加载样式表 + QString qssStyle = QssFileUtils::loadQssFileContent(QApplication::applicationDirPath() + "/qss/infoMain.css"); + if (qssStyle.isEmpty() == false) { + this->setStyleSheet(qssStyle); // 仅本窗口生效 + } - - + ui->scrollArea->setWindowFlags(Qt::FramelessWindowHint); // 设置无边框 } void InfoMainForm::initSubMenuForms() { diff --git a/infomation/InfoMainForm.ui b/infomation/InfoMainForm.ui index 958a6b2..d9066dd 100644 --- a/infomation/InfoMainForm.ui +++ b/infomation/InfoMainForm.ui @@ -90,7 +90,7 @@ - 280 + 295 48 @@ -103,7 +103,7 @@ - 280 + 295 48 @@ -116,7 +116,7 @@ - 280 + 295 48 @@ -129,7 +129,7 @@ - 280 + 295 48 @@ -142,7 +142,7 @@ - 280 + 295 48 @@ -155,7 +155,7 @@ - 280 + 295 48 @@ -168,7 +168,7 @@ - 280 + 295 48 @@ -181,7 +181,7 @@ - 280 + 295 48 @@ -194,7 +194,7 @@ - 280 + 295 48 @@ -207,7 +207,7 @@ - 280 + 295 48 @@ -220,7 +220,7 @@ - 280 + 295 48 @@ -233,7 +233,7 @@ - 280 + 295 48 @@ -246,7 +246,7 @@ - 280 + 295 48 diff --git a/infomation/task/DeptTaskForm.cpp b/infomation/task/DeptTaskForm.cpp index ea21a9f..cc6bf31 100644 --- a/infomation/task/DeptTaskForm.cpp +++ b/infomation/task/DeptTaskForm.cpp @@ -18,12 +18,17 @@ delete ui; } -void DeptTaskForm::showEvent(QShowEvent *event) +void DeptTaskForm::showEvent(QShowEvent * event) { ui->tableDeptTask->adjustTableWidth(); getDeptTaskList(0); } +void DeptTaskForm::resizeEvent(QResizeEvent * event) +{ + ui->tableDeptTask->adjustTableWidth(); +} + void DeptTaskForm::initFormTable() { // 初始化查询条件 diff --git a/infomation/task/DeptTaskForm.h b/infomation/task/DeptTaskForm.h index 1055c36..3c1ad5b 100644 --- a/infomation/task/DeptTaskForm.h +++ b/infomation/task/DeptTaskForm.h @@ -21,7 +21,8 @@ ~DeptTaskForm(); protected: - void showEvent(QShowEvent *event) override; + void showEvent(QShowEvent * event) override; + void resizeEvent(QResizeEvent * event) override; private: Ui::DeptTaskForm *ui; diff --git a/main.cpp b/main.cpp index 525387e..0b78c87 100644 --- a/main.cpp +++ b/main.cpp @@ -1,5 +1,3 @@ -#include "MainWindow.h" - #include #include diff --git a/res/image/Index/u1176.svg b/res/image/Index/u1176.svg deleted file mode 100644 index c81ce8a..0000000 --- a/res/image/Index/u1176.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1180.svg b/res/image/Index/u1180.svg deleted file mode 100644 index 2ef24ab..0000000 --- a/res/image/Index/u1180.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1220.svg b/res/image/Index/u1220.svg deleted file mode 100644 index 43452aa..0000000 --- a/res/image/Index/u1220.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2158.svg b/res/image/Index/u2158.svg deleted file mode 100644 index fd249e0..0000000 --- a/res/image/Index/u2158.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u2188.svg b/res/image/Index/u2188.svg deleted file mode 100644 index 34f53c4..0000000 --- a/res/image/Index/u2188.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2189.svg b/res/image/Index/u2189.svg deleted file mode 100644 index 01a6bbb..0000000 --- a/res/image/Index/u2189.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2324.svg b/res/image/Index/u2324.svg deleted file mode 100644 index 797f1c5..0000000 --- a/res/image/Index/u2324.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2325.svg b/res/image/Index/u2325.svg deleted file mode 100644 index fefe01b..0000000 --- a/res/image/Index/u2325.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u642.svg b/res/image/Index/u642.svg deleted file mode 100644 index 33c9e0a..0000000 --- a/res/image/Index/u642.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u7406.svg b/res/image/Index/u7406.svg deleted file mode 100644 index 8a7a6d9..0000000 --- a/res/image/Index/u7406.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7453.svg b/res/image/Index/u7453.svg deleted file mode 100644 index 603c496..0000000 --- a/res/image/Index/u7453.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7458.svg b/res/image/Index/u7458.svg deleted file mode 100644 index b31087b..0000000 --- a/res/image/Index/u7458.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/AutoCalibrationXC.pro b/AutoCalibrationXC.pro index 6bcb335..7790b37 100644 --- a/AutoCalibrationXC.pro +++ b/AutoCalibrationXC.pro @@ -24,11 +24,6 @@ include(QPagedTable/QPagedTable.pri) SOURCES += main.cpp -SOURCES += MainWindow.cpp - -HEADERS += MainWindow.h - -FORMS += MainWindow.ui RC_ICONS = res/autoCalibration.ico diff --git a/MainWindow.cpp b/MainWindow.cpp deleted file mode 100644 index ff126e8..0000000 --- a/MainWindow.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#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/MainWindow.h b/MainWindow.h deleted file mode 100644 index 4643e32..0000000 --- a/MainWindow.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#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; -}; -#endif // MAINWINDOW_H diff --git a/MainWindow.ui b/MainWindow.ui deleted file mode 100644 index b232854..0000000 --- a/MainWindow.ui +++ /dev/null @@ -1,22 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 800 - 600 - - - - MainWindow - - - - - - - - diff --git a/frame/CustomMessageBox.ui b/frame/CustomMessageBox.ui index 336be54..b545d74 100644 --- a/frame/CustomMessageBox.ui +++ b/frame/CustomMessageBox.ui @@ -84,8 +84,8 @@ - - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + + :/image/msgbox/icon_box_close.png:/image/msgbox/icon_box_close.png @@ -134,7 +134,7 @@ - :/image/msgbox/icon_box_success.png + :/image/msgbox/icon_box_success.png Qt::AlignCenter @@ -265,6 +265,8 @@ - + + + diff --git a/frame/MainWindowForm.cpp b/frame/MainWindowForm.cpp index 2ded44b..ec82cd7 100644 --- a/frame/MainWindowForm.cpp +++ b/frame/MainWindowForm.cpp @@ -1,6 +1,8 @@ #include "MainWindowForm.h" #include "ui_MainWindowForm.h" +#include + MainWindowForm::MainWindowForm(QWidget *parent) : FramelessWindow(parent), ui(new Ui::MainWindowForm) @@ -12,7 +14,7 @@ initMenuWidgets(); initFunctionButtons(); - // 每秒更新 界面上没有地方能摆 暂时先不启动定时器 + // 每秒更新 connect(TimeCounterUtil::getInstance().clockTimer, &QTimer::timeout, this, &MainWindowForm::onUpdateTimestampHandler); TimeCounterUtil::getInstance().clockTimer->start(1000); @@ -34,6 +36,7 @@ void MainWindowForm::initForm() { setWindowFlags(Qt::FramelessWindowHint); // 设置全屏 + setWindowState(Qt::WindowState::WindowMaximized); this->setTitleBar(ui->wdgtTop); // 设置窗口位置和大小 move(0, 0); @@ -120,6 +123,22 @@ setWindowState(Qt::WindowMinimized | windowState()); } +void MainWindowForm::on_btnMaxWin_clicked() +{ + QScreen *screen = QGuiApplication::primaryScreen(); + QRect screenSize = screen->availableGeometry(); // 可用区域(排除任务栏) + + if (this->isMaximized()) { + resize(screenSize.width() * 0.8, screenSize.height() * 0.8); + move(QRandomGenerator::global()->bounded(10, 100), QRandomGenerator::global()->bounded(10, 50)); + this->showNormal(); + } else { + resize(screenSize.width(), screenSize.height()); + move(0, 0); + this->showMaximized(); + } +} + void MainWindowForm::on_btnCloseWin_clicked() { // 创建一个消息框 @@ -146,18 +165,9 @@ ui->labelTime->setText(now.toString("yyyy-MM-dd HH:mm:ss")); } -void MainWindowForm::on_btnMenuMax_clicked() -{ - if (this->isMaximized()) { - this->showNormal(); - } else { - this->showMaximized(); - } -} - void MainWindowForm::titleDblClick() { - on_btnMenuMax_clicked(); + on_btnMaxWin_clicked(); } void MainWindowForm::onMenuButtonsEabled(bool enable) { diff --git a/frame/MainWindowForm.h b/frame/MainWindowForm.h index 4d206b1..9b4eae4 100644 --- a/frame/MainWindowForm.h +++ b/frame/MainWindowForm.h @@ -45,11 +45,11 @@ private slots: void on_btnMinWin_clicked(); + void on_btnMaxWin_clicked(); void on_btnCloseWin_clicked(); void onFunctionButtonsAction(); void onUpdateTimestampHandler(); - void on_btnMenuMax_clicked(); void titleDblClick(); void onMenuButtonsEabled(bool enable); diff --git a/frame/MainWindowForm.ui b/frame/MainWindowForm.ui index bd42122..f37d171 100644 --- a/frame/MainWindowForm.ui +++ b/frame/MainWindowForm.ui @@ -41,7 +41,7 @@ 0 - 120 + 100 @@ -58,7 +58,7 @@ 20 - 0 + 20 @@ -88,8 +88,8 @@ - 120 - 120 + 150 + 100 @@ -107,6 +107,22 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + @@ -158,7 +174,7 @@ 100 - 84 + 72 @@ -166,7 +182,8 @@ - :/image/main/calibration.png:/image/main/calibration.png + :/image/main/icon_menu_calibration.png + :/image/main/icon_menu_calibration_selected.png:/image/main/icon_menu_calibration.png @@ -184,7 +201,7 @@ 100 - 84 + 72 @@ -192,7 +209,8 @@ - :/image/main/rawDataRecord.png:/image/main/rawDataRecord.png + :/image/main/icon_menu_check.png + :/image/main/icon_menu_check_selected.png:/image/main/icon_menu_check.png @@ -210,7 +228,7 @@ 100 - 84 + 72 @@ -218,7 +236,8 @@ - :/image/main/fileRes.png:/image/main/fileRes.png + :/image/main/icon_menu_infomation.png + :/image/main/icon_menu_infomation_checked.png:/image/main/icon_menu_infomation.png @@ -235,10 +254,147 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 50 + 20 + + + + + - 320 + 240 + 16777215 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 5 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + :/image/main/iconTemp.png + + + + + + + 34.5℃ + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + + + + :/image/main/iconHumi.png + + + + + + + 25%Rh + + + + + + + + + + + + + + 240 16777215 @@ -308,7 +464,7 @@ - :/image/main/icon_setting_p.png:/image/main/icon_setting_p.png + :/image/main/icon_setting.png:/image/main/icon_setting.png @@ -334,7 +490,33 @@ - :/image/main/icon_min_p.png:/image/main/icon_min_p.png + :/image/main/icon_min.png:/image/main/icon_min.png + + + + 32 + 32 + + + + + + + + + 40 + 40 + + + + 最小化 + + + + + + + :/image/main/icon_max.png:/image/main/icon_max.png @@ -360,7 +542,7 @@ - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + :/image/main/icon_close.png:/image/main/icon_close.png @@ -426,87 +608,9 @@ - - - - - 0 - 30 - - - - - 20 - - - 0 - - - 0 - - - 40 - - - 0 - - - - - Qt::Horizontal - - - - 1289 - 20 - - - - - - - - - - - - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 20 - - - - - - - - - - - - - - wdgtContent wdgtTop - wdgtFoot diff --git a/infomation/InfoMainForm.cpp b/infomation/InfoMainForm.cpp index c001199..5d0ffc8 100644 --- a/infomation/InfoMainForm.cpp +++ b/infomation/InfoMainForm.cpp @@ -21,9 +21,13 @@ void InfoMainForm::initForm() { + // 加载样式表 + QString qssStyle = QssFileUtils::loadQssFileContent(QApplication::applicationDirPath() + "/qss/infoMain.css"); + if (qssStyle.isEmpty() == false) { + this->setStyleSheet(qssStyle); // 仅本窗口生效 + } - - + ui->scrollArea->setWindowFlags(Qt::FramelessWindowHint); // 设置无边框 } void InfoMainForm::initSubMenuForms() { diff --git a/infomation/InfoMainForm.ui b/infomation/InfoMainForm.ui index 958a6b2..d9066dd 100644 --- a/infomation/InfoMainForm.ui +++ b/infomation/InfoMainForm.ui @@ -90,7 +90,7 @@ - 280 + 295 48 @@ -103,7 +103,7 @@ - 280 + 295 48 @@ -116,7 +116,7 @@ - 280 + 295 48 @@ -129,7 +129,7 @@ - 280 + 295 48 @@ -142,7 +142,7 @@ - 280 + 295 48 @@ -155,7 +155,7 @@ - 280 + 295 48 @@ -168,7 +168,7 @@ - 280 + 295 48 @@ -181,7 +181,7 @@ - 280 + 295 48 @@ -194,7 +194,7 @@ - 280 + 295 48 @@ -207,7 +207,7 @@ - 280 + 295 48 @@ -220,7 +220,7 @@ - 280 + 295 48 @@ -233,7 +233,7 @@ - 280 + 295 48 @@ -246,7 +246,7 @@ - 280 + 295 48 diff --git a/infomation/task/DeptTaskForm.cpp b/infomation/task/DeptTaskForm.cpp index ea21a9f..cc6bf31 100644 --- a/infomation/task/DeptTaskForm.cpp +++ b/infomation/task/DeptTaskForm.cpp @@ -18,12 +18,17 @@ delete ui; } -void DeptTaskForm::showEvent(QShowEvent *event) +void DeptTaskForm::showEvent(QShowEvent * event) { ui->tableDeptTask->adjustTableWidth(); getDeptTaskList(0); } +void DeptTaskForm::resizeEvent(QResizeEvent * event) +{ + ui->tableDeptTask->adjustTableWidth(); +} + void DeptTaskForm::initFormTable() { // 初始化查询条件 diff --git a/infomation/task/DeptTaskForm.h b/infomation/task/DeptTaskForm.h index 1055c36..3c1ad5b 100644 --- a/infomation/task/DeptTaskForm.h +++ b/infomation/task/DeptTaskForm.h @@ -21,7 +21,8 @@ ~DeptTaskForm(); protected: - void showEvent(QShowEvent *event) override; + void showEvent(QShowEvent * event) override; + void resizeEvent(QResizeEvent * event) override; private: Ui::DeptTaskForm *ui; diff --git a/main.cpp b/main.cpp index 525387e..0b78c87 100644 --- a/main.cpp +++ b/main.cpp @@ -1,5 +1,3 @@ -#include "MainWindow.h" - #include #include diff --git a/res/image/Index/u1176.svg b/res/image/Index/u1176.svg deleted file mode 100644 index c81ce8a..0000000 --- a/res/image/Index/u1176.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1180.svg b/res/image/Index/u1180.svg deleted file mode 100644 index 2ef24ab..0000000 --- a/res/image/Index/u1180.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1220.svg b/res/image/Index/u1220.svg deleted file mode 100644 index 43452aa..0000000 --- a/res/image/Index/u1220.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2158.svg b/res/image/Index/u2158.svg deleted file mode 100644 index fd249e0..0000000 --- a/res/image/Index/u2158.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u2188.svg b/res/image/Index/u2188.svg deleted file mode 100644 index 34f53c4..0000000 --- a/res/image/Index/u2188.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2189.svg b/res/image/Index/u2189.svg deleted file mode 100644 index 01a6bbb..0000000 --- a/res/image/Index/u2189.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2324.svg b/res/image/Index/u2324.svg deleted file mode 100644 index 797f1c5..0000000 --- a/res/image/Index/u2324.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2325.svg b/res/image/Index/u2325.svg deleted file mode 100644 index fefe01b..0000000 --- a/res/image/Index/u2325.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u642.svg b/res/image/Index/u642.svg deleted file mode 100644 index 33c9e0a..0000000 --- a/res/image/Index/u642.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u7406.svg b/res/image/Index/u7406.svg deleted file mode 100644 index 8a7a6d9..0000000 --- a/res/image/Index/u7406.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7453.svg b/res/image/Index/u7453.svg deleted file mode 100644 index 603c496..0000000 --- a/res/image/Index/u7453.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7458.svg b/res/image/Index/u7458.svg deleted file mode 100644 index b31087b..0000000 --- a/res/image/Index/u7458.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7488.svg b/res/image/Index/u7488.svg deleted file mode 100644 index 8baf439..0000000 --- a/res/image/Index/u7488.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/AutoCalibrationXC.pro b/AutoCalibrationXC.pro index 6bcb335..7790b37 100644 --- a/AutoCalibrationXC.pro +++ b/AutoCalibrationXC.pro @@ -24,11 +24,6 @@ include(QPagedTable/QPagedTable.pri) SOURCES += main.cpp -SOURCES += MainWindow.cpp - -HEADERS += MainWindow.h - -FORMS += MainWindow.ui RC_ICONS = res/autoCalibration.ico diff --git a/MainWindow.cpp b/MainWindow.cpp deleted file mode 100644 index ff126e8..0000000 --- a/MainWindow.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#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/MainWindow.h b/MainWindow.h deleted file mode 100644 index 4643e32..0000000 --- a/MainWindow.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#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; -}; -#endif // MAINWINDOW_H diff --git a/MainWindow.ui b/MainWindow.ui deleted file mode 100644 index b232854..0000000 --- a/MainWindow.ui +++ /dev/null @@ -1,22 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 800 - 600 - - - - MainWindow - - - - - - - - diff --git a/frame/CustomMessageBox.ui b/frame/CustomMessageBox.ui index 336be54..b545d74 100644 --- a/frame/CustomMessageBox.ui +++ b/frame/CustomMessageBox.ui @@ -84,8 +84,8 @@ - - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + + :/image/msgbox/icon_box_close.png:/image/msgbox/icon_box_close.png @@ -134,7 +134,7 @@ - :/image/msgbox/icon_box_success.png + :/image/msgbox/icon_box_success.png Qt::AlignCenter @@ -265,6 +265,8 @@ - + + + diff --git a/frame/MainWindowForm.cpp b/frame/MainWindowForm.cpp index 2ded44b..ec82cd7 100644 --- a/frame/MainWindowForm.cpp +++ b/frame/MainWindowForm.cpp @@ -1,6 +1,8 @@ #include "MainWindowForm.h" #include "ui_MainWindowForm.h" +#include + MainWindowForm::MainWindowForm(QWidget *parent) : FramelessWindow(parent), ui(new Ui::MainWindowForm) @@ -12,7 +14,7 @@ initMenuWidgets(); initFunctionButtons(); - // 每秒更新 界面上没有地方能摆 暂时先不启动定时器 + // 每秒更新 connect(TimeCounterUtil::getInstance().clockTimer, &QTimer::timeout, this, &MainWindowForm::onUpdateTimestampHandler); TimeCounterUtil::getInstance().clockTimer->start(1000); @@ -34,6 +36,7 @@ void MainWindowForm::initForm() { setWindowFlags(Qt::FramelessWindowHint); // 设置全屏 + setWindowState(Qt::WindowState::WindowMaximized); this->setTitleBar(ui->wdgtTop); // 设置窗口位置和大小 move(0, 0); @@ -120,6 +123,22 @@ setWindowState(Qt::WindowMinimized | windowState()); } +void MainWindowForm::on_btnMaxWin_clicked() +{ + QScreen *screen = QGuiApplication::primaryScreen(); + QRect screenSize = screen->availableGeometry(); // 可用区域(排除任务栏) + + if (this->isMaximized()) { + resize(screenSize.width() * 0.8, screenSize.height() * 0.8); + move(QRandomGenerator::global()->bounded(10, 100), QRandomGenerator::global()->bounded(10, 50)); + this->showNormal(); + } else { + resize(screenSize.width(), screenSize.height()); + move(0, 0); + this->showMaximized(); + } +} + void MainWindowForm::on_btnCloseWin_clicked() { // 创建一个消息框 @@ -146,18 +165,9 @@ ui->labelTime->setText(now.toString("yyyy-MM-dd HH:mm:ss")); } -void MainWindowForm::on_btnMenuMax_clicked() -{ - if (this->isMaximized()) { - this->showNormal(); - } else { - this->showMaximized(); - } -} - void MainWindowForm::titleDblClick() { - on_btnMenuMax_clicked(); + on_btnMaxWin_clicked(); } void MainWindowForm::onMenuButtonsEabled(bool enable) { diff --git a/frame/MainWindowForm.h b/frame/MainWindowForm.h index 4d206b1..9b4eae4 100644 --- a/frame/MainWindowForm.h +++ b/frame/MainWindowForm.h @@ -45,11 +45,11 @@ private slots: void on_btnMinWin_clicked(); + void on_btnMaxWin_clicked(); void on_btnCloseWin_clicked(); void onFunctionButtonsAction(); void onUpdateTimestampHandler(); - void on_btnMenuMax_clicked(); void titleDblClick(); void onMenuButtonsEabled(bool enable); diff --git a/frame/MainWindowForm.ui b/frame/MainWindowForm.ui index bd42122..f37d171 100644 --- a/frame/MainWindowForm.ui +++ b/frame/MainWindowForm.ui @@ -41,7 +41,7 @@ 0 - 120 + 100 @@ -58,7 +58,7 @@ 20 - 0 + 20 @@ -88,8 +88,8 @@ - 120 - 120 + 150 + 100 @@ -107,6 +107,22 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + @@ -158,7 +174,7 @@ 100 - 84 + 72 @@ -166,7 +182,8 @@ - :/image/main/calibration.png:/image/main/calibration.png + :/image/main/icon_menu_calibration.png + :/image/main/icon_menu_calibration_selected.png:/image/main/icon_menu_calibration.png @@ -184,7 +201,7 @@ 100 - 84 + 72 @@ -192,7 +209,8 @@ - :/image/main/rawDataRecord.png:/image/main/rawDataRecord.png + :/image/main/icon_menu_check.png + :/image/main/icon_menu_check_selected.png:/image/main/icon_menu_check.png @@ -210,7 +228,7 @@ 100 - 84 + 72 @@ -218,7 +236,8 @@ - :/image/main/fileRes.png:/image/main/fileRes.png + :/image/main/icon_menu_infomation.png + :/image/main/icon_menu_infomation_checked.png:/image/main/icon_menu_infomation.png @@ -235,10 +254,147 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 50 + 20 + + + + + - 320 + 240 + 16777215 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 5 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + :/image/main/iconTemp.png + + + + + + + 34.5℃ + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + + + + :/image/main/iconHumi.png + + + + + + + 25%Rh + + + + + + + + + + + + + + 240 16777215 @@ -308,7 +464,7 @@ - :/image/main/icon_setting_p.png:/image/main/icon_setting_p.png + :/image/main/icon_setting.png:/image/main/icon_setting.png @@ -334,7 +490,33 @@ - :/image/main/icon_min_p.png:/image/main/icon_min_p.png + :/image/main/icon_min.png:/image/main/icon_min.png + + + + 32 + 32 + + + + + + + + + 40 + 40 + + + + 最小化 + + + + + + + :/image/main/icon_max.png:/image/main/icon_max.png @@ -360,7 +542,7 @@ - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + :/image/main/icon_close.png:/image/main/icon_close.png @@ -426,87 +608,9 @@ - - - - - 0 - 30 - - - - - 20 - - - 0 - - - 0 - - - 40 - - - 0 - - - - - Qt::Horizontal - - - - 1289 - 20 - - - - - - - - - - - - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 20 - - - - - - - - - - - - - - wdgtContent wdgtTop - wdgtFoot diff --git a/infomation/InfoMainForm.cpp b/infomation/InfoMainForm.cpp index c001199..5d0ffc8 100644 --- a/infomation/InfoMainForm.cpp +++ b/infomation/InfoMainForm.cpp @@ -21,9 +21,13 @@ void InfoMainForm::initForm() { + // 加载样式表 + QString qssStyle = QssFileUtils::loadQssFileContent(QApplication::applicationDirPath() + "/qss/infoMain.css"); + if (qssStyle.isEmpty() == false) { + this->setStyleSheet(qssStyle); // 仅本窗口生效 + } - - + ui->scrollArea->setWindowFlags(Qt::FramelessWindowHint); // 设置无边框 } void InfoMainForm::initSubMenuForms() { diff --git a/infomation/InfoMainForm.ui b/infomation/InfoMainForm.ui index 958a6b2..d9066dd 100644 --- a/infomation/InfoMainForm.ui +++ b/infomation/InfoMainForm.ui @@ -90,7 +90,7 @@ - 280 + 295 48 @@ -103,7 +103,7 @@ - 280 + 295 48 @@ -116,7 +116,7 @@ - 280 + 295 48 @@ -129,7 +129,7 @@ - 280 + 295 48 @@ -142,7 +142,7 @@ - 280 + 295 48 @@ -155,7 +155,7 @@ - 280 + 295 48 @@ -168,7 +168,7 @@ - 280 + 295 48 @@ -181,7 +181,7 @@ - 280 + 295 48 @@ -194,7 +194,7 @@ - 280 + 295 48 @@ -207,7 +207,7 @@ - 280 + 295 48 @@ -220,7 +220,7 @@ - 280 + 295 48 @@ -233,7 +233,7 @@ - 280 + 295 48 @@ -246,7 +246,7 @@ - 280 + 295 48 diff --git a/infomation/task/DeptTaskForm.cpp b/infomation/task/DeptTaskForm.cpp index ea21a9f..cc6bf31 100644 --- a/infomation/task/DeptTaskForm.cpp +++ b/infomation/task/DeptTaskForm.cpp @@ -18,12 +18,17 @@ delete ui; } -void DeptTaskForm::showEvent(QShowEvent *event) +void DeptTaskForm::showEvent(QShowEvent * event) { ui->tableDeptTask->adjustTableWidth(); getDeptTaskList(0); } +void DeptTaskForm::resizeEvent(QResizeEvent * event) +{ + ui->tableDeptTask->adjustTableWidth(); +} + void DeptTaskForm::initFormTable() { // 初始化查询条件 diff --git a/infomation/task/DeptTaskForm.h b/infomation/task/DeptTaskForm.h index 1055c36..3c1ad5b 100644 --- a/infomation/task/DeptTaskForm.h +++ b/infomation/task/DeptTaskForm.h @@ -21,7 +21,8 @@ ~DeptTaskForm(); protected: - void showEvent(QShowEvent *event) override; + void showEvent(QShowEvent * event) override; + void resizeEvent(QResizeEvent * event) override; private: Ui::DeptTaskForm *ui; diff --git a/main.cpp b/main.cpp index 525387e..0b78c87 100644 --- a/main.cpp +++ b/main.cpp @@ -1,5 +1,3 @@ -#include "MainWindow.h" - #include #include diff --git a/res/image/Index/u1176.svg b/res/image/Index/u1176.svg deleted file mode 100644 index c81ce8a..0000000 --- a/res/image/Index/u1176.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1180.svg b/res/image/Index/u1180.svg deleted file mode 100644 index 2ef24ab..0000000 --- a/res/image/Index/u1180.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1220.svg b/res/image/Index/u1220.svg deleted file mode 100644 index 43452aa..0000000 --- a/res/image/Index/u1220.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2158.svg b/res/image/Index/u2158.svg deleted file mode 100644 index fd249e0..0000000 --- a/res/image/Index/u2158.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u2188.svg b/res/image/Index/u2188.svg deleted file mode 100644 index 34f53c4..0000000 --- a/res/image/Index/u2188.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2189.svg b/res/image/Index/u2189.svg deleted file mode 100644 index 01a6bbb..0000000 --- a/res/image/Index/u2189.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2324.svg b/res/image/Index/u2324.svg deleted file mode 100644 index 797f1c5..0000000 --- a/res/image/Index/u2324.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2325.svg b/res/image/Index/u2325.svg deleted file mode 100644 index fefe01b..0000000 --- a/res/image/Index/u2325.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u642.svg b/res/image/Index/u642.svg deleted file mode 100644 index 33c9e0a..0000000 --- a/res/image/Index/u642.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u7406.svg b/res/image/Index/u7406.svg deleted file mode 100644 index 8a7a6d9..0000000 --- a/res/image/Index/u7406.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7453.svg b/res/image/Index/u7453.svg deleted file mode 100644 index 603c496..0000000 --- a/res/image/Index/u7453.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7458.svg b/res/image/Index/u7458.svg deleted file mode 100644 index b31087b..0000000 --- a/res/image/Index/u7458.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7488.svg b/res/image/Index/u7488.svg deleted file mode 100644 index 8baf439..0000000 --- a/res/image/Index/u7488.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7491.svg b/res/image/Index/u7491.svg deleted file mode 100644 index 3e41c10..0000000 --- a/res/image/Index/u7491.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/AutoCalibrationXC.pro b/AutoCalibrationXC.pro index 6bcb335..7790b37 100644 --- a/AutoCalibrationXC.pro +++ b/AutoCalibrationXC.pro @@ -24,11 +24,6 @@ include(QPagedTable/QPagedTable.pri) SOURCES += main.cpp -SOURCES += MainWindow.cpp - -HEADERS += MainWindow.h - -FORMS += MainWindow.ui RC_ICONS = res/autoCalibration.ico diff --git a/MainWindow.cpp b/MainWindow.cpp deleted file mode 100644 index ff126e8..0000000 --- a/MainWindow.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#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/MainWindow.h b/MainWindow.h deleted file mode 100644 index 4643e32..0000000 --- a/MainWindow.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#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; -}; -#endif // MAINWINDOW_H diff --git a/MainWindow.ui b/MainWindow.ui deleted file mode 100644 index b232854..0000000 --- a/MainWindow.ui +++ /dev/null @@ -1,22 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 800 - 600 - - - - MainWindow - - - - - - - - diff --git a/frame/CustomMessageBox.ui b/frame/CustomMessageBox.ui index 336be54..b545d74 100644 --- a/frame/CustomMessageBox.ui +++ b/frame/CustomMessageBox.ui @@ -84,8 +84,8 @@ - - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + + :/image/msgbox/icon_box_close.png:/image/msgbox/icon_box_close.png @@ -134,7 +134,7 @@ - :/image/msgbox/icon_box_success.png + :/image/msgbox/icon_box_success.png Qt::AlignCenter @@ -265,6 +265,8 @@ - + + + diff --git a/frame/MainWindowForm.cpp b/frame/MainWindowForm.cpp index 2ded44b..ec82cd7 100644 --- a/frame/MainWindowForm.cpp +++ b/frame/MainWindowForm.cpp @@ -1,6 +1,8 @@ #include "MainWindowForm.h" #include "ui_MainWindowForm.h" +#include + MainWindowForm::MainWindowForm(QWidget *parent) : FramelessWindow(parent), ui(new Ui::MainWindowForm) @@ -12,7 +14,7 @@ initMenuWidgets(); initFunctionButtons(); - // 每秒更新 界面上没有地方能摆 暂时先不启动定时器 + // 每秒更新 connect(TimeCounterUtil::getInstance().clockTimer, &QTimer::timeout, this, &MainWindowForm::onUpdateTimestampHandler); TimeCounterUtil::getInstance().clockTimer->start(1000); @@ -34,6 +36,7 @@ void MainWindowForm::initForm() { setWindowFlags(Qt::FramelessWindowHint); // 设置全屏 + setWindowState(Qt::WindowState::WindowMaximized); this->setTitleBar(ui->wdgtTop); // 设置窗口位置和大小 move(0, 0); @@ -120,6 +123,22 @@ setWindowState(Qt::WindowMinimized | windowState()); } +void MainWindowForm::on_btnMaxWin_clicked() +{ + QScreen *screen = QGuiApplication::primaryScreen(); + QRect screenSize = screen->availableGeometry(); // 可用区域(排除任务栏) + + if (this->isMaximized()) { + resize(screenSize.width() * 0.8, screenSize.height() * 0.8); + move(QRandomGenerator::global()->bounded(10, 100), QRandomGenerator::global()->bounded(10, 50)); + this->showNormal(); + } else { + resize(screenSize.width(), screenSize.height()); + move(0, 0); + this->showMaximized(); + } +} + void MainWindowForm::on_btnCloseWin_clicked() { // 创建一个消息框 @@ -146,18 +165,9 @@ ui->labelTime->setText(now.toString("yyyy-MM-dd HH:mm:ss")); } -void MainWindowForm::on_btnMenuMax_clicked() -{ - if (this->isMaximized()) { - this->showNormal(); - } else { - this->showMaximized(); - } -} - void MainWindowForm::titleDblClick() { - on_btnMenuMax_clicked(); + on_btnMaxWin_clicked(); } void MainWindowForm::onMenuButtonsEabled(bool enable) { diff --git a/frame/MainWindowForm.h b/frame/MainWindowForm.h index 4d206b1..9b4eae4 100644 --- a/frame/MainWindowForm.h +++ b/frame/MainWindowForm.h @@ -45,11 +45,11 @@ private slots: void on_btnMinWin_clicked(); + void on_btnMaxWin_clicked(); void on_btnCloseWin_clicked(); void onFunctionButtonsAction(); void onUpdateTimestampHandler(); - void on_btnMenuMax_clicked(); void titleDblClick(); void onMenuButtonsEabled(bool enable); diff --git a/frame/MainWindowForm.ui b/frame/MainWindowForm.ui index bd42122..f37d171 100644 --- a/frame/MainWindowForm.ui +++ b/frame/MainWindowForm.ui @@ -41,7 +41,7 @@ 0 - 120 + 100 @@ -58,7 +58,7 @@ 20 - 0 + 20 @@ -88,8 +88,8 @@ - 120 - 120 + 150 + 100 @@ -107,6 +107,22 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + @@ -158,7 +174,7 @@ 100 - 84 + 72 @@ -166,7 +182,8 @@ - :/image/main/calibration.png:/image/main/calibration.png + :/image/main/icon_menu_calibration.png + :/image/main/icon_menu_calibration_selected.png:/image/main/icon_menu_calibration.png @@ -184,7 +201,7 @@ 100 - 84 + 72 @@ -192,7 +209,8 @@ - :/image/main/rawDataRecord.png:/image/main/rawDataRecord.png + :/image/main/icon_menu_check.png + :/image/main/icon_menu_check_selected.png:/image/main/icon_menu_check.png @@ -210,7 +228,7 @@ 100 - 84 + 72 @@ -218,7 +236,8 @@ - :/image/main/fileRes.png:/image/main/fileRes.png + :/image/main/icon_menu_infomation.png + :/image/main/icon_menu_infomation_checked.png:/image/main/icon_menu_infomation.png @@ -235,10 +254,147 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 50 + 20 + + + + + - 320 + 240 + 16777215 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 5 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + :/image/main/iconTemp.png + + + + + + + 34.5℃ + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + + + + :/image/main/iconHumi.png + + + + + + + 25%Rh + + + + + + + + + + + + + + 240 16777215 @@ -308,7 +464,7 @@ - :/image/main/icon_setting_p.png:/image/main/icon_setting_p.png + :/image/main/icon_setting.png:/image/main/icon_setting.png @@ -334,7 +490,33 @@ - :/image/main/icon_min_p.png:/image/main/icon_min_p.png + :/image/main/icon_min.png:/image/main/icon_min.png + + + + 32 + 32 + + + + + + + + + 40 + 40 + + + + 最小化 + + + + + + + :/image/main/icon_max.png:/image/main/icon_max.png @@ -360,7 +542,7 @@ - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + :/image/main/icon_close.png:/image/main/icon_close.png @@ -426,87 +608,9 @@ - - - - - 0 - 30 - - - - - 20 - - - 0 - - - 0 - - - 40 - - - 0 - - - - - Qt::Horizontal - - - - 1289 - 20 - - - - - - - - - - - - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 20 - - - - - - - - - - - - - - wdgtContent wdgtTop - wdgtFoot diff --git a/infomation/InfoMainForm.cpp b/infomation/InfoMainForm.cpp index c001199..5d0ffc8 100644 --- a/infomation/InfoMainForm.cpp +++ b/infomation/InfoMainForm.cpp @@ -21,9 +21,13 @@ void InfoMainForm::initForm() { + // 加载样式表 + QString qssStyle = QssFileUtils::loadQssFileContent(QApplication::applicationDirPath() + "/qss/infoMain.css"); + if (qssStyle.isEmpty() == false) { + this->setStyleSheet(qssStyle); // 仅本窗口生效 + } - - + ui->scrollArea->setWindowFlags(Qt::FramelessWindowHint); // 设置无边框 } void InfoMainForm::initSubMenuForms() { diff --git a/infomation/InfoMainForm.ui b/infomation/InfoMainForm.ui index 958a6b2..d9066dd 100644 --- a/infomation/InfoMainForm.ui +++ b/infomation/InfoMainForm.ui @@ -90,7 +90,7 @@ - 280 + 295 48 @@ -103,7 +103,7 @@ - 280 + 295 48 @@ -116,7 +116,7 @@ - 280 + 295 48 @@ -129,7 +129,7 @@ - 280 + 295 48 @@ -142,7 +142,7 @@ - 280 + 295 48 @@ -155,7 +155,7 @@ - 280 + 295 48 @@ -168,7 +168,7 @@ - 280 + 295 48 @@ -181,7 +181,7 @@ - 280 + 295 48 @@ -194,7 +194,7 @@ - 280 + 295 48 @@ -207,7 +207,7 @@ - 280 + 295 48 @@ -220,7 +220,7 @@ - 280 + 295 48 @@ -233,7 +233,7 @@ - 280 + 295 48 @@ -246,7 +246,7 @@ - 280 + 295 48 diff --git a/infomation/task/DeptTaskForm.cpp b/infomation/task/DeptTaskForm.cpp index ea21a9f..cc6bf31 100644 --- a/infomation/task/DeptTaskForm.cpp +++ b/infomation/task/DeptTaskForm.cpp @@ -18,12 +18,17 @@ delete ui; } -void DeptTaskForm::showEvent(QShowEvent *event) +void DeptTaskForm::showEvent(QShowEvent * event) { ui->tableDeptTask->adjustTableWidth(); getDeptTaskList(0); } +void DeptTaskForm::resizeEvent(QResizeEvent * event) +{ + ui->tableDeptTask->adjustTableWidth(); +} + void DeptTaskForm::initFormTable() { // 初始化查询条件 diff --git a/infomation/task/DeptTaskForm.h b/infomation/task/DeptTaskForm.h index 1055c36..3c1ad5b 100644 --- a/infomation/task/DeptTaskForm.h +++ b/infomation/task/DeptTaskForm.h @@ -21,7 +21,8 @@ ~DeptTaskForm(); protected: - void showEvent(QShowEvent *event) override; + void showEvent(QShowEvent * event) override; + void resizeEvent(QResizeEvent * event) override; private: Ui::DeptTaskForm *ui; diff --git a/main.cpp b/main.cpp index 525387e..0b78c87 100644 --- a/main.cpp +++ b/main.cpp @@ -1,5 +1,3 @@ -#include "MainWindow.h" - #include #include diff --git a/res/image/Index/u1176.svg b/res/image/Index/u1176.svg deleted file mode 100644 index c81ce8a..0000000 --- a/res/image/Index/u1176.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1180.svg b/res/image/Index/u1180.svg deleted file mode 100644 index 2ef24ab..0000000 --- a/res/image/Index/u1180.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1220.svg b/res/image/Index/u1220.svg deleted file mode 100644 index 43452aa..0000000 --- a/res/image/Index/u1220.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2158.svg b/res/image/Index/u2158.svg deleted file mode 100644 index fd249e0..0000000 --- a/res/image/Index/u2158.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u2188.svg b/res/image/Index/u2188.svg deleted file mode 100644 index 34f53c4..0000000 --- a/res/image/Index/u2188.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2189.svg b/res/image/Index/u2189.svg deleted file mode 100644 index 01a6bbb..0000000 --- a/res/image/Index/u2189.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2324.svg b/res/image/Index/u2324.svg deleted file mode 100644 index 797f1c5..0000000 --- a/res/image/Index/u2324.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2325.svg b/res/image/Index/u2325.svg deleted file mode 100644 index fefe01b..0000000 --- a/res/image/Index/u2325.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u642.svg b/res/image/Index/u642.svg deleted file mode 100644 index 33c9e0a..0000000 --- a/res/image/Index/u642.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u7406.svg b/res/image/Index/u7406.svg deleted file mode 100644 index 8a7a6d9..0000000 --- a/res/image/Index/u7406.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7453.svg b/res/image/Index/u7453.svg deleted file mode 100644 index 603c496..0000000 --- a/res/image/Index/u7453.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7458.svg b/res/image/Index/u7458.svg deleted file mode 100644 index b31087b..0000000 --- a/res/image/Index/u7458.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7488.svg b/res/image/Index/u7488.svg deleted file mode 100644 index 8baf439..0000000 --- a/res/image/Index/u7488.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7491.svg b/res/image/Index/u7491.svg deleted file mode 100644 index 3e41c10..0000000 --- a/res/image/Index/u7491.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7538.svg b/res/image/Index/u7538.svg deleted file mode 100644 index 417077d..0000000 --- a/res/image/Index/u7538.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/AutoCalibrationXC.pro b/AutoCalibrationXC.pro index 6bcb335..7790b37 100644 --- a/AutoCalibrationXC.pro +++ b/AutoCalibrationXC.pro @@ -24,11 +24,6 @@ include(QPagedTable/QPagedTable.pri) SOURCES += main.cpp -SOURCES += MainWindow.cpp - -HEADERS += MainWindow.h - -FORMS += MainWindow.ui RC_ICONS = res/autoCalibration.ico diff --git a/MainWindow.cpp b/MainWindow.cpp deleted file mode 100644 index ff126e8..0000000 --- a/MainWindow.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#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/MainWindow.h b/MainWindow.h deleted file mode 100644 index 4643e32..0000000 --- a/MainWindow.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#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; -}; -#endif // MAINWINDOW_H diff --git a/MainWindow.ui b/MainWindow.ui deleted file mode 100644 index b232854..0000000 --- a/MainWindow.ui +++ /dev/null @@ -1,22 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 800 - 600 - - - - MainWindow - - - - - - - - diff --git a/frame/CustomMessageBox.ui b/frame/CustomMessageBox.ui index 336be54..b545d74 100644 --- a/frame/CustomMessageBox.ui +++ b/frame/CustomMessageBox.ui @@ -84,8 +84,8 @@ - - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + + :/image/msgbox/icon_box_close.png:/image/msgbox/icon_box_close.png @@ -134,7 +134,7 @@ - :/image/msgbox/icon_box_success.png + :/image/msgbox/icon_box_success.png Qt::AlignCenter @@ -265,6 +265,8 @@ - + + + diff --git a/frame/MainWindowForm.cpp b/frame/MainWindowForm.cpp index 2ded44b..ec82cd7 100644 --- a/frame/MainWindowForm.cpp +++ b/frame/MainWindowForm.cpp @@ -1,6 +1,8 @@ #include "MainWindowForm.h" #include "ui_MainWindowForm.h" +#include + MainWindowForm::MainWindowForm(QWidget *parent) : FramelessWindow(parent), ui(new Ui::MainWindowForm) @@ -12,7 +14,7 @@ initMenuWidgets(); initFunctionButtons(); - // 每秒更新 界面上没有地方能摆 暂时先不启动定时器 + // 每秒更新 connect(TimeCounterUtil::getInstance().clockTimer, &QTimer::timeout, this, &MainWindowForm::onUpdateTimestampHandler); TimeCounterUtil::getInstance().clockTimer->start(1000); @@ -34,6 +36,7 @@ void MainWindowForm::initForm() { setWindowFlags(Qt::FramelessWindowHint); // 设置全屏 + setWindowState(Qt::WindowState::WindowMaximized); this->setTitleBar(ui->wdgtTop); // 设置窗口位置和大小 move(0, 0); @@ -120,6 +123,22 @@ setWindowState(Qt::WindowMinimized | windowState()); } +void MainWindowForm::on_btnMaxWin_clicked() +{ + QScreen *screen = QGuiApplication::primaryScreen(); + QRect screenSize = screen->availableGeometry(); // 可用区域(排除任务栏) + + if (this->isMaximized()) { + resize(screenSize.width() * 0.8, screenSize.height() * 0.8); + move(QRandomGenerator::global()->bounded(10, 100), QRandomGenerator::global()->bounded(10, 50)); + this->showNormal(); + } else { + resize(screenSize.width(), screenSize.height()); + move(0, 0); + this->showMaximized(); + } +} + void MainWindowForm::on_btnCloseWin_clicked() { // 创建一个消息框 @@ -146,18 +165,9 @@ ui->labelTime->setText(now.toString("yyyy-MM-dd HH:mm:ss")); } -void MainWindowForm::on_btnMenuMax_clicked() -{ - if (this->isMaximized()) { - this->showNormal(); - } else { - this->showMaximized(); - } -} - void MainWindowForm::titleDblClick() { - on_btnMenuMax_clicked(); + on_btnMaxWin_clicked(); } void MainWindowForm::onMenuButtonsEabled(bool enable) { diff --git a/frame/MainWindowForm.h b/frame/MainWindowForm.h index 4d206b1..9b4eae4 100644 --- a/frame/MainWindowForm.h +++ b/frame/MainWindowForm.h @@ -45,11 +45,11 @@ private slots: void on_btnMinWin_clicked(); + void on_btnMaxWin_clicked(); void on_btnCloseWin_clicked(); void onFunctionButtonsAction(); void onUpdateTimestampHandler(); - void on_btnMenuMax_clicked(); void titleDblClick(); void onMenuButtonsEabled(bool enable); diff --git a/frame/MainWindowForm.ui b/frame/MainWindowForm.ui index bd42122..f37d171 100644 --- a/frame/MainWindowForm.ui +++ b/frame/MainWindowForm.ui @@ -41,7 +41,7 @@ 0 - 120 + 100 @@ -58,7 +58,7 @@ 20 - 0 + 20 @@ -88,8 +88,8 @@ - 120 - 120 + 150 + 100 @@ -107,6 +107,22 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + @@ -158,7 +174,7 @@ 100 - 84 + 72 @@ -166,7 +182,8 @@ - :/image/main/calibration.png:/image/main/calibration.png + :/image/main/icon_menu_calibration.png + :/image/main/icon_menu_calibration_selected.png:/image/main/icon_menu_calibration.png @@ -184,7 +201,7 @@ 100 - 84 + 72 @@ -192,7 +209,8 @@ - :/image/main/rawDataRecord.png:/image/main/rawDataRecord.png + :/image/main/icon_menu_check.png + :/image/main/icon_menu_check_selected.png:/image/main/icon_menu_check.png @@ -210,7 +228,7 @@ 100 - 84 + 72 @@ -218,7 +236,8 @@ - :/image/main/fileRes.png:/image/main/fileRes.png + :/image/main/icon_menu_infomation.png + :/image/main/icon_menu_infomation_checked.png:/image/main/icon_menu_infomation.png @@ -235,10 +254,147 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 50 + 20 + + + + + - 320 + 240 + 16777215 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 5 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + :/image/main/iconTemp.png + + + + + + + 34.5℃ + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + + + + :/image/main/iconHumi.png + + + + + + + 25%Rh + + + + + + + + + + + + + + 240 16777215 @@ -308,7 +464,7 @@ - :/image/main/icon_setting_p.png:/image/main/icon_setting_p.png + :/image/main/icon_setting.png:/image/main/icon_setting.png @@ -334,7 +490,33 @@ - :/image/main/icon_min_p.png:/image/main/icon_min_p.png + :/image/main/icon_min.png:/image/main/icon_min.png + + + + 32 + 32 + + + + + + + + + 40 + 40 + + + + 最小化 + + + + + + + :/image/main/icon_max.png:/image/main/icon_max.png @@ -360,7 +542,7 @@ - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + :/image/main/icon_close.png:/image/main/icon_close.png @@ -426,87 +608,9 @@ - - - - - 0 - 30 - - - - - 20 - - - 0 - - - 0 - - - 40 - - - 0 - - - - - Qt::Horizontal - - - - 1289 - 20 - - - - - - - - - - - - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 20 - - - - - - - - - - - - - - wdgtContent wdgtTop - wdgtFoot diff --git a/infomation/InfoMainForm.cpp b/infomation/InfoMainForm.cpp index c001199..5d0ffc8 100644 --- a/infomation/InfoMainForm.cpp +++ b/infomation/InfoMainForm.cpp @@ -21,9 +21,13 @@ void InfoMainForm::initForm() { + // 加载样式表 + QString qssStyle = QssFileUtils::loadQssFileContent(QApplication::applicationDirPath() + "/qss/infoMain.css"); + if (qssStyle.isEmpty() == false) { + this->setStyleSheet(qssStyle); // 仅本窗口生效 + } - - + ui->scrollArea->setWindowFlags(Qt::FramelessWindowHint); // 设置无边框 } void InfoMainForm::initSubMenuForms() { diff --git a/infomation/InfoMainForm.ui b/infomation/InfoMainForm.ui index 958a6b2..d9066dd 100644 --- a/infomation/InfoMainForm.ui +++ b/infomation/InfoMainForm.ui @@ -90,7 +90,7 @@ - 280 + 295 48 @@ -103,7 +103,7 @@ - 280 + 295 48 @@ -116,7 +116,7 @@ - 280 + 295 48 @@ -129,7 +129,7 @@ - 280 + 295 48 @@ -142,7 +142,7 @@ - 280 + 295 48 @@ -155,7 +155,7 @@ - 280 + 295 48 @@ -168,7 +168,7 @@ - 280 + 295 48 @@ -181,7 +181,7 @@ - 280 + 295 48 @@ -194,7 +194,7 @@ - 280 + 295 48 @@ -207,7 +207,7 @@ - 280 + 295 48 @@ -220,7 +220,7 @@ - 280 + 295 48 @@ -233,7 +233,7 @@ - 280 + 295 48 @@ -246,7 +246,7 @@ - 280 + 295 48 diff --git a/infomation/task/DeptTaskForm.cpp b/infomation/task/DeptTaskForm.cpp index ea21a9f..cc6bf31 100644 --- a/infomation/task/DeptTaskForm.cpp +++ b/infomation/task/DeptTaskForm.cpp @@ -18,12 +18,17 @@ delete ui; } -void DeptTaskForm::showEvent(QShowEvent *event) +void DeptTaskForm::showEvent(QShowEvent * event) { ui->tableDeptTask->adjustTableWidth(); getDeptTaskList(0); } +void DeptTaskForm::resizeEvent(QResizeEvent * event) +{ + ui->tableDeptTask->adjustTableWidth(); +} + void DeptTaskForm::initFormTable() { // 初始化查询条件 diff --git a/infomation/task/DeptTaskForm.h b/infomation/task/DeptTaskForm.h index 1055c36..3c1ad5b 100644 --- a/infomation/task/DeptTaskForm.h +++ b/infomation/task/DeptTaskForm.h @@ -21,7 +21,8 @@ ~DeptTaskForm(); protected: - void showEvent(QShowEvent *event) override; + void showEvent(QShowEvent * event) override; + void resizeEvent(QResizeEvent * event) override; private: Ui::DeptTaskForm *ui; diff --git a/main.cpp b/main.cpp index 525387e..0b78c87 100644 --- a/main.cpp +++ b/main.cpp @@ -1,5 +1,3 @@ -#include "MainWindow.h" - #include #include diff --git a/res/image/Index/u1176.svg b/res/image/Index/u1176.svg deleted file mode 100644 index c81ce8a..0000000 --- a/res/image/Index/u1176.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1180.svg b/res/image/Index/u1180.svg deleted file mode 100644 index 2ef24ab..0000000 --- a/res/image/Index/u1180.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1220.svg b/res/image/Index/u1220.svg deleted file mode 100644 index 43452aa..0000000 --- a/res/image/Index/u1220.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2158.svg b/res/image/Index/u2158.svg deleted file mode 100644 index fd249e0..0000000 --- a/res/image/Index/u2158.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u2188.svg b/res/image/Index/u2188.svg deleted file mode 100644 index 34f53c4..0000000 --- a/res/image/Index/u2188.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2189.svg b/res/image/Index/u2189.svg deleted file mode 100644 index 01a6bbb..0000000 --- a/res/image/Index/u2189.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2324.svg b/res/image/Index/u2324.svg deleted file mode 100644 index 797f1c5..0000000 --- a/res/image/Index/u2324.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2325.svg b/res/image/Index/u2325.svg deleted file mode 100644 index fefe01b..0000000 --- a/res/image/Index/u2325.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u642.svg b/res/image/Index/u642.svg deleted file mode 100644 index 33c9e0a..0000000 --- a/res/image/Index/u642.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u7406.svg b/res/image/Index/u7406.svg deleted file mode 100644 index 8a7a6d9..0000000 --- a/res/image/Index/u7406.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7453.svg b/res/image/Index/u7453.svg deleted file mode 100644 index 603c496..0000000 --- a/res/image/Index/u7453.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7458.svg b/res/image/Index/u7458.svg deleted file mode 100644 index b31087b..0000000 --- a/res/image/Index/u7458.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7488.svg b/res/image/Index/u7488.svg deleted file mode 100644 index 8baf439..0000000 --- a/res/image/Index/u7488.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7491.svg b/res/image/Index/u7491.svg deleted file mode 100644 index 3e41c10..0000000 --- a/res/image/Index/u7491.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7538.svg b/res/image/Index/u7538.svg deleted file mode 100644 index 417077d..0000000 --- a/res/image/Index/u7538.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u794.svg b/res/image/Index/u794.svg deleted file mode 100644 index e12cff7..0000000 --- a/res/image/Index/u794.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/AutoCalibrationXC.pro b/AutoCalibrationXC.pro index 6bcb335..7790b37 100644 --- a/AutoCalibrationXC.pro +++ b/AutoCalibrationXC.pro @@ -24,11 +24,6 @@ include(QPagedTable/QPagedTable.pri) SOURCES += main.cpp -SOURCES += MainWindow.cpp - -HEADERS += MainWindow.h - -FORMS += MainWindow.ui RC_ICONS = res/autoCalibration.ico diff --git a/MainWindow.cpp b/MainWindow.cpp deleted file mode 100644 index ff126e8..0000000 --- a/MainWindow.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#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/MainWindow.h b/MainWindow.h deleted file mode 100644 index 4643e32..0000000 --- a/MainWindow.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#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; -}; -#endif // MAINWINDOW_H diff --git a/MainWindow.ui b/MainWindow.ui deleted file mode 100644 index b232854..0000000 --- a/MainWindow.ui +++ /dev/null @@ -1,22 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 800 - 600 - - - - MainWindow - - - - - - - - diff --git a/frame/CustomMessageBox.ui b/frame/CustomMessageBox.ui index 336be54..b545d74 100644 --- a/frame/CustomMessageBox.ui +++ b/frame/CustomMessageBox.ui @@ -84,8 +84,8 @@ - - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + + :/image/msgbox/icon_box_close.png:/image/msgbox/icon_box_close.png @@ -134,7 +134,7 @@ - :/image/msgbox/icon_box_success.png + :/image/msgbox/icon_box_success.png Qt::AlignCenter @@ -265,6 +265,8 @@ - + + + diff --git a/frame/MainWindowForm.cpp b/frame/MainWindowForm.cpp index 2ded44b..ec82cd7 100644 --- a/frame/MainWindowForm.cpp +++ b/frame/MainWindowForm.cpp @@ -1,6 +1,8 @@ #include "MainWindowForm.h" #include "ui_MainWindowForm.h" +#include + MainWindowForm::MainWindowForm(QWidget *parent) : FramelessWindow(parent), ui(new Ui::MainWindowForm) @@ -12,7 +14,7 @@ initMenuWidgets(); initFunctionButtons(); - // 每秒更新 界面上没有地方能摆 暂时先不启动定时器 + // 每秒更新 connect(TimeCounterUtil::getInstance().clockTimer, &QTimer::timeout, this, &MainWindowForm::onUpdateTimestampHandler); TimeCounterUtil::getInstance().clockTimer->start(1000); @@ -34,6 +36,7 @@ void MainWindowForm::initForm() { setWindowFlags(Qt::FramelessWindowHint); // 设置全屏 + setWindowState(Qt::WindowState::WindowMaximized); this->setTitleBar(ui->wdgtTop); // 设置窗口位置和大小 move(0, 0); @@ -120,6 +123,22 @@ setWindowState(Qt::WindowMinimized | windowState()); } +void MainWindowForm::on_btnMaxWin_clicked() +{ + QScreen *screen = QGuiApplication::primaryScreen(); + QRect screenSize = screen->availableGeometry(); // 可用区域(排除任务栏) + + if (this->isMaximized()) { + resize(screenSize.width() * 0.8, screenSize.height() * 0.8); + move(QRandomGenerator::global()->bounded(10, 100), QRandomGenerator::global()->bounded(10, 50)); + this->showNormal(); + } else { + resize(screenSize.width(), screenSize.height()); + move(0, 0); + this->showMaximized(); + } +} + void MainWindowForm::on_btnCloseWin_clicked() { // 创建一个消息框 @@ -146,18 +165,9 @@ ui->labelTime->setText(now.toString("yyyy-MM-dd HH:mm:ss")); } -void MainWindowForm::on_btnMenuMax_clicked() -{ - if (this->isMaximized()) { - this->showNormal(); - } else { - this->showMaximized(); - } -} - void MainWindowForm::titleDblClick() { - on_btnMenuMax_clicked(); + on_btnMaxWin_clicked(); } void MainWindowForm::onMenuButtonsEabled(bool enable) { diff --git a/frame/MainWindowForm.h b/frame/MainWindowForm.h index 4d206b1..9b4eae4 100644 --- a/frame/MainWindowForm.h +++ b/frame/MainWindowForm.h @@ -45,11 +45,11 @@ private slots: void on_btnMinWin_clicked(); + void on_btnMaxWin_clicked(); void on_btnCloseWin_clicked(); void onFunctionButtonsAction(); void onUpdateTimestampHandler(); - void on_btnMenuMax_clicked(); void titleDblClick(); void onMenuButtonsEabled(bool enable); diff --git a/frame/MainWindowForm.ui b/frame/MainWindowForm.ui index bd42122..f37d171 100644 --- a/frame/MainWindowForm.ui +++ b/frame/MainWindowForm.ui @@ -41,7 +41,7 @@ 0 - 120 + 100 @@ -58,7 +58,7 @@ 20 - 0 + 20 @@ -88,8 +88,8 @@ - 120 - 120 + 150 + 100 @@ -107,6 +107,22 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + @@ -158,7 +174,7 @@ 100 - 84 + 72 @@ -166,7 +182,8 @@ - :/image/main/calibration.png:/image/main/calibration.png + :/image/main/icon_menu_calibration.png + :/image/main/icon_menu_calibration_selected.png:/image/main/icon_menu_calibration.png @@ -184,7 +201,7 @@ 100 - 84 + 72 @@ -192,7 +209,8 @@ - :/image/main/rawDataRecord.png:/image/main/rawDataRecord.png + :/image/main/icon_menu_check.png + :/image/main/icon_menu_check_selected.png:/image/main/icon_menu_check.png @@ -210,7 +228,7 @@ 100 - 84 + 72 @@ -218,7 +236,8 @@ - :/image/main/fileRes.png:/image/main/fileRes.png + :/image/main/icon_menu_infomation.png + :/image/main/icon_menu_infomation_checked.png:/image/main/icon_menu_infomation.png @@ -235,10 +254,147 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 50 + 20 + + + + + - 320 + 240 + 16777215 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 5 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + :/image/main/iconTemp.png + + + + + + + 34.5℃ + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + + + + :/image/main/iconHumi.png + + + + + + + 25%Rh + + + + + + + + + + + + + + 240 16777215 @@ -308,7 +464,7 @@ - :/image/main/icon_setting_p.png:/image/main/icon_setting_p.png + :/image/main/icon_setting.png:/image/main/icon_setting.png @@ -334,7 +490,33 @@ - :/image/main/icon_min_p.png:/image/main/icon_min_p.png + :/image/main/icon_min.png:/image/main/icon_min.png + + + + 32 + 32 + + + + + + + + + 40 + 40 + + + + 最小化 + + + + + + + :/image/main/icon_max.png:/image/main/icon_max.png @@ -360,7 +542,7 @@ - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + :/image/main/icon_close.png:/image/main/icon_close.png @@ -426,87 +608,9 @@ - - - - - 0 - 30 - - - - - 20 - - - 0 - - - 0 - - - 40 - - - 0 - - - - - Qt::Horizontal - - - - 1289 - 20 - - - - - - - - - - - - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 20 - - - - - - - - - - - - - - wdgtContent wdgtTop - wdgtFoot diff --git a/infomation/InfoMainForm.cpp b/infomation/InfoMainForm.cpp index c001199..5d0ffc8 100644 --- a/infomation/InfoMainForm.cpp +++ b/infomation/InfoMainForm.cpp @@ -21,9 +21,13 @@ void InfoMainForm::initForm() { + // 加载样式表 + QString qssStyle = QssFileUtils::loadQssFileContent(QApplication::applicationDirPath() + "/qss/infoMain.css"); + if (qssStyle.isEmpty() == false) { + this->setStyleSheet(qssStyle); // 仅本窗口生效 + } - - + ui->scrollArea->setWindowFlags(Qt::FramelessWindowHint); // 设置无边框 } void InfoMainForm::initSubMenuForms() { diff --git a/infomation/InfoMainForm.ui b/infomation/InfoMainForm.ui index 958a6b2..d9066dd 100644 --- a/infomation/InfoMainForm.ui +++ b/infomation/InfoMainForm.ui @@ -90,7 +90,7 @@ - 280 + 295 48 @@ -103,7 +103,7 @@ - 280 + 295 48 @@ -116,7 +116,7 @@ - 280 + 295 48 @@ -129,7 +129,7 @@ - 280 + 295 48 @@ -142,7 +142,7 @@ - 280 + 295 48 @@ -155,7 +155,7 @@ - 280 + 295 48 @@ -168,7 +168,7 @@ - 280 + 295 48 @@ -181,7 +181,7 @@ - 280 + 295 48 @@ -194,7 +194,7 @@ - 280 + 295 48 @@ -207,7 +207,7 @@ - 280 + 295 48 @@ -220,7 +220,7 @@ - 280 + 295 48 @@ -233,7 +233,7 @@ - 280 + 295 48 @@ -246,7 +246,7 @@ - 280 + 295 48 diff --git a/infomation/task/DeptTaskForm.cpp b/infomation/task/DeptTaskForm.cpp index ea21a9f..cc6bf31 100644 --- a/infomation/task/DeptTaskForm.cpp +++ b/infomation/task/DeptTaskForm.cpp @@ -18,12 +18,17 @@ delete ui; } -void DeptTaskForm::showEvent(QShowEvent *event) +void DeptTaskForm::showEvent(QShowEvent * event) { ui->tableDeptTask->adjustTableWidth(); getDeptTaskList(0); } +void DeptTaskForm::resizeEvent(QResizeEvent * event) +{ + ui->tableDeptTask->adjustTableWidth(); +} + void DeptTaskForm::initFormTable() { // 初始化查询条件 diff --git a/infomation/task/DeptTaskForm.h b/infomation/task/DeptTaskForm.h index 1055c36..3c1ad5b 100644 --- a/infomation/task/DeptTaskForm.h +++ b/infomation/task/DeptTaskForm.h @@ -21,7 +21,8 @@ ~DeptTaskForm(); protected: - void showEvent(QShowEvent *event) override; + void showEvent(QShowEvent * event) override; + void resizeEvent(QResizeEvent * event) override; private: Ui::DeptTaskForm *ui; diff --git a/main.cpp b/main.cpp index 525387e..0b78c87 100644 --- a/main.cpp +++ b/main.cpp @@ -1,5 +1,3 @@ -#include "MainWindow.h" - #include #include diff --git a/res/image/Index/u1176.svg b/res/image/Index/u1176.svg deleted file mode 100644 index c81ce8a..0000000 --- a/res/image/Index/u1176.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1180.svg b/res/image/Index/u1180.svg deleted file mode 100644 index 2ef24ab..0000000 --- a/res/image/Index/u1180.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1220.svg b/res/image/Index/u1220.svg deleted file mode 100644 index 43452aa..0000000 --- a/res/image/Index/u1220.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2158.svg b/res/image/Index/u2158.svg deleted file mode 100644 index fd249e0..0000000 --- a/res/image/Index/u2158.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u2188.svg b/res/image/Index/u2188.svg deleted file mode 100644 index 34f53c4..0000000 --- a/res/image/Index/u2188.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2189.svg b/res/image/Index/u2189.svg deleted file mode 100644 index 01a6bbb..0000000 --- a/res/image/Index/u2189.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2324.svg b/res/image/Index/u2324.svg deleted file mode 100644 index 797f1c5..0000000 --- a/res/image/Index/u2324.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2325.svg b/res/image/Index/u2325.svg deleted file mode 100644 index fefe01b..0000000 --- a/res/image/Index/u2325.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u642.svg b/res/image/Index/u642.svg deleted file mode 100644 index 33c9e0a..0000000 --- a/res/image/Index/u642.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u7406.svg b/res/image/Index/u7406.svg deleted file mode 100644 index 8a7a6d9..0000000 --- a/res/image/Index/u7406.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7453.svg b/res/image/Index/u7453.svg deleted file mode 100644 index 603c496..0000000 --- a/res/image/Index/u7453.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7458.svg b/res/image/Index/u7458.svg deleted file mode 100644 index b31087b..0000000 --- a/res/image/Index/u7458.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7488.svg b/res/image/Index/u7488.svg deleted file mode 100644 index 8baf439..0000000 --- a/res/image/Index/u7488.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7491.svg b/res/image/Index/u7491.svg deleted file mode 100644 index 3e41c10..0000000 --- a/res/image/Index/u7491.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7538.svg b/res/image/Index/u7538.svg deleted file mode 100644 index 417077d..0000000 --- a/res/image/Index/u7538.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u794.svg b/res/image/Index/u794.svg deleted file mode 100644 index e12cff7..0000000 --- a/res/image/Index/u794.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u8448.svg b/res/image/Index/u8448.svg deleted file mode 100644 index 7f6f4c0..0000000 --- a/res/image/Index/u8448.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/AutoCalibrationXC.pro b/AutoCalibrationXC.pro index 6bcb335..7790b37 100644 --- a/AutoCalibrationXC.pro +++ b/AutoCalibrationXC.pro @@ -24,11 +24,6 @@ include(QPagedTable/QPagedTable.pri) SOURCES += main.cpp -SOURCES += MainWindow.cpp - -HEADERS += MainWindow.h - -FORMS += MainWindow.ui RC_ICONS = res/autoCalibration.ico diff --git a/MainWindow.cpp b/MainWindow.cpp deleted file mode 100644 index ff126e8..0000000 --- a/MainWindow.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#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/MainWindow.h b/MainWindow.h deleted file mode 100644 index 4643e32..0000000 --- a/MainWindow.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#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; -}; -#endif // MAINWINDOW_H diff --git a/MainWindow.ui b/MainWindow.ui deleted file mode 100644 index b232854..0000000 --- a/MainWindow.ui +++ /dev/null @@ -1,22 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 800 - 600 - - - - MainWindow - - - - - - - - diff --git a/frame/CustomMessageBox.ui b/frame/CustomMessageBox.ui index 336be54..b545d74 100644 --- a/frame/CustomMessageBox.ui +++ b/frame/CustomMessageBox.ui @@ -84,8 +84,8 @@ - - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + + :/image/msgbox/icon_box_close.png:/image/msgbox/icon_box_close.png @@ -134,7 +134,7 @@ - :/image/msgbox/icon_box_success.png + :/image/msgbox/icon_box_success.png Qt::AlignCenter @@ -265,6 +265,8 @@ - + + + diff --git a/frame/MainWindowForm.cpp b/frame/MainWindowForm.cpp index 2ded44b..ec82cd7 100644 --- a/frame/MainWindowForm.cpp +++ b/frame/MainWindowForm.cpp @@ -1,6 +1,8 @@ #include "MainWindowForm.h" #include "ui_MainWindowForm.h" +#include + MainWindowForm::MainWindowForm(QWidget *parent) : FramelessWindow(parent), ui(new Ui::MainWindowForm) @@ -12,7 +14,7 @@ initMenuWidgets(); initFunctionButtons(); - // 每秒更新 界面上没有地方能摆 暂时先不启动定时器 + // 每秒更新 connect(TimeCounterUtil::getInstance().clockTimer, &QTimer::timeout, this, &MainWindowForm::onUpdateTimestampHandler); TimeCounterUtil::getInstance().clockTimer->start(1000); @@ -34,6 +36,7 @@ void MainWindowForm::initForm() { setWindowFlags(Qt::FramelessWindowHint); // 设置全屏 + setWindowState(Qt::WindowState::WindowMaximized); this->setTitleBar(ui->wdgtTop); // 设置窗口位置和大小 move(0, 0); @@ -120,6 +123,22 @@ setWindowState(Qt::WindowMinimized | windowState()); } +void MainWindowForm::on_btnMaxWin_clicked() +{ + QScreen *screen = QGuiApplication::primaryScreen(); + QRect screenSize = screen->availableGeometry(); // 可用区域(排除任务栏) + + if (this->isMaximized()) { + resize(screenSize.width() * 0.8, screenSize.height() * 0.8); + move(QRandomGenerator::global()->bounded(10, 100), QRandomGenerator::global()->bounded(10, 50)); + this->showNormal(); + } else { + resize(screenSize.width(), screenSize.height()); + move(0, 0); + this->showMaximized(); + } +} + void MainWindowForm::on_btnCloseWin_clicked() { // 创建一个消息框 @@ -146,18 +165,9 @@ ui->labelTime->setText(now.toString("yyyy-MM-dd HH:mm:ss")); } -void MainWindowForm::on_btnMenuMax_clicked() -{ - if (this->isMaximized()) { - this->showNormal(); - } else { - this->showMaximized(); - } -} - void MainWindowForm::titleDblClick() { - on_btnMenuMax_clicked(); + on_btnMaxWin_clicked(); } void MainWindowForm::onMenuButtonsEabled(bool enable) { diff --git a/frame/MainWindowForm.h b/frame/MainWindowForm.h index 4d206b1..9b4eae4 100644 --- a/frame/MainWindowForm.h +++ b/frame/MainWindowForm.h @@ -45,11 +45,11 @@ private slots: void on_btnMinWin_clicked(); + void on_btnMaxWin_clicked(); void on_btnCloseWin_clicked(); void onFunctionButtonsAction(); void onUpdateTimestampHandler(); - void on_btnMenuMax_clicked(); void titleDblClick(); void onMenuButtonsEabled(bool enable); diff --git a/frame/MainWindowForm.ui b/frame/MainWindowForm.ui index bd42122..f37d171 100644 --- a/frame/MainWindowForm.ui +++ b/frame/MainWindowForm.ui @@ -41,7 +41,7 @@ 0 - 120 + 100 @@ -58,7 +58,7 @@ 20 - 0 + 20 @@ -88,8 +88,8 @@ - 120 - 120 + 150 + 100 @@ -107,6 +107,22 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + @@ -158,7 +174,7 @@ 100 - 84 + 72 @@ -166,7 +182,8 @@ - :/image/main/calibration.png:/image/main/calibration.png + :/image/main/icon_menu_calibration.png + :/image/main/icon_menu_calibration_selected.png:/image/main/icon_menu_calibration.png @@ -184,7 +201,7 @@ 100 - 84 + 72 @@ -192,7 +209,8 @@ - :/image/main/rawDataRecord.png:/image/main/rawDataRecord.png + :/image/main/icon_menu_check.png + :/image/main/icon_menu_check_selected.png:/image/main/icon_menu_check.png @@ -210,7 +228,7 @@ 100 - 84 + 72 @@ -218,7 +236,8 @@ - :/image/main/fileRes.png:/image/main/fileRes.png + :/image/main/icon_menu_infomation.png + :/image/main/icon_menu_infomation_checked.png:/image/main/icon_menu_infomation.png @@ -235,10 +254,147 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 50 + 20 + + + + + - 320 + 240 + 16777215 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 5 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + :/image/main/iconTemp.png + + + + + + + 34.5℃ + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + + + + :/image/main/iconHumi.png + + + + + + + 25%Rh + + + + + + + + + + + + + + 240 16777215 @@ -308,7 +464,7 @@ - :/image/main/icon_setting_p.png:/image/main/icon_setting_p.png + :/image/main/icon_setting.png:/image/main/icon_setting.png @@ -334,7 +490,33 @@ - :/image/main/icon_min_p.png:/image/main/icon_min_p.png + :/image/main/icon_min.png:/image/main/icon_min.png + + + + 32 + 32 + + + + + + + + + 40 + 40 + + + + 最小化 + + + + + + + :/image/main/icon_max.png:/image/main/icon_max.png @@ -360,7 +542,7 @@ - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + :/image/main/icon_close.png:/image/main/icon_close.png @@ -426,87 +608,9 @@ - - - - - 0 - 30 - - - - - 20 - - - 0 - - - 0 - - - 40 - - - 0 - - - - - Qt::Horizontal - - - - 1289 - 20 - - - - - - - - - - - - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 20 - - - - - - - - - - - - - - wdgtContent wdgtTop - wdgtFoot diff --git a/infomation/InfoMainForm.cpp b/infomation/InfoMainForm.cpp index c001199..5d0ffc8 100644 --- a/infomation/InfoMainForm.cpp +++ b/infomation/InfoMainForm.cpp @@ -21,9 +21,13 @@ void InfoMainForm::initForm() { + // 加载样式表 + QString qssStyle = QssFileUtils::loadQssFileContent(QApplication::applicationDirPath() + "/qss/infoMain.css"); + if (qssStyle.isEmpty() == false) { + this->setStyleSheet(qssStyle); // 仅本窗口生效 + } - - + ui->scrollArea->setWindowFlags(Qt::FramelessWindowHint); // 设置无边框 } void InfoMainForm::initSubMenuForms() { diff --git a/infomation/InfoMainForm.ui b/infomation/InfoMainForm.ui index 958a6b2..d9066dd 100644 --- a/infomation/InfoMainForm.ui +++ b/infomation/InfoMainForm.ui @@ -90,7 +90,7 @@ - 280 + 295 48 @@ -103,7 +103,7 @@ - 280 + 295 48 @@ -116,7 +116,7 @@ - 280 + 295 48 @@ -129,7 +129,7 @@ - 280 + 295 48 @@ -142,7 +142,7 @@ - 280 + 295 48 @@ -155,7 +155,7 @@ - 280 + 295 48 @@ -168,7 +168,7 @@ - 280 + 295 48 @@ -181,7 +181,7 @@ - 280 + 295 48 @@ -194,7 +194,7 @@ - 280 + 295 48 @@ -207,7 +207,7 @@ - 280 + 295 48 @@ -220,7 +220,7 @@ - 280 + 295 48 @@ -233,7 +233,7 @@ - 280 + 295 48 @@ -246,7 +246,7 @@ - 280 + 295 48 diff --git a/infomation/task/DeptTaskForm.cpp b/infomation/task/DeptTaskForm.cpp index ea21a9f..cc6bf31 100644 --- a/infomation/task/DeptTaskForm.cpp +++ b/infomation/task/DeptTaskForm.cpp @@ -18,12 +18,17 @@ delete ui; } -void DeptTaskForm::showEvent(QShowEvent *event) +void DeptTaskForm::showEvent(QShowEvent * event) { ui->tableDeptTask->adjustTableWidth(); getDeptTaskList(0); } +void DeptTaskForm::resizeEvent(QResizeEvent * event) +{ + ui->tableDeptTask->adjustTableWidth(); +} + void DeptTaskForm::initFormTable() { // 初始化查询条件 diff --git a/infomation/task/DeptTaskForm.h b/infomation/task/DeptTaskForm.h index 1055c36..3c1ad5b 100644 --- a/infomation/task/DeptTaskForm.h +++ b/infomation/task/DeptTaskForm.h @@ -21,7 +21,8 @@ ~DeptTaskForm(); protected: - void showEvent(QShowEvent *event) override; + void showEvent(QShowEvent * event) override; + void resizeEvent(QResizeEvent * event) override; private: Ui::DeptTaskForm *ui; diff --git a/main.cpp b/main.cpp index 525387e..0b78c87 100644 --- a/main.cpp +++ b/main.cpp @@ -1,5 +1,3 @@ -#include "MainWindow.h" - #include #include diff --git a/res/image/Index/u1176.svg b/res/image/Index/u1176.svg deleted file mode 100644 index c81ce8a..0000000 --- a/res/image/Index/u1176.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1180.svg b/res/image/Index/u1180.svg deleted file mode 100644 index 2ef24ab..0000000 --- a/res/image/Index/u1180.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1220.svg b/res/image/Index/u1220.svg deleted file mode 100644 index 43452aa..0000000 --- a/res/image/Index/u1220.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2158.svg b/res/image/Index/u2158.svg deleted file mode 100644 index fd249e0..0000000 --- a/res/image/Index/u2158.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u2188.svg b/res/image/Index/u2188.svg deleted file mode 100644 index 34f53c4..0000000 --- a/res/image/Index/u2188.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2189.svg b/res/image/Index/u2189.svg deleted file mode 100644 index 01a6bbb..0000000 --- a/res/image/Index/u2189.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2324.svg b/res/image/Index/u2324.svg deleted file mode 100644 index 797f1c5..0000000 --- a/res/image/Index/u2324.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2325.svg b/res/image/Index/u2325.svg deleted file mode 100644 index fefe01b..0000000 --- a/res/image/Index/u2325.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u642.svg b/res/image/Index/u642.svg deleted file mode 100644 index 33c9e0a..0000000 --- a/res/image/Index/u642.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u7406.svg b/res/image/Index/u7406.svg deleted file mode 100644 index 8a7a6d9..0000000 --- a/res/image/Index/u7406.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7453.svg b/res/image/Index/u7453.svg deleted file mode 100644 index 603c496..0000000 --- a/res/image/Index/u7453.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7458.svg b/res/image/Index/u7458.svg deleted file mode 100644 index b31087b..0000000 --- a/res/image/Index/u7458.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7488.svg b/res/image/Index/u7488.svg deleted file mode 100644 index 8baf439..0000000 --- a/res/image/Index/u7488.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7491.svg b/res/image/Index/u7491.svg deleted file mode 100644 index 3e41c10..0000000 --- a/res/image/Index/u7491.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7538.svg b/res/image/Index/u7538.svg deleted file mode 100644 index 417077d..0000000 --- a/res/image/Index/u7538.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u794.svg b/res/image/Index/u794.svg deleted file mode 100644 index e12cff7..0000000 --- a/res/image/Index/u794.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u8448.svg b/res/image/Index/u8448.svg deleted file mode 100644 index 7f6f4c0..0000000 --- a/res/image/Index/u8448.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u8458.svg b/res/image/Index/u8458.svg deleted file mode 100644 index 6d04a12..0000000 --- a/res/image/Index/u8458.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/AutoCalibrationXC.pro b/AutoCalibrationXC.pro index 6bcb335..7790b37 100644 --- a/AutoCalibrationXC.pro +++ b/AutoCalibrationXC.pro @@ -24,11 +24,6 @@ include(QPagedTable/QPagedTable.pri) SOURCES += main.cpp -SOURCES += MainWindow.cpp - -HEADERS += MainWindow.h - -FORMS += MainWindow.ui RC_ICONS = res/autoCalibration.ico diff --git a/MainWindow.cpp b/MainWindow.cpp deleted file mode 100644 index ff126e8..0000000 --- a/MainWindow.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#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/MainWindow.h b/MainWindow.h deleted file mode 100644 index 4643e32..0000000 --- a/MainWindow.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#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; -}; -#endif // MAINWINDOW_H diff --git a/MainWindow.ui b/MainWindow.ui deleted file mode 100644 index b232854..0000000 --- a/MainWindow.ui +++ /dev/null @@ -1,22 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 800 - 600 - - - - MainWindow - - - - - - - - diff --git a/frame/CustomMessageBox.ui b/frame/CustomMessageBox.ui index 336be54..b545d74 100644 --- a/frame/CustomMessageBox.ui +++ b/frame/CustomMessageBox.ui @@ -84,8 +84,8 @@ - - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + + :/image/msgbox/icon_box_close.png:/image/msgbox/icon_box_close.png @@ -134,7 +134,7 @@ - :/image/msgbox/icon_box_success.png + :/image/msgbox/icon_box_success.png Qt::AlignCenter @@ -265,6 +265,8 @@ - + + + diff --git a/frame/MainWindowForm.cpp b/frame/MainWindowForm.cpp index 2ded44b..ec82cd7 100644 --- a/frame/MainWindowForm.cpp +++ b/frame/MainWindowForm.cpp @@ -1,6 +1,8 @@ #include "MainWindowForm.h" #include "ui_MainWindowForm.h" +#include + MainWindowForm::MainWindowForm(QWidget *parent) : FramelessWindow(parent), ui(new Ui::MainWindowForm) @@ -12,7 +14,7 @@ initMenuWidgets(); initFunctionButtons(); - // 每秒更新 界面上没有地方能摆 暂时先不启动定时器 + // 每秒更新 connect(TimeCounterUtil::getInstance().clockTimer, &QTimer::timeout, this, &MainWindowForm::onUpdateTimestampHandler); TimeCounterUtil::getInstance().clockTimer->start(1000); @@ -34,6 +36,7 @@ void MainWindowForm::initForm() { setWindowFlags(Qt::FramelessWindowHint); // 设置全屏 + setWindowState(Qt::WindowState::WindowMaximized); this->setTitleBar(ui->wdgtTop); // 设置窗口位置和大小 move(0, 0); @@ -120,6 +123,22 @@ setWindowState(Qt::WindowMinimized | windowState()); } +void MainWindowForm::on_btnMaxWin_clicked() +{ + QScreen *screen = QGuiApplication::primaryScreen(); + QRect screenSize = screen->availableGeometry(); // 可用区域(排除任务栏) + + if (this->isMaximized()) { + resize(screenSize.width() * 0.8, screenSize.height() * 0.8); + move(QRandomGenerator::global()->bounded(10, 100), QRandomGenerator::global()->bounded(10, 50)); + this->showNormal(); + } else { + resize(screenSize.width(), screenSize.height()); + move(0, 0); + this->showMaximized(); + } +} + void MainWindowForm::on_btnCloseWin_clicked() { // 创建一个消息框 @@ -146,18 +165,9 @@ ui->labelTime->setText(now.toString("yyyy-MM-dd HH:mm:ss")); } -void MainWindowForm::on_btnMenuMax_clicked() -{ - if (this->isMaximized()) { - this->showNormal(); - } else { - this->showMaximized(); - } -} - void MainWindowForm::titleDblClick() { - on_btnMenuMax_clicked(); + on_btnMaxWin_clicked(); } void MainWindowForm::onMenuButtonsEabled(bool enable) { diff --git a/frame/MainWindowForm.h b/frame/MainWindowForm.h index 4d206b1..9b4eae4 100644 --- a/frame/MainWindowForm.h +++ b/frame/MainWindowForm.h @@ -45,11 +45,11 @@ private slots: void on_btnMinWin_clicked(); + void on_btnMaxWin_clicked(); void on_btnCloseWin_clicked(); void onFunctionButtonsAction(); void onUpdateTimestampHandler(); - void on_btnMenuMax_clicked(); void titleDblClick(); void onMenuButtonsEabled(bool enable); diff --git a/frame/MainWindowForm.ui b/frame/MainWindowForm.ui index bd42122..f37d171 100644 --- a/frame/MainWindowForm.ui +++ b/frame/MainWindowForm.ui @@ -41,7 +41,7 @@ 0 - 120 + 100 @@ -58,7 +58,7 @@ 20 - 0 + 20 @@ -88,8 +88,8 @@ - 120 - 120 + 150 + 100 @@ -107,6 +107,22 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + @@ -158,7 +174,7 @@ 100 - 84 + 72 @@ -166,7 +182,8 @@ - :/image/main/calibration.png:/image/main/calibration.png + :/image/main/icon_menu_calibration.png + :/image/main/icon_menu_calibration_selected.png:/image/main/icon_menu_calibration.png @@ -184,7 +201,7 @@ 100 - 84 + 72 @@ -192,7 +209,8 @@ - :/image/main/rawDataRecord.png:/image/main/rawDataRecord.png + :/image/main/icon_menu_check.png + :/image/main/icon_menu_check_selected.png:/image/main/icon_menu_check.png @@ -210,7 +228,7 @@ 100 - 84 + 72 @@ -218,7 +236,8 @@ - :/image/main/fileRes.png:/image/main/fileRes.png + :/image/main/icon_menu_infomation.png + :/image/main/icon_menu_infomation_checked.png:/image/main/icon_menu_infomation.png @@ -235,10 +254,147 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 50 + 20 + + + + + - 320 + 240 + 16777215 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 5 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + :/image/main/iconTemp.png + + + + + + + 34.5℃ + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + + + + :/image/main/iconHumi.png + + + + + + + 25%Rh + + + + + + + + + + + + + + 240 16777215 @@ -308,7 +464,7 @@ - :/image/main/icon_setting_p.png:/image/main/icon_setting_p.png + :/image/main/icon_setting.png:/image/main/icon_setting.png @@ -334,7 +490,33 @@ - :/image/main/icon_min_p.png:/image/main/icon_min_p.png + :/image/main/icon_min.png:/image/main/icon_min.png + + + + 32 + 32 + + + + + + + + + 40 + 40 + + + + 最小化 + + + + + + + :/image/main/icon_max.png:/image/main/icon_max.png @@ -360,7 +542,7 @@ - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + :/image/main/icon_close.png:/image/main/icon_close.png @@ -426,87 +608,9 @@ - - - - - 0 - 30 - - - - - 20 - - - 0 - - - 0 - - - 40 - - - 0 - - - - - Qt::Horizontal - - - - 1289 - 20 - - - - - - - - - - - - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 20 - - - - - - - - - - - - - - wdgtContent wdgtTop - wdgtFoot diff --git a/infomation/InfoMainForm.cpp b/infomation/InfoMainForm.cpp index c001199..5d0ffc8 100644 --- a/infomation/InfoMainForm.cpp +++ b/infomation/InfoMainForm.cpp @@ -21,9 +21,13 @@ void InfoMainForm::initForm() { + // 加载样式表 + QString qssStyle = QssFileUtils::loadQssFileContent(QApplication::applicationDirPath() + "/qss/infoMain.css"); + if (qssStyle.isEmpty() == false) { + this->setStyleSheet(qssStyle); // 仅本窗口生效 + } - - + ui->scrollArea->setWindowFlags(Qt::FramelessWindowHint); // 设置无边框 } void InfoMainForm::initSubMenuForms() { diff --git a/infomation/InfoMainForm.ui b/infomation/InfoMainForm.ui index 958a6b2..d9066dd 100644 --- a/infomation/InfoMainForm.ui +++ b/infomation/InfoMainForm.ui @@ -90,7 +90,7 @@ - 280 + 295 48 @@ -103,7 +103,7 @@ - 280 + 295 48 @@ -116,7 +116,7 @@ - 280 + 295 48 @@ -129,7 +129,7 @@ - 280 + 295 48 @@ -142,7 +142,7 @@ - 280 + 295 48 @@ -155,7 +155,7 @@ - 280 + 295 48 @@ -168,7 +168,7 @@ - 280 + 295 48 @@ -181,7 +181,7 @@ - 280 + 295 48 @@ -194,7 +194,7 @@ - 280 + 295 48 @@ -207,7 +207,7 @@ - 280 + 295 48 @@ -220,7 +220,7 @@ - 280 + 295 48 @@ -233,7 +233,7 @@ - 280 + 295 48 @@ -246,7 +246,7 @@ - 280 + 295 48 diff --git a/infomation/task/DeptTaskForm.cpp b/infomation/task/DeptTaskForm.cpp index ea21a9f..cc6bf31 100644 --- a/infomation/task/DeptTaskForm.cpp +++ b/infomation/task/DeptTaskForm.cpp @@ -18,12 +18,17 @@ delete ui; } -void DeptTaskForm::showEvent(QShowEvent *event) +void DeptTaskForm::showEvent(QShowEvent * event) { ui->tableDeptTask->adjustTableWidth(); getDeptTaskList(0); } +void DeptTaskForm::resizeEvent(QResizeEvent * event) +{ + ui->tableDeptTask->adjustTableWidth(); +} + void DeptTaskForm::initFormTable() { // 初始化查询条件 diff --git a/infomation/task/DeptTaskForm.h b/infomation/task/DeptTaskForm.h index 1055c36..3c1ad5b 100644 --- a/infomation/task/DeptTaskForm.h +++ b/infomation/task/DeptTaskForm.h @@ -21,7 +21,8 @@ ~DeptTaskForm(); protected: - void showEvent(QShowEvent *event) override; + void showEvent(QShowEvent * event) override; + void resizeEvent(QResizeEvent * event) override; private: Ui::DeptTaskForm *ui; diff --git a/main.cpp b/main.cpp index 525387e..0b78c87 100644 --- a/main.cpp +++ b/main.cpp @@ -1,5 +1,3 @@ -#include "MainWindow.h" - #include #include diff --git a/res/image/Index/u1176.svg b/res/image/Index/u1176.svg deleted file mode 100644 index c81ce8a..0000000 --- a/res/image/Index/u1176.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1180.svg b/res/image/Index/u1180.svg deleted file mode 100644 index 2ef24ab..0000000 --- a/res/image/Index/u1180.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1220.svg b/res/image/Index/u1220.svg deleted file mode 100644 index 43452aa..0000000 --- a/res/image/Index/u1220.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2158.svg b/res/image/Index/u2158.svg deleted file mode 100644 index fd249e0..0000000 --- a/res/image/Index/u2158.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u2188.svg b/res/image/Index/u2188.svg deleted file mode 100644 index 34f53c4..0000000 --- a/res/image/Index/u2188.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2189.svg b/res/image/Index/u2189.svg deleted file mode 100644 index 01a6bbb..0000000 --- a/res/image/Index/u2189.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2324.svg b/res/image/Index/u2324.svg deleted file mode 100644 index 797f1c5..0000000 --- a/res/image/Index/u2324.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2325.svg b/res/image/Index/u2325.svg deleted file mode 100644 index fefe01b..0000000 --- a/res/image/Index/u2325.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u642.svg b/res/image/Index/u642.svg deleted file mode 100644 index 33c9e0a..0000000 --- a/res/image/Index/u642.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u7406.svg b/res/image/Index/u7406.svg deleted file mode 100644 index 8a7a6d9..0000000 --- a/res/image/Index/u7406.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7453.svg b/res/image/Index/u7453.svg deleted file mode 100644 index 603c496..0000000 --- a/res/image/Index/u7453.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7458.svg b/res/image/Index/u7458.svg deleted file mode 100644 index b31087b..0000000 --- a/res/image/Index/u7458.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7488.svg b/res/image/Index/u7488.svg deleted file mode 100644 index 8baf439..0000000 --- a/res/image/Index/u7488.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7491.svg b/res/image/Index/u7491.svg deleted file mode 100644 index 3e41c10..0000000 --- a/res/image/Index/u7491.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7538.svg b/res/image/Index/u7538.svg deleted file mode 100644 index 417077d..0000000 --- a/res/image/Index/u7538.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u794.svg b/res/image/Index/u794.svg deleted file mode 100644 index e12cff7..0000000 --- a/res/image/Index/u794.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u8448.svg b/res/image/Index/u8448.svg deleted file mode 100644 index 7f6f4c0..0000000 --- a/res/image/Index/u8448.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u8458.svg b/res/image/Index/u8458.svg deleted file mode 100644 index 6d04a12..0000000 --- a/res/image/Index/u8458.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/main/bg_banner.png b/res/image/main/bg_banner.png new file mode 100644 index 0000000..26ddffd --- /dev/null +++ b/res/image/main/bg_banner.png Binary files differ diff --git a/AutoCalibrationXC.pro b/AutoCalibrationXC.pro index 6bcb335..7790b37 100644 --- a/AutoCalibrationXC.pro +++ b/AutoCalibrationXC.pro @@ -24,11 +24,6 @@ include(QPagedTable/QPagedTable.pri) SOURCES += main.cpp -SOURCES += MainWindow.cpp - -HEADERS += MainWindow.h - -FORMS += MainWindow.ui RC_ICONS = res/autoCalibration.ico diff --git a/MainWindow.cpp b/MainWindow.cpp deleted file mode 100644 index ff126e8..0000000 --- a/MainWindow.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#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/MainWindow.h b/MainWindow.h deleted file mode 100644 index 4643e32..0000000 --- a/MainWindow.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#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; -}; -#endif // MAINWINDOW_H diff --git a/MainWindow.ui b/MainWindow.ui deleted file mode 100644 index b232854..0000000 --- a/MainWindow.ui +++ /dev/null @@ -1,22 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 800 - 600 - - - - MainWindow - - - - - - - - diff --git a/frame/CustomMessageBox.ui b/frame/CustomMessageBox.ui index 336be54..b545d74 100644 --- a/frame/CustomMessageBox.ui +++ b/frame/CustomMessageBox.ui @@ -84,8 +84,8 @@ - - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + + :/image/msgbox/icon_box_close.png:/image/msgbox/icon_box_close.png @@ -134,7 +134,7 @@ - :/image/msgbox/icon_box_success.png + :/image/msgbox/icon_box_success.png Qt::AlignCenter @@ -265,6 +265,8 @@ - + + + diff --git a/frame/MainWindowForm.cpp b/frame/MainWindowForm.cpp index 2ded44b..ec82cd7 100644 --- a/frame/MainWindowForm.cpp +++ b/frame/MainWindowForm.cpp @@ -1,6 +1,8 @@ #include "MainWindowForm.h" #include "ui_MainWindowForm.h" +#include + MainWindowForm::MainWindowForm(QWidget *parent) : FramelessWindow(parent), ui(new Ui::MainWindowForm) @@ -12,7 +14,7 @@ initMenuWidgets(); initFunctionButtons(); - // 每秒更新 界面上没有地方能摆 暂时先不启动定时器 + // 每秒更新 connect(TimeCounterUtil::getInstance().clockTimer, &QTimer::timeout, this, &MainWindowForm::onUpdateTimestampHandler); TimeCounterUtil::getInstance().clockTimer->start(1000); @@ -34,6 +36,7 @@ void MainWindowForm::initForm() { setWindowFlags(Qt::FramelessWindowHint); // 设置全屏 + setWindowState(Qt::WindowState::WindowMaximized); this->setTitleBar(ui->wdgtTop); // 设置窗口位置和大小 move(0, 0); @@ -120,6 +123,22 @@ setWindowState(Qt::WindowMinimized | windowState()); } +void MainWindowForm::on_btnMaxWin_clicked() +{ + QScreen *screen = QGuiApplication::primaryScreen(); + QRect screenSize = screen->availableGeometry(); // 可用区域(排除任务栏) + + if (this->isMaximized()) { + resize(screenSize.width() * 0.8, screenSize.height() * 0.8); + move(QRandomGenerator::global()->bounded(10, 100), QRandomGenerator::global()->bounded(10, 50)); + this->showNormal(); + } else { + resize(screenSize.width(), screenSize.height()); + move(0, 0); + this->showMaximized(); + } +} + void MainWindowForm::on_btnCloseWin_clicked() { // 创建一个消息框 @@ -146,18 +165,9 @@ ui->labelTime->setText(now.toString("yyyy-MM-dd HH:mm:ss")); } -void MainWindowForm::on_btnMenuMax_clicked() -{ - if (this->isMaximized()) { - this->showNormal(); - } else { - this->showMaximized(); - } -} - void MainWindowForm::titleDblClick() { - on_btnMenuMax_clicked(); + on_btnMaxWin_clicked(); } void MainWindowForm::onMenuButtonsEabled(bool enable) { diff --git a/frame/MainWindowForm.h b/frame/MainWindowForm.h index 4d206b1..9b4eae4 100644 --- a/frame/MainWindowForm.h +++ b/frame/MainWindowForm.h @@ -45,11 +45,11 @@ private slots: void on_btnMinWin_clicked(); + void on_btnMaxWin_clicked(); void on_btnCloseWin_clicked(); void onFunctionButtonsAction(); void onUpdateTimestampHandler(); - void on_btnMenuMax_clicked(); void titleDblClick(); void onMenuButtonsEabled(bool enable); diff --git a/frame/MainWindowForm.ui b/frame/MainWindowForm.ui index bd42122..f37d171 100644 --- a/frame/MainWindowForm.ui +++ b/frame/MainWindowForm.ui @@ -41,7 +41,7 @@ 0 - 120 + 100 @@ -58,7 +58,7 @@ 20 - 0 + 20 @@ -88,8 +88,8 @@ - 120 - 120 + 150 + 100 @@ -107,6 +107,22 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + @@ -158,7 +174,7 @@ 100 - 84 + 72 @@ -166,7 +182,8 @@ - :/image/main/calibration.png:/image/main/calibration.png + :/image/main/icon_menu_calibration.png + :/image/main/icon_menu_calibration_selected.png:/image/main/icon_menu_calibration.png @@ -184,7 +201,7 @@ 100 - 84 + 72 @@ -192,7 +209,8 @@ - :/image/main/rawDataRecord.png:/image/main/rawDataRecord.png + :/image/main/icon_menu_check.png + :/image/main/icon_menu_check_selected.png:/image/main/icon_menu_check.png @@ -210,7 +228,7 @@ 100 - 84 + 72 @@ -218,7 +236,8 @@ - :/image/main/fileRes.png:/image/main/fileRes.png + :/image/main/icon_menu_infomation.png + :/image/main/icon_menu_infomation_checked.png:/image/main/icon_menu_infomation.png @@ -235,10 +254,147 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 50 + 20 + + + + + - 320 + 240 + 16777215 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 5 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + :/image/main/iconTemp.png + + + + + + + 34.5℃ + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + + + + :/image/main/iconHumi.png + + + + + + + 25%Rh + + + + + + + + + + + + + + 240 16777215 @@ -308,7 +464,7 @@ - :/image/main/icon_setting_p.png:/image/main/icon_setting_p.png + :/image/main/icon_setting.png:/image/main/icon_setting.png @@ -334,7 +490,33 @@ - :/image/main/icon_min_p.png:/image/main/icon_min_p.png + :/image/main/icon_min.png:/image/main/icon_min.png + + + + 32 + 32 + + + + + + + + + 40 + 40 + + + + 最小化 + + + + + + + :/image/main/icon_max.png:/image/main/icon_max.png @@ -360,7 +542,7 @@ - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + :/image/main/icon_close.png:/image/main/icon_close.png @@ -426,87 +608,9 @@ - - - - - 0 - 30 - - - - - 20 - - - 0 - - - 0 - - - 40 - - - 0 - - - - - Qt::Horizontal - - - - 1289 - 20 - - - - - - - - - - - - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 20 - - - - - - - - - - - - - - wdgtContent wdgtTop - wdgtFoot diff --git a/infomation/InfoMainForm.cpp b/infomation/InfoMainForm.cpp index c001199..5d0ffc8 100644 --- a/infomation/InfoMainForm.cpp +++ b/infomation/InfoMainForm.cpp @@ -21,9 +21,13 @@ void InfoMainForm::initForm() { + // 加载样式表 + QString qssStyle = QssFileUtils::loadQssFileContent(QApplication::applicationDirPath() + "/qss/infoMain.css"); + if (qssStyle.isEmpty() == false) { + this->setStyleSheet(qssStyle); // 仅本窗口生效 + } - - + ui->scrollArea->setWindowFlags(Qt::FramelessWindowHint); // 设置无边框 } void InfoMainForm::initSubMenuForms() { diff --git a/infomation/InfoMainForm.ui b/infomation/InfoMainForm.ui index 958a6b2..d9066dd 100644 --- a/infomation/InfoMainForm.ui +++ b/infomation/InfoMainForm.ui @@ -90,7 +90,7 @@ - 280 + 295 48 @@ -103,7 +103,7 @@ - 280 + 295 48 @@ -116,7 +116,7 @@ - 280 + 295 48 @@ -129,7 +129,7 @@ - 280 + 295 48 @@ -142,7 +142,7 @@ - 280 + 295 48 @@ -155,7 +155,7 @@ - 280 + 295 48 @@ -168,7 +168,7 @@ - 280 + 295 48 @@ -181,7 +181,7 @@ - 280 + 295 48 @@ -194,7 +194,7 @@ - 280 + 295 48 @@ -207,7 +207,7 @@ - 280 + 295 48 @@ -220,7 +220,7 @@ - 280 + 295 48 @@ -233,7 +233,7 @@ - 280 + 295 48 @@ -246,7 +246,7 @@ - 280 + 295 48 diff --git a/infomation/task/DeptTaskForm.cpp b/infomation/task/DeptTaskForm.cpp index ea21a9f..cc6bf31 100644 --- a/infomation/task/DeptTaskForm.cpp +++ b/infomation/task/DeptTaskForm.cpp @@ -18,12 +18,17 @@ delete ui; } -void DeptTaskForm::showEvent(QShowEvent *event) +void DeptTaskForm::showEvent(QShowEvent * event) { ui->tableDeptTask->adjustTableWidth(); getDeptTaskList(0); } +void DeptTaskForm::resizeEvent(QResizeEvent * event) +{ + ui->tableDeptTask->adjustTableWidth(); +} + void DeptTaskForm::initFormTable() { // 初始化查询条件 diff --git a/infomation/task/DeptTaskForm.h b/infomation/task/DeptTaskForm.h index 1055c36..3c1ad5b 100644 --- a/infomation/task/DeptTaskForm.h +++ b/infomation/task/DeptTaskForm.h @@ -21,7 +21,8 @@ ~DeptTaskForm(); protected: - void showEvent(QShowEvent *event) override; + void showEvent(QShowEvent * event) override; + void resizeEvent(QResizeEvent * event) override; private: Ui::DeptTaskForm *ui; diff --git a/main.cpp b/main.cpp index 525387e..0b78c87 100644 --- a/main.cpp +++ b/main.cpp @@ -1,5 +1,3 @@ -#include "MainWindow.h" - #include #include diff --git a/res/image/Index/u1176.svg b/res/image/Index/u1176.svg deleted file mode 100644 index c81ce8a..0000000 --- a/res/image/Index/u1176.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1180.svg b/res/image/Index/u1180.svg deleted file mode 100644 index 2ef24ab..0000000 --- a/res/image/Index/u1180.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1220.svg b/res/image/Index/u1220.svg deleted file mode 100644 index 43452aa..0000000 --- a/res/image/Index/u1220.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2158.svg b/res/image/Index/u2158.svg deleted file mode 100644 index fd249e0..0000000 --- a/res/image/Index/u2158.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u2188.svg b/res/image/Index/u2188.svg deleted file mode 100644 index 34f53c4..0000000 --- a/res/image/Index/u2188.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2189.svg b/res/image/Index/u2189.svg deleted file mode 100644 index 01a6bbb..0000000 --- a/res/image/Index/u2189.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2324.svg b/res/image/Index/u2324.svg deleted file mode 100644 index 797f1c5..0000000 --- a/res/image/Index/u2324.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2325.svg b/res/image/Index/u2325.svg deleted file mode 100644 index fefe01b..0000000 --- a/res/image/Index/u2325.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u642.svg b/res/image/Index/u642.svg deleted file mode 100644 index 33c9e0a..0000000 --- a/res/image/Index/u642.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u7406.svg b/res/image/Index/u7406.svg deleted file mode 100644 index 8a7a6d9..0000000 --- a/res/image/Index/u7406.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7453.svg b/res/image/Index/u7453.svg deleted file mode 100644 index 603c496..0000000 --- a/res/image/Index/u7453.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7458.svg b/res/image/Index/u7458.svg deleted file mode 100644 index b31087b..0000000 --- a/res/image/Index/u7458.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7488.svg b/res/image/Index/u7488.svg deleted file mode 100644 index 8baf439..0000000 --- a/res/image/Index/u7488.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7491.svg b/res/image/Index/u7491.svg deleted file mode 100644 index 3e41c10..0000000 --- a/res/image/Index/u7491.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7538.svg b/res/image/Index/u7538.svg deleted file mode 100644 index 417077d..0000000 --- a/res/image/Index/u7538.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u794.svg b/res/image/Index/u794.svg deleted file mode 100644 index e12cff7..0000000 --- a/res/image/Index/u794.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u8448.svg b/res/image/Index/u8448.svg deleted file mode 100644 index 7f6f4c0..0000000 --- a/res/image/Index/u8448.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u8458.svg b/res/image/Index/u8458.svg deleted file mode 100644 index 6d04a12..0000000 --- a/res/image/Index/u8458.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/main/bg_banner.png b/res/image/main/bg_banner.png new file mode 100644 index 0000000..26ddffd --- /dev/null +++ b/res/image/main/bg_banner.png Binary files differ diff --git a/res/image/main/iconHumi.png b/res/image/main/iconHumi.png index 4410d38..bd164e8 100644 --- a/res/image/main/iconHumi.png +++ b/res/image/main/iconHumi.png Binary files differ diff --git a/AutoCalibrationXC.pro b/AutoCalibrationXC.pro index 6bcb335..7790b37 100644 --- a/AutoCalibrationXC.pro +++ b/AutoCalibrationXC.pro @@ -24,11 +24,6 @@ include(QPagedTable/QPagedTable.pri) SOURCES += main.cpp -SOURCES += MainWindow.cpp - -HEADERS += MainWindow.h - -FORMS += MainWindow.ui RC_ICONS = res/autoCalibration.ico diff --git a/MainWindow.cpp b/MainWindow.cpp deleted file mode 100644 index ff126e8..0000000 --- a/MainWindow.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#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/MainWindow.h b/MainWindow.h deleted file mode 100644 index 4643e32..0000000 --- a/MainWindow.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#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; -}; -#endif // MAINWINDOW_H diff --git a/MainWindow.ui b/MainWindow.ui deleted file mode 100644 index b232854..0000000 --- a/MainWindow.ui +++ /dev/null @@ -1,22 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 800 - 600 - - - - MainWindow - - - - - - - - diff --git a/frame/CustomMessageBox.ui b/frame/CustomMessageBox.ui index 336be54..b545d74 100644 --- a/frame/CustomMessageBox.ui +++ b/frame/CustomMessageBox.ui @@ -84,8 +84,8 @@ - - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + + :/image/msgbox/icon_box_close.png:/image/msgbox/icon_box_close.png @@ -134,7 +134,7 @@ - :/image/msgbox/icon_box_success.png + :/image/msgbox/icon_box_success.png Qt::AlignCenter @@ -265,6 +265,8 @@ - + + + diff --git a/frame/MainWindowForm.cpp b/frame/MainWindowForm.cpp index 2ded44b..ec82cd7 100644 --- a/frame/MainWindowForm.cpp +++ b/frame/MainWindowForm.cpp @@ -1,6 +1,8 @@ #include "MainWindowForm.h" #include "ui_MainWindowForm.h" +#include + MainWindowForm::MainWindowForm(QWidget *parent) : FramelessWindow(parent), ui(new Ui::MainWindowForm) @@ -12,7 +14,7 @@ initMenuWidgets(); initFunctionButtons(); - // 每秒更新 界面上没有地方能摆 暂时先不启动定时器 + // 每秒更新 connect(TimeCounterUtil::getInstance().clockTimer, &QTimer::timeout, this, &MainWindowForm::onUpdateTimestampHandler); TimeCounterUtil::getInstance().clockTimer->start(1000); @@ -34,6 +36,7 @@ void MainWindowForm::initForm() { setWindowFlags(Qt::FramelessWindowHint); // 设置全屏 + setWindowState(Qt::WindowState::WindowMaximized); this->setTitleBar(ui->wdgtTop); // 设置窗口位置和大小 move(0, 0); @@ -120,6 +123,22 @@ setWindowState(Qt::WindowMinimized | windowState()); } +void MainWindowForm::on_btnMaxWin_clicked() +{ + QScreen *screen = QGuiApplication::primaryScreen(); + QRect screenSize = screen->availableGeometry(); // 可用区域(排除任务栏) + + if (this->isMaximized()) { + resize(screenSize.width() * 0.8, screenSize.height() * 0.8); + move(QRandomGenerator::global()->bounded(10, 100), QRandomGenerator::global()->bounded(10, 50)); + this->showNormal(); + } else { + resize(screenSize.width(), screenSize.height()); + move(0, 0); + this->showMaximized(); + } +} + void MainWindowForm::on_btnCloseWin_clicked() { // 创建一个消息框 @@ -146,18 +165,9 @@ ui->labelTime->setText(now.toString("yyyy-MM-dd HH:mm:ss")); } -void MainWindowForm::on_btnMenuMax_clicked() -{ - if (this->isMaximized()) { - this->showNormal(); - } else { - this->showMaximized(); - } -} - void MainWindowForm::titleDblClick() { - on_btnMenuMax_clicked(); + on_btnMaxWin_clicked(); } void MainWindowForm::onMenuButtonsEabled(bool enable) { diff --git a/frame/MainWindowForm.h b/frame/MainWindowForm.h index 4d206b1..9b4eae4 100644 --- a/frame/MainWindowForm.h +++ b/frame/MainWindowForm.h @@ -45,11 +45,11 @@ private slots: void on_btnMinWin_clicked(); + void on_btnMaxWin_clicked(); void on_btnCloseWin_clicked(); void onFunctionButtonsAction(); void onUpdateTimestampHandler(); - void on_btnMenuMax_clicked(); void titleDblClick(); void onMenuButtonsEabled(bool enable); diff --git a/frame/MainWindowForm.ui b/frame/MainWindowForm.ui index bd42122..f37d171 100644 --- a/frame/MainWindowForm.ui +++ b/frame/MainWindowForm.ui @@ -41,7 +41,7 @@ 0 - 120 + 100 @@ -58,7 +58,7 @@ 20 - 0 + 20 @@ -88,8 +88,8 @@ - 120 - 120 + 150 + 100 @@ -107,6 +107,22 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + @@ -158,7 +174,7 @@ 100 - 84 + 72 @@ -166,7 +182,8 @@ - :/image/main/calibration.png:/image/main/calibration.png + :/image/main/icon_menu_calibration.png + :/image/main/icon_menu_calibration_selected.png:/image/main/icon_menu_calibration.png @@ -184,7 +201,7 @@ 100 - 84 + 72 @@ -192,7 +209,8 @@ - :/image/main/rawDataRecord.png:/image/main/rawDataRecord.png + :/image/main/icon_menu_check.png + :/image/main/icon_menu_check_selected.png:/image/main/icon_menu_check.png @@ -210,7 +228,7 @@ 100 - 84 + 72 @@ -218,7 +236,8 @@ - :/image/main/fileRes.png:/image/main/fileRes.png + :/image/main/icon_menu_infomation.png + :/image/main/icon_menu_infomation_checked.png:/image/main/icon_menu_infomation.png @@ -235,10 +254,147 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 50 + 20 + + + + + - 320 + 240 + 16777215 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 5 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + :/image/main/iconTemp.png + + + + + + + 34.5℃ + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + + + + :/image/main/iconHumi.png + + + + + + + 25%Rh + + + + + + + + + + + + + + 240 16777215 @@ -308,7 +464,7 @@ - :/image/main/icon_setting_p.png:/image/main/icon_setting_p.png + :/image/main/icon_setting.png:/image/main/icon_setting.png @@ -334,7 +490,33 @@ - :/image/main/icon_min_p.png:/image/main/icon_min_p.png + :/image/main/icon_min.png:/image/main/icon_min.png + + + + 32 + 32 + + + + + + + + + 40 + 40 + + + + 最小化 + + + + + + + :/image/main/icon_max.png:/image/main/icon_max.png @@ -360,7 +542,7 @@ - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + :/image/main/icon_close.png:/image/main/icon_close.png @@ -426,87 +608,9 @@ - - - - - 0 - 30 - - - - - 20 - - - 0 - - - 0 - - - 40 - - - 0 - - - - - Qt::Horizontal - - - - 1289 - 20 - - - - - - - - - - - - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 20 - - - - - - - - - - - - - - wdgtContent wdgtTop - wdgtFoot diff --git a/infomation/InfoMainForm.cpp b/infomation/InfoMainForm.cpp index c001199..5d0ffc8 100644 --- a/infomation/InfoMainForm.cpp +++ b/infomation/InfoMainForm.cpp @@ -21,9 +21,13 @@ void InfoMainForm::initForm() { + // 加载样式表 + QString qssStyle = QssFileUtils::loadQssFileContent(QApplication::applicationDirPath() + "/qss/infoMain.css"); + if (qssStyle.isEmpty() == false) { + this->setStyleSheet(qssStyle); // 仅本窗口生效 + } - - + ui->scrollArea->setWindowFlags(Qt::FramelessWindowHint); // 设置无边框 } void InfoMainForm::initSubMenuForms() { diff --git a/infomation/InfoMainForm.ui b/infomation/InfoMainForm.ui index 958a6b2..d9066dd 100644 --- a/infomation/InfoMainForm.ui +++ b/infomation/InfoMainForm.ui @@ -90,7 +90,7 @@ - 280 + 295 48 @@ -103,7 +103,7 @@ - 280 + 295 48 @@ -116,7 +116,7 @@ - 280 + 295 48 @@ -129,7 +129,7 @@ - 280 + 295 48 @@ -142,7 +142,7 @@ - 280 + 295 48 @@ -155,7 +155,7 @@ - 280 + 295 48 @@ -168,7 +168,7 @@ - 280 + 295 48 @@ -181,7 +181,7 @@ - 280 + 295 48 @@ -194,7 +194,7 @@ - 280 + 295 48 @@ -207,7 +207,7 @@ - 280 + 295 48 @@ -220,7 +220,7 @@ - 280 + 295 48 @@ -233,7 +233,7 @@ - 280 + 295 48 @@ -246,7 +246,7 @@ - 280 + 295 48 diff --git a/infomation/task/DeptTaskForm.cpp b/infomation/task/DeptTaskForm.cpp index ea21a9f..cc6bf31 100644 --- a/infomation/task/DeptTaskForm.cpp +++ b/infomation/task/DeptTaskForm.cpp @@ -18,12 +18,17 @@ delete ui; } -void DeptTaskForm::showEvent(QShowEvent *event) +void DeptTaskForm::showEvent(QShowEvent * event) { ui->tableDeptTask->adjustTableWidth(); getDeptTaskList(0); } +void DeptTaskForm::resizeEvent(QResizeEvent * event) +{ + ui->tableDeptTask->adjustTableWidth(); +} + void DeptTaskForm::initFormTable() { // 初始化查询条件 diff --git a/infomation/task/DeptTaskForm.h b/infomation/task/DeptTaskForm.h index 1055c36..3c1ad5b 100644 --- a/infomation/task/DeptTaskForm.h +++ b/infomation/task/DeptTaskForm.h @@ -21,7 +21,8 @@ ~DeptTaskForm(); protected: - void showEvent(QShowEvent *event) override; + void showEvent(QShowEvent * event) override; + void resizeEvent(QResizeEvent * event) override; private: Ui::DeptTaskForm *ui; diff --git a/main.cpp b/main.cpp index 525387e..0b78c87 100644 --- a/main.cpp +++ b/main.cpp @@ -1,5 +1,3 @@ -#include "MainWindow.h" - #include #include diff --git a/res/image/Index/u1176.svg b/res/image/Index/u1176.svg deleted file mode 100644 index c81ce8a..0000000 --- a/res/image/Index/u1176.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1180.svg b/res/image/Index/u1180.svg deleted file mode 100644 index 2ef24ab..0000000 --- a/res/image/Index/u1180.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1220.svg b/res/image/Index/u1220.svg deleted file mode 100644 index 43452aa..0000000 --- a/res/image/Index/u1220.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2158.svg b/res/image/Index/u2158.svg deleted file mode 100644 index fd249e0..0000000 --- a/res/image/Index/u2158.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u2188.svg b/res/image/Index/u2188.svg deleted file mode 100644 index 34f53c4..0000000 --- a/res/image/Index/u2188.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2189.svg b/res/image/Index/u2189.svg deleted file mode 100644 index 01a6bbb..0000000 --- a/res/image/Index/u2189.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2324.svg b/res/image/Index/u2324.svg deleted file mode 100644 index 797f1c5..0000000 --- a/res/image/Index/u2324.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2325.svg b/res/image/Index/u2325.svg deleted file mode 100644 index fefe01b..0000000 --- a/res/image/Index/u2325.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u642.svg b/res/image/Index/u642.svg deleted file mode 100644 index 33c9e0a..0000000 --- a/res/image/Index/u642.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u7406.svg b/res/image/Index/u7406.svg deleted file mode 100644 index 8a7a6d9..0000000 --- a/res/image/Index/u7406.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7453.svg b/res/image/Index/u7453.svg deleted file mode 100644 index 603c496..0000000 --- a/res/image/Index/u7453.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7458.svg b/res/image/Index/u7458.svg deleted file mode 100644 index b31087b..0000000 --- a/res/image/Index/u7458.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7488.svg b/res/image/Index/u7488.svg deleted file mode 100644 index 8baf439..0000000 --- a/res/image/Index/u7488.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7491.svg b/res/image/Index/u7491.svg deleted file mode 100644 index 3e41c10..0000000 --- a/res/image/Index/u7491.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7538.svg b/res/image/Index/u7538.svg deleted file mode 100644 index 417077d..0000000 --- a/res/image/Index/u7538.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u794.svg b/res/image/Index/u794.svg deleted file mode 100644 index e12cff7..0000000 --- a/res/image/Index/u794.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u8448.svg b/res/image/Index/u8448.svg deleted file mode 100644 index 7f6f4c0..0000000 --- a/res/image/Index/u8448.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u8458.svg b/res/image/Index/u8458.svg deleted file mode 100644 index 6d04a12..0000000 --- a/res/image/Index/u8458.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/main/bg_banner.png b/res/image/main/bg_banner.png new file mode 100644 index 0000000..26ddffd --- /dev/null +++ b/res/image/main/bg_banner.png Binary files differ diff --git a/res/image/main/iconHumi.png b/res/image/main/iconHumi.png index 4410d38..bd164e8 100644 --- a/res/image/main/iconHumi.png +++ b/res/image/main/iconHumi.png Binary files differ diff --git a/res/image/main/iconTemp.png b/res/image/main/iconTemp.png index 8fd059c..a2cfe4d 100644 --- a/res/image/main/iconTemp.png +++ b/res/image/main/iconTemp.png Binary files differ diff --git a/AutoCalibrationXC.pro b/AutoCalibrationXC.pro index 6bcb335..7790b37 100644 --- a/AutoCalibrationXC.pro +++ b/AutoCalibrationXC.pro @@ -24,11 +24,6 @@ include(QPagedTable/QPagedTable.pri) SOURCES += main.cpp -SOURCES += MainWindow.cpp - -HEADERS += MainWindow.h - -FORMS += MainWindow.ui RC_ICONS = res/autoCalibration.ico diff --git a/MainWindow.cpp b/MainWindow.cpp deleted file mode 100644 index ff126e8..0000000 --- a/MainWindow.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#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/MainWindow.h b/MainWindow.h deleted file mode 100644 index 4643e32..0000000 --- a/MainWindow.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#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; -}; -#endif // MAINWINDOW_H diff --git a/MainWindow.ui b/MainWindow.ui deleted file mode 100644 index b232854..0000000 --- a/MainWindow.ui +++ /dev/null @@ -1,22 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 800 - 600 - - - - MainWindow - - - - - - - - diff --git a/frame/CustomMessageBox.ui b/frame/CustomMessageBox.ui index 336be54..b545d74 100644 --- a/frame/CustomMessageBox.ui +++ b/frame/CustomMessageBox.ui @@ -84,8 +84,8 @@ - - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + + :/image/msgbox/icon_box_close.png:/image/msgbox/icon_box_close.png @@ -134,7 +134,7 @@ - :/image/msgbox/icon_box_success.png + :/image/msgbox/icon_box_success.png Qt::AlignCenter @@ -265,6 +265,8 @@ - + + + diff --git a/frame/MainWindowForm.cpp b/frame/MainWindowForm.cpp index 2ded44b..ec82cd7 100644 --- a/frame/MainWindowForm.cpp +++ b/frame/MainWindowForm.cpp @@ -1,6 +1,8 @@ #include "MainWindowForm.h" #include "ui_MainWindowForm.h" +#include + MainWindowForm::MainWindowForm(QWidget *parent) : FramelessWindow(parent), ui(new Ui::MainWindowForm) @@ -12,7 +14,7 @@ initMenuWidgets(); initFunctionButtons(); - // 每秒更新 界面上没有地方能摆 暂时先不启动定时器 + // 每秒更新 connect(TimeCounterUtil::getInstance().clockTimer, &QTimer::timeout, this, &MainWindowForm::onUpdateTimestampHandler); TimeCounterUtil::getInstance().clockTimer->start(1000); @@ -34,6 +36,7 @@ void MainWindowForm::initForm() { setWindowFlags(Qt::FramelessWindowHint); // 设置全屏 + setWindowState(Qt::WindowState::WindowMaximized); this->setTitleBar(ui->wdgtTop); // 设置窗口位置和大小 move(0, 0); @@ -120,6 +123,22 @@ setWindowState(Qt::WindowMinimized | windowState()); } +void MainWindowForm::on_btnMaxWin_clicked() +{ + QScreen *screen = QGuiApplication::primaryScreen(); + QRect screenSize = screen->availableGeometry(); // 可用区域(排除任务栏) + + if (this->isMaximized()) { + resize(screenSize.width() * 0.8, screenSize.height() * 0.8); + move(QRandomGenerator::global()->bounded(10, 100), QRandomGenerator::global()->bounded(10, 50)); + this->showNormal(); + } else { + resize(screenSize.width(), screenSize.height()); + move(0, 0); + this->showMaximized(); + } +} + void MainWindowForm::on_btnCloseWin_clicked() { // 创建一个消息框 @@ -146,18 +165,9 @@ ui->labelTime->setText(now.toString("yyyy-MM-dd HH:mm:ss")); } -void MainWindowForm::on_btnMenuMax_clicked() -{ - if (this->isMaximized()) { - this->showNormal(); - } else { - this->showMaximized(); - } -} - void MainWindowForm::titleDblClick() { - on_btnMenuMax_clicked(); + on_btnMaxWin_clicked(); } void MainWindowForm::onMenuButtonsEabled(bool enable) { diff --git a/frame/MainWindowForm.h b/frame/MainWindowForm.h index 4d206b1..9b4eae4 100644 --- a/frame/MainWindowForm.h +++ b/frame/MainWindowForm.h @@ -45,11 +45,11 @@ private slots: void on_btnMinWin_clicked(); + void on_btnMaxWin_clicked(); void on_btnCloseWin_clicked(); void onFunctionButtonsAction(); void onUpdateTimestampHandler(); - void on_btnMenuMax_clicked(); void titleDblClick(); void onMenuButtonsEabled(bool enable); diff --git a/frame/MainWindowForm.ui b/frame/MainWindowForm.ui index bd42122..f37d171 100644 --- a/frame/MainWindowForm.ui +++ b/frame/MainWindowForm.ui @@ -41,7 +41,7 @@ 0 - 120 + 100 @@ -58,7 +58,7 @@ 20 - 0 + 20 @@ -88,8 +88,8 @@ - 120 - 120 + 150 + 100 @@ -107,6 +107,22 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + @@ -158,7 +174,7 @@ 100 - 84 + 72 @@ -166,7 +182,8 @@ - :/image/main/calibration.png:/image/main/calibration.png + :/image/main/icon_menu_calibration.png + :/image/main/icon_menu_calibration_selected.png:/image/main/icon_menu_calibration.png @@ -184,7 +201,7 @@ 100 - 84 + 72 @@ -192,7 +209,8 @@ - :/image/main/rawDataRecord.png:/image/main/rawDataRecord.png + :/image/main/icon_menu_check.png + :/image/main/icon_menu_check_selected.png:/image/main/icon_menu_check.png @@ -210,7 +228,7 @@ 100 - 84 + 72 @@ -218,7 +236,8 @@ - :/image/main/fileRes.png:/image/main/fileRes.png + :/image/main/icon_menu_infomation.png + :/image/main/icon_menu_infomation_checked.png:/image/main/icon_menu_infomation.png @@ -235,10 +254,147 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 50 + 20 + + + + + - 320 + 240 + 16777215 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 5 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + :/image/main/iconTemp.png + + + + + + + 34.5℃ + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + + + + :/image/main/iconHumi.png + + + + + + + 25%Rh + + + + + + + + + + + + + + 240 16777215 @@ -308,7 +464,7 @@ - :/image/main/icon_setting_p.png:/image/main/icon_setting_p.png + :/image/main/icon_setting.png:/image/main/icon_setting.png @@ -334,7 +490,33 @@ - :/image/main/icon_min_p.png:/image/main/icon_min_p.png + :/image/main/icon_min.png:/image/main/icon_min.png + + + + 32 + 32 + + + + + + + + + 40 + 40 + + + + 最小化 + + + + + + + :/image/main/icon_max.png:/image/main/icon_max.png @@ -360,7 +542,7 @@ - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + :/image/main/icon_close.png:/image/main/icon_close.png @@ -426,87 +608,9 @@ - - - - - 0 - 30 - - - - - 20 - - - 0 - - - 0 - - - 40 - - - 0 - - - - - Qt::Horizontal - - - - 1289 - 20 - - - - - - - - - - - - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 20 - - - - - - - - - - - - - - wdgtContent wdgtTop - wdgtFoot diff --git a/infomation/InfoMainForm.cpp b/infomation/InfoMainForm.cpp index c001199..5d0ffc8 100644 --- a/infomation/InfoMainForm.cpp +++ b/infomation/InfoMainForm.cpp @@ -21,9 +21,13 @@ void InfoMainForm::initForm() { + // 加载样式表 + QString qssStyle = QssFileUtils::loadQssFileContent(QApplication::applicationDirPath() + "/qss/infoMain.css"); + if (qssStyle.isEmpty() == false) { + this->setStyleSheet(qssStyle); // 仅本窗口生效 + } - - + ui->scrollArea->setWindowFlags(Qt::FramelessWindowHint); // 设置无边框 } void InfoMainForm::initSubMenuForms() { diff --git a/infomation/InfoMainForm.ui b/infomation/InfoMainForm.ui index 958a6b2..d9066dd 100644 --- a/infomation/InfoMainForm.ui +++ b/infomation/InfoMainForm.ui @@ -90,7 +90,7 @@ - 280 + 295 48 @@ -103,7 +103,7 @@ - 280 + 295 48 @@ -116,7 +116,7 @@ - 280 + 295 48 @@ -129,7 +129,7 @@ - 280 + 295 48 @@ -142,7 +142,7 @@ - 280 + 295 48 @@ -155,7 +155,7 @@ - 280 + 295 48 @@ -168,7 +168,7 @@ - 280 + 295 48 @@ -181,7 +181,7 @@ - 280 + 295 48 @@ -194,7 +194,7 @@ - 280 + 295 48 @@ -207,7 +207,7 @@ - 280 + 295 48 @@ -220,7 +220,7 @@ - 280 + 295 48 @@ -233,7 +233,7 @@ - 280 + 295 48 @@ -246,7 +246,7 @@ - 280 + 295 48 diff --git a/infomation/task/DeptTaskForm.cpp b/infomation/task/DeptTaskForm.cpp index ea21a9f..cc6bf31 100644 --- a/infomation/task/DeptTaskForm.cpp +++ b/infomation/task/DeptTaskForm.cpp @@ -18,12 +18,17 @@ delete ui; } -void DeptTaskForm::showEvent(QShowEvent *event) +void DeptTaskForm::showEvent(QShowEvent * event) { ui->tableDeptTask->adjustTableWidth(); getDeptTaskList(0); } +void DeptTaskForm::resizeEvent(QResizeEvent * event) +{ + ui->tableDeptTask->adjustTableWidth(); +} + void DeptTaskForm::initFormTable() { // 初始化查询条件 diff --git a/infomation/task/DeptTaskForm.h b/infomation/task/DeptTaskForm.h index 1055c36..3c1ad5b 100644 --- a/infomation/task/DeptTaskForm.h +++ b/infomation/task/DeptTaskForm.h @@ -21,7 +21,8 @@ ~DeptTaskForm(); protected: - void showEvent(QShowEvent *event) override; + void showEvent(QShowEvent * event) override; + void resizeEvent(QResizeEvent * event) override; private: Ui::DeptTaskForm *ui; diff --git a/main.cpp b/main.cpp index 525387e..0b78c87 100644 --- a/main.cpp +++ b/main.cpp @@ -1,5 +1,3 @@ -#include "MainWindow.h" - #include #include diff --git a/res/image/Index/u1176.svg b/res/image/Index/u1176.svg deleted file mode 100644 index c81ce8a..0000000 --- a/res/image/Index/u1176.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1180.svg b/res/image/Index/u1180.svg deleted file mode 100644 index 2ef24ab..0000000 --- a/res/image/Index/u1180.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1220.svg b/res/image/Index/u1220.svg deleted file mode 100644 index 43452aa..0000000 --- a/res/image/Index/u1220.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2158.svg b/res/image/Index/u2158.svg deleted file mode 100644 index fd249e0..0000000 --- a/res/image/Index/u2158.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u2188.svg b/res/image/Index/u2188.svg deleted file mode 100644 index 34f53c4..0000000 --- a/res/image/Index/u2188.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2189.svg b/res/image/Index/u2189.svg deleted file mode 100644 index 01a6bbb..0000000 --- a/res/image/Index/u2189.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2324.svg b/res/image/Index/u2324.svg deleted file mode 100644 index 797f1c5..0000000 --- a/res/image/Index/u2324.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2325.svg b/res/image/Index/u2325.svg deleted file mode 100644 index fefe01b..0000000 --- a/res/image/Index/u2325.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u642.svg b/res/image/Index/u642.svg deleted file mode 100644 index 33c9e0a..0000000 --- a/res/image/Index/u642.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u7406.svg b/res/image/Index/u7406.svg deleted file mode 100644 index 8a7a6d9..0000000 --- a/res/image/Index/u7406.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7453.svg b/res/image/Index/u7453.svg deleted file mode 100644 index 603c496..0000000 --- a/res/image/Index/u7453.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7458.svg b/res/image/Index/u7458.svg deleted file mode 100644 index b31087b..0000000 --- a/res/image/Index/u7458.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7488.svg b/res/image/Index/u7488.svg deleted file mode 100644 index 8baf439..0000000 --- a/res/image/Index/u7488.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7491.svg b/res/image/Index/u7491.svg deleted file mode 100644 index 3e41c10..0000000 --- a/res/image/Index/u7491.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7538.svg b/res/image/Index/u7538.svg deleted file mode 100644 index 417077d..0000000 --- a/res/image/Index/u7538.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u794.svg b/res/image/Index/u794.svg deleted file mode 100644 index e12cff7..0000000 --- a/res/image/Index/u794.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u8448.svg b/res/image/Index/u8448.svg deleted file mode 100644 index 7f6f4c0..0000000 --- a/res/image/Index/u8448.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u8458.svg b/res/image/Index/u8458.svg deleted file mode 100644 index 6d04a12..0000000 --- a/res/image/Index/u8458.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/main/bg_banner.png b/res/image/main/bg_banner.png new file mode 100644 index 0000000..26ddffd --- /dev/null +++ b/res/image/main/bg_banner.png Binary files differ diff --git a/res/image/main/iconHumi.png b/res/image/main/iconHumi.png index 4410d38..bd164e8 100644 --- a/res/image/main/iconHumi.png +++ b/res/image/main/iconHumi.png Binary files differ diff --git a/res/image/main/iconTemp.png b/res/image/main/iconTemp.png index 8fd059c..a2cfe4d 100644 --- a/res/image/main/iconTemp.png +++ b/res/image/main/iconTemp.png Binary files differ diff --git a/res/image/main/icon_close.png b/res/image/main/icon_close.png new file mode 100644 index 0000000..f3aa270 --- /dev/null +++ b/res/image/main/icon_close.png Binary files differ diff --git a/AutoCalibrationXC.pro b/AutoCalibrationXC.pro index 6bcb335..7790b37 100644 --- a/AutoCalibrationXC.pro +++ b/AutoCalibrationXC.pro @@ -24,11 +24,6 @@ include(QPagedTable/QPagedTable.pri) SOURCES += main.cpp -SOURCES += MainWindow.cpp - -HEADERS += MainWindow.h - -FORMS += MainWindow.ui RC_ICONS = res/autoCalibration.ico diff --git a/MainWindow.cpp b/MainWindow.cpp deleted file mode 100644 index ff126e8..0000000 --- a/MainWindow.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#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/MainWindow.h b/MainWindow.h deleted file mode 100644 index 4643e32..0000000 --- a/MainWindow.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#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; -}; -#endif // MAINWINDOW_H diff --git a/MainWindow.ui b/MainWindow.ui deleted file mode 100644 index b232854..0000000 --- a/MainWindow.ui +++ /dev/null @@ -1,22 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 800 - 600 - - - - MainWindow - - - - - - - - diff --git a/frame/CustomMessageBox.ui b/frame/CustomMessageBox.ui index 336be54..b545d74 100644 --- a/frame/CustomMessageBox.ui +++ b/frame/CustomMessageBox.ui @@ -84,8 +84,8 @@ - - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + + :/image/msgbox/icon_box_close.png:/image/msgbox/icon_box_close.png @@ -134,7 +134,7 @@ - :/image/msgbox/icon_box_success.png + :/image/msgbox/icon_box_success.png Qt::AlignCenter @@ -265,6 +265,8 @@ - + + + diff --git a/frame/MainWindowForm.cpp b/frame/MainWindowForm.cpp index 2ded44b..ec82cd7 100644 --- a/frame/MainWindowForm.cpp +++ b/frame/MainWindowForm.cpp @@ -1,6 +1,8 @@ #include "MainWindowForm.h" #include "ui_MainWindowForm.h" +#include + MainWindowForm::MainWindowForm(QWidget *parent) : FramelessWindow(parent), ui(new Ui::MainWindowForm) @@ -12,7 +14,7 @@ initMenuWidgets(); initFunctionButtons(); - // 每秒更新 界面上没有地方能摆 暂时先不启动定时器 + // 每秒更新 connect(TimeCounterUtil::getInstance().clockTimer, &QTimer::timeout, this, &MainWindowForm::onUpdateTimestampHandler); TimeCounterUtil::getInstance().clockTimer->start(1000); @@ -34,6 +36,7 @@ void MainWindowForm::initForm() { setWindowFlags(Qt::FramelessWindowHint); // 设置全屏 + setWindowState(Qt::WindowState::WindowMaximized); this->setTitleBar(ui->wdgtTop); // 设置窗口位置和大小 move(0, 0); @@ -120,6 +123,22 @@ setWindowState(Qt::WindowMinimized | windowState()); } +void MainWindowForm::on_btnMaxWin_clicked() +{ + QScreen *screen = QGuiApplication::primaryScreen(); + QRect screenSize = screen->availableGeometry(); // 可用区域(排除任务栏) + + if (this->isMaximized()) { + resize(screenSize.width() * 0.8, screenSize.height() * 0.8); + move(QRandomGenerator::global()->bounded(10, 100), QRandomGenerator::global()->bounded(10, 50)); + this->showNormal(); + } else { + resize(screenSize.width(), screenSize.height()); + move(0, 0); + this->showMaximized(); + } +} + void MainWindowForm::on_btnCloseWin_clicked() { // 创建一个消息框 @@ -146,18 +165,9 @@ ui->labelTime->setText(now.toString("yyyy-MM-dd HH:mm:ss")); } -void MainWindowForm::on_btnMenuMax_clicked() -{ - if (this->isMaximized()) { - this->showNormal(); - } else { - this->showMaximized(); - } -} - void MainWindowForm::titleDblClick() { - on_btnMenuMax_clicked(); + on_btnMaxWin_clicked(); } void MainWindowForm::onMenuButtonsEabled(bool enable) { diff --git a/frame/MainWindowForm.h b/frame/MainWindowForm.h index 4d206b1..9b4eae4 100644 --- a/frame/MainWindowForm.h +++ b/frame/MainWindowForm.h @@ -45,11 +45,11 @@ private slots: void on_btnMinWin_clicked(); + void on_btnMaxWin_clicked(); void on_btnCloseWin_clicked(); void onFunctionButtonsAction(); void onUpdateTimestampHandler(); - void on_btnMenuMax_clicked(); void titleDblClick(); void onMenuButtonsEabled(bool enable); diff --git a/frame/MainWindowForm.ui b/frame/MainWindowForm.ui index bd42122..f37d171 100644 --- a/frame/MainWindowForm.ui +++ b/frame/MainWindowForm.ui @@ -41,7 +41,7 @@ 0 - 120 + 100 @@ -58,7 +58,7 @@ 20 - 0 + 20 @@ -88,8 +88,8 @@ - 120 - 120 + 150 + 100 @@ -107,6 +107,22 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + @@ -158,7 +174,7 @@ 100 - 84 + 72 @@ -166,7 +182,8 @@ - :/image/main/calibration.png:/image/main/calibration.png + :/image/main/icon_menu_calibration.png + :/image/main/icon_menu_calibration_selected.png:/image/main/icon_menu_calibration.png @@ -184,7 +201,7 @@ 100 - 84 + 72 @@ -192,7 +209,8 @@ - :/image/main/rawDataRecord.png:/image/main/rawDataRecord.png + :/image/main/icon_menu_check.png + :/image/main/icon_menu_check_selected.png:/image/main/icon_menu_check.png @@ -210,7 +228,7 @@ 100 - 84 + 72 @@ -218,7 +236,8 @@ - :/image/main/fileRes.png:/image/main/fileRes.png + :/image/main/icon_menu_infomation.png + :/image/main/icon_menu_infomation_checked.png:/image/main/icon_menu_infomation.png @@ -235,10 +254,147 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 50 + 20 + + + + + - 320 + 240 + 16777215 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 5 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + :/image/main/iconTemp.png + + + + + + + 34.5℃ + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + + + + :/image/main/iconHumi.png + + + + + + + 25%Rh + + + + + + + + + + + + + + 240 16777215 @@ -308,7 +464,7 @@ - :/image/main/icon_setting_p.png:/image/main/icon_setting_p.png + :/image/main/icon_setting.png:/image/main/icon_setting.png @@ -334,7 +490,33 @@ - :/image/main/icon_min_p.png:/image/main/icon_min_p.png + :/image/main/icon_min.png:/image/main/icon_min.png + + + + 32 + 32 + + + + + + + + + 40 + 40 + + + + 最小化 + + + + + + + :/image/main/icon_max.png:/image/main/icon_max.png @@ -360,7 +542,7 @@ - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + :/image/main/icon_close.png:/image/main/icon_close.png @@ -426,87 +608,9 @@ - - - - - 0 - 30 - - - - - 20 - - - 0 - - - 0 - - - 40 - - - 0 - - - - - Qt::Horizontal - - - - 1289 - 20 - - - - - - - - - - - - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 20 - - - - - - - - - - - - - - wdgtContent wdgtTop - wdgtFoot diff --git a/infomation/InfoMainForm.cpp b/infomation/InfoMainForm.cpp index c001199..5d0ffc8 100644 --- a/infomation/InfoMainForm.cpp +++ b/infomation/InfoMainForm.cpp @@ -21,9 +21,13 @@ void InfoMainForm::initForm() { + // 加载样式表 + QString qssStyle = QssFileUtils::loadQssFileContent(QApplication::applicationDirPath() + "/qss/infoMain.css"); + if (qssStyle.isEmpty() == false) { + this->setStyleSheet(qssStyle); // 仅本窗口生效 + } - - + ui->scrollArea->setWindowFlags(Qt::FramelessWindowHint); // 设置无边框 } void InfoMainForm::initSubMenuForms() { diff --git a/infomation/InfoMainForm.ui b/infomation/InfoMainForm.ui index 958a6b2..d9066dd 100644 --- a/infomation/InfoMainForm.ui +++ b/infomation/InfoMainForm.ui @@ -90,7 +90,7 @@ - 280 + 295 48 @@ -103,7 +103,7 @@ - 280 + 295 48 @@ -116,7 +116,7 @@ - 280 + 295 48 @@ -129,7 +129,7 @@ - 280 + 295 48 @@ -142,7 +142,7 @@ - 280 + 295 48 @@ -155,7 +155,7 @@ - 280 + 295 48 @@ -168,7 +168,7 @@ - 280 + 295 48 @@ -181,7 +181,7 @@ - 280 + 295 48 @@ -194,7 +194,7 @@ - 280 + 295 48 @@ -207,7 +207,7 @@ - 280 + 295 48 @@ -220,7 +220,7 @@ - 280 + 295 48 @@ -233,7 +233,7 @@ - 280 + 295 48 @@ -246,7 +246,7 @@ - 280 + 295 48 diff --git a/infomation/task/DeptTaskForm.cpp b/infomation/task/DeptTaskForm.cpp index ea21a9f..cc6bf31 100644 --- a/infomation/task/DeptTaskForm.cpp +++ b/infomation/task/DeptTaskForm.cpp @@ -18,12 +18,17 @@ delete ui; } -void DeptTaskForm::showEvent(QShowEvent *event) +void DeptTaskForm::showEvent(QShowEvent * event) { ui->tableDeptTask->adjustTableWidth(); getDeptTaskList(0); } +void DeptTaskForm::resizeEvent(QResizeEvent * event) +{ + ui->tableDeptTask->adjustTableWidth(); +} + void DeptTaskForm::initFormTable() { // 初始化查询条件 diff --git a/infomation/task/DeptTaskForm.h b/infomation/task/DeptTaskForm.h index 1055c36..3c1ad5b 100644 --- a/infomation/task/DeptTaskForm.h +++ b/infomation/task/DeptTaskForm.h @@ -21,7 +21,8 @@ ~DeptTaskForm(); protected: - void showEvent(QShowEvent *event) override; + void showEvent(QShowEvent * event) override; + void resizeEvent(QResizeEvent * event) override; private: Ui::DeptTaskForm *ui; diff --git a/main.cpp b/main.cpp index 525387e..0b78c87 100644 --- a/main.cpp +++ b/main.cpp @@ -1,5 +1,3 @@ -#include "MainWindow.h" - #include #include diff --git a/res/image/Index/u1176.svg b/res/image/Index/u1176.svg deleted file mode 100644 index c81ce8a..0000000 --- a/res/image/Index/u1176.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1180.svg b/res/image/Index/u1180.svg deleted file mode 100644 index 2ef24ab..0000000 --- a/res/image/Index/u1180.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1220.svg b/res/image/Index/u1220.svg deleted file mode 100644 index 43452aa..0000000 --- a/res/image/Index/u1220.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2158.svg b/res/image/Index/u2158.svg deleted file mode 100644 index fd249e0..0000000 --- a/res/image/Index/u2158.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u2188.svg b/res/image/Index/u2188.svg deleted file mode 100644 index 34f53c4..0000000 --- a/res/image/Index/u2188.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2189.svg b/res/image/Index/u2189.svg deleted file mode 100644 index 01a6bbb..0000000 --- a/res/image/Index/u2189.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2324.svg b/res/image/Index/u2324.svg deleted file mode 100644 index 797f1c5..0000000 --- a/res/image/Index/u2324.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2325.svg b/res/image/Index/u2325.svg deleted file mode 100644 index fefe01b..0000000 --- a/res/image/Index/u2325.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u642.svg b/res/image/Index/u642.svg deleted file mode 100644 index 33c9e0a..0000000 --- a/res/image/Index/u642.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u7406.svg b/res/image/Index/u7406.svg deleted file mode 100644 index 8a7a6d9..0000000 --- a/res/image/Index/u7406.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7453.svg b/res/image/Index/u7453.svg deleted file mode 100644 index 603c496..0000000 --- a/res/image/Index/u7453.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7458.svg b/res/image/Index/u7458.svg deleted file mode 100644 index b31087b..0000000 --- a/res/image/Index/u7458.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7488.svg b/res/image/Index/u7488.svg deleted file mode 100644 index 8baf439..0000000 --- a/res/image/Index/u7488.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7491.svg b/res/image/Index/u7491.svg deleted file mode 100644 index 3e41c10..0000000 --- a/res/image/Index/u7491.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7538.svg b/res/image/Index/u7538.svg deleted file mode 100644 index 417077d..0000000 --- a/res/image/Index/u7538.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u794.svg b/res/image/Index/u794.svg deleted file mode 100644 index e12cff7..0000000 --- a/res/image/Index/u794.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u8448.svg b/res/image/Index/u8448.svg deleted file mode 100644 index 7f6f4c0..0000000 --- a/res/image/Index/u8448.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u8458.svg b/res/image/Index/u8458.svg deleted file mode 100644 index 6d04a12..0000000 --- a/res/image/Index/u8458.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/main/bg_banner.png b/res/image/main/bg_banner.png new file mode 100644 index 0000000..26ddffd --- /dev/null +++ b/res/image/main/bg_banner.png Binary files differ diff --git a/res/image/main/iconHumi.png b/res/image/main/iconHumi.png index 4410d38..bd164e8 100644 --- a/res/image/main/iconHumi.png +++ b/res/image/main/iconHumi.png Binary files differ diff --git a/res/image/main/iconTemp.png b/res/image/main/iconTemp.png index 8fd059c..a2cfe4d 100644 --- a/res/image/main/iconTemp.png +++ b/res/image/main/iconTemp.png Binary files differ diff --git a/res/image/main/icon_close.png b/res/image/main/icon_close.png new file mode 100644 index 0000000..f3aa270 --- /dev/null +++ b/res/image/main/icon_close.png Binary files differ diff --git a/res/image/main/icon_close_p.png b/res/image/main/icon_close_p.png deleted file mode 100644 index b9ba30c..0000000 --- a/res/image/main/icon_close_p.png +++ /dev/null Binary files differ diff --git a/AutoCalibrationXC.pro b/AutoCalibrationXC.pro index 6bcb335..7790b37 100644 --- a/AutoCalibrationXC.pro +++ b/AutoCalibrationXC.pro @@ -24,11 +24,6 @@ include(QPagedTable/QPagedTable.pri) SOURCES += main.cpp -SOURCES += MainWindow.cpp - -HEADERS += MainWindow.h - -FORMS += MainWindow.ui RC_ICONS = res/autoCalibration.ico diff --git a/MainWindow.cpp b/MainWindow.cpp deleted file mode 100644 index ff126e8..0000000 --- a/MainWindow.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#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/MainWindow.h b/MainWindow.h deleted file mode 100644 index 4643e32..0000000 --- a/MainWindow.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#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; -}; -#endif // MAINWINDOW_H diff --git a/MainWindow.ui b/MainWindow.ui deleted file mode 100644 index b232854..0000000 --- a/MainWindow.ui +++ /dev/null @@ -1,22 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 800 - 600 - - - - MainWindow - - - - - - - - diff --git a/frame/CustomMessageBox.ui b/frame/CustomMessageBox.ui index 336be54..b545d74 100644 --- a/frame/CustomMessageBox.ui +++ b/frame/CustomMessageBox.ui @@ -84,8 +84,8 @@ - - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + + :/image/msgbox/icon_box_close.png:/image/msgbox/icon_box_close.png @@ -134,7 +134,7 @@ - :/image/msgbox/icon_box_success.png + :/image/msgbox/icon_box_success.png Qt::AlignCenter @@ -265,6 +265,8 @@ - + + + diff --git a/frame/MainWindowForm.cpp b/frame/MainWindowForm.cpp index 2ded44b..ec82cd7 100644 --- a/frame/MainWindowForm.cpp +++ b/frame/MainWindowForm.cpp @@ -1,6 +1,8 @@ #include "MainWindowForm.h" #include "ui_MainWindowForm.h" +#include + MainWindowForm::MainWindowForm(QWidget *parent) : FramelessWindow(parent), ui(new Ui::MainWindowForm) @@ -12,7 +14,7 @@ initMenuWidgets(); initFunctionButtons(); - // 每秒更新 界面上没有地方能摆 暂时先不启动定时器 + // 每秒更新 connect(TimeCounterUtil::getInstance().clockTimer, &QTimer::timeout, this, &MainWindowForm::onUpdateTimestampHandler); TimeCounterUtil::getInstance().clockTimer->start(1000); @@ -34,6 +36,7 @@ void MainWindowForm::initForm() { setWindowFlags(Qt::FramelessWindowHint); // 设置全屏 + setWindowState(Qt::WindowState::WindowMaximized); this->setTitleBar(ui->wdgtTop); // 设置窗口位置和大小 move(0, 0); @@ -120,6 +123,22 @@ setWindowState(Qt::WindowMinimized | windowState()); } +void MainWindowForm::on_btnMaxWin_clicked() +{ + QScreen *screen = QGuiApplication::primaryScreen(); + QRect screenSize = screen->availableGeometry(); // 可用区域(排除任务栏) + + if (this->isMaximized()) { + resize(screenSize.width() * 0.8, screenSize.height() * 0.8); + move(QRandomGenerator::global()->bounded(10, 100), QRandomGenerator::global()->bounded(10, 50)); + this->showNormal(); + } else { + resize(screenSize.width(), screenSize.height()); + move(0, 0); + this->showMaximized(); + } +} + void MainWindowForm::on_btnCloseWin_clicked() { // 创建一个消息框 @@ -146,18 +165,9 @@ ui->labelTime->setText(now.toString("yyyy-MM-dd HH:mm:ss")); } -void MainWindowForm::on_btnMenuMax_clicked() -{ - if (this->isMaximized()) { - this->showNormal(); - } else { - this->showMaximized(); - } -} - void MainWindowForm::titleDblClick() { - on_btnMenuMax_clicked(); + on_btnMaxWin_clicked(); } void MainWindowForm::onMenuButtonsEabled(bool enable) { diff --git a/frame/MainWindowForm.h b/frame/MainWindowForm.h index 4d206b1..9b4eae4 100644 --- a/frame/MainWindowForm.h +++ b/frame/MainWindowForm.h @@ -45,11 +45,11 @@ private slots: void on_btnMinWin_clicked(); + void on_btnMaxWin_clicked(); void on_btnCloseWin_clicked(); void onFunctionButtonsAction(); void onUpdateTimestampHandler(); - void on_btnMenuMax_clicked(); void titleDblClick(); void onMenuButtonsEabled(bool enable); diff --git a/frame/MainWindowForm.ui b/frame/MainWindowForm.ui index bd42122..f37d171 100644 --- a/frame/MainWindowForm.ui +++ b/frame/MainWindowForm.ui @@ -41,7 +41,7 @@ 0 - 120 + 100 @@ -58,7 +58,7 @@ 20 - 0 + 20 @@ -88,8 +88,8 @@ - 120 - 120 + 150 + 100 @@ -107,6 +107,22 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + @@ -158,7 +174,7 @@ 100 - 84 + 72 @@ -166,7 +182,8 @@ - :/image/main/calibration.png:/image/main/calibration.png + :/image/main/icon_menu_calibration.png + :/image/main/icon_menu_calibration_selected.png:/image/main/icon_menu_calibration.png @@ -184,7 +201,7 @@ 100 - 84 + 72 @@ -192,7 +209,8 @@ - :/image/main/rawDataRecord.png:/image/main/rawDataRecord.png + :/image/main/icon_menu_check.png + :/image/main/icon_menu_check_selected.png:/image/main/icon_menu_check.png @@ -210,7 +228,7 @@ 100 - 84 + 72 @@ -218,7 +236,8 @@ - :/image/main/fileRes.png:/image/main/fileRes.png + :/image/main/icon_menu_infomation.png + :/image/main/icon_menu_infomation_checked.png:/image/main/icon_menu_infomation.png @@ -235,10 +254,147 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 50 + 20 + + + + + - 320 + 240 + 16777215 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 5 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + :/image/main/iconTemp.png + + + + + + + 34.5℃ + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + + + + :/image/main/iconHumi.png + + + + + + + 25%Rh + + + + + + + + + + + + + + 240 16777215 @@ -308,7 +464,7 @@ - :/image/main/icon_setting_p.png:/image/main/icon_setting_p.png + :/image/main/icon_setting.png:/image/main/icon_setting.png @@ -334,7 +490,33 @@ - :/image/main/icon_min_p.png:/image/main/icon_min_p.png + :/image/main/icon_min.png:/image/main/icon_min.png + + + + 32 + 32 + + + + + + + + + 40 + 40 + + + + 最小化 + + + + + + + :/image/main/icon_max.png:/image/main/icon_max.png @@ -360,7 +542,7 @@ - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + :/image/main/icon_close.png:/image/main/icon_close.png @@ -426,87 +608,9 @@ - - - - - 0 - 30 - - - - - 20 - - - 0 - - - 0 - - - 40 - - - 0 - - - - - Qt::Horizontal - - - - 1289 - 20 - - - - - - - - - - - - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 20 - - - - - - - - - - - - - - wdgtContent wdgtTop - wdgtFoot diff --git a/infomation/InfoMainForm.cpp b/infomation/InfoMainForm.cpp index c001199..5d0ffc8 100644 --- a/infomation/InfoMainForm.cpp +++ b/infomation/InfoMainForm.cpp @@ -21,9 +21,13 @@ void InfoMainForm::initForm() { + // 加载样式表 + QString qssStyle = QssFileUtils::loadQssFileContent(QApplication::applicationDirPath() + "/qss/infoMain.css"); + if (qssStyle.isEmpty() == false) { + this->setStyleSheet(qssStyle); // 仅本窗口生效 + } - - + ui->scrollArea->setWindowFlags(Qt::FramelessWindowHint); // 设置无边框 } void InfoMainForm::initSubMenuForms() { diff --git a/infomation/InfoMainForm.ui b/infomation/InfoMainForm.ui index 958a6b2..d9066dd 100644 --- a/infomation/InfoMainForm.ui +++ b/infomation/InfoMainForm.ui @@ -90,7 +90,7 @@ - 280 + 295 48 @@ -103,7 +103,7 @@ - 280 + 295 48 @@ -116,7 +116,7 @@ - 280 + 295 48 @@ -129,7 +129,7 @@ - 280 + 295 48 @@ -142,7 +142,7 @@ - 280 + 295 48 @@ -155,7 +155,7 @@ - 280 + 295 48 @@ -168,7 +168,7 @@ - 280 + 295 48 @@ -181,7 +181,7 @@ - 280 + 295 48 @@ -194,7 +194,7 @@ - 280 + 295 48 @@ -207,7 +207,7 @@ - 280 + 295 48 @@ -220,7 +220,7 @@ - 280 + 295 48 @@ -233,7 +233,7 @@ - 280 + 295 48 @@ -246,7 +246,7 @@ - 280 + 295 48 diff --git a/infomation/task/DeptTaskForm.cpp b/infomation/task/DeptTaskForm.cpp index ea21a9f..cc6bf31 100644 --- a/infomation/task/DeptTaskForm.cpp +++ b/infomation/task/DeptTaskForm.cpp @@ -18,12 +18,17 @@ delete ui; } -void DeptTaskForm::showEvent(QShowEvent *event) +void DeptTaskForm::showEvent(QShowEvent * event) { ui->tableDeptTask->adjustTableWidth(); getDeptTaskList(0); } +void DeptTaskForm::resizeEvent(QResizeEvent * event) +{ + ui->tableDeptTask->adjustTableWidth(); +} + void DeptTaskForm::initFormTable() { // 初始化查询条件 diff --git a/infomation/task/DeptTaskForm.h b/infomation/task/DeptTaskForm.h index 1055c36..3c1ad5b 100644 --- a/infomation/task/DeptTaskForm.h +++ b/infomation/task/DeptTaskForm.h @@ -21,7 +21,8 @@ ~DeptTaskForm(); protected: - void showEvent(QShowEvent *event) override; + void showEvent(QShowEvent * event) override; + void resizeEvent(QResizeEvent * event) override; private: Ui::DeptTaskForm *ui; diff --git a/main.cpp b/main.cpp index 525387e..0b78c87 100644 --- a/main.cpp +++ b/main.cpp @@ -1,5 +1,3 @@ -#include "MainWindow.h" - #include #include diff --git a/res/image/Index/u1176.svg b/res/image/Index/u1176.svg deleted file mode 100644 index c81ce8a..0000000 --- a/res/image/Index/u1176.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1180.svg b/res/image/Index/u1180.svg deleted file mode 100644 index 2ef24ab..0000000 --- a/res/image/Index/u1180.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1220.svg b/res/image/Index/u1220.svg deleted file mode 100644 index 43452aa..0000000 --- a/res/image/Index/u1220.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2158.svg b/res/image/Index/u2158.svg deleted file mode 100644 index fd249e0..0000000 --- a/res/image/Index/u2158.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u2188.svg b/res/image/Index/u2188.svg deleted file mode 100644 index 34f53c4..0000000 --- a/res/image/Index/u2188.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2189.svg b/res/image/Index/u2189.svg deleted file mode 100644 index 01a6bbb..0000000 --- a/res/image/Index/u2189.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2324.svg b/res/image/Index/u2324.svg deleted file mode 100644 index 797f1c5..0000000 --- a/res/image/Index/u2324.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2325.svg b/res/image/Index/u2325.svg deleted file mode 100644 index fefe01b..0000000 --- a/res/image/Index/u2325.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u642.svg b/res/image/Index/u642.svg deleted file mode 100644 index 33c9e0a..0000000 --- a/res/image/Index/u642.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u7406.svg b/res/image/Index/u7406.svg deleted file mode 100644 index 8a7a6d9..0000000 --- a/res/image/Index/u7406.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7453.svg b/res/image/Index/u7453.svg deleted file mode 100644 index 603c496..0000000 --- a/res/image/Index/u7453.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7458.svg b/res/image/Index/u7458.svg deleted file mode 100644 index b31087b..0000000 --- a/res/image/Index/u7458.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7488.svg b/res/image/Index/u7488.svg deleted file mode 100644 index 8baf439..0000000 --- a/res/image/Index/u7488.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7491.svg b/res/image/Index/u7491.svg deleted file mode 100644 index 3e41c10..0000000 --- a/res/image/Index/u7491.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7538.svg b/res/image/Index/u7538.svg deleted file mode 100644 index 417077d..0000000 --- a/res/image/Index/u7538.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u794.svg b/res/image/Index/u794.svg deleted file mode 100644 index e12cff7..0000000 --- a/res/image/Index/u794.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u8448.svg b/res/image/Index/u8448.svg deleted file mode 100644 index 7f6f4c0..0000000 --- a/res/image/Index/u8448.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u8458.svg b/res/image/Index/u8458.svg deleted file mode 100644 index 6d04a12..0000000 --- a/res/image/Index/u8458.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/main/bg_banner.png b/res/image/main/bg_banner.png new file mode 100644 index 0000000..26ddffd --- /dev/null +++ b/res/image/main/bg_banner.png Binary files differ diff --git a/res/image/main/iconHumi.png b/res/image/main/iconHumi.png index 4410d38..bd164e8 100644 --- a/res/image/main/iconHumi.png +++ b/res/image/main/iconHumi.png Binary files differ diff --git a/res/image/main/iconTemp.png b/res/image/main/iconTemp.png index 8fd059c..a2cfe4d 100644 --- a/res/image/main/iconTemp.png +++ b/res/image/main/iconTemp.png Binary files differ diff --git a/res/image/main/icon_close.png b/res/image/main/icon_close.png new file mode 100644 index 0000000..f3aa270 --- /dev/null +++ b/res/image/main/icon_close.png Binary files differ diff --git a/res/image/main/icon_close_p.png b/res/image/main/icon_close_p.png deleted file mode 100644 index b9ba30c..0000000 --- a/res/image/main/icon_close_p.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_main.png b/res/image/main/icon_main.png deleted file mode 100644 index 9d004d5..0000000 --- a/res/image/main/icon_main.png +++ /dev/null Binary files differ diff --git a/AutoCalibrationXC.pro b/AutoCalibrationXC.pro index 6bcb335..7790b37 100644 --- a/AutoCalibrationXC.pro +++ b/AutoCalibrationXC.pro @@ -24,11 +24,6 @@ include(QPagedTable/QPagedTable.pri) SOURCES += main.cpp -SOURCES += MainWindow.cpp - -HEADERS += MainWindow.h - -FORMS += MainWindow.ui RC_ICONS = res/autoCalibration.ico diff --git a/MainWindow.cpp b/MainWindow.cpp deleted file mode 100644 index ff126e8..0000000 --- a/MainWindow.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#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/MainWindow.h b/MainWindow.h deleted file mode 100644 index 4643e32..0000000 --- a/MainWindow.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#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; -}; -#endif // MAINWINDOW_H diff --git a/MainWindow.ui b/MainWindow.ui deleted file mode 100644 index b232854..0000000 --- a/MainWindow.ui +++ /dev/null @@ -1,22 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 800 - 600 - - - - MainWindow - - - - - - - - diff --git a/frame/CustomMessageBox.ui b/frame/CustomMessageBox.ui index 336be54..b545d74 100644 --- a/frame/CustomMessageBox.ui +++ b/frame/CustomMessageBox.ui @@ -84,8 +84,8 @@ - - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + + :/image/msgbox/icon_box_close.png:/image/msgbox/icon_box_close.png @@ -134,7 +134,7 @@ - :/image/msgbox/icon_box_success.png + :/image/msgbox/icon_box_success.png Qt::AlignCenter @@ -265,6 +265,8 @@ - + + + diff --git a/frame/MainWindowForm.cpp b/frame/MainWindowForm.cpp index 2ded44b..ec82cd7 100644 --- a/frame/MainWindowForm.cpp +++ b/frame/MainWindowForm.cpp @@ -1,6 +1,8 @@ #include "MainWindowForm.h" #include "ui_MainWindowForm.h" +#include + MainWindowForm::MainWindowForm(QWidget *parent) : FramelessWindow(parent), ui(new Ui::MainWindowForm) @@ -12,7 +14,7 @@ initMenuWidgets(); initFunctionButtons(); - // 每秒更新 界面上没有地方能摆 暂时先不启动定时器 + // 每秒更新 connect(TimeCounterUtil::getInstance().clockTimer, &QTimer::timeout, this, &MainWindowForm::onUpdateTimestampHandler); TimeCounterUtil::getInstance().clockTimer->start(1000); @@ -34,6 +36,7 @@ void MainWindowForm::initForm() { setWindowFlags(Qt::FramelessWindowHint); // 设置全屏 + setWindowState(Qt::WindowState::WindowMaximized); this->setTitleBar(ui->wdgtTop); // 设置窗口位置和大小 move(0, 0); @@ -120,6 +123,22 @@ setWindowState(Qt::WindowMinimized | windowState()); } +void MainWindowForm::on_btnMaxWin_clicked() +{ + QScreen *screen = QGuiApplication::primaryScreen(); + QRect screenSize = screen->availableGeometry(); // 可用区域(排除任务栏) + + if (this->isMaximized()) { + resize(screenSize.width() * 0.8, screenSize.height() * 0.8); + move(QRandomGenerator::global()->bounded(10, 100), QRandomGenerator::global()->bounded(10, 50)); + this->showNormal(); + } else { + resize(screenSize.width(), screenSize.height()); + move(0, 0); + this->showMaximized(); + } +} + void MainWindowForm::on_btnCloseWin_clicked() { // 创建一个消息框 @@ -146,18 +165,9 @@ ui->labelTime->setText(now.toString("yyyy-MM-dd HH:mm:ss")); } -void MainWindowForm::on_btnMenuMax_clicked() -{ - if (this->isMaximized()) { - this->showNormal(); - } else { - this->showMaximized(); - } -} - void MainWindowForm::titleDblClick() { - on_btnMenuMax_clicked(); + on_btnMaxWin_clicked(); } void MainWindowForm::onMenuButtonsEabled(bool enable) { diff --git a/frame/MainWindowForm.h b/frame/MainWindowForm.h index 4d206b1..9b4eae4 100644 --- a/frame/MainWindowForm.h +++ b/frame/MainWindowForm.h @@ -45,11 +45,11 @@ private slots: void on_btnMinWin_clicked(); + void on_btnMaxWin_clicked(); void on_btnCloseWin_clicked(); void onFunctionButtonsAction(); void onUpdateTimestampHandler(); - void on_btnMenuMax_clicked(); void titleDblClick(); void onMenuButtonsEabled(bool enable); diff --git a/frame/MainWindowForm.ui b/frame/MainWindowForm.ui index bd42122..f37d171 100644 --- a/frame/MainWindowForm.ui +++ b/frame/MainWindowForm.ui @@ -41,7 +41,7 @@ 0 - 120 + 100 @@ -58,7 +58,7 @@ 20 - 0 + 20 @@ -88,8 +88,8 @@ - 120 - 120 + 150 + 100 @@ -107,6 +107,22 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + @@ -158,7 +174,7 @@ 100 - 84 + 72 @@ -166,7 +182,8 @@ - :/image/main/calibration.png:/image/main/calibration.png + :/image/main/icon_menu_calibration.png + :/image/main/icon_menu_calibration_selected.png:/image/main/icon_menu_calibration.png @@ -184,7 +201,7 @@ 100 - 84 + 72 @@ -192,7 +209,8 @@ - :/image/main/rawDataRecord.png:/image/main/rawDataRecord.png + :/image/main/icon_menu_check.png + :/image/main/icon_menu_check_selected.png:/image/main/icon_menu_check.png @@ -210,7 +228,7 @@ 100 - 84 + 72 @@ -218,7 +236,8 @@ - :/image/main/fileRes.png:/image/main/fileRes.png + :/image/main/icon_menu_infomation.png + :/image/main/icon_menu_infomation_checked.png:/image/main/icon_menu_infomation.png @@ -235,10 +254,147 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 50 + 20 + + + + + - 320 + 240 + 16777215 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 5 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + :/image/main/iconTemp.png + + + + + + + 34.5℃ + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + + + + :/image/main/iconHumi.png + + + + + + + 25%Rh + + + + + + + + + + + + + + 240 16777215 @@ -308,7 +464,7 @@ - :/image/main/icon_setting_p.png:/image/main/icon_setting_p.png + :/image/main/icon_setting.png:/image/main/icon_setting.png @@ -334,7 +490,33 @@ - :/image/main/icon_min_p.png:/image/main/icon_min_p.png + :/image/main/icon_min.png:/image/main/icon_min.png + + + + 32 + 32 + + + + + + + + + 40 + 40 + + + + 最小化 + + + + + + + :/image/main/icon_max.png:/image/main/icon_max.png @@ -360,7 +542,7 @@ - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + :/image/main/icon_close.png:/image/main/icon_close.png @@ -426,87 +608,9 @@ - - - - - 0 - 30 - - - - - 20 - - - 0 - - - 0 - - - 40 - - - 0 - - - - - Qt::Horizontal - - - - 1289 - 20 - - - - - - - - - - - - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 20 - - - - - - - - - - - - - - wdgtContent wdgtTop - wdgtFoot diff --git a/infomation/InfoMainForm.cpp b/infomation/InfoMainForm.cpp index c001199..5d0ffc8 100644 --- a/infomation/InfoMainForm.cpp +++ b/infomation/InfoMainForm.cpp @@ -21,9 +21,13 @@ void InfoMainForm::initForm() { + // 加载样式表 + QString qssStyle = QssFileUtils::loadQssFileContent(QApplication::applicationDirPath() + "/qss/infoMain.css"); + if (qssStyle.isEmpty() == false) { + this->setStyleSheet(qssStyle); // 仅本窗口生效 + } - - + ui->scrollArea->setWindowFlags(Qt::FramelessWindowHint); // 设置无边框 } void InfoMainForm::initSubMenuForms() { diff --git a/infomation/InfoMainForm.ui b/infomation/InfoMainForm.ui index 958a6b2..d9066dd 100644 --- a/infomation/InfoMainForm.ui +++ b/infomation/InfoMainForm.ui @@ -90,7 +90,7 @@ - 280 + 295 48 @@ -103,7 +103,7 @@ - 280 + 295 48 @@ -116,7 +116,7 @@ - 280 + 295 48 @@ -129,7 +129,7 @@ - 280 + 295 48 @@ -142,7 +142,7 @@ - 280 + 295 48 @@ -155,7 +155,7 @@ - 280 + 295 48 @@ -168,7 +168,7 @@ - 280 + 295 48 @@ -181,7 +181,7 @@ - 280 + 295 48 @@ -194,7 +194,7 @@ - 280 + 295 48 @@ -207,7 +207,7 @@ - 280 + 295 48 @@ -220,7 +220,7 @@ - 280 + 295 48 @@ -233,7 +233,7 @@ - 280 + 295 48 @@ -246,7 +246,7 @@ - 280 + 295 48 diff --git a/infomation/task/DeptTaskForm.cpp b/infomation/task/DeptTaskForm.cpp index ea21a9f..cc6bf31 100644 --- a/infomation/task/DeptTaskForm.cpp +++ b/infomation/task/DeptTaskForm.cpp @@ -18,12 +18,17 @@ delete ui; } -void DeptTaskForm::showEvent(QShowEvent *event) +void DeptTaskForm::showEvent(QShowEvent * event) { ui->tableDeptTask->adjustTableWidth(); getDeptTaskList(0); } +void DeptTaskForm::resizeEvent(QResizeEvent * event) +{ + ui->tableDeptTask->adjustTableWidth(); +} + void DeptTaskForm::initFormTable() { // 初始化查询条件 diff --git a/infomation/task/DeptTaskForm.h b/infomation/task/DeptTaskForm.h index 1055c36..3c1ad5b 100644 --- a/infomation/task/DeptTaskForm.h +++ b/infomation/task/DeptTaskForm.h @@ -21,7 +21,8 @@ ~DeptTaskForm(); protected: - void showEvent(QShowEvent *event) override; + void showEvent(QShowEvent * event) override; + void resizeEvent(QResizeEvent * event) override; private: Ui::DeptTaskForm *ui; diff --git a/main.cpp b/main.cpp index 525387e..0b78c87 100644 --- a/main.cpp +++ b/main.cpp @@ -1,5 +1,3 @@ -#include "MainWindow.h" - #include #include diff --git a/res/image/Index/u1176.svg b/res/image/Index/u1176.svg deleted file mode 100644 index c81ce8a..0000000 --- a/res/image/Index/u1176.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1180.svg b/res/image/Index/u1180.svg deleted file mode 100644 index 2ef24ab..0000000 --- a/res/image/Index/u1180.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1220.svg b/res/image/Index/u1220.svg deleted file mode 100644 index 43452aa..0000000 --- a/res/image/Index/u1220.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2158.svg b/res/image/Index/u2158.svg deleted file mode 100644 index fd249e0..0000000 --- a/res/image/Index/u2158.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u2188.svg b/res/image/Index/u2188.svg deleted file mode 100644 index 34f53c4..0000000 --- a/res/image/Index/u2188.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2189.svg b/res/image/Index/u2189.svg deleted file mode 100644 index 01a6bbb..0000000 --- a/res/image/Index/u2189.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2324.svg b/res/image/Index/u2324.svg deleted file mode 100644 index 797f1c5..0000000 --- a/res/image/Index/u2324.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2325.svg b/res/image/Index/u2325.svg deleted file mode 100644 index fefe01b..0000000 --- a/res/image/Index/u2325.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u642.svg b/res/image/Index/u642.svg deleted file mode 100644 index 33c9e0a..0000000 --- a/res/image/Index/u642.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u7406.svg b/res/image/Index/u7406.svg deleted file mode 100644 index 8a7a6d9..0000000 --- a/res/image/Index/u7406.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7453.svg b/res/image/Index/u7453.svg deleted file mode 100644 index 603c496..0000000 --- a/res/image/Index/u7453.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7458.svg b/res/image/Index/u7458.svg deleted file mode 100644 index b31087b..0000000 --- a/res/image/Index/u7458.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7488.svg b/res/image/Index/u7488.svg deleted file mode 100644 index 8baf439..0000000 --- a/res/image/Index/u7488.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7491.svg b/res/image/Index/u7491.svg deleted file mode 100644 index 3e41c10..0000000 --- a/res/image/Index/u7491.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7538.svg b/res/image/Index/u7538.svg deleted file mode 100644 index 417077d..0000000 --- a/res/image/Index/u7538.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u794.svg b/res/image/Index/u794.svg deleted file mode 100644 index e12cff7..0000000 --- a/res/image/Index/u794.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u8448.svg b/res/image/Index/u8448.svg deleted file mode 100644 index 7f6f4c0..0000000 --- a/res/image/Index/u8448.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u8458.svg b/res/image/Index/u8458.svg deleted file mode 100644 index 6d04a12..0000000 --- a/res/image/Index/u8458.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/main/bg_banner.png b/res/image/main/bg_banner.png new file mode 100644 index 0000000..26ddffd --- /dev/null +++ b/res/image/main/bg_banner.png Binary files differ diff --git a/res/image/main/iconHumi.png b/res/image/main/iconHumi.png index 4410d38..bd164e8 100644 --- a/res/image/main/iconHumi.png +++ b/res/image/main/iconHumi.png Binary files differ diff --git a/res/image/main/iconTemp.png b/res/image/main/iconTemp.png index 8fd059c..a2cfe4d 100644 --- a/res/image/main/iconTemp.png +++ b/res/image/main/iconTemp.png Binary files differ diff --git a/res/image/main/icon_close.png b/res/image/main/icon_close.png new file mode 100644 index 0000000..f3aa270 --- /dev/null +++ b/res/image/main/icon_close.png Binary files differ diff --git a/res/image/main/icon_close_p.png b/res/image/main/icon_close_p.png deleted file mode 100644 index b9ba30c..0000000 --- a/res/image/main/icon_close_p.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_main.png b/res/image/main/icon_main.png deleted file mode 100644 index 9d004d5..0000000 --- a/res/image/main/icon_main.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_max.png b/res/image/main/icon_max.png new file mode 100644 index 0000000..6cbf073 --- /dev/null +++ b/res/image/main/icon_max.png Binary files differ diff --git a/AutoCalibrationXC.pro b/AutoCalibrationXC.pro index 6bcb335..7790b37 100644 --- a/AutoCalibrationXC.pro +++ b/AutoCalibrationXC.pro @@ -24,11 +24,6 @@ include(QPagedTable/QPagedTable.pri) SOURCES += main.cpp -SOURCES += MainWindow.cpp - -HEADERS += MainWindow.h - -FORMS += MainWindow.ui RC_ICONS = res/autoCalibration.ico diff --git a/MainWindow.cpp b/MainWindow.cpp deleted file mode 100644 index ff126e8..0000000 --- a/MainWindow.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#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/MainWindow.h b/MainWindow.h deleted file mode 100644 index 4643e32..0000000 --- a/MainWindow.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#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; -}; -#endif // MAINWINDOW_H diff --git a/MainWindow.ui b/MainWindow.ui deleted file mode 100644 index b232854..0000000 --- a/MainWindow.ui +++ /dev/null @@ -1,22 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 800 - 600 - - - - MainWindow - - - - - - - - diff --git a/frame/CustomMessageBox.ui b/frame/CustomMessageBox.ui index 336be54..b545d74 100644 --- a/frame/CustomMessageBox.ui +++ b/frame/CustomMessageBox.ui @@ -84,8 +84,8 @@ - - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + + :/image/msgbox/icon_box_close.png:/image/msgbox/icon_box_close.png @@ -134,7 +134,7 @@ - :/image/msgbox/icon_box_success.png + :/image/msgbox/icon_box_success.png Qt::AlignCenter @@ -265,6 +265,8 @@ - + + + diff --git a/frame/MainWindowForm.cpp b/frame/MainWindowForm.cpp index 2ded44b..ec82cd7 100644 --- a/frame/MainWindowForm.cpp +++ b/frame/MainWindowForm.cpp @@ -1,6 +1,8 @@ #include "MainWindowForm.h" #include "ui_MainWindowForm.h" +#include + MainWindowForm::MainWindowForm(QWidget *parent) : FramelessWindow(parent), ui(new Ui::MainWindowForm) @@ -12,7 +14,7 @@ initMenuWidgets(); initFunctionButtons(); - // 每秒更新 界面上没有地方能摆 暂时先不启动定时器 + // 每秒更新 connect(TimeCounterUtil::getInstance().clockTimer, &QTimer::timeout, this, &MainWindowForm::onUpdateTimestampHandler); TimeCounterUtil::getInstance().clockTimer->start(1000); @@ -34,6 +36,7 @@ void MainWindowForm::initForm() { setWindowFlags(Qt::FramelessWindowHint); // 设置全屏 + setWindowState(Qt::WindowState::WindowMaximized); this->setTitleBar(ui->wdgtTop); // 设置窗口位置和大小 move(0, 0); @@ -120,6 +123,22 @@ setWindowState(Qt::WindowMinimized | windowState()); } +void MainWindowForm::on_btnMaxWin_clicked() +{ + QScreen *screen = QGuiApplication::primaryScreen(); + QRect screenSize = screen->availableGeometry(); // 可用区域(排除任务栏) + + if (this->isMaximized()) { + resize(screenSize.width() * 0.8, screenSize.height() * 0.8); + move(QRandomGenerator::global()->bounded(10, 100), QRandomGenerator::global()->bounded(10, 50)); + this->showNormal(); + } else { + resize(screenSize.width(), screenSize.height()); + move(0, 0); + this->showMaximized(); + } +} + void MainWindowForm::on_btnCloseWin_clicked() { // 创建一个消息框 @@ -146,18 +165,9 @@ ui->labelTime->setText(now.toString("yyyy-MM-dd HH:mm:ss")); } -void MainWindowForm::on_btnMenuMax_clicked() -{ - if (this->isMaximized()) { - this->showNormal(); - } else { - this->showMaximized(); - } -} - void MainWindowForm::titleDblClick() { - on_btnMenuMax_clicked(); + on_btnMaxWin_clicked(); } void MainWindowForm::onMenuButtonsEabled(bool enable) { diff --git a/frame/MainWindowForm.h b/frame/MainWindowForm.h index 4d206b1..9b4eae4 100644 --- a/frame/MainWindowForm.h +++ b/frame/MainWindowForm.h @@ -45,11 +45,11 @@ private slots: void on_btnMinWin_clicked(); + void on_btnMaxWin_clicked(); void on_btnCloseWin_clicked(); void onFunctionButtonsAction(); void onUpdateTimestampHandler(); - void on_btnMenuMax_clicked(); void titleDblClick(); void onMenuButtonsEabled(bool enable); diff --git a/frame/MainWindowForm.ui b/frame/MainWindowForm.ui index bd42122..f37d171 100644 --- a/frame/MainWindowForm.ui +++ b/frame/MainWindowForm.ui @@ -41,7 +41,7 @@ 0 - 120 + 100 @@ -58,7 +58,7 @@ 20 - 0 + 20 @@ -88,8 +88,8 @@ - 120 - 120 + 150 + 100 @@ -107,6 +107,22 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + @@ -158,7 +174,7 @@ 100 - 84 + 72 @@ -166,7 +182,8 @@ - :/image/main/calibration.png:/image/main/calibration.png + :/image/main/icon_menu_calibration.png + :/image/main/icon_menu_calibration_selected.png:/image/main/icon_menu_calibration.png @@ -184,7 +201,7 @@ 100 - 84 + 72 @@ -192,7 +209,8 @@ - :/image/main/rawDataRecord.png:/image/main/rawDataRecord.png + :/image/main/icon_menu_check.png + :/image/main/icon_menu_check_selected.png:/image/main/icon_menu_check.png @@ -210,7 +228,7 @@ 100 - 84 + 72 @@ -218,7 +236,8 @@ - :/image/main/fileRes.png:/image/main/fileRes.png + :/image/main/icon_menu_infomation.png + :/image/main/icon_menu_infomation_checked.png:/image/main/icon_menu_infomation.png @@ -235,10 +254,147 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 50 + 20 + + + + + - 320 + 240 + 16777215 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 5 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + :/image/main/iconTemp.png + + + + + + + 34.5℃ + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + + + + :/image/main/iconHumi.png + + + + + + + 25%Rh + + + + + + + + + + + + + + 240 16777215 @@ -308,7 +464,7 @@ - :/image/main/icon_setting_p.png:/image/main/icon_setting_p.png + :/image/main/icon_setting.png:/image/main/icon_setting.png @@ -334,7 +490,33 @@ - :/image/main/icon_min_p.png:/image/main/icon_min_p.png + :/image/main/icon_min.png:/image/main/icon_min.png + + + + 32 + 32 + + + + + + + + + 40 + 40 + + + + 最小化 + + + + + + + :/image/main/icon_max.png:/image/main/icon_max.png @@ -360,7 +542,7 @@ - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + :/image/main/icon_close.png:/image/main/icon_close.png @@ -426,87 +608,9 @@ - - - - - 0 - 30 - - - - - 20 - - - 0 - - - 0 - - - 40 - - - 0 - - - - - Qt::Horizontal - - - - 1289 - 20 - - - - - - - - - - - - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 20 - - - - - - - - - - - - - - wdgtContent wdgtTop - wdgtFoot diff --git a/infomation/InfoMainForm.cpp b/infomation/InfoMainForm.cpp index c001199..5d0ffc8 100644 --- a/infomation/InfoMainForm.cpp +++ b/infomation/InfoMainForm.cpp @@ -21,9 +21,13 @@ void InfoMainForm::initForm() { + // 加载样式表 + QString qssStyle = QssFileUtils::loadQssFileContent(QApplication::applicationDirPath() + "/qss/infoMain.css"); + if (qssStyle.isEmpty() == false) { + this->setStyleSheet(qssStyle); // 仅本窗口生效 + } - - + ui->scrollArea->setWindowFlags(Qt::FramelessWindowHint); // 设置无边框 } void InfoMainForm::initSubMenuForms() { diff --git a/infomation/InfoMainForm.ui b/infomation/InfoMainForm.ui index 958a6b2..d9066dd 100644 --- a/infomation/InfoMainForm.ui +++ b/infomation/InfoMainForm.ui @@ -90,7 +90,7 @@ - 280 + 295 48 @@ -103,7 +103,7 @@ - 280 + 295 48 @@ -116,7 +116,7 @@ - 280 + 295 48 @@ -129,7 +129,7 @@ - 280 + 295 48 @@ -142,7 +142,7 @@ - 280 + 295 48 @@ -155,7 +155,7 @@ - 280 + 295 48 @@ -168,7 +168,7 @@ - 280 + 295 48 @@ -181,7 +181,7 @@ - 280 + 295 48 @@ -194,7 +194,7 @@ - 280 + 295 48 @@ -207,7 +207,7 @@ - 280 + 295 48 @@ -220,7 +220,7 @@ - 280 + 295 48 @@ -233,7 +233,7 @@ - 280 + 295 48 @@ -246,7 +246,7 @@ - 280 + 295 48 diff --git a/infomation/task/DeptTaskForm.cpp b/infomation/task/DeptTaskForm.cpp index ea21a9f..cc6bf31 100644 --- a/infomation/task/DeptTaskForm.cpp +++ b/infomation/task/DeptTaskForm.cpp @@ -18,12 +18,17 @@ delete ui; } -void DeptTaskForm::showEvent(QShowEvent *event) +void DeptTaskForm::showEvent(QShowEvent * event) { ui->tableDeptTask->adjustTableWidth(); getDeptTaskList(0); } +void DeptTaskForm::resizeEvent(QResizeEvent * event) +{ + ui->tableDeptTask->adjustTableWidth(); +} + void DeptTaskForm::initFormTable() { // 初始化查询条件 diff --git a/infomation/task/DeptTaskForm.h b/infomation/task/DeptTaskForm.h index 1055c36..3c1ad5b 100644 --- a/infomation/task/DeptTaskForm.h +++ b/infomation/task/DeptTaskForm.h @@ -21,7 +21,8 @@ ~DeptTaskForm(); protected: - void showEvent(QShowEvent *event) override; + void showEvent(QShowEvent * event) override; + void resizeEvent(QResizeEvent * event) override; private: Ui::DeptTaskForm *ui; diff --git a/main.cpp b/main.cpp index 525387e..0b78c87 100644 --- a/main.cpp +++ b/main.cpp @@ -1,5 +1,3 @@ -#include "MainWindow.h" - #include #include diff --git a/res/image/Index/u1176.svg b/res/image/Index/u1176.svg deleted file mode 100644 index c81ce8a..0000000 --- a/res/image/Index/u1176.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1180.svg b/res/image/Index/u1180.svg deleted file mode 100644 index 2ef24ab..0000000 --- a/res/image/Index/u1180.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1220.svg b/res/image/Index/u1220.svg deleted file mode 100644 index 43452aa..0000000 --- a/res/image/Index/u1220.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2158.svg b/res/image/Index/u2158.svg deleted file mode 100644 index fd249e0..0000000 --- a/res/image/Index/u2158.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u2188.svg b/res/image/Index/u2188.svg deleted file mode 100644 index 34f53c4..0000000 --- a/res/image/Index/u2188.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2189.svg b/res/image/Index/u2189.svg deleted file mode 100644 index 01a6bbb..0000000 --- a/res/image/Index/u2189.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2324.svg b/res/image/Index/u2324.svg deleted file mode 100644 index 797f1c5..0000000 --- a/res/image/Index/u2324.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2325.svg b/res/image/Index/u2325.svg deleted file mode 100644 index fefe01b..0000000 --- a/res/image/Index/u2325.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u642.svg b/res/image/Index/u642.svg deleted file mode 100644 index 33c9e0a..0000000 --- a/res/image/Index/u642.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u7406.svg b/res/image/Index/u7406.svg deleted file mode 100644 index 8a7a6d9..0000000 --- a/res/image/Index/u7406.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7453.svg b/res/image/Index/u7453.svg deleted file mode 100644 index 603c496..0000000 --- a/res/image/Index/u7453.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7458.svg b/res/image/Index/u7458.svg deleted file mode 100644 index b31087b..0000000 --- a/res/image/Index/u7458.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7488.svg b/res/image/Index/u7488.svg deleted file mode 100644 index 8baf439..0000000 --- a/res/image/Index/u7488.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7491.svg b/res/image/Index/u7491.svg deleted file mode 100644 index 3e41c10..0000000 --- a/res/image/Index/u7491.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7538.svg b/res/image/Index/u7538.svg deleted file mode 100644 index 417077d..0000000 --- a/res/image/Index/u7538.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u794.svg b/res/image/Index/u794.svg deleted file mode 100644 index e12cff7..0000000 --- a/res/image/Index/u794.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u8448.svg b/res/image/Index/u8448.svg deleted file mode 100644 index 7f6f4c0..0000000 --- a/res/image/Index/u8448.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u8458.svg b/res/image/Index/u8458.svg deleted file mode 100644 index 6d04a12..0000000 --- a/res/image/Index/u8458.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/main/bg_banner.png b/res/image/main/bg_banner.png new file mode 100644 index 0000000..26ddffd --- /dev/null +++ b/res/image/main/bg_banner.png Binary files differ diff --git a/res/image/main/iconHumi.png b/res/image/main/iconHumi.png index 4410d38..bd164e8 100644 --- a/res/image/main/iconHumi.png +++ b/res/image/main/iconHumi.png Binary files differ diff --git a/res/image/main/iconTemp.png b/res/image/main/iconTemp.png index 8fd059c..a2cfe4d 100644 --- a/res/image/main/iconTemp.png +++ b/res/image/main/iconTemp.png Binary files differ diff --git a/res/image/main/icon_close.png b/res/image/main/icon_close.png new file mode 100644 index 0000000..f3aa270 --- /dev/null +++ b/res/image/main/icon_close.png Binary files differ diff --git a/res/image/main/icon_close_p.png b/res/image/main/icon_close_p.png deleted file mode 100644 index b9ba30c..0000000 --- a/res/image/main/icon_close_p.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_main.png b/res/image/main/icon_main.png deleted file mode 100644 index 9d004d5..0000000 --- a/res/image/main/icon_main.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_max.png b/res/image/main/icon_max.png new file mode 100644 index 0000000..6cbf073 --- /dev/null +++ b/res/image/main/icon_max.png Binary files differ diff --git a/res/image/main/icon_menu_calibration.png b/res/image/main/icon_menu_calibration.png new file mode 100644 index 0000000..6fca8be --- /dev/null +++ b/res/image/main/icon_menu_calibration.png Binary files differ diff --git a/AutoCalibrationXC.pro b/AutoCalibrationXC.pro index 6bcb335..7790b37 100644 --- a/AutoCalibrationXC.pro +++ b/AutoCalibrationXC.pro @@ -24,11 +24,6 @@ include(QPagedTable/QPagedTable.pri) SOURCES += main.cpp -SOURCES += MainWindow.cpp - -HEADERS += MainWindow.h - -FORMS += MainWindow.ui RC_ICONS = res/autoCalibration.ico diff --git a/MainWindow.cpp b/MainWindow.cpp deleted file mode 100644 index ff126e8..0000000 --- a/MainWindow.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#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/MainWindow.h b/MainWindow.h deleted file mode 100644 index 4643e32..0000000 --- a/MainWindow.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#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; -}; -#endif // MAINWINDOW_H diff --git a/MainWindow.ui b/MainWindow.ui deleted file mode 100644 index b232854..0000000 --- a/MainWindow.ui +++ /dev/null @@ -1,22 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 800 - 600 - - - - MainWindow - - - - - - - - diff --git a/frame/CustomMessageBox.ui b/frame/CustomMessageBox.ui index 336be54..b545d74 100644 --- a/frame/CustomMessageBox.ui +++ b/frame/CustomMessageBox.ui @@ -84,8 +84,8 @@ - - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + + :/image/msgbox/icon_box_close.png:/image/msgbox/icon_box_close.png @@ -134,7 +134,7 @@ - :/image/msgbox/icon_box_success.png + :/image/msgbox/icon_box_success.png Qt::AlignCenter @@ -265,6 +265,8 @@ - + + + diff --git a/frame/MainWindowForm.cpp b/frame/MainWindowForm.cpp index 2ded44b..ec82cd7 100644 --- a/frame/MainWindowForm.cpp +++ b/frame/MainWindowForm.cpp @@ -1,6 +1,8 @@ #include "MainWindowForm.h" #include "ui_MainWindowForm.h" +#include + MainWindowForm::MainWindowForm(QWidget *parent) : FramelessWindow(parent), ui(new Ui::MainWindowForm) @@ -12,7 +14,7 @@ initMenuWidgets(); initFunctionButtons(); - // 每秒更新 界面上没有地方能摆 暂时先不启动定时器 + // 每秒更新 connect(TimeCounterUtil::getInstance().clockTimer, &QTimer::timeout, this, &MainWindowForm::onUpdateTimestampHandler); TimeCounterUtil::getInstance().clockTimer->start(1000); @@ -34,6 +36,7 @@ void MainWindowForm::initForm() { setWindowFlags(Qt::FramelessWindowHint); // 设置全屏 + setWindowState(Qt::WindowState::WindowMaximized); this->setTitleBar(ui->wdgtTop); // 设置窗口位置和大小 move(0, 0); @@ -120,6 +123,22 @@ setWindowState(Qt::WindowMinimized | windowState()); } +void MainWindowForm::on_btnMaxWin_clicked() +{ + QScreen *screen = QGuiApplication::primaryScreen(); + QRect screenSize = screen->availableGeometry(); // 可用区域(排除任务栏) + + if (this->isMaximized()) { + resize(screenSize.width() * 0.8, screenSize.height() * 0.8); + move(QRandomGenerator::global()->bounded(10, 100), QRandomGenerator::global()->bounded(10, 50)); + this->showNormal(); + } else { + resize(screenSize.width(), screenSize.height()); + move(0, 0); + this->showMaximized(); + } +} + void MainWindowForm::on_btnCloseWin_clicked() { // 创建一个消息框 @@ -146,18 +165,9 @@ ui->labelTime->setText(now.toString("yyyy-MM-dd HH:mm:ss")); } -void MainWindowForm::on_btnMenuMax_clicked() -{ - if (this->isMaximized()) { - this->showNormal(); - } else { - this->showMaximized(); - } -} - void MainWindowForm::titleDblClick() { - on_btnMenuMax_clicked(); + on_btnMaxWin_clicked(); } void MainWindowForm::onMenuButtonsEabled(bool enable) { diff --git a/frame/MainWindowForm.h b/frame/MainWindowForm.h index 4d206b1..9b4eae4 100644 --- a/frame/MainWindowForm.h +++ b/frame/MainWindowForm.h @@ -45,11 +45,11 @@ private slots: void on_btnMinWin_clicked(); + void on_btnMaxWin_clicked(); void on_btnCloseWin_clicked(); void onFunctionButtonsAction(); void onUpdateTimestampHandler(); - void on_btnMenuMax_clicked(); void titleDblClick(); void onMenuButtonsEabled(bool enable); diff --git a/frame/MainWindowForm.ui b/frame/MainWindowForm.ui index bd42122..f37d171 100644 --- a/frame/MainWindowForm.ui +++ b/frame/MainWindowForm.ui @@ -41,7 +41,7 @@ 0 - 120 + 100 @@ -58,7 +58,7 @@ 20 - 0 + 20 @@ -88,8 +88,8 @@ - 120 - 120 + 150 + 100 @@ -107,6 +107,22 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + @@ -158,7 +174,7 @@ 100 - 84 + 72 @@ -166,7 +182,8 @@ - :/image/main/calibration.png:/image/main/calibration.png + :/image/main/icon_menu_calibration.png + :/image/main/icon_menu_calibration_selected.png:/image/main/icon_menu_calibration.png @@ -184,7 +201,7 @@ 100 - 84 + 72 @@ -192,7 +209,8 @@ - :/image/main/rawDataRecord.png:/image/main/rawDataRecord.png + :/image/main/icon_menu_check.png + :/image/main/icon_menu_check_selected.png:/image/main/icon_menu_check.png @@ -210,7 +228,7 @@ 100 - 84 + 72 @@ -218,7 +236,8 @@ - :/image/main/fileRes.png:/image/main/fileRes.png + :/image/main/icon_menu_infomation.png + :/image/main/icon_menu_infomation_checked.png:/image/main/icon_menu_infomation.png @@ -235,10 +254,147 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 50 + 20 + + + + + - 320 + 240 + 16777215 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 5 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + :/image/main/iconTemp.png + + + + + + + 34.5℃ + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + + + + :/image/main/iconHumi.png + + + + + + + 25%Rh + + + + + + + + + + + + + + 240 16777215 @@ -308,7 +464,7 @@ - :/image/main/icon_setting_p.png:/image/main/icon_setting_p.png + :/image/main/icon_setting.png:/image/main/icon_setting.png @@ -334,7 +490,33 @@ - :/image/main/icon_min_p.png:/image/main/icon_min_p.png + :/image/main/icon_min.png:/image/main/icon_min.png + + + + 32 + 32 + + + + + + + + + 40 + 40 + + + + 最小化 + + + + + + + :/image/main/icon_max.png:/image/main/icon_max.png @@ -360,7 +542,7 @@ - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + :/image/main/icon_close.png:/image/main/icon_close.png @@ -426,87 +608,9 @@ - - - - - 0 - 30 - - - - - 20 - - - 0 - - - 0 - - - 40 - - - 0 - - - - - Qt::Horizontal - - - - 1289 - 20 - - - - - - - - - - - - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 20 - - - - - - - - - - - - - - wdgtContent wdgtTop - wdgtFoot diff --git a/infomation/InfoMainForm.cpp b/infomation/InfoMainForm.cpp index c001199..5d0ffc8 100644 --- a/infomation/InfoMainForm.cpp +++ b/infomation/InfoMainForm.cpp @@ -21,9 +21,13 @@ void InfoMainForm::initForm() { + // 加载样式表 + QString qssStyle = QssFileUtils::loadQssFileContent(QApplication::applicationDirPath() + "/qss/infoMain.css"); + if (qssStyle.isEmpty() == false) { + this->setStyleSheet(qssStyle); // 仅本窗口生效 + } - - + ui->scrollArea->setWindowFlags(Qt::FramelessWindowHint); // 设置无边框 } void InfoMainForm::initSubMenuForms() { diff --git a/infomation/InfoMainForm.ui b/infomation/InfoMainForm.ui index 958a6b2..d9066dd 100644 --- a/infomation/InfoMainForm.ui +++ b/infomation/InfoMainForm.ui @@ -90,7 +90,7 @@ - 280 + 295 48 @@ -103,7 +103,7 @@ - 280 + 295 48 @@ -116,7 +116,7 @@ - 280 + 295 48 @@ -129,7 +129,7 @@ - 280 + 295 48 @@ -142,7 +142,7 @@ - 280 + 295 48 @@ -155,7 +155,7 @@ - 280 + 295 48 @@ -168,7 +168,7 @@ - 280 + 295 48 @@ -181,7 +181,7 @@ - 280 + 295 48 @@ -194,7 +194,7 @@ - 280 + 295 48 @@ -207,7 +207,7 @@ - 280 + 295 48 @@ -220,7 +220,7 @@ - 280 + 295 48 @@ -233,7 +233,7 @@ - 280 + 295 48 @@ -246,7 +246,7 @@ - 280 + 295 48 diff --git a/infomation/task/DeptTaskForm.cpp b/infomation/task/DeptTaskForm.cpp index ea21a9f..cc6bf31 100644 --- a/infomation/task/DeptTaskForm.cpp +++ b/infomation/task/DeptTaskForm.cpp @@ -18,12 +18,17 @@ delete ui; } -void DeptTaskForm::showEvent(QShowEvent *event) +void DeptTaskForm::showEvent(QShowEvent * event) { ui->tableDeptTask->adjustTableWidth(); getDeptTaskList(0); } +void DeptTaskForm::resizeEvent(QResizeEvent * event) +{ + ui->tableDeptTask->adjustTableWidth(); +} + void DeptTaskForm::initFormTable() { // 初始化查询条件 diff --git a/infomation/task/DeptTaskForm.h b/infomation/task/DeptTaskForm.h index 1055c36..3c1ad5b 100644 --- a/infomation/task/DeptTaskForm.h +++ b/infomation/task/DeptTaskForm.h @@ -21,7 +21,8 @@ ~DeptTaskForm(); protected: - void showEvent(QShowEvent *event) override; + void showEvent(QShowEvent * event) override; + void resizeEvent(QResizeEvent * event) override; private: Ui::DeptTaskForm *ui; diff --git a/main.cpp b/main.cpp index 525387e..0b78c87 100644 --- a/main.cpp +++ b/main.cpp @@ -1,5 +1,3 @@ -#include "MainWindow.h" - #include #include diff --git a/res/image/Index/u1176.svg b/res/image/Index/u1176.svg deleted file mode 100644 index c81ce8a..0000000 --- a/res/image/Index/u1176.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1180.svg b/res/image/Index/u1180.svg deleted file mode 100644 index 2ef24ab..0000000 --- a/res/image/Index/u1180.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1220.svg b/res/image/Index/u1220.svg deleted file mode 100644 index 43452aa..0000000 --- a/res/image/Index/u1220.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2158.svg b/res/image/Index/u2158.svg deleted file mode 100644 index fd249e0..0000000 --- a/res/image/Index/u2158.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u2188.svg b/res/image/Index/u2188.svg deleted file mode 100644 index 34f53c4..0000000 --- a/res/image/Index/u2188.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2189.svg b/res/image/Index/u2189.svg deleted file mode 100644 index 01a6bbb..0000000 --- a/res/image/Index/u2189.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2324.svg b/res/image/Index/u2324.svg deleted file mode 100644 index 797f1c5..0000000 --- a/res/image/Index/u2324.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2325.svg b/res/image/Index/u2325.svg deleted file mode 100644 index fefe01b..0000000 --- a/res/image/Index/u2325.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u642.svg b/res/image/Index/u642.svg deleted file mode 100644 index 33c9e0a..0000000 --- a/res/image/Index/u642.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u7406.svg b/res/image/Index/u7406.svg deleted file mode 100644 index 8a7a6d9..0000000 --- a/res/image/Index/u7406.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7453.svg b/res/image/Index/u7453.svg deleted file mode 100644 index 603c496..0000000 --- a/res/image/Index/u7453.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7458.svg b/res/image/Index/u7458.svg deleted file mode 100644 index b31087b..0000000 --- a/res/image/Index/u7458.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7488.svg b/res/image/Index/u7488.svg deleted file mode 100644 index 8baf439..0000000 --- a/res/image/Index/u7488.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7491.svg b/res/image/Index/u7491.svg deleted file mode 100644 index 3e41c10..0000000 --- a/res/image/Index/u7491.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7538.svg b/res/image/Index/u7538.svg deleted file mode 100644 index 417077d..0000000 --- a/res/image/Index/u7538.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u794.svg b/res/image/Index/u794.svg deleted file mode 100644 index e12cff7..0000000 --- a/res/image/Index/u794.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u8448.svg b/res/image/Index/u8448.svg deleted file mode 100644 index 7f6f4c0..0000000 --- a/res/image/Index/u8448.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u8458.svg b/res/image/Index/u8458.svg deleted file mode 100644 index 6d04a12..0000000 --- a/res/image/Index/u8458.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/main/bg_banner.png b/res/image/main/bg_banner.png new file mode 100644 index 0000000..26ddffd --- /dev/null +++ b/res/image/main/bg_banner.png Binary files differ diff --git a/res/image/main/iconHumi.png b/res/image/main/iconHumi.png index 4410d38..bd164e8 100644 --- a/res/image/main/iconHumi.png +++ b/res/image/main/iconHumi.png Binary files differ diff --git a/res/image/main/iconTemp.png b/res/image/main/iconTemp.png index 8fd059c..a2cfe4d 100644 --- a/res/image/main/iconTemp.png +++ b/res/image/main/iconTemp.png Binary files differ diff --git a/res/image/main/icon_close.png b/res/image/main/icon_close.png new file mode 100644 index 0000000..f3aa270 --- /dev/null +++ b/res/image/main/icon_close.png Binary files differ diff --git a/res/image/main/icon_close_p.png b/res/image/main/icon_close_p.png deleted file mode 100644 index b9ba30c..0000000 --- a/res/image/main/icon_close_p.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_main.png b/res/image/main/icon_main.png deleted file mode 100644 index 9d004d5..0000000 --- a/res/image/main/icon_main.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_max.png b/res/image/main/icon_max.png new file mode 100644 index 0000000..6cbf073 --- /dev/null +++ b/res/image/main/icon_max.png Binary files differ diff --git a/res/image/main/icon_menu_calibration.png b/res/image/main/icon_menu_calibration.png new file mode 100644 index 0000000..6fca8be --- /dev/null +++ b/res/image/main/icon_menu_calibration.png Binary files differ diff --git a/res/image/main/icon_menu_calibration_selected.png b/res/image/main/icon_menu_calibration_selected.png new file mode 100644 index 0000000..17f918f --- /dev/null +++ b/res/image/main/icon_menu_calibration_selected.png Binary files differ diff --git a/AutoCalibrationXC.pro b/AutoCalibrationXC.pro index 6bcb335..7790b37 100644 --- a/AutoCalibrationXC.pro +++ b/AutoCalibrationXC.pro @@ -24,11 +24,6 @@ include(QPagedTable/QPagedTable.pri) SOURCES += main.cpp -SOURCES += MainWindow.cpp - -HEADERS += MainWindow.h - -FORMS += MainWindow.ui RC_ICONS = res/autoCalibration.ico diff --git a/MainWindow.cpp b/MainWindow.cpp deleted file mode 100644 index ff126e8..0000000 --- a/MainWindow.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#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/MainWindow.h b/MainWindow.h deleted file mode 100644 index 4643e32..0000000 --- a/MainWindow.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#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; -}; -#endif // MAINWINDOW_H diff --git a/MainWindow.ui b/MainWindow.ui deleted file mode 100644 index b232854..0000000 --- a/MainWindow.ui +++ /dev/null @@ -1,22 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 800 - 600 - - - - MainWindow - - - - - - - - diff --git a/frame/CustomMessageBox.ui b/frame/CustomMessageBox.ui index 336be54..b545d74 100644 --- a/frame/CustomMessageBox.ui +++ b/frame/CustomMessageBox.ui @@ -84,8 +84,8 @@ - - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + + :/image/msgbox/icon_box_close.png:/image/msgbox/icon_box_close.png @@ -134,7 +134,7 @@ - :/image/msgbox/icon_box_success.png + :/image/msgbox/icon_box_success.png Qt::AlignCenter @@ -265,6 +265,8 @@ - + + + diff --git a/frame/MainWindowForm.cpp b/frame/MainWindowForm.cpp index 2ded44b..ec82cd7 100644 --- a/frame/MainWindowForm.cpp +++ b/frame/MainWindowForm.cpp @@ -1,6 +1,8 @@ #include "MainWindowForm.h" #include "ui_MainWindowForm.h" +#include + MainWindowForm::MainWindowForm(QWidget *parent) : FramelessWindow(parent), ui(new Ui::MainWindowForm) @@ -12,7 +14,7 @@ initMenuWidgets(); initFunctionButtons(); - // 每秒更新 界面上没有地方能摆 暂时先不启动定时器 + // 每秒更新 connect(TimeCounterUtil::getInstance().clockTimer, &QTimer::timeout, this, &MainWindowForm::onUpdateTimestampHandler); TimeCounterUtil::getInstance().clockTimer->start(1000); @@ -34,6 +36,7 @@ void MainWindowForm::initForm() { setWindowFlags(Qt::FramelessWindowHint); // 设置全屏 + setWindowState(Qt::WindowState::WindowMaximized); this->setTitleBar(ui->wdgtTop); // 设置窗口位置和大小 move(0, 0); @@ -120,6 +123,22 @@ setWindowState(Qt::WindowMinimized | windowState()); } +void MainWindowForm::on_btnMaxWin_clicked() +{ + QScreen *screen = QGuiApplication::primaryScreen(); + QRect screenSize = screen->availableGeometry(); // 可用区域(排除任务栏) + + if (this->isMaximized()) { + resize(screenSize.width() * 0.8, screenSize.height() * 0.8); + move(QRandomGenerator::global()->bounded(10, 100), QRandomGenerator::global()->bounded(10, 50)); + this->showNormal(); + } else { + resize(screenSize.width(), screenSize.height()); + move(0, 0); + this->showMaximized(); + } +} + void MainWindowForm::on_btnCloseWin_clicked() { // 创建一个消息框 @@ -146,18 +165,9 @@ ui->labelTime->setText(now.toString("yyyy-MM-dd HH:mm:ss")); } -void MainWindowForm::on_btnMenuMax_clicked() -{ - if (this->isMaximized()) { - this->showNormal(); - } else { - this->showMaximized(); - } -} - void MainWindowForm::titleDblClick() { - on_btnMenuMax_clicked(); + on_btnMaxWin_clicked(); } void MainWindowForm::onMenuButtonsEabled(bool enable) { diff --git a/frame/MainWindowForm.h b/frame/MainWindowForm.h index 4d206b1..9b4eae4 100644 --- a/frame/MainWindowForm.h +++ b/frame/MainWindowForm.h @@ -45,11 +45,11 @@ private slots: void on_btnMinWin_clicked(); + void on_btnMaxWin_clicked(); void on_btnCloseWin_clicked(); void onFunctionButtonsAction(); void onUpdateTimestampHandler(); - void on_btnMenuMax_clicked(); void titleDblClick(); void onMenuButtonsEabled(bool enable); diff --git a/frame/MainWindowForm.ui b/frame/MainWindowForm.ui index bd42122..f37d171 100644 --- a/frame/MainWindowForm.ui +++ b/frame/MainWindowForm.ui @@ -41,7 +41,7 @@ 0 - 120 + 100 @@ -58,7 +58,7 @@ 20 - 0 + 20 @@ -88,8 +88,8 @@ - 120 - 120 + 150 + 100 @@ -107,6 +107,22 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + @@ -158,7 +174,7 @@ 100 - 84 + 72 @@ -166,7 +182,8 @@ - :/image/main/calibration.png:/image/main/calibration.png + :/image/main/icon_menu_calibration.png + :/image/main/icon_menu_calibration_selected.png:/image/main/icon_menu_calibration.png @@ -184,7 +201,7 @@ 100 - 84 + 72 @@ -192,7 +209,8 @@ - :/image/main/rawDataRecord.png:/image/main/rawDataRecord.png + :/image/main/icon_menu_check.png + :/image/main/icon_menu_check_selected.png:/image/main/icon_menu_check.png @@ -210,7 +228,7 @@ 100 - 84 + 72 @@ -218,7 +236,8 @@ - :/image/main/fileRes.png:/image/main/fileRes.png + :/image/main/icon_menu_infomation.png + :/image/main/icon_menu_infomation_checked.png:/image/main/icon_menu_infomation.png @@ -235,10 +254,147 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 50 + 20 + + + + + - 320 + 240 + 16777215 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 5 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + :/image/main/iconTemp.png + + + + + + + 34.5℃ + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + + + + :/image/main/iconHumi.png + + + + + + + 25%Rh + + + + + + + + + + + + + + 240 16777215 @@ -308,7 +464,7 @@ - :/image/main/icon_setting_p.png:/image/main/icon_setting_p.png + :/image/main/icon_setting.png:/image/main/icon_setting.png @@ -334,7 +490,33 @@ - :/image/main/icon_min_p.png:/image/main/icon_min_p.png + :/image/main/icon_min.png:/image/main/icon_min.png + + + + 32 + 32 + + + + + + + + + 40 + 40 + + + + 最小化 + + + + + + + :/image/main/icon_max.png:/image/main/icon_max.png @@ -360,7 +542,7 @@ - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + :/image/main/icon_close.png:/image/main/icon_close.png @@ -426,87 +608,9 @@ - - - - - 0 - 30 - - - - - 20 - - - 0 - - - 0 - - - 40 - - - 0 - - - - - Qt::Horizontal - - - - 1289 - 20 - - - - - - - - - - - - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 20 - - - - - - - - - - - - - - wdgtContent wdgtTop - wdgtFoot diff --git a/infomation/InfoMainForm.cpp b/infomation/InfoMainForm.cpp index c001199..5d0ffc8 100644 --- a/infomation/InfoMainForm.cpp +++ b/infomation/InfoMainForm.cpp @@ -21,9 +21,13 @@ void InfoMainForm::initForm() { + // 加载样式表 + QString qssStyle = QssFileUtils::loadQssFileContent(QApplication::applicationDirPath() + "/qss/infoMain.css"); + if (qssStyle.isEmpty() == false) { + this->setStyleSheet(qssStyle); // 仅本窗口生效 + } - - + ui->scrollArea->setWindowFlags(Qt::FramelessWindowHint); // 设置无边框 } void InfoMainForm::initSubMenuForms() { diff --git a/infomation/InfoMainForm.ui b/infomation/InfoMainForm.ui index 958a6b2..d9066dd 100644 --- a/infomation/InfoMainForm.ui +++ b/infomation/InfoMainForm.ui @@ -90,7 +90,7 @@ - 280 + 295 48 @@ -103,7 +103,7 @@ - 280 + 295 48 @@ -116,7 +116,7 @@ - 280 + 295 48 @@ -129,7 +129,7 @@ - 280 + 295 48 @@ -142,7 +142,7 @@ - 280 + 295 48 @@ -155,7 +155,7 @@ - 280 + 295 48 @@ -168,7 +168,7 @@ - 280 + 295 48 @@ -181,7 +181,7 @@ - 280 + 295 48 @@ -194,7 +194,7 @@ - 280 + 295 48 @@ -207,7 +207,7 @@ - 280 + 295 48 @@ -220,7 +220,7 @@ - 280 + 295 48 @@ -233,7 +233,7 @@ - 280 + 295 48 @@ -246,7 +246,7 @@ - 280 + 295 48 diff --git a/infomation/task/DeptTaskForm.cpp b/infomation/task/DeptTaskForm.cpp index ea21a9f..cc6bf31 100644 --- a/infomation/task/DeptTaskForm.cpp +++ b/infomation/task/DeptTaskForm.cpp @@ -18,12 +18,17 @@ delete ui; } -void DeptTaskForm::showEvent(QShowEvent *event) +void DeptTaskForm::showEvent(QShowEvent * event) { ui->tableDeptTask->adjustTableWidth(); getDeptTaskList(0); } +void DeptTaskForm::resizeEvent(QResizeEvent * event) +{ + ui->tableDeptTask->adjustTableWidth(); +} + void DeptTaskForm::initFormTable() { // 初始化查询条件 diff --git a/infomation/task/DeptTaskForm.h b/infomation/task/DeptTaskForm.h index 1055c36..3c1ad5b 100644 --- a/infomation/task/DeptTaskForm.h +++ b/infomation/task/DeptTaskForm.h @@ -21,7 +21,8 @@ ~DeptTaskForm(); protected: - void showEvent(QShowEvent *event) override; + void showEvent(QShowEvent * event) override; + void resizeEvent(QResizeEvent * event) override; private: Ui::DeptTaskForm *ui; diff --git a/main.cpp b/main.cpp index 525387e..0b78c87 100644 --- a/main.cpp +++ b/main.cpp @@ -1,5 +1,3 @@ -#include "MainWindow.h" - #include #include diff --git a/res/image/Index/u1176.svg b/res/image/Index/u1176.svg deleted file mode 100644 index c81ce8a..0000000 --- a/res/image/Index/u1176.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1180.svg b/res/image/Index/u1180.svg deleted file mode 100644 index 2ef24ab..0000000 --- a/res/image/Index/u1180.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1220.svg b/res/image/Index/u1220.svg deleted file mode 100644 index 43452aa..0000000 --- a/res/image/Index/u1220.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2158.svg b/res/image/Index/u2158.svg deleted file mode 100644 index fd249e0..0000000 --- a/res/image/Index/u2158.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u2188.svg b/res/image/Index/u2188.svg deleted file mode 100644 index 34f53c4..0000000 --- a/res/image/Index/u2188.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2189.svg b/res/image/Index/u2189.svg deleted file mode 100644 index 01a6bbb..0000000 --- a/res/image/Index/u2189.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2324.svg b/res/image/Index/u2324.svg deleted file mode 100644 index 797f1c5..0000000 --- a/res/image/Index/u2324.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2325.svg b/res/image/Index/u2325.svg deleted file mode 100644 index fefe01b..0000000 --- a/res/image/Index/u2325.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u642.svg b/res/image/Index/u642.svg deleted file mode 100644 index 33c9e0a..0000000 --- a/res/image/Index/u642.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u7406.svg b/res/image/Index/u7406.svg deleted file mode 100644 index 8a7a6d9..0000000 --- a/res/image/Index/u7406.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7453.svg b/res/image/Index/u7453.svg deleted file mode 100644 index 603c496..0000000 --- a/res/image/Index/u7453.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7458.svg b/res/image/Index/u7458.svg deleted file mode 100644 index b31087b..0000000 --- a/res/image/Index/u7458.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7488.svg b/res/image/Index/u7488.svg deleted file mode 100644 index 8baf439..0000000 --- a/res/image/Index/u7488.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7491.svg b/res/image/Index/u7491.svg deleted file mode 100644 index 3e41c10..0000000 --- a/res/image/Index/u7491.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7538.svg b/res/image/Index/u7538.svg deleted file mode 100644 index 417077d..0000000 --- a/res/image/Index/u7538.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u794.svg b/res/image/Index/u794.svg deleted file mode 100644 index e12cff7..0000000 --- a/res/image/Index/u794.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u8448.svg b/res/image/Index/u8448.svg deleted file mode 100644 index 7f6f4c0..0000000 --- a/res/image/Index/u8448.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u8458.svg b/res/image/Index/u8458.svg deleted file mode 100644 index 6d04a12..0000000 --- a/res/image/Index/u8458.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/main/bg_banner.png b/res/image/main/bg_banner.png new file mode 100644 index 0000000..26ddffd --- /dev/null +++ b/res/image/main/bg_banner.png Binary files differ diff --git a/res/image/main/iconHumi.png b/res/image/main/iconHumi.png index 4410d38..bd164e8 100644 --- a/res/image/main/iconHumi.png +++ b/res/image/main/iconHumi.png Binary files differ diff --git a/res/image/main/iconTemp.png b/res/image/main/iconTemp.png index 8fd059c..a2cfe4d 100644 --- a/res/image/main/iconTemp.png +++ b/res/image/main/iconTemp.png Binary files differ diff --git a/res/image/main/icon_close.png b/res/image/main/icon_close.png new file mode 100644 index 0000000..f3aa270 --- /dev/null +++ b/res/image/main/icon_close.png Binary files differ diff --git a/res/image/main/icon_close_p.png b/res/image/main/icon_close_p.png deleted file mode 100644 index b9ba30c..0000000 --- a/res/image/main/icon_close_p.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_main.png b/res/image/main/icon_main.png deleted file mode 100644 index 9d004d5..0000000 --- a/res/image/main/icon_main.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_max.png b/res/image/main/icon_max.png new file mode 100644 index 0000000..6cbf073 --- /dev/null +++ b/res/image/main/icon_max.png Binary files differ diff --git a/res/image/main/icon_menu_calibration.png b/res/image/main/icon_menu_calibration.png new file mode 100644 index 0000000..6fca8be --- /dev/null +++ b/res/image/main/icon_menu_calibration.png Binary files differ diff --git a/res/image/main/icon_menu_calibration_selected.png b/res/image/main/icon_menu_calibration_selected.png new file mode 100644 index 0000000..17f918f --- /dev/null +++ b/res/image/main/icon_menu_calibration_selected.png Binary files differ diff --git a/res/image/main/icon_menu_check.png b/res/image/main/icon_menu_check.png new file mode 100644 index 0000000..c3db5fa --- /dev/null +++ b/res/image/main/icon_menu_check.png Binary files differ diff --git a/AutoCalibrationXC.pro b/AutoCalibrationXC.pro index 6bcb335..7790b37 100644 --- a/AutoCalibrationXC.pro +++ b/AutoCalibrationXC.pro @@ -24,11 +24,6 @@ include(QPagedTable/QPagedTable.pri) SOURCES += main.cpp -SOURCES += MainWindow.cpp - -HEADERS += MainWindow.h - -FORMS += MainWindow.ui RC_ICONS = res/autoCalibration.ico diff --git a/MainWindow.cpp b/MainWindow.cpp deleted file mode 100644 index ff126e8..0000000 --- a/MainWindow.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#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/MainWindow.h b/MainWindow.h deleted file mode 100644 index 4643e32..0000000 --- a/MainWindow.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#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; -}; -#endif // MAINWINDOW_H diff --git a/MainWindow.ui b/MainWindow.ui deleted file mode 100644 index b232854..0000000 --- a/MainWindow.ui +++ /dev/null @@ -1,22 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 800 - 600 - - - - MainWindow - - - - - - - - diff --git a/frame/CustomMessageBox.ui b/frame/CustomMessageBox.ui index 336be54..b545d74 100644 --- a/frame/CustomMessageBox.ui +++ b/frame/CustomMessageBox.ui @@ -84,8 +84,8 @@ - - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + + :/image/msgbox/icon_box_close.png:/image/msgbox/icon_box_close.png @@ -134,7 +134,7 @@ - :/image/msgbox/icon_box_success.png + :/image/msgbox/icon_box_success.png Qt::AlignCenter @@ -265,6 +265,8 @@ - + + + diff --git a/frame/MainWindowForm.cpp b/frame/MainWindowForm.cpp index 2ded44b..ec82cd7 100644 --- a/frame/MainWindowForm.cpp +++ b/frame/MainWindowForm.cpp @@ -1,6 +1,8 @@ #include "MainWindowForm.h" #include "ui_MainWindowForm.h" +#include + MainWindowForm::MainWindowForm(QWidget *parent) : FramelessWindow(parent), ui(new Ui::MainWindowForm) @@ -12,7 +14,7 @@ initMenuWidgets(); initFunctionButtons(); - // 每秒更新 界面上没有地方能摆 暂时先不启动定时器 + // 每秒更新 connect(TimeCounterUtil::getInstance().clockTimer, &QTimer::timeout, this, &MainWindowForm::onUpdateTimestampHandler); TimeCounterUtil::getInstance().clockTimer->start(1000); @@ -34,6 +36,7 @@ void MainWindowForm::initForm() { setWindowFlags(Qt::FramelessWindowHint); // 设置全屏 + setWindowState(Qt::WindowState::WindowMaximized); this->setTitleBar(ui->wdgtTop); // 设置窗口位置和大小 move(0, 0); @@ -120,6 +123,22 @@ setWindowState(Qt::WindowMinimized | windowState()); } +void MainWindowForm::on_btnMaxWin_clicked() +{ + QScreen *screen = QGuiApplication::primaryScreen(); + QRect screenSize = screen->availableGeometry(); // 可用区域(排除任务栏) + + if (this->isMaximized()) { + resize(screenSize.width() * 0.8, screenSize.height() * 0.8); + move(QRandomGenerator::global()->bounded(10, 100), QRandomGenerator::global()->bounded(10, 50)); + this->showNormal(); + } else { + resize(screenSize.width(), screenSize.height()); + move(0, 0); + this->showMaximized(); + } +} + void MainWindowForm::on_btnCloseWin_clicked() { // 创建一个消息框 @@ -146,18 +165,9 @@ ui->labelTime->setText(now.toString("yyyy-MM-dd HH:mm:ss")); } -void MainWindowForm::on_btnMenuMax_clicked() -{ - if (this->isMaximized()) { - this->showNormal(); - } else { - this->showMaximized(); - } -} - void MainWindowForm::titleDblClick() { - on_btnMenuMax_clicked(); + on_btnMaxWin_clicked(); } void MainWindowForm::onMenuButtonsEabled(bool enable) { diff --git a/frame/MainWindowForm.h b/frame/MainWindowForm.h index 4d206b1..9b4eae4 100644 --- a/frame/MainWindowForm.h +++ b/frame/MainWindowForm.h @@ -45,11 +45,11 @@ private slots: void on_btnMinWin_clicked(); + void on_btnMaxWin_clicked(); void on_btnCloseWin_clicked(); void onFunctionButtonsAction(); void onUpdateTimestampHandler(); - void on_btnMenuMax_clicked(); void titleDblClick(); void onMenuButtonsEabled(bool enable); diff --git a/frame/MainWindowForm.ui b/frame/MainWindowForm.ui index bd42122..f37d171 100644 --- a/frame/MainWindowForm.ui +++ b/frame/MainWindowForm.ui @@ -41,7 +41,7 @@ 0 - 120 + 100 @@ -58,7 +58,7 @@ 20 - 0 + 20 @@ -88,8 +88,8 @@ - 120 - 120 + 150 + 100 @@ -107,6 +107,22 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + @@ -158,7 +174,7 @@ 100 - 84 + 72 @@ -166,7 +182,8 @@ - :/image/main/calibration.png:/image/main/calibration.png + :/image/main/icon_menu_calibration.png + :/image/main/icon_menu_calibration_selected.png:/image/main/icon_menu_calibration.png @@ -184,7 +201,7 @@ 100 - 84 + 72 @@ -192,7 +209,8 @@ - :/image/main/rawDataRecord.png:/image/main/rawDataRecord.png + :/image/main/icon_menu_check.png + :/image/main/icon_menu_check_selected.png:/image/main/icon_menu_check.png @@ -210,7 +228,7 @@ 100 - 84 + 72 @@ -218,7 +236,8 @@ - :/image/main/fileRes.png:/image/main/fileRes.png + :/image/main/icon_menu_infomation.png + :/image/main/icon_menu_infomation_checked.png:/image/main/icon_menu_infomation.png @@ -235,10 +254,147 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 50 + 20 + + + + + - 320 + 240 + 16777215 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 5 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + :/image/main/iconTemp.png + + + + + + + 34.5℃ + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + + + + :/image/main/iconHumi.png + + + + + + + 25%Rh + + + + + + + + + + + + + + 240 16777215 @@ -308,7 +464,7 @@ - :/image/main/icon_setting_p.png:/image/main/icon_setting_p.png + :/image/main/icon_setting.png:/image/main/icon_setting.png @@ -334,7 +490,33 @@ - :/image/main/icon_min_p.png:/image/main/icon_min_p.png + :/image/main/icon_min.png:/image/main/icon_min.png + + + + 32 + 32 + + + + + + + + + 40 + 40 + + + + 最小化 + + + + + + + :/image/main/icon_max.png:/image/main/icon_max.png @@ -360,7 +542,7 @@ - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + :/image/main/icon_close.png:/image/main/icon_close.png @@ -426,87 +608,9 @@ - - - - - 0 - 30 - - - - - 20 - - - 0 - - - 0 - - - 40 - - - 0 - - - - - Qt::Horizontal - - - - 1289 - 20 - - - - - - - - - - - - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 20 - - - - - - - - - - - - - - wdgtContent wdgtTop - wdgtFoot diff --git a/infomation/InfoMainForm.cpp b/infomation/InfoMainForm.cpp index c001199..5d0ffc8 100644 --- a/infomation/InfoMainForm.cpp +++ b/infomation/InfoMainForm.cpp @@ -21,9 +21,13 @@ void InfoMainForm::initForm() { + // 加载样式表 + QString qssStyle = QssFileUtils::loadQssFileContent(QApplication::applicationDirPath() + "/qss/infoMain.css"); + if (qssStyle.isEmpty() == false) { + this->setStyleSheet(qssStyle); // 仅本窗口生效 + } - - + ui->scrollArea->setWindowFlags(Qt::FramelessWindowHint); // 设置无边框 } void InfoMainForm::initSubMenuForms() { diff --git a/infomation/InfoMainForm.ui b/infomation/InfoMainForm.ui index 958a6b2..d9066dd 100644 --- a/infomation/InfoMainForm.ui +++ b/infomation/InfoMainForm.ui @@ -90,7 +90,7 @@ - 280 + 295 48 @@ -103,7 +103,7 @@ - 280 + 295 48 @@ -116,7 +116,7 @@ - 280 + 295 48 @@ -129,7 +129,7 @@ - 280 + 295 48 @@ -142,7 +142,7 @@ - 280 + 295 48 @@ -155,7 +155,7 @@ - 280 + 295 48 @@ -168,7 +168,7 @@ - 280 + 295 48 @@ -181,7 +181,7 @@ - 280 + 295 48 @@ -194,7 +194,7 @@ - 280 + 295 48 @@ -207,7 +207,7 @@ - 280 + 295 48 @@ -220,7 +220,7 @@ - 280 + 295 48 @@ -233,7 +233,7 @@ - 280 + 295 48 @@ -246,7 +246,7 @@ - 280 + 295 48 diff --git a/infomation/task/DeptTaskForm.cpp b/infomation/task/DeptTaskForm.cpp index ea21a9f..cc6bf31 100644 --- a/infomation/task/DeptTaskForm.cpp +++ b/infomation/task/DeptTaskForm.cpp @@ -18,12 +18,17 @@ delete ui; } -void DeptTaskForm::showEvent(QShowEvent *event) +void DeptTaskForm::showEvent(QShowEvent * event) { ui->tableDeptTask->adjustTableWidth(); getDeptTaskList(0); } +void DeptTaskForm::resizeEvent(QResizeEvent * event) +{ + ui->tableDeptTask->adjustTableWidth(); +} + void DeptTaskForm::initFormTable() { // 初始化查询条件 diff --git a/infomation/task/DeptTaskForm.h b/infomation/task/DeptTaskForm.h index 1055c36..3c1ad5b 100644 --- a/infomation/task/DeptTaskForm.h +++ b/infomation/task/DeptTaskForm.h @@ -21,7 +21,8 @@ ~DeptTaskForm(); protected: - void showEvent(QShowEvent *event) override; + void showEvent(QShowEvent * event) override; + void resizeEvent(QResizeEvent * event) override; private: Ui::DeptTaskForm *ui; diff --git a/main.cpp b/main.cpp index 525387e..0b78c87 100644 --- a/main.cpp +++ b/main.cpp @@ -1,5 +1,3 @@ -#include "MainWindow.h" - #include #include diff --git a/res/image/Index/u1176.svg b/res/image/Index/u1176.svg deleted file mode 100644 index c81ce8a..0000000 --- a/res/image/Index/u1176.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1180.svg b/res/image/Index/u1180.svg deleted file mode 100644 index 2ef24ab..0000000 --- a/res/image/Index/u1180.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1220.svg b/res/image/Index/u1220.svg deleted file mode 100644 index 43452aa..0000000 --- a/res/image/Index/u1220.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2158.svg b/res/image/Index/u2158.svg deleted file mode 100644 index fd249e0..0000000 --- a/res/image/Index/u2158.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u2188.svg b/res/image/Index/u2188.svg deleted file mode 100644 index 34f53c4..0000000 --- a/res/image/Index/u2188.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2189.svg b/res/image/Index/u2189.svg deleted file mode 100644 index 01a6bbb..0000000 --- a/res/image/Index/u2189.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2324.svg b/res/image/Index/u2324.svg deleted file mode 100644 index 797f1c5..0000000 --- a/res/image/Index/u2324.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2325.svg b/res/image/Index/u2325.svg deleted file mode 100644 index fefe01b..0000000 --- a/res/image/Index/u2325.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u642.svg b/res/image/Index/u642.svg deleted file mode 100644 index 33c9e0a..0000000 --- a/res/image/Index/u642.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u7406.svg b/res/image/Index/u7406.svg deleted file mode 100644 index 8a7a6d9..0000000 --- a/res/image/Index/u7406.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7453.svg b/res/image/Index/u7453.svg deleted file mode 100644 index 603c496..0000000 --- a/res/image/Index/u7453.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7458.svg b/res/image/Index/u7458.svg deleted file mode 100644 index b31087b..0000000 --- a/res/image/Index/u7458.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7488.svg b/res/image/Index/u7488.svg deleted file mode 100644 index 8baf439..0000000 --- a/res/image/Index/u7488.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7491.svg b/res/image/Index/u7491.svg deleted file mode 100644 index 3e41c10..0000000 --- a/res/image/Index/u7491.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7538.svg b/res/image/Index/u7538.svg deleted file mode 100644 index 417077d..0000000 --- a/res/image/Index/u7538.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u794.svg b/res/image/Index/u794.svg deleted file mode 100644 index e12cff7..0000000 --- a/res/image/Index/u794.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u8448.svg b/res/image/Index/u8448.svg deleted file mode 100644 index 7f6f4c0..0000000 --- a/res/image/Index/u8448.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u8458.svg b/res/image/Index/u8458.svg deleted file mode 100644 index 6d04a12..0000000 --- a/res/image/Index/u8458.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/main/bg_banner.png b/res/image/main/bg_banner.png new file mode 100644 index 0000000..26ddffd --- /dev/null +++ b/res/image/main/bg_banner.png Binary files differ diff --git a/res/image/main/iconHumi.png b/res/image/main/iconHumi.png index 4410d38..bd164e8 100644 --- a/res/image/main/iconHumi.png +++ b/res/image/main/iconHumi.png Binary files differ diff --git a/res/image/main/iconTemp.png b/res/image/main/iconTemp.png index 8fd059c..a2cfe4d 100644 --- a/res/image/main/iconTemp.png +++ b/res/image/main/iconTemp.png Binary files differ diff --git a/res/image/main/icon_close.png b/res/image/main/icon_close.png new file mode 100644 index 0000000..f3aa270 --- /dev/null +++ b/res/image/main/icon_close.png Binary files differ diff --git a/res/image/main/icon_close_p.png b/res/image/main/icon_close_p.png deleted file mode 100644 index b9ba30c..0000000 --- a/res/image/main/icon_close_p.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_main.png b/res/image/main/icon_main.png deleted file mode 100644 index 9d004d5..0000000 --- a/res/image/main/icon_main.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_max.png b/res/image/main/icon_max.png new file mode 100644 index 0000000..6cbf073 --- /dev/null +++ b/res/image/main/icon_max.png Binary files differ diff --git a/res/image/main/icon_menu_calibration.png b/res/image/main/icon_menu_calibration.png new file mode 100644 index 0000000..6fca8be --- /dev/null +++ b/res/image/main/icon_menu_calibration.png Binary files differ diff --git a/res/image/main/icon_menu_calibration_selected.png b/res/image/main/icon_menu_calibration_selected.png new file mode 100644 index 0000000..17f918f --- /dev/null +++ b/res/image/main/icon_menu_calibration_selected.png Binary files differ diff --git a/res/image/main/icon_menu_check.png b/res/image/main/icon_menu_check.png new file mode 100644 index 0000000..c3db5fa --- /dev/null +++ b/res/image/main/icon_menu_check.png Binary files differ diff --git a/res/image/main/icon_menu_check_selected.png b/res/image/main/icon_menu_check_selected.png new file mode 100644 index 0000000..9794c43 --- /dev/null +++ b/res/image/main/icon_menu_check_selected.png Binary files differ diff --git a/AutoCalibrationXC.pro b/AutoCalibrationXC.pro index 6bcb335..7790b37 100644 --- a/AutoCalibrationXC.pro +++ b/AutoCalibrationXC.pro @@ -24,11 +24,6 @@ include(QPagedTable/QPagedTable.pri) SOURCES += main.cpp -SOURCES += MainWindow.cpp - -HEADERS += MainWindow.h - -FORMS += MainWindow.ui RC_ICONS = res/autoCalibration.ico diff --git a/MainWindow.cpp b/MainWindow.cpp deleted file mode 100644 index ff126e8..0000000 --- a/MainWindow.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#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/MainWindow.h b/MainWindow.h deleted file mode 100644 index 4643e32..0000000 --- a/MainWindow.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#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; -}; -#endif // MAINWINDOW_H diff --git a/MainWindow.ui b/MainWindow.ui deleted file mode 100644 index b232854..0000000 --- a/MainWindow.ui +++ /dev/null @@ -1,22 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 800 - 600 - - - - MainWindow - - - - - - - - diff --git a/frame/CustomMessageBox.ui b/frame/CustomMessageBox.ui index 336be54..b545d74 100644 --- a/frame/CustomMessageBox.ui +++ b/frame/CustomMessageBox.ui @@ -84,8 +84,8 @@ - - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + + :/image/msgbox/icon_box_close.png:/image/msgbox/icon_box_close.png @@ -134,7 +134,7 @@ - :/image/msgbox/icon_box_success.png + :/image/msgbox/icon_box_success.png Qt::AlignCenter @@ -265,6 +265,8 @@ - + + + diff --git a/frame/MainWindowForm.cpp b/frame/MainWindowForm.cpp index 2ded44b..ec82cd7 100644 --- a/frame/MainWindowForm.cpp +++ b/frame/MainWindowForm.cpp @@ -1,6 +1,8 @@ #include "MainWindowForm.h" #include "ui_MainWindowForm.h" +#include + MainWindowForm::MainWindowForm(QWidget *parent) : FramelessWindow(parent), ui(new Ui::MainWindowForm) @@ -12,7 +14,7 @@ initMenuWidgets(); initFunctionButtons(); - // 每秒更新 界面上没有地方能摆 暂时先不启动定时器 + // 每秒更新 connect(TimeCounterUtil::getInstance().clockTimer, &QTimer::timeout, this, &MainWindowForm::onUpdateTimestampHandler); TimeCounterUtil::getInstance().clockTimer->start(1000); @@ -34,6 +36,7 @@ void MainWindowForm::initForm() { setWindowFlags(Qt::FramelessWindowHint); // 设置全屏 + setWindowState(Qt::WindowState::WindowMaximized); this->setTitleBar(ui->wdgtTop); // 设置窗口位置和大小 move(0, 0); @@ -120,6 +123,22 @@ setWindowState(Qt::WindowMinimized | windowState()); } +void MainWindowForm::on_btnMaxWin_clicked() +{ + QScreen *screen = QGuiApplication::primaryScreen(); + QRect screenSize = screen->availableGeometry(); // 可用区域(排除任务栏) + + if (this->isMaximized()) { + resize(screenSize.width() * 0.8, screenSize.height() * 0.8); + move(QRandomGenerator::global()->bounded(10, 100), QRandomGenerator::global()->bounded(10, 50)); + this->showNormal(); + } else { + resize(screenSize.width(), screenSize.height()); + move(0, 0); + this->showMaximized(); + } +} + void MainWindowForm::on_btnCloseWin_clicked() { // 创建一个消息框 @@ -146,18 +165,9 @@ ui->labelTime->setText(now.toString("yyyy-MM-dd HH:mm:ss")); } -void MainWindowForm::on_btnMenuMax_clicked() -{ - if (this->isMaximized()) { - this->showNormal(); - } else { - this->showMaximized(); - } -} - void MainWindowForm::titleDblClick() { - on_btnMenuMax_clicked(); + on_btnMaxWin_clicked(); } void MainWindowForm::onMenuButtonsEabled(bool enable) { diff --git a/frame/MainWindowForm.h b/frame/MainWindowForm.h index 4d206b1..9b4eae4 100644 --- a/frame/MainWindowForm.h +++ b/frame/MainWindowForm.h @@ -45,11 +45,11 @@ private slots: void on_btnMinWin_clicked(); + void on_btnMaxWin_clicked(); void on_btnCloseWin_clicked(); void onFunctionButtonsAction(); void onUpdateTimestampHandler(); - void on_btnMenuMax_clicked(); void titleDblClick(); void onMenuButtonsEabled(bool enable); diff --git a/frame/MainWindowForm.ui b/frame/MainWindowForm.ui index bd42122..f37d171 100644 --- a/frame/MainWindowForm.ui +++ b/frame/MainWindowForm.ui @@ -41,7 +41,7 @@ 0 - 120 + 100 @@ -58,7 +58,7 @@ 20 - 0 + 20 @@ -88,8 +88,8 @@ - 120 - 120 + 150 + 100 @@ -107,6 +107,22 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + @@ -158,7 +174,7 @@ 100 - 84 + 72 @@ -166,7 +182,8 @@ - :/image/main/calibration.png:/image/main/calibration.png + :/image/main/icon_menu_calibration.png + :/image/main/icon_menu_calibration_selected.png:/image/main/icon_menu_calibration.png @@ -184,7 +201,7 @@ 100 - 84 + 72 @@ -192,7 +209,8 @@ - :/image/main/rawDataRecord.png:/image/main/rawDataRecord.png + :/image/main/icon_menu_check.png + :/image/main/icon_menu_check_selected.png:/image/main/icon_menu_check.png @@ -210,7 +228,7 @@ 100 - 84 + 72 @@ -218,7 +236,8 @@ - :/image/main/fileRes.png:/image/main/fileRes.png + :/image/main/icon_menu_infomation.png + :/image/main/icon_menu_infomation_checked.png:/image/main/icon_menu_infomation.png @@ -235,10 +254,147 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 50 + 20 + + + + + - 320 + 240 + 16777215 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 5 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + :/image/main/iconTemp.png + + + + + + + 34.5℃ + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + + + + :/image/main/iconHumi.png + + + + + + + 25%Rh + + + + + + + + + + + + + + 240 16777215 @@ -308,7 +464,7 @@ - :/image/main/icon_setting_p.png:/image/main/icon_setting_p.png + :/image/main/icon_setting.png:/image/main/icon_setting.png @@ -334,7 +490,33 @@ - :/image/main/icon_min_p.png:/image/main/icon_min_p.png + :/image/main/icon_min.png:/image/main/icon_min.png + + + + 32 + 32 + + + + + + + + + 40 + 40 + + + + 最小化 + + + + + + + :/image/main/icon_max.png:/image/main/icon_max.png @@ -360,7 +542,7 @@ - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + :/image/main/icon_close.png:/image/main/icon_close.png @@ -426,87 +608,9 @@ - - - - - 0 - 30 - - - - - 20 - - - 0 - - - 0 - - - 40 - - - 0 - - - - - Qt::Horizontal - - - - 1289 - 20 - - - - - - - - - - - - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 20 - - - - - - - - - - - - - - wdgtContent wdgtTop - wdgtFoot diff --git a/infomation/InfoMainForm.cpp b/infomation/InfoMainForm.cpp index c001199..5d0ffc8 100644 --- a/infomation/InfoMainForm.cpp +++ b/infomation/InfoMainForm.cpp @@ -21,9 +21,13 @@ void InfoMainForm::initForm() { + // 加载样式表 + QString qssStyle = QssFileUtils::loadQssFileContent(QApplication::applicationDirPath() + "/qss/infoMain.css"); + if (qssStyle.isEmpty() == false) { + this->setStyleSheet(qssStyle); // 仅本窗口生效 + } - - + ui->scrollArea->setWindowFlags(Qt::FramelessWindowHint); // 设置无边框 } void InfoMainForm::initSubMenuForms() { diff --git a/infomation/InfoMainForm.ui b/infomation/InfoMainForm.ui index 958a6b2..d9066dd 100644 --- a/infomation/InfoMainForm.ui +++ b/infomation/InfoMainForm.ui @@ -90,7 +90,7 @@ - 280 + 295 48 @@ -103,7 +103,7 @@ - 280 + 295 48 @@ -116,7 +116,7 @@ - 280 + 295 48 @@ -129,7 +129,7 @@ - 280 + 295 48 @@ -142,7 +142,7 @@ - 280 + 295 48 @@ -155,7 +155,7 @@ - 280 + 295 48 @@ -168,7 +168,7 @@ - 280 + 295 48 @@ -181,7 +181,7 @@ - 280 + 295 48 @@ -194,7 +194,7 @@ - 280 + 295 48 @@ -207,7 +207,7 @@ - 280 + 295 48 @@ -220,7 +220,7 @@ - 280 + 295 48 @@ -233,7 +233,7 @@ - 280 + 295 48 @@ -246,7 +246,7 @@ - 280 + 295 48 diff --git a/infomation/task/DeptTaskForm.cpp b/infomation/task/DeptTaskForm.cpp index ea21a9f..cc6bf31 100644 --- a/infomation/task/DeptTaskForm.cpp +++ b/infomation/task/DeptTaskForm.cpp @@ -18,12 +18,17 @@ delete ui; } -void DeptTaskForm::showEvent(QShowEvent *event) +void DeptTaskForm::showEvent(QShowEvent * event) { ui->tableDeptTask->adjustTableWidth(); getDeptTaskList(0); } +void DeptTaskForm::resizeEvent(QResizeEvent * event) +{ + ui->tableDeptTask->adjustTableWidth(); +} + void DeptTaskForm::initFormTable() { // 初始化查询条件 diff --git a/infomation/task/DeptTaskForm.h b/infomation/task/DeptTaskForm.h index 1055c36..3c1ad5b 100644 --- a/infomation/task/DeptTaskForm.h +++ b/infomation/task/DeptTaskForm.h @@ -21,7 +21,8 @@ ~DeptTaskForm(); protected: - void showEvent(QShowEvent *event) override; + void showEvent(QShowEvent * event) override; + void resizeEvent(QResizeEvent * event) override; private: Ui::DeptTaskForm *ui; diff --git a/main.cpp b/main.cpp index 525387e..0b78c87 100644 --- a/main.cpp +++ b/main.cpp @@ -1,5 +1,3 @@ -#include "MainWindow.h" - #include #include diff --git a/res/image/Index/u1176.svg b/res/image/Index/u1176.svg deleted file mode 100644 index c81ce8a..0000000 --- a/res/image/Index/u1176.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1180.svg b/res/image/Index/u1180.svg deleted file mode 100644 index 2ef24ab..0000000 --- a/res/image/Index/u1180.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1220.svg b/res/image/Index/u1220.svg deleted file mode 100644 index 43452aa..0000000 --- a/res/image/Index/u1220.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2158.svg b/res/image/Index/u2158.svg deleted file mode 100644 index fd249e0..0000000 --- a/res/image/Index/u2158.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u2188.svg b/res/image/Index/u2188.svg deleted file mode 100644 index 34f53c4..0000000 --- a/res/image/Index/u2188.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2189.svg b/res/image/Index/u2189.svg deleted file mode 100644 index 01a6bbb..0000000 --- a/res/image/Index/u2189.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2324.svg b/res/image/Index/u2324.svg deleted file mode 100644 index 797f1c5..0000000 --- a/res/image/Index/u2324.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2325.svg b/res/image/Index/u2325.svg deleted file mode 100644 index fefe01b..0000000 --- a/res/image/Index/u2325.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u642.svg b/res/image/Index/u642.svg deleted file mode 100644 index 33c9e0a..0000000 --- a/res/image/Index/u642.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u7406.svg b/res/image/Index/u7406.svg deleted file mode 100644 index 8a7a6d9..0000000 --- a/res/image/Index/u7406.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7453.svg b/res/image/Index/u7453.svg deleted file mode 100644 index 603c496..0000000 --- a/res/image/Index/u7453.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7458.svg b/res/image/Index/u7458.svg deleted file mode 100644 index b31087b..0000000 --- a/res/image/Index/u7458.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7488.svg b/res/image/Index/u7488.svg deleted file mode 100644 index 8baf439..0000000 --- a/res/image/Index/u7488.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7491.svg b/res/image/Index/u7491.svg deleted file mode 100644 index 3e41c10..0000000 --- a/res/image/Index/u7491.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7538.svg b/res/image/Index/u7538.svg deleted file mode 100644 index 417077d..0000000 --- a/res/image/Index/u7538.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u794.svg b/res/image/Index/u794.svg deleted file mode 100644 index e12cff7..0000000 --- a/res/image/Index/u794.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u8448.svg b/res/image/Index/u8448.svg deleted file mode 100644 index 7f6f4c0..0000000 --- a/res/image/Index/u8448.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u8458.svg b/res/image/Index/u8458.svg deleted file mode 100644 index 6d04a12..0000000 --- a/res/image/Index/u8458.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/main/bg_banner.png b/res/image/main/bg_banner.png new file mode 100644 index 0000000..26ddffd --- /dev/null +++ b/res/image/main/bg_banner.png Binary files differ diff --git a/res/image/main/iconHumi.png b/res/image/main/iconHumi.png index 4410d38..bd164e8 100644 --- a/res/image/main/iconHumi.png +++ b/res/image/main/iconHumi.png Binary files differ diff --git a/res/image/main/iconTemp.png b/res/image/main/iconTemp.png index 8fd059c..a2cfe4d 100644 --- a/res/image/main/iconTemp.png +++ b/res/image/main/iconTemp.png Binary files differ diff --git a/res/image/main/icon_close.png b/res/image/main/icon_close.png new file mode 100644 index 0000000..f3aa270 --- /dev/null +++ b/res/image/main/icon_close.png Binary files differ diff --git a/res/image/main/icon_close_p.png b/res/image/main/icon_close_p.png deleted file mode 100644 index b9ba30c..0000000 --- a/res/image/main/icon_close_p.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_main.png b/res/image/main/icon_main.png deleted file mode 100644 index 9d004d5..0000000 --- a/res/image/main/icon_main.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_max.png b/res/image/main/icon_max.png new file mode 100644 index 0000000..6cbf073 --- /dev/null +++ b/res/image/main/icon_max.png Binary files differ diff --git a/res/image/main/icon_menu_calibration.png b/res/image/main/icon_menu_calibration.png new file mode 100644 index 0000000..6fca8be --- /dev/null +++ b/res/image/main/icon_menu_calibration.png Binary files differ diff --git a/res/image/main/icon_menu_calibration_selected.png b/res/image/main/icon_menu_calibration_selected.png new file mode 100644 index 0000000..17f918f --- /dev/null +++ b/res/image/main/icon_menu_calibration_selected.png Binary files differ diff --git a/res/image/main/icon_menu_check.png b/res/image/main/icon_menu_check.png new file mode 100644 index 0000000..c3db5fa --- /dev/null +++ b/res/image/main/icon_menu_check.png Binary files differ diff --git a/res/image/main/icon_menu_check_selected.png b/res/image/main/icon_menu_check_selected.png new file mode 100644 index 0000000..9794c43 --- /dev/null +++ b/res/image/main/icon_menu_check_selected.png Binary files differ diff --git a/res/image/main/icon_menu_infomation.png b/res/image/main/icon_menu_infomation.png new file mode 100644 index 0000000..e272f4c --- /dev/null +++ b/res/image/main/icon_menu_infomation.png Binary files differ diff --git a/AutoCalibrationXC.pro b/AutoCalibrationXC.pro index 6bcb335..7790b37 100644 --- a/AutoCalibrationXC.pro +++ b/AutoCalibrationXC.pro @@ -24,11 +24,6 @@ include(QPagedTable/QPagedTable.pri) SOURCES += main.cpp -SOURCES += MainWindow.cpp - -HEADERS += MainWindow.h - -FORMS += MainWindow.ui RC_ICONS = res/autoCalibration.ico diff --git a/MainWindow.cpp b/MainWindow.cpp deleted file mode 100644 index ff126e8..0000000 --- a/MainWindow.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#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/MainWindow.h b/MainWindow.h deleted file mode 100644 index 4643e32..0000000 --- a/MainWindow.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#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; -}; -#endif // MAINWINDOW_H diff --git a/MainWindow.ui b/MainWindow.ui deleted file mode 100644 index b232854..0000000 --- a/MainWindow.ui +++ /dev/null @@ -1,22 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 800 - 600 - - - - MainWindow - - - - - - - - diff --git a/frame/CustomMessageBox.ui b/frame/CustomMessageBox.ui index 336be54..b545d74 100644 --- a/frame/CustomMessageBox.ui +++ b/frame/CustomMessageBox.ui @@ -84,8 +84,8 @@ - - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + + :/image/msgbox/icon_box_close.png:/image/msgbox/icon_box_close.png @@ -134,7 +134,7 @@ - :/image/msgbox/icon_box_success.png + :/image/msgbox/icon_box_success.png Qt::AlignCenter @@ -265,6 +265,8 @@ - + + + diff --git a/frame/MainWindowForm.cpp b/frame/MainWindowForm.cpp index 2ded44b..ec82cd7 100644 --- a/frame/MainWindowForm.cpp +++ b/frame/MainWindowForm.cpp @@ -1,6 +1,8 @@ #include "MainWindowForm.h" #include "ui_MainWindowForm.h" +#include + MainWindowForm::MainWindowForm(QWidget *parent) : FramelessWindow(parent), ui(new Ui::MainWindowForm) @@ -12,7 +14,7 @@ initMenuWidgets(); initFunctionButtons(); - // 每秒更新 界面上没有地方能摆 暂时先不启动定时器 + // 每秒更新 connect(TimeCounterUtil::getInstance().clockTimer, &QTimer::timeout, this, &MainWindowForm::onUpdateTimestampHandler); TimeCounterUtil::getInstance().clockTimer->start(1000); @@ -34,6 +36,7 @@ void MainWindowForm::initForm() { setWindowFlags(Qt::FramelessWindowHint); // 设置全屏 + setWindowState(Qt::WindowState::WindowMaximized); this->setTitleBar(ui->wdgtTop); // 设置窗口位置和大小 move(0, 0); @@ -120,6 +123,22 @@ setWindowState(Qt::WindowMinimized | windowState()); } +void MainWindowForm::on_btnMaxWin_clicked() +{ + QScreen *screen = QGuiApplication::primaryScreen(); + QRect screenSize = screen->availableGeometry(); // 可用区域(排除任务栏) + + if (this->isMaximized()) { + resize(screenSize.width() * 0.8, screenSize.height() * 0.8); + move(QRandomGenerator::global()->bounded(10, 100), QRandomGenerator::global()->bounded(10, 50)); + this->showNormal(); + } else { + resize(screenSize.width(), screenSize.height()); + move(0, 0); + this->showMaximized(); + } +} + void MainWindowForm::on_btnCloseWin_clicked() { // 创建一个消息框 @@ -146,18 +165,9 @@ ui->labelTime->setText(now.toString("yyyy-MM-dd HH:mm:ss")); } -void MainWindowForm::on_btnMenuMax_clicked() -{ - if (this->isMaximized()) { - this->showNormal(); - } else { - this->showMaximized(); - } -} - void MainWindowForm::titleDblClick() { - on_btnMenuMax_clicked(); + on_btnMaxWin_clicked(); } void MainWindowForm::onMenuButtonsEabled(bool enable) { diff --git a/frame/MainWindowForm.h b/frame/MainWindowForm.h index 4d206b1..9b4eae4 100644 --- a/frame/MainWindowForm.h +++ b/frame/MainWindowForm.h @@ -45,11 +45,11 @@ private slots: void on_btnMinWin_clicked(); + void on_btnMaxWin_clicked(); void on_btnCloseWin_clicked(); void onFunctionButtonsAction(); void onUpdateTimestampHandler(); - void on_btnMenuMax_clicked(); void titleDblClick(); void onMenuButtonsEabled(bool enable); diff --git a/frame/MainWindowForm.ui b/frame/MainWindowForm.ui index bd42122..f37d171 100644 --- a/frame/MainWindowForm.ui +++ b/frame/MainWindowForm.ui @@ -41,7 +41,7 @@ 0 - 120 + 100 @@ -58,7 +58,7 @@ 20 - 0 + 20 @@ -88,8 +88,8 @@ - 120 - 120 + 150 + 100 @@ -107,6 +107,22 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + @@ -158,7 +174,7 @@ 100 - 84 + 72 @@ -166,7 +182,8 @@ - :/image/main/calibration.png:/image/main/calibration.png + :/image/main/icon_menu_calibration.png + :/image/main/icon_menu_calibration_selected.png:/image/main/icon_menu_calibration.png @@ -184,7 +201,7 @@ 100 - 84 + 72 @@ -192,7 +209,8 @@ - :/image/main/rawDataRecord.png:/image/main/rawDataRecord.png + :/image/main/icon_menu_check.png + :/image/main/icon_menu_check_selected.png:/image/main/icon_menu_check.png @@ -210,7 +228,7 @@ 100 - 84 + 72 @@ -218,7 +236,8 @@ - :/image/main/fileRes.png:/image/main/fileRes.png + :/image/main/icon_menu_infomation.png + :/image/main/icon_menu_infomation_checked.png:/image/main/icon_menu_infomation.png @@ -235,10 +254,147 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 50 + 20 + + + + + - 320 + 240 + 16777215 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 5 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + :/image/main/iconTemp.png + + + + + + + 34.5℃ + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + + + + :/image/main/iconHumi.png + + + + + + + 25%Rh + + + + + + + + + + + + + + 240 16777215 @@ -308,7 +464,7 @@ - :/image/main/icon_setting_p.png:/image/main/icon_setting_p.png + :/image/main/icon_setting.png:/image/main/icon_setting.png @@ -334,7 +490,33 @@ - :/image/main/icon_min_p.png:/image/main/icon_min_p.png + :/image/main/icon_min.png:/image/main/icon_min.png + + + + 32 + 32 + + + + + + + + + 40 + 40 + + + + 最小化 + + + + + + + :/image/main/icon_max.png:/image/main/icon_max.png @@ -360,7 +542,7 @@ - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + :/image/main/icon_close.png:/image/main/icon_close.png @@ -426,87 +608,9 @@ - - - - - 0 - 30 - - - - - 20 - - - 0 - - - 0 - - - 40 - - - 0 - - - - - Qt::Horizontal - - - - 1289 - 20 - - - - - - - - - - - - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 20 - - - - - - - - - - - - - - wdgtContent wdgtTop - wdgtFoot diff --git a/infomation/InfoMainForm.cpp b/infomation/InfoMainForm.cpp index c001199..5d0ffc8 100644 --- a/infomation/InfoMainForm.cpp +++ b/infomation/InfoMainForm.cpp @@ -21,9 +21,13 @@ void InfoMainForm::initForm() { + // 加载样式表 + QString qssStyle = QssFileUtils::loadQssFileContent(QApplication::applicationDirPath() + "/qss/infoMain.css"); + if (qssStyle.isEmpty() == false) { + this->setStyleSheet(qssStyle); // 仅本窗口生效 + } - - + ui->scrollArea->setWindowFlags(Qt::FramelessWindowHint); // 设置无边框 } void InfoMainForm::initSubMenuForms() { diff --git a/infomation/InfoMainForm.ui b/infomation/InfoMainForm.ui index 958a6b2..d9066dd 100644 --- a/infomation/InfoMainForm.ui +++ b/infomation/InfoMainForm.ui @@ -90,7 +90,7 @@ - 280 + 295 48 @@ -103,7 +103,7 @@ - 280 + 295 48 @@ -116,7 +116,7 @@ - 280 + 295 48 @@ -129,7 +129,7 @@ - 280 + 295 48 @@ -142,7 +142,7 @@ - 280 + 295 48 @@ -155,7 +155,7 @@ - 280 + 295 48 @@ -168,7 +168,7 @@ - 280 + 295 48 @@ -181,7 +181,7 @@ - 280 + 295 48 @@ -194,7 +194,7 @@ - 280 + 295 48 @@ -207,7 +207,7 @@ - 280 + 295 48 @@ -220,7 +220,7 @@ - 280 + 295 48 @@ -233,7 +233,7 @@ - 280 + 295 48 @@ -246,7 +246,7 @@ - 280 + 295 48 diff --git a/infomation/task/DeptTaskForm.cpp b/infomation/task/DeptTaskForm.cpp index ea21a9f..cc6bf31 100644 --- a/infomation/task/DeptTaskForm.cpp +++ b/infomation/task/DeptTaskForm.cpp @@ -18,12 +18,17 @@ delete ui; } -void DeptTaskForm::showEvent(QShowEvent *event) +void DeptTaskForm::showEvent(QShowEvent * event) { ui->tableDeptTask->adjustTableWidth(); getDeptTaskList(0); } +void DeptTaskForm::resizeEvent(QResizeEvent * event) +{ + ui->tableDeptTask->adjustTableWidth(); +} + void DeptTaskForm::initFormTable() { // 初始化查询条件 diff --git a/infomation/task/DeptTaskForm.h b/infomation/task/DeptTaskForm.h index 1055c36..3c1ad5b 100644 --- a/infomation/task/DeptTaskForm.h +++ b/infomation/task/DeptTaskForm.h @@ -21,7 +21,8 @@ ~DeptTaskForm(); protected: - void showEvent(QShowEvent *event) override; + void showEvent(QShowEvent * event) override; + void resizeEvent(QResizeEvent * event) override; private: Ui::DeptTaskForm *ui; diff --git a/main.cpp b/main.cpp index 525387e..0b78c87 100644 --- a/main.cpp +++ b/main.cpp @@ -1,5 +1,3 @@ -#include "MainWindow.h" - #include #include diff --git a/res/image/Index/u1176.svg b/res/image/Index/u1176.svg deleted file mode 100644 index c81ce8a..0000000 --- a/res/image/Index/u1176.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1180.svg b/res/image/Index/u1180.svg deleted file mode 100644 index 2ef24ab..0000000 --- a/res/image/Index/u1180.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1220.svg b/res/image/Index/u1220.svg deleted file mode 100644 index 43452aa..0000000 --- a/res/image/Index/u1220.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2158.svg b/res/image/Index/u2158.svg deleted file mode 100644 index fd249e0..0000000 --- a/res/image/Index/u2158.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u2188.svg b/res/image/Index/u2188.svg deleted file mode 100644 index 34f53c4..0000000 --- a/res/image/Index/u2188.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2189.svg b/res/image/Index/u2189.svg deleted file mode 100644 index 01a6bbb..0000000 --- a/res/image/Index/u2189.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2324.svg b/res/image/Index/u2324.svg deleted file mode 100644 index 797f1c5..0000000 --- a/res/image/Index/u2324.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2325.svg b/res/image/Index/u2325.svg deleted file mode 100644 index fefe01b..0000000 --- a/res/image/Index/u2325.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u642.svg b/res/image/Index/u642.svg deleted file mode 100644 index 33c9e0a..0000000 --- a/res/image/Index/u642.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u7406.svg b/res/image/Index/u7406.svg deleted file mode 100644 index 8a7a6d9..0000000 --- a/res/image/Index/u7406.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7453.svg b/res/image/Index/u7453.svg deleted file mode 100644 index 603c496..0000000 --- a/res/image/Index/u7453.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7458.svg b/res/image/Index/u7458.svg deleted file mode 100644 index b31087b..0000000 --- a/res/image/Index/u7458.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7488.svg b/res/image/Index/u7488.svg deleted file mode 100644 index 8baf439..0000000 --- a/res/image/Index/u7488.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7491.svg b/res/image/Index/u7491.svg deleted file mode 100644 index 3e41c10..0000000 --- a/res/image/Index/u7491.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7538.svg b/res/image/Index/u7538.svg deleted file mode 100644 index 417077d..0000000 --- a/res/image/Index/u7538.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u794.svg b/res/image/Index/u794.svg deleted file mode 100644 index e12cff7..0000000 --- a/res/image/Index/u794.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u8448.svg b/res/image/Index/u8448.svg deleted file mode 100644 index 7f6f4c0..0000000 --- a/res/image/Index/u8448.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u8458.svg b/res/image/Index/u8458.svg deleted file mode 100644 index 6d04a12..0000000 --- a/res/image/Index/u8458.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/main/bg_banner.png b/res/image/main/bg_banner.png new file mode 100644 index 0000000..26ddffd --- /dev/null +++ b/res/image/main/bg_banner.png Binary files differ diff --git a/res/image/main/iconHumi.png b/res/image/main/iconHumi.png index 4410d38..bd164e8 100644 --- a/res/image/main/iconHumi.png +++ b/res/image/main/iconHumi.png Binary files differ diff --git a/res/image/main/iconTemp.png b/res/image/main/iconTemp.png index 8fd059c..a2cfe4d 100644 --- a/res/image/main/iconTemp.png +++ b/res/image/main/iconTemp.png Binary files differ diff --git a/res/image/main/icon_close.png b/res/image/main/icon_close.png new file mode 100644 index 0000000..f3aa270 --- /dev/null +++ b/res/image/main/icon_close.png Binary files differ diff --git a/res/image/main/icon_close_p.png b/res/image/main/icon_close_p.png deleted file mode 100644 index b9ba30c..0000000 --- a/res/image/main/icon_close_p.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_main.png b/res/image/main/icon_main.png deleted file mode 100644 index 9d004d5..0000000 --- a/res/image/main/icon_main.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_max.png b/res/image/main/icon_max.png new file mode 100644 index 0000000..6cbf073 --- /dev/null +++ b/res/image/main/icon_max.png Binary files differ diff --git a/res/image/main/icon_menu_calibration.png b/res/image/main/icon_menu_calibration.png new file mode 100644 index 0000000..6fca8be --- /dev/null +++ b/res/image/main/icon_menu_calibration.png Binary files differ diff --git a/res/image/main/icon_menu_calibration_selected.png b/res/image/main/icon_menu_calibration_selected.png new file mode 100644 index 0000000..17f918f --- /dev/null +++ b/res/image/main/icon_menu_calibration_selected.png Binary files differ diff --git a/res/image/main/icon_menu_check.png b/res/image/main/icon_menu_check.png new file mode 100644 index 0000000..c3db5fa --- /dev/null +++ b/res/image/main/icon_menu_check.png Binary files differ diff --git a/res/image/main/icon_menu_check_selected.png b/res/image/main/icon_menu_check_selected.png new file mode 100644 index 0000000..9794c43 --- /dev/null +++ b/res/image/main/icon_menu_check_selected.png Binary files differ diff --git a/res/image/main/icon_menu_infomation.png b/res/image/main/icon_menu_infomation.png new file mode 100644 index 0000000..e272f4c --- /dev/null +++ b/res/image/main/icon_menu_infomation.png Binary files differ diff --git a/res/image/main/icon_menu_infomation_checked.png b/res/image/main/icon_menu_infomation_checked.png new file mode 100644 index 0000000..6122c7b --- /dev/null +++ b/res/image/main/icon_menu_infomation_checked.png Binary files differ diff --git a/AutoCalibrationXC.pro b/AutoCalibrationXC.pro index 6bcb335..7790b37 100644 --- a/AutoCalibrationXC.pro +++ b/AutoCalibrationXC.pro @@ -24,11 +24,6 @@ include(QPagedTable/QPagedTable.pri) SOURCES += main.cpp -SOURCES += MainWindow.cpp - -HEADERS += MainWindow.h - -FORMS += MainWindow.ui RC_ICONS = res/autoCalibration.ico diff --git a/MainWindow.cpp b/MainWindow.cpp deleted file mode 100644 index ff126e8..0000000 --- a/MainWindow.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#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/MainWindow.h b/MainWindow.h deleted file mode 100644 index 4643e32..0000000 --- a/MainWindow.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#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; -}; -#endif // MAINWINDOW_H diff --git a/MainWindow.ui b/MainWindow.ui deleted file mode 100644 index b232854..0000000 --- a/MainWindow.ui +++ /dev/null @@ -1,22 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 800 - 600 - - - - MainWindow - - - - - - - - diff --git a/frame/CustomMessageBox.ui b/frame/CustomMessageBox.ui index 336be54..b545d74 100644 --- a/frame/CustomMessageBox.ui +++ b/frame/CustomMessageBox.ui @@ -84,8 +84,8 @@ - - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + + :/image/msgbox/icon_box_close.png:/image/msgbox/icon_box_close.png @@ -134,7 +134,7 @@ - :/image/msgbox/icon_box_success.png + :/image/msgbox/icon_box_success.png Qt::AlignCenter @@ -265,6 +265,8 @@ - + + + diff --git a/frame/MainWindowForm.cpp b/frame/MainWindowForm.cpp index 2ded44b..ec82cd7 100644 --- a/frame/MainWindowForm.cpp +++ b/frame/MainWindowForm.cpp @@ -1,6 +1,8 @@ #include "MainWindowForm.h" #include "ui_MainWindowForm.h" +#include + MainWindowForm::MainWindowForm(QWidget *parent) : FramelessWindow(parent), ui(new Ui::MainWindowForm) @@ -12,7 +14,7 @@ initMenuWidgets(); initFunctionButtons(); - // 每秒更新 界面上没有地方能摆 暂时先不启动定时器 + // 每秒更新 connect(TimeCounterUtil::getInstance().clockTimer, &QTimer::timeout, this, &MainWindowForm::onUpdateTimestampHandler); TimeCounterUtil::getInstance().clockTimer->start(1000); @@ -34,6 +36,7 @@ void MainWindowForm::initForm() { setWindowFlags(Qt::FramelessWindowHint); // 设置全屏 + setWindowState(Qt::WindowState::WindowMaximized); this->setTitleBar(ui->wdgtTop); // 设置窗口位置和大小 move(0, 0); @@ -120,6 +123,22 @@ setWindowState(Qt::WindowMinimized | windowState()); } +void MainWindowForm::on_btnMaxWin_clicked() +{ + QScreen *screen = QGuiApplication::primaryScreen(); + QRect screenSize = screen->availableGeometry(); // 可用区域(排除任务栏) + + if (this->isMaximized()) { + resize(screenSize.width() * 0.8, screenSize.height() * 0.8); + move(QRandomGenerator::global()->bounded(10, 100), QRandomGenerator::global()->bounded(10, 50)); + this->showNormal(); + } else { + resize(screenSize.width(), screenSize.height()); + move(0, 0); + this->showMaximized(); + } +} + void MainWindowForm::on_btnCloseWin_clicked() { // 创建一个消息框 @@ -146,18 +165,9 @@ ui->labelTime->setText(now.toString("yyyy-MM-dd HH:mm:ss")); } -void MainWindowForm::on_btnMenuMax_clicked() -{ - if (this->isMaximized()) { - this->showNormal(); - } else { - this->showMaximized(); - } -} - void MainWindowForm::titleDblClick() { - on_btnMenuMax_clicked(); + on_btnMaxWin_clicked(); } void MainWindowForm::onMenuButtonsEabled(bool enable) { diff --git a/frame/MainWindowForm.h b/frame/MainWindowForm.h index 4d206b1..9b4eae4 100644 --- a/frame/MainWindowForm.h +++ b/frame/MainWindowForm.h @@ -45,11 +45,11 @@ private slots: void on_btnMinWin_clicked(); + void on_btnMaxWin_clicked(); void on_btnCloseWin_clicked(); void onFunctionButtonsAction(); void onUpdateTimestampHandler(); - void on_btnMenuMax_clicked(); void titleDblClick(); void onMenuButtonsEabled(bool enable); diff --git a/frame/MainWindowForm.ui b/frame/MainWindowForm.ui index bd42122..f37d171 100644 --- a/frame/MainWindowForm.ui +++ b/frame/MainWindowForm.ui @@ -41,7 +41,7 @@ 0 - 120 + 100 @@ -58,7 +58,7 @@ 20 - 0 + 20 @@ -88,8 +88,8 @@ - 120 - 120 + 150 + 100 @@ -107,6 +107,22 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + @@ -158,7 +174,7 @@ 100 - 84 + 72 @@ -166,7 +182,8 @@ - :/image/main/calibration.png:/image/main/calibration.png + :/image/main/icon_menu_calibration.png + :/image/main/icon_menu_calibration_selected.png:/image/main/icon_menu_calibration.png @@ -184,7 +201,7 @@ 100 - 84 + 72 @@ -192,7 +209,8 @@ - :/image/main/rawDataRecord.png:/image/main/rawDataRecord.png + :/image/main/icon_menu_check.png + :/image/main/icon_menu_check_selected.png:/image/main/icon_menu_check.png @@ -210,7 +228,7 @@ 100 - 84 + 72 @@ -218,7 +236,8 @@ - :/image/main/fileRes.png:/image/main/fileRes.png + :/image/main/icon_menu_infomation.png + :/image/main/icon_menu_infomation_checked.png:/image/main/icon_menu_infomation.png @@ -235,10 +254,147 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 50 + 20 + + + + + - 320 + 240 + 16777215 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 5 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + :/image/main/iconTemp.png + + + + + + + 34.5℃ + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + + + + :/image/main/iconHumi.png + + + + + + + 25%Rh + + + + + + + + + + + + + + 240 16777215 @@ -308,7 +464,7 @@ - :/image/main/icon_setting_p.png:/image/main/icon_setting_p.png + :/image/main/icon_setting.png:/image/main/icon_setting.png @@ -334,7 +490,33 @@ - :/image/main/icon_min_p.png:/image/main/icon_min_p.png + :/image/main/icon_min.png:/image/main/icon_min.png + + + + 32 + 32 + + + + + + + + + 40 + 40 + + + + 最小化 + + + + + + + :/image/main/icon_max.png:/image/main/icon_max.png @@ -360,7 +542,7 @@ - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + :/image/main/icon_close.png:/image/main/icon_close.png @@ -426,87 +608,9 @@ - - - - - 0 - 30 - - - - - 20 - - - 0 - - - 0 - - - 40 - - - 0 - - - - - Qt::Horizontal - - - - 1289 - 20 - - - - - - - - - - - - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 20 - - - - - - - - - - - - - - wdgtContent wdgtTop - wdgtFoot diff --git a/infomation/InfoMainForm.cpp b/infomation/InfoMainForm.cpp index c001199..5d0ffc8 100644 --- a/infomation/InfoMainForm.cpp +++ b/infomation/InfoMainForm.cpp @@ -21,9 +21,13 @@ void InfoMainForm::initForm() { + // 加载样式表 + QString qssStyle = QssFileUtils::loadQssFileContent(QApplication::applicationDirPath() + "/qss/infoMain.css"); + if (qssStyle.isEmpty() == false) { + this->setStyleSheet(qssStyle); // 仅本窗口生效 + } - - + ui->scrollArea->setWindowFlags(Qt::FramelessWindowHint); // 设置无边框 } void InfoMainForm::initSubMenuForms() { diff --git a/infomation/InfoMainForm.ui b/infomation/InfoMainForm.ui index 958a6b2..d9066dd 100644 --- a/infomation/InfoMainForm.ui +++ b/infomation/InfoMainForm.ui @@ -90,7 +90,7 @@ - 280 + 295 48 @@ -103,7 +103,7 @@ - 280 + 295 48 @@ -116,7 +116,7 @@ - 280 + 295 48 @@ -129,7 +129,7 @@ - 280 + 295 48 @@ -142,7 +142,7 @@ - 280 + 295 48 @@ -155,7 +155,7 @@ - 280 + 295 48 @@ -168,7 +168,7 @@ - 280 + 295 48 @@ -181,7 +181,7 @@ - 280 + 295 48 @@ -194,7 +194,7 @@ - 280 + 295 48 @@ -207,7 +207,7 @@ - 280 + 295 48 @@ -220,7 +220,7 @@ - 280 + 295 48 @@ -233,7 +233,7 @@ - 280 + 295 48 @@ -246,7 +246,7 @@ - 280 + 295 48 diff --git a/infomation/task/DeptTaskForm.cpp b/infomation/task/DeptTaskForm.cpp index ea21a9f..cc6bf31 100644 --- a/infomation/task/DeptTaskForm.cpp +++ b/infomation/task/DeptTaskForm.cpp @@ -18,12 +18,17 @@ delete ui; } -void DeptTaskForm::showEvent(QShowEvent *event) +void DeptTaskForm::showEvent(QShowEvent * event) { ui->tableDeptTask->adjustTableWidth(); getDeptTaskList(0); } +void DeptTaskForm::resizeEvent(QResizeEvent * event) +{ + ui->tableDeptTask->adjustTableWidth(); +} + void DeptTaskForm::initFormTable() { // 初始化查询条件 diff --git a/infomation/task/DeptTaskForm.h b/infomation/task/DeptTaskForm.h index 1055c36..3c1ad5b 100644 --- a/infomation/task/DeptTaskForm.h +++ b/infomation/task/DeptTaskForm.h @@ -21,7 +21,8 @@ ~DeptTaskForm(); protected: - void showEvent(QShowEvent *event) override; + void showEvent(QShowEvent * event) override; + void resizeEvent(QResizeEvent * event) override; private: Ui::DeptTaskForm *ui; diff --git a/main.cpp b/main.cpp index 525387e..0b78c87 100644 --- a/main.cpp +++ b/main.cpp @@ -1,5 +1,3 @@ -#include "MainWindow.h" - #include #include diff --git a/res/image/Index/u1176.svg b/res/image/Index/u1176.svg deleted file mode 100644 index c81ce8a..0000000 --- a/res/image/Index/u1176.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1180.svg b/res/image/Index/u1180.svg deleted file mode 100644 index 2ef24ab..0000000 --- a/res/image/Index/u1180.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1220.svg b/res/image/Index/u1220.svg deleted file mode 100644 index 43452aa..0000000 --- a/res/image/Index/u1220.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2158.svg b/res/image/Index/u2158.svg deleted file mode 100644 index fd249e0..0000000 --- a/res/image/Index/u2158.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u2188.svg b/res/image/Index/u2188.svg deleted file mode 100644 index 34f53c4..0000000 --- a/res/image/Index/u2188.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2189.svg b/res/image/Index/u2189.svg deleted file mode 100644 index 01a6bbb..0000000 --- a/res/image/Index/u2189.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2324.svg b/res/image/Index/u2324.svg deleted file mode 100644 index 797f1c5..0000000 --- a/res/image/Index/u2324.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2325.svg b/res/image/Index/u2325.svg deleted file mode 100644 index fefe01b..0000000 --- a/res/image/Index/u2325.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u642.svg b/res/image/Index/u642.svg deleted file mode 100644 index 33c9e0a..0000000 --- a/res/image/Index/u642.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u7406.svg b/res/image/Index/u7406.svg deleted file mode 100644 index 8a7a6d9..0000000 --- a/res/image/Index/u7406.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7453.svg b/res/image/Index/u7453.svg deleted file mode 100644 index 603c496..0000000 --- a/res/image/Index/u7453.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7458.svg b/res/image/Index/u7458.svg deleted file mode 100644 index b31087b..0000000 --- a/res/image/Index/u7458.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7488.svg b/res/image/Index/u7488.svg deleted file mode 100644 index 8baf439..0000000 --- a/res/image/Index/u7488.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7491.svg b/res/image/Index/u7491.svg deleted file mode 100644 index 3e41c10..0000000 --- a/res/image/Index/u7491.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7538.svg b/res/image/Index/u7538.svg deleted file mode 100644 index 417077d..0000000 --- a/res/image/Index/u7538.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u794.svg b/res/image/Index/u794.svg deleted file mode 100644 index e12cff7..0000000 --- a/res/image/Index/u794.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u8448.svg b/res/image/Index/u8448.svg deleted file mode 100644 index 7f6f4c0..0000000 --- a/res/image/Index/u8448.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u8458.svg b/res/image/Index/u8458.svg deleted file mode 100644 index 6d04a12..0000000 --- a/res/image/Index/u8458.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/main/bg_banner.png b/res/image/main/bg_banner.png new file mode 100644 index 0000000..26ddffd --- /dev/null +++ b/res/image/main/bg_banner.png Binary files differ diff --git a/res/image/main/iconHumi.png b/res/image/main/iconHumi.png index 4410d38..bd164e8 100644 --- a/res/image/main/iconHumi.png +++ b/res/image/main/iconHumi.png Binary files differ diff --git a/res/image/main/iconTemp.png b/res/image/main/iconTemp.png index 8fd059c..a2cfe4d 100644 --- a/res/image/main/iconTemp.png +++ b/res/image/main/iconTemp.png Binary files differ diff --git a/res/image/main/icon_close.png b/res/image/main/icon_close.png new file mode 100644 index 0000000..f3aa270 --- /dev/null +++ b/res/image/main/icon_close.png Binary files differ diff --git a/res/image/main/icon_close_p.png b/res/image/main/icon_close_p.png deleted file mode 100644 index b9ba30c..0000000 --- a/res/image/main/icon_close_p.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_main.png b/res/image/main/icon_main.png deleted file mode 100644 index 9d004d5..0000000 --- a/res/image/main/icon_main.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_max.png b/res/image/main/icon_max.png new file mode 100644 index 0000000..6cbf073 --- /dev/null +++ b/res/image/main/icon_max.png Binary files differ diff --git a/res/image/main/icon_menu_calibration.png b/res/image/main/icon_menu_calibration.png new file mode 100644 index 0000000..6fca8be --- /dev/null +++ b/res/image/main/icon_menu_calibration.png Binary files differ diff --git a/res/image/main/icon_menu_calibration_selected.png b/res/image/main/icon_menu_calibration_selected.png new file mode 100644 index 0000000..17f918f --- /dev/null +++ b/res/image/main/icon_menu_calibration_selected.png Binary files differ diff --git a/res/image/main/icon_menu_check.png b/res/image/main/icon_menu_check.png new file mode 100644 index 0000000..c3db5fa --- /dev/null +++ b/res/image/main/icon_menu_check.png Binary files differ diff --git a/res/image/main/icon_menu_check_selected.png b/res/image/main/icon_menu_check_selected.png new file mode 100644 index 0000000..9794c43 --- /dev/null +++ b/res/image/main/icon_menu_check_selected.png Binary files differ diff --git a/res/image/main/icon_menu_infomation.png b/res/image/main/icon_menu_infomation.png new file mode 100644 index 0000000..e272f4c --- /dev/null +++ b/res/image/main/icon_menu_infomation.png Binary files differ diff --git a/res/image/main/icon_menu_infomation_checked.png b/res/image/main/icon_menu_infomation_checked.png new file mode 100644 index 0000000..6122c7b --- /dev/null +++ b/res/image/main/icon_menu_infomation_checked.png Binary files differ diff --git a/res/image/main/icon_min.png b/res/image/main/icon_min.png new file mode 100644 index 0000000..2f524d9 --- /dev/null +++ b/res/image/main/icon_min.png Binary files differ diff --git a/AutoCalibrationXC.pro b/AutoCalibrationXC.pro index 6bcb335..7790b37 100644 --- a/AutoCalibrationXC.pro +++ b/AutoCalibrationXC.pro @@ -24,11 +24,6 @@ include(QPagedTable/QPagedTable.pri) SOURCES += main.cpp -SOURCES += MainWindow.cpp - -HEADERS += MainWindow.h - -FORMS += MainWindow.ui RC_ICONS = res/autoCalibration.ico diff --git a/MainWindow.cpp b/MainWindow.cpp deleted file mode 100644 index ff126e8..0000000 --- a/MainWindow.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#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/MainWindow.h b/MainWindow.h deleted file mode 100644 index 4643e32..0000000 --- a/MainWindow.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#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; -}; -#endif // MAINWINDOW_H diff --git a/MainWindow.ui b/MainWindow.ui deleted file mode 100644 index b232854..0000000 --- a/MainWindow.ui +++ /dev/null @@ -1,22 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 800 - 600 - - - - MainWindow - - - - - - - - diff --git a/frame/CustomMessageBox.ui b/frame/CustomMessageBox.ui index 336be54..b545d74 100644 --- a/frame/CustomMessageBox.ui +++ b/frame/CustomMessageBox.ui @@ -84,8 +84,8 @@ - - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + + :/image/msgbox/icon_box_close.png:/image/msgbox/icon_box_close.png @@ -134,7 +134,7 @@ - :/image/msgbox/icon_box_success.png + :/image/msgbox/icon_box_success.png Qt::AlignCenter @@ -265,6 +265,8 @@ - + + + diff --git a/frame/MainWindowForm.cpp b/frame/MainWindowForm.cpp index 2ded44b..ec82cd7 100644 --- a/frame/MainWindowForm.cpp +++ b/frame/MainWindowForm.cpp @@ -1,6 +1,8 @@ #include "MainWindowForm.h" #include "ui_MainWindowForm.h" +#include + MainWindowForm::MainWindowForm(QWidget *parent) : FramelessWindow(parent), ui(new Ui::MainWindowForm) @@ -12,7 +14,7 @@ initMenuWidgets(); initFunctionButtons(); - // 每秒更新 界面上没有地方能摆 暂时先不启动定时器 + // 每秒更新 connect(TimeCounterUtil::getInstance().clockTimer, &QTimer::timeout, this, &MainWindowForm::onUpdateTimestampHandler); TimeCounterUtil::getInstance().clockTimer->start(1000); @@ -34,6 +36,7 @@ void MainWindowForm::initForm() { setWindowFlags(Qt::FramelessWindowHint); // 设置全屏 + setWindowState(Qt::WindowState::WindowMaximized); this->setTitleBar(ui->wdgtTop); // 设置窗口位置和大小 move(0, 0); @@ -120,6 +123,22 @@ setWindowState(Qt::WindowMinimized | windowState()); } +void MainWindowForm::on_btnMaxWin_clicked() +{ + QScreen *screen = QGuiApplication::primaryScreen(); + QRect screenSize = screen->availableGeometry(); // 可用区域(排除任务栏) + + if (this->isMaximized()) { + resize(screenSize.width() * 0.8, screenSize.height() * 0.8); + move(QRandomGenerator::global()->bounded(10, 100), QRandomGenerator::global()->bounded(10, 50)); + this->showNormal(); + } else { + resize(screenSize.width(), screenSize.height()); + move(0, 0); + this->showMaximized(); + } +} + void MainWindowForm::on_btnCloseWin_clicked() { // 创建一个消息框 @@ -146,18 +165,9 @@ ui->labelTime->setText(now.toString("yyyy-MM-dd HH:mm:ss")); } -void MainWindowForm::on_btnMenuMax_clicked() -{ - if (this->isMaximized()) { - this->showNormal(); - } else { - this->showMaximized(); - } -} - void MainWindowForm::titleDblClick() { - on_btnMenuMax_clicked(); + on_btnMaxWin_clicked(); } void MainWindowForm::onMenuButtonsEabled(bool enable) { diff --git a/frame/MainWindowForm.h b/frame/MainWindowForm.h index 4d206b1..9b4eae4 100644 --- a/frame/MainWindowForm.h +++ b/frame/MainWindowForm.h @@ -45,11 +45,11 @@ private slots: void on_btnMinWin_clicked(); + void on_btnMaxWin_clicked(); void on_btnCloseWin_clicked(); void onFunctionButtonsAction(); void onUpdateTimestampHandler(); - void on_btnMenuMax_clicked(); void titleDblClick(); void onMenuButtonsEabled(bool enable); diff --git a/frame/MainWindowForm.ui b/frame/MainWindowForm.ui index bd42122..f37d171 100644 --- a/frame/MainWindowForm.ui +++ b/frame/MainWindowForm.ui @@ -41,7 +41,7 @@ 0 - 120 + 100 @@ -58,7 +58,7 @@ 20 - 0 + 20 @@ -88,8 +88,8 @@ - 120 - 120 + 150 + 100 @@ -107,6 +107,22 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + @@ -158,7 +174,7 @@ 100 - 84 + 72 @@ -166,7 +182,8 @@ - :/image/main/calibration.png:/image/main/calibration.png + :/image/main/icon_menu_calibration.png + :/image/main/icon_menu_calibration_selected.png:/image/main/icon_menu_calibration.png @@ -184,7 +201,7 @@ 100 - 84 + 72 @@ -192,7 +209,8 @@ - :/image/main/rawDataRecord.png:/image/main/rawDataRecord.png + :/image/main/icon_menu_check.png + :/image/main/icon_menu_check_selected.png:/image/main/icon_menu_check.png @@ -210,7 +228,7 @@ 100 - 84 + 72 @@ -218,7 +236,8 @@ - :/image/main/fileRes.png:/image/main/fileRes.png + :/image/main/icon_menu_infomation.png + :/image/main/icon_menu_infomation_checked.png:/image/main/icon_menu_infomation.png @@ -235,10 +254,147 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 50 + 20 + + + + + - 320 + 240 + 16777215 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 5 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + :/image/main/iconTemp.png + + + + + + + 34.5℃ + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + + + + :/image/main/iconHumi.png + + + + + + + 25%Rh + + + + + + + + + + + + + + 240 16777215 @@ -308,7 +464,7 @@ - :/image/main/icon_setting_p.png:/image/main/icon_setting_p.png + :/image/main/icon_setting.png:/image/main/icon_setting.png @@ -334,7 +490,33 @@ - :/image/main/icon_min_p.png:/image/main/icon_min_p.png + :/image/main/icon_min.png:/image/main/icon_min.png + + + + 32 + 32 + + + + + + + + + 40 + 40 + + + + 最小化 + + + + + + + :/image/main/icon_max.png:/image/main/icon_max.png @@ -360,7 +542,7 @@ - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + :/image/main/icon_close.png:/image/main/icon_close.png @@ -426,87 +608,9 @@ - - - - - 0 - 30 - - - - - 20 - - - 0 - - - 0 - - - 40 - - - 0 - - - - - Qt::Horizontal - - - - 1289 - 20 - - - - - - - - - - - - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 20 - - - - - - - - - - - - - - wdgtContent wdgtTop - wdgtFoot diff --git a/infomation/InfoMainForm.cpp b/infomation/InfoMainForm.cpp index c001199..5d0ffc8 100644 --- a/infomation/InfoMainForm.cpp +++ b/infomation/InfoMainForm.cpp @@ -21,9 +21,13 @@ void InfoMainForm::initForm() { + // 加载样式表 + QString qssStyle = QssFileUtils::loadQssFileContent(QApplication::applicationDirPath() + "/qss/infoMain.css"); + if (qssStyle.isEmpty() == false) { + this->setStyleSheet(qssStyle); // 仅本窗口生效 + } - - + ui->scrollArea->setWindowFlags(Qt::FramelessWindowHint); // 设置无边框 } void InfoMainForm::initSubMenuForms() { diff --git a/infomation/InfoMainForm.ui b/infomation/InfoMainForm.ui index 958a6b2..d9066dd 100644 --- a/infomation/InfoMainForm.ui +++ b/infomation/InfoMainForm.ui @@ -90,7 +90,7 @@ - 280 + 295 48 @@ -103,7 +103,7 @@ - 280 + 295 48 @@ -116,7 +116,7 @@ - 280 + 295 48 @@ -129,7 +129,7 @@ - 280 + 295 48 @@ -142,7 +142,7 @@ - 280 + 295 48 @@ -155,7 +155,7 @@ - 280 + 295 48 @@ -168,7 +168,7 @@ - 280 + 295 48 @@ -181,7 +181,7 @@ - 280 + 295 48 @@ -194,7 +194,7 @@ - 280 + 295 48 @@ -207,7 +207,7 @@ - 280 + 295 48 @@ -220,7 +220,7 @@ - 280 + 295 48 @@ -233,7 +233,7 @@ - 280 + 295 48 @@ -246,7 +246,7 @@ - 280 + 295 48 diff --git a/infomation/task/DeptTaskForm.cpp b/infomation/task/DeptTaskForm.cpp index ea21a9f..cc6bf31 100644 --- a/infomation/task/DeptTaskForm.cpp +++ b/infomation/task/DeptTaskForm.cpp @@ -18,12 +18,17 @@ delete ui; } -void DeptTaskForm::showEvent(QShowEvent *event) +void DeptTaskForm::showEvent(QShowEvent * event) { ui->tableDeptTask->adjustTableWidth(); getDeptTaskList(0); } +void DeptTaskForm::resizeEvent(QResizeEvent * event) +{ + ui->tableDeptTask->adjustTableWidth(); +} + void DeptTaskForm::initFormTable() { // 初始化查询条件 diff --git a/infomation/task/DeptTaskForm.h b/infomation/task/DeptTaskForm.h index 1055c36..3c1ad5b 100644 --- a/infomation/task/DeptTaskForm.h +++ b/infomation/task/DeptTaskForm.h @@ -21,7 +21,8 @@ ~DeptTaskForm(); protected: - void showEvent(QShowEvent *event) override; + void showEvent(QShowEvent * event) override; + void resizeEvent(QResizeEvent * event) override; private: Ui::DeptTaskForm *ui; diff --git a/main.cpp b/main.cpp index 525387e..0b78c87 100644 --- a/main.cpp +++ b/main.cpp @@ -1,5 +1,3 @@ -#include "MainWindow.h" - #include #include diff --git a/res/image/Index/u1176.svg b/res/image/Index/u1176.svg deleted file mode 100644 index c81ce8a..0000000 --- a/res/image/Index/u1176.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1180.svg b/res/image/Index/u1180.svg deleted file mode 100644 index 2ef24ab..0000000 --- a/res/image/Index/u1180.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1220.svg b/res/image/Index/u1220.svg deleted file mode 100644 index 43452aa..0000000 --- a/res/image/Index/u1220.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2158.svg b/res/image/Index/u2158.svg deleted file mode 100644 index fd249e0..0000000 --- a/res/image/Index/u2158.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u2188.svg b/res/image/Index/u2188.svg deleted file mode 100644 index 34f53c4..0000000 --- a/res/image/Index/u2188.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2189.svg b/res/image/Index/u2189.svg deleted file mode 100644 index 01a6bbb..0000000 --- a/res/image/Index/u2189.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2324.svg b/res/image/Index/u2324.svg deleted file mode 100644 index 797f1c5..0000000 --- a/res/image/Index/u2324.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2325.svg b/res/image/Index/u2325.svg deleted file mode 100644 index fefe01b..0000000 --- a/res/image/Index/u2325.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u642.svg b/res/image/Index/u642.svg deleted file mode 100644 index 33c9e0a..0000000 --- a/res/image/Index/u642.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u7406.svg b/res/image/Index/u7406.svg deleted file mode 100644 index 8a7a6d9..0000000 --- a/res/image/Index/u7406.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7453.svg b/res/image/Index/u7453.svg deleted file mode 100644 index 603c496..0000000 --- a/res/image/Index/u7453.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7458.svg b/res/image/Index/u7458.svg deleted file mode 100644 index b31087b..0000000 --- a/res/image/Index/u7458.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7488.svg b/res/image/Index/u7488.svg deleted file mode 100644 index 8baf439..0000000 --- a/res/image/Index/u7488.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7491.svg b/res/image/Index/u7491.svg deleted file mode 100644 index 3e41c10..0000000 --- a/res/image/Index/u7491.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7538.svg b/res/image/Index/u7538.svg deleted file mode 100644 index 417077d..0000000 --- a/res/image/Index/u7538.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u794.svg b/res/image/Index/u794.svg deleted file mode 100644 index e12cff7..0000000 --- a/res/image/Index/u794.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u8448.svg b/res/image/Index/u8448.svg deleted file mode 100644 index 7f6f4c0..0000000 --- a/res/image/Index/u8448.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u8458.svg b/res/image/Index/u8458.svg deleted file mode 100644 index 6d04a12..0000000 --- a/res/image/Index/u8458.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/main/bg_banner.png b/res/image/main/bg_banner.png new file mode 100644 index 0000000..26ddffd --- /dev/null +++ b/res/image/main/bg_banner.png Binary files differ diff --git a/res/image/main/iconHumi.png b/res/image/main/iconHumi.png index 4410d38..bd164e8 100644 --- a/res/image/main/iconHumi.png +++ b/res/image/main/iconHumi.png Binary files differ diff --git a/res/image/main/iconTemp.png b/res/image/main/iconTemp.png index 8fd059c..a2cfe4d 100644 --- a/res/image/main/iconTemp.png +++ b/res/image/main/iconTemp.png Binary files differ diff --git a/res/image/main/icon_close.png b/res/image/main/icon_close.png new file mode 100644 index 0000000..f3aa270 --- /dev/null +++ b/res/image/main/icon_close.png Binary files differ diff --git a/res/image/main/icon_close_p.png b/res/image/main/icon_close_p.png deleted file mode 100644 index b9ba30c..0000000 --- a/res/image/main/icon_close_p.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_main.png b/res/image/main/icon_main.png deleted file mode 100644 index 9d004d5..0000000 --- a/res/image/main/icon_main.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_max.png b/res/image/main/icon_max.png new file mode 100644 index 0000000..6cbf073 --- /dev/null +++ b/res/image/main/icon_max.png Binary files differ diff --git a/res/image/main/icon_menu_calibration.png b/res/image/main/icon_menu_calibration.png new file mode 100644 index 0000000..6fca8be --- /dev/null +++ b/res/image/main/icon_menu_calibration.png Binary files differ diff --git a/res/image/main/icon_menu_calibration_selected.png b/res/image/main/icon_menu_calibration_selected.png new file mode 100644 index 0000000..17f918f --- /dev/null +++ b/res/image/main/icon_menu_calibration_selected.png Binary files differ diff --git a/res/image/main/icon_menu_check.png b/res/image/main/icon_menu_check.png new file mode 100644 index 0000000..c3db5fa --- /dev/null +++ b/res/image/main/icon_menu_check.png Binary files differ diff --git a/res/image/main/icon_menu_check_selected.png b/res/image/main/icon_menu_check_selected.png new file mode 100644 index 0000000..9794c43 --- /dev/null +++ b/res/image/main/icon_menu_check_selected.png Binary files differ diff --git a/res/image/main/icon_menu_infomation.png b/res/image/main/icon_menu_infomation.png new file mode 100644 index 0000000..e272f4c --- /dev/null +++ b/res/image/main/icon_menu_infomation.png Binary files differ diff --git a/res/image/main/icon_menu_infomation_checked.png b/res/image/main/icon_menu_infomation_checked.png new file mode 100644 index 0000000..6122c7b --- /dev/null +++ b/res/image/main/icon_menu_infomation_checked.png Binary files differ diff --git a/res/image/main/icon_min.png b/res/image/main/icon_min.png new file mode 100644 index 0000000..2f524d9 --- /dev/null +++ b/res/image/main/icon_min.png Binary files differ diff --git a/res/image/main/icon_min_p.png b/res/image/main/icon_min_p.png deleted file mode 100644 index 93bd487..0000000 --- a/res/image/main/icon_min_p.png +++ /dev/null Binary files differ diff --git a/AutoCalibrationXC.pro b/AutoCalibrationXC.pro index 6bcb335..7790b37 100644 --- a/AutoCalibrationXC.pro +++ b/AutoCalibrationXC.pro @@ -24,11 +24,6 @@ include(QPagedTable/QPagedTable.pri) SOURCES += main.cpp -SOURCES += MainWindow.cpp - -HEADERS += MainWindow.h - -FORMS += MainWindow.ui RC_ICONS = res/autoCalibration.ico diff --git a/MainWindow.cpp b/MainWindow.cpp deleted file mode 100644 index ff126e8..0000000 --- a/MainWindow.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#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/MainWindow.h b/MainWindow.h deleted file mode 100644 index 4643e32..0000000 --- a/MainWindow.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#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; -}; -#endif // MAINWINDOW_H diff --git a/MainWindow.ui b/MainWindow.ui deleted file mode 100644 index b232854..0000000 --- a/MainWindow.ui +++ /dev/null @@ -1,22 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 800 - 600 - - - - MainWindow - - - - - - - - diff --git a/frame/CustomMessageBox.ui b/frame/CustomMessageBox.ui index 336be54..b545d74 100644 --- a/frame/CustomMessageBox.ui +++ b/frame/CustomMessageBox.ui @@ -84,8 +84,8 @@ - - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + + :/image/msgbox/icon_box_close.png:/image/msgbox/icon_box_close.png @@ -134,7 +134,7 @@ - :/image/msgbox/icon_box_success.png + :/image/msgbox/icon_box_success.png Qt::AlignCenter @@ -265,6 +265,8 @@ - + + + diff --git a/frame/MainWindowForm.cpp b/frame/MainWindowForm.cpp index 2ded44b..ec82cd7 100644 --- a/frame/MainWindowForm.cpp +++ b/frame/MainWindowForm.cpp @@ -1,6 +1,8 @@ #include "MainWindowForm.h" #include "ui_MainWindowForm.h" +#include + MainWindowForm::MainWindowForm(QWidget *parent) : FramelessWindow(parent), ui(new Ui::MainWindowForm) @@ -12,7 +14,7 @@ initMenuWidgets(); initFunctionButtons(); - // 每秒更新 界面上没有地方能摆 暂时先不启动定时器 + // 每秒更新 connect(TimeCounterUtil::getInstance().clockTimer, &QTimer::timeout, this, &MainWindowForm::onUpdateTimestampHandler); TimeCounterUtil::getInstance().clockTimer->start(1000); @@ -34,6 +36,7 @@ void MainWindowForm::initForm() { setWindowFlags(Qt::FramelessWindowHint); // 设置全屏 + setWindowState(Qt::WindowState::WindowMaximized); this->setTitleBar(ui->wdgtTop); // 设置窗口位置和大小 move(0, 0); @@ -120,6 +123,22 @@ setWindowState(Qt::WindowMinimized | windowState()); } +void MainWindowForm::on_btnMaxWin_clicked() +{ + QScreen *screen = QGuiApplication::primaryScreen(); + QRect screenSize = screen->availableGeometry(); // 可用区域(排除任务栏) + + if (this->isMaximized()) { + resize(screenSize.width() * 0.8, screenSize.height() * 0.8); + move(QRandomGenerator::global()->bounded(10, 100), QRandomGenerator::global()->bounded(10, 50)); + this->showNormal(); + } else { + resize(screenSize.width(), screenSize.height()); + move(0, 0); + this->showMaximized(); + } +} + void MainWindowForm::on_btnCloseWin_clicked() { // 创建一个消息框 @@ -146,18 +165,9 @@ ui->labelTime->setText(now.toString("yyyy-MM-dd HH:mm:ss")); } -void MainWindowForm::on_btnMenuMax_clicked() -{ - if (this->isMaximized()) { - this->showNormal(); - } else { - this->showMaximized(); - } -} - void MainWindowForm::titleDblClick() { - on_btnMenuMax_clicked(); + on_btnMaxWin_clicked(); } void MainWindowForm::onMenuButtonsEabled(bool enable) { diff --git a/frame/MainWindowForm.h b/frame/MainWindowForm.h index 4d206b1..9b4eae4 100644 --- a/frame/MainWindowForm.h +++ b/frame/MainWindowForm.h @@ -45,11 +45,11 @@ private slots: void on_btnMinWin_clicked(); + void on_btnMaxWin_clicked(); void on_btnCloseWin_clicked(); void onFunctionButtonsAction(); void onUpdateTimestampHandler(); - void on_btnMenuMax_clicked(); void titleDblClick(); void onMenuButtonsEabled(bool enable); diff --git a/frame/MainWindowForm.ui b/frame/MainWindowForm.ui index bd42122..f37d171 100644 --- a/frame/MainWindowForm.ui +++ b/frame/MainWindowForm.ui @@ -41,7 +41,7 @@ 0 - 120 + 100 @@ -58,7 +58,7 @@ 20 - 0 + 20 @@ -88,8 +88,8 @@ - 120 - 120 + 150 + 100 @@ -107,6 +107,22 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + @@ -158,7 +174,7 @@ 100 - 84 + 72 @@ -166,7 +182,8 @@ - :/image/main/calibration.png:/image/main/calibration.png + :/image/main/icon_menu_calibration.png + :/image/main/icon_menu_calibration_selected.png:/image/main/icon_menu_calibration.png @@ -184,7 +201,7 @@ 100 - 84 + 72 @@ -192,7 +209,8 @@ - :/image/main/rawDataRecord.png:/image/main/rawDataRecord.png + :/image/main/icon_menu_check.png + :/image/main/icon_menu_check_selected.png:/image/main/icon_menu_check.png @@ -210,7 +228,7 @@ 100 - 84 + 72 @@ -218,7 +236,8 @@ - :/image/main/fileRes.png:/image/main/fileRes.png + :/image/main/icon_menu_infomation.png + :/image/main/icon_menu_infomation_checked.png:/image/main/icon_menu_infomation.png @@ -235,10 +254,147 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 50 + 20 + + + + + - 320 + 240 + 16777215 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 5 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + :/image/main/iconTemp.png + + + + + + + 34.5℃ + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + + + + :/image/main/iconHumi.png + + + + + + + 25%Rh + + + + + + + + + + + + + + 240 16777215 @@ -308,7 +464,7 @@ - :/image/main/icon_setting_p.png:/image/main/icon_setting_p.png + :/image/main/icon_setting.png:/image/main/icon_setting.png @@ -334,7 +490,33 @@ - :/image/main/icon_min_p.png:/image/main/icon_min_p.png + :/image/main/icon_min.png:/image/main/icon_min.png + + + + 32 + 32 + + + + + + + + + 40 + 40 + + + + 最小化 + + + + + + + :/image/main/icon_max.png:/image/main/icon_max.png @@ -360,7 +542,7 @@ - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + :/image/main/icon_close.png:/image/main/icon_close.png @@ -426,87 +608,9 @@ - - - - - 0 - 30 - - - - - 20 - - - 0 - - - 0 - - - 40 - - - 0 - - - - - Qt::Horizontal - - - - 1289 - 20 - - - - - - - - - - - - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 20 - - - - - - - - - - - - - - wdgtContent wdgtTop - wdgtFoot diff --git a/infomation/InfoMainForm.cpp b/infomation/InfoMainForm.cpp index c001199..5d0ffc8 100644 --- a/infomation/InfoMainForm.cpp +++ b/infomation/InfoMainForm.cpp @@ -21,9 +21,13 @@ void InfoMainForm::initForm() { + // 加载样式表 + QString qssStyle = QssFileUtils::loadQssFileContent(QApplication::applicationDirPath() + "/qss/infoMain.css"); + if (qssStyle.isEmpty() == false) { + this->setStyleSheet(qssStyle); // 仅本窗口生效 + } - - + ui->scrollArea->setWindowFlags(Qt::FramelessWindowHint); // 设置无边框 } void InfoMainForm::initSubMenuForms() { diff --git a/infomation/InfoMainForm.ui b/infomation/InfoMainForm.ui index 958a6b2..d9066dd 100644 --- a/infomation/InfoMainForm.ui +++ b/infomation/InfoMainForm.ui @@ -90,7 +90,7 @@ - 280 + 295 48 @@ -103,7 +103,7 @@ - 280 + 295 48 @@ -116,7 +116,7 @@ - 280 + 295 48 @@ -129,7 +129,7 @@ - 280 + 295 48 @@ -142,7 +142,7 @@ - 280 + 295 48 @@ -155,7 +155,7 @@ - 280 + 295 48 @@ -168,7 +168,7 @@ - 280 + 295 48 @@ -181,7 +181,7 @@ - 280 + 295 48 @@ -194,7 +194,7 @@ - 280 + 295 48 @@ -207,7 +207,7 @@ - 280 + 295 48 @@ -220,7 +220,7 @@ - 280 + 295 48 @@ -233,7 +233,7 @@ - 280 + 295 48 @@ -246,7 +246,7 @@ - 280 + 295 48 diff --git a/infomation/task/DeptTaskForm.cpp b/infomation/task/DeptTaskForm.cpp index ea21a9f..cc6bf31 100644 --- a/infomation/task/DeptTaskForm.cpp +++ b/infomation/task/DeptTaskForm.cpp @@ -18,12 +18,17 @@ delete ui; } -void DeptTaskForm::showEvent(QShowEvent *event) +void DeptTaskForm::showEvent(QShowEvent * event) { ui->tableDeptTask->adjustTableWidth(); getDeptTaskList(0); } +void DeptTaskForm::resizeEvent(QResizeEvent * event) +{ + ui->tableDeptTask->adjustTableWidth(); +} + void DeptTaskForm::initFormTable() { // 初始化查询条件 diff --git a/infomation/task/DeptTaskForm.h b/infomation/task/DeptTaskForm.h index 1055c36..3c1ad5b 100644 --- a/infomation/task/DeptTaskForm.h +++ b/infomation/task/DeptTaskForm.h @@ -21,7 +21,8 @@ ~DeptTaskForm(); protected: - void showEvent(QShowEvent *event) override; + void showEvent(QShowEvent * event) override; + void resizeEvent(QResizeEvent * event) override; private: Ui::DeptTaskForm *ui; diff --git a/main.cpp b/main.cpp index 525387e..0b78c87 100644 --- a/main.cpp +++ b/main.cpp @@ -1,5 +1,3 @@ -#include "MainWindow.h" - #include #include diff --git a/res/image/Index/u1176.svg b/res/image/Index/u1176.svg deleted file mode 100644 index c81ce8a..0000000 --- a/res/image/Index/u1176.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1180.svg b/res/image/Index/u1180.svg deleted file mode 100644 index 2ef24ab..0000000 --- a/res/image/Index/u1180.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1220.svg b/res/image/Index/u1220.svg deleted file mode 100644 index 43452aa..0000000 --- a/res/image/Index/u1220.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2158.svg b/res/image/Index/u2158.svg deleted file mode 100644 index fd249e0..0000000 --- a/res/image/Index/u2158.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u2188.svg b/res/image/Index/u2188.svg deleted file mode 100644 index 34f53c4..0000000 --- a/res/image/Index/u2188.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2189.svg b/res/image/Index/u2189.svg deleted file mode 100644 index 01a6bbb..0000000 --- a/res/image/Index/u2189.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2324.svg b/res/image/Index/u2324.svg deleted file mode 100644 index 797f1c5..0000000 --- a/res/image/Index/u2324.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2325.svg b/res/image/Index/u2325.svg deleted file mode 100644 index fefe01b..0000000 --- a/res/image/Index/u2325.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u642.svg b/res/image/Index/u642.svg deleted file mode 100644 index 33c9e0a..0000000 --- a/res/image/Index/u642.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u7406.svg b/res/image/Index/u7406.svg deleted file mode 100644 index 8a7a6d9..0000000 --- a/res/image/Index/u7406.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7453.svg b/res/image/Index/u7453.svg deleted file mode 100644 index 603c496..0000000 --- a/res/image/Index/u7453.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7458.svg b/res/image/Index/u7458.svg deleted file mode 100644 index b31087b..0000000 --- a/res/image/Index/u7458.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7488.svg b/res/image/Index/u7488.svg deleted file mode 100644 index 8baf439..0000000 --- a/res/image/Index/u7488.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7491.svg b/res/image/Index/u7491.svg deleted file mode 100644 index 3e41c10..0000000 --- a/res/image/Index/u7491.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7538.svg b/res/image/Index/u7538.svg deleted file mode 100644 index 417077d..0000000 --- a/res/image/Index/u7538.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u794.svg b/res/image/Index/u794.svg deleted file mode 100644 index e12cff7..0000000 --- a/res/image/Index/u794.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u8448.svg b/res/image/Index/u8448.svg deleted file mode 100644 index 7f6f4c0..0000000 --- a/res/image/Index/u8448.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u8458.svg b/res/image/Index/u8458.svg deleted file mode 100644 index 6d04a12..0000000 --- a/res/image/Index/u8458.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/main/bg_banner.png b/res/image/main/bg_banner.png new file mode 100644 index 0000000..26ddffd --- /dev/null +++ b/res/image/main/bg_banner.png Binary files differ diff --git a/res/image/main/iconHumi.png b/res/image/main/iconHumi.png index 4410d38..bd164e8 100644 --- a/res/image/main/iconHumi.png +++ b/res/image/main/iconHumi.png Binary files differ diff --git a/res/image/main/iconTemp.png b/res/image/main/iconTemp.png index 8fd059c..a2cfe4d 100644 --- a/res/image/main/iconTemp.png +++ b/res/image/main/iconTemp.png Binary files differ diff --git a/res/image/main/icon_close.png b/res/image/main/icon_close.png new file mode 100644 index 0000000..f3aa270 --- /dev/null +++ b/res/image/main/icon_close.png Binary files differ diff --git a/res/image/main/icon_close_p.png b/res/image/main/icon_close_p.png deleted file mode 100644 index b9ba30c..0000000 --- a/res/image/main/icon_close_p.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_main.png b/res/image/main/icon_main.png deleted file mode 100644 index 9d004d5..0000000 --- a/res/image/main/icon_main.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_max.png b/res/image/main/icon_max.png new file mode 100644 index 0000000..6cbf073 --- /dev/null +++ b/res/image/main/icon_max.png Binary files differ diff --git a/res/image/main/icon_menu_calibration.png b/res/image/main/icon_menu_calibration.png new file mode 100644 index 0000000..6fca8be --- /dev/null +++ b/res/image/main/icon_menu_calibration.png Binary files differ diff --git a/res/image/main/icon_menu_calibration_selected.png b/res/image/main/icon_menu_calibration_selected.png new file mode 100644 index 0000000..17f918f --- /dev/null +++ b/res/image/main/icon_menu_calibration_selected.png Binary files differ diff --git a/res/image/main/icon_menu_check.png b/res/image/main/icon_menu_check.png new file mode 100644 index 0000000..c3db5fa --- /dev/null +++ b/res/image/main/icon_menu_check.png Binary files differ diff --git a/res/image/main/icon_menu_check_selected.png b/res/image/main/icon_menu_check_selected.png new file mode 100644 index 0000000..9794c43 --- /dev/null +++ b/res/image/main/icon_menu_check_selected.png Binary files differ diff --git a/res/image/main/icon_menu_infomation.png b/res/image/main/icon_menu_infomation.png new file mode 100644 index 0000000..e272f4c --- /dev/null +++ b/res/image/main/icon_menu_infomation.png Binary files differ diff --git a/res/image/main/icon_menu_infomation_checked.png b/res/image/main/icon_menu_infomation_checked.png new file mode 100644 index 0000000..6122c7b --- /dev/null +++ b/res/image/main/icon_menu_infomation_checked.png Binary files differ diff --git a/res/image/main/icon_min.png b/res/image/main/icon_min.png new file mode 100644 index 0000000..2f524d9 --- /dev/null +++ b/res/image/main/icon_min.png Binary files differ diff --git a/res/image/main/icon_min_p.png b/res/image/main/icon_min_p.png deleted file mode 100644 index 93bd487..0000000 --- a/res/image/main/icon_min_p.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_quit_p.png b/res/image/main/icon_quit_p.png deleted file mode 100644 index 10d8bac..0000000 --- a/res/image/main/icon_quit_p.png +++ /dev/null Binary files differ diff --git a/AutoCalibrationXC.pro b/AutoCalibrationXC.pro index 6bcb335..7790b37 100644 --- a/AutoCalibrationXC.pro +++ b/AutoCalibrationXC.pro @@ -24,11 +24,6 @@ include(QPagedTable/QPagedTable.pri) SOURCES += main.cpp -SOURCES += MainWindow.cpp - -HEADERS += MainWindow.h - -FORMS += MainWindow.ui RC_ICONS = res/autoCalibration.ico diff --git a/MainWindow.cpp b/MainWindow.cpp deleted file mode 100644 index ff126e8..0000000 --- a/MainWindow.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#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/MainWindow.h b/MainWindow.h deleted file mode 100644 index 4643e32..0000000 --- a/MainWindow.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#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; -}; -#endif // MAINWINDOW_H diff --git a/MainWindow.ui b/MainWindow.ui deleted file mode 100644 index b232854..0000000 --- a/MainWindow.ui +++ /dev/null @@ -1,22 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 800 - 600 - - - - MainWindow - - - - - - - - diff --git a/frame/CustomMessageBox.ui b/frame/CustomMessageBox.ui index 336be54..b545d74 100644 --- a/frame/CustomMessageBox.ui +++ b/frame/CustomMessageBox.ui @@ -84,8 +84,8 @@ - - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + + :/image/msgbox/icon_box_close.png:/image/msgbox/icon_box_close.png @@ -134,7 +134,7 @@ - :/image/msgbox/icon_box_success.png + :/image/msgbox/icon_box_success.png Qt::AlignCenter @@ -265,6 +265,8 @@ - + + + diff --git a/frame/MainWindowForm.cpp b/frame/MainWindowForm.cpp index 2ded44b..ec82cd7 100644 --- a/frame/MainWindowForm.cpp +++ b/frame/MainWindowForm.cpp @@ -1,6 +1,8 @@ #include "MainWindowForm.h" #include "ui_MainWindowForm.h" +#include + MainWindowForm::MainWindowForm(QWidget *parent) : FramelessWindow(parent), ui(new Ui::MainWindowForm) @@ -12,7 +14,7 @@ initMenuWidgets(); initFunctionButtons(); - // 每秒更新 界面上没有地方能摆 暂时先不启动定时器 + // 每秒更新 connect(TimeCounterUtil::getInstance().clockTimer, &QTimer::timeout, this, &MainWindowForm::onUpdateTimestampHandler); TimeCounterUtil::getInstance().clockTimer->start(1000); @@ -34,6 +36,7 @@ void MainWindowForm::initForm() { setWindowFlags(Qt::FramelessWindowHint); // 设置全屏 + setWindowState(Qt::WindowState::WindowMaximized); this->setTitleBar(ui->wdgtTop); // 设置窗口位置和大小 move(0, 0); @@ -120,6 +123,22 @@ setWindowState(Qt::WindowMinimized | windowState()); } +void MainWindowForm::on_btnMaxWin_clicked() +{ + QScreen *screen = QGuiApplication::primaryScreen(); + QRect screenSize = screen->availableGeometry(); // 可用区域(排除任务栏) + + if (this->isMaximized()) { + resize(screenSize.width() * 0.8, screenSize.height() * 0.8); + move(QRandomGenerator::global()->bounded(10, 100), QRandomGenerator::global()->bounded(10, 50)); + this->showNormal(); + } else { + resize(screenSize.width(), screenSize.height()); + move(0, 0); + this->showMaximized(); + } +} + void MainWindowForm::on_btnCloseWin_clicked() { // 创建一个消息框 @@ -146,18 +165,9 @@ ui->labelTime->setText(now.toString("yyyy-MM-dd HH:mm:ss")); } -void MainWindowForm::on_btnMenuMax_clicked() -{ - if (this->isMaximized()) { - this->showNormal(); - } else { - this->showMaximized(); - } -} - void MainWindowForm::titleDblClick() { - on_btnMenuMax_clicked(); + on_btnMaxWin_clicked(); } void MainWindowForm::onMenuButtonsEabled(bool enable) { diff --git a/frame/MainWindowForm.h b/frame/MainWindowForm.h index 4d206b1..9b4eae4 100644 --- a/frame/MainWindowForm.h +++ b/frame/MainWindowForm.h @@ -45,11 +45,11 @@ private slots: void on_btnMinWin_clicked(); + void on_btnMaxWin_clicked(); void on_btnCloseWin_clicked(); void onFunctionButtonsAction(); void onUpdateTimestampHandler(); - void on_btnMenuMax_clicked(); void titleDblClick(); void onMenuButtonsEabled(bool enable); diff --git a/frame/MainWindowForm.ui b/frame/MainWindowForm.ui index bd42122..f37d171 100644 --- a/frame/MainWindowForm.ui +++ b/frame/MainWindowForm.ui @@ -41,7 +41,7 @@ 0 - 120 + 100 @@ -58,7 +58,7 @@ 20 - 0 + 20 @@ -88,8 +88,8 @@ - 120 - 120 + 150 + 100 @@ -107,6 +107,22 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + @@ -158,7 +174,7 @@ 100 - 84 + 72 @@ -166,7 +182,8 @@ - :/image/main/calibration.png:/image/main/calibration.png + :/image/main/icon_menu_calibration.png + :/image/main/icon_menu_calibration_selected.png:/image/main/icon_menu_calibration.png @@ -184,7 +201,7 @@ 100 - 84 + 72 @@ -192,7 +209,8 @@ - :/image/main/rawDataRecord.png:/image/main/rawDataRecord.png + :/image/main/icon_menu_check.png + :/image/main/icon_menu_check_selected.png:/image/main/icon_menu_check.png @@ -210,7 +228,7 @@ 100 - 84 + 72 @@ -218,7 +236,8 @@ - :/image/main/fileRes.png:/image/main/fileRes.png + :/image/main/icon_menu_infomation.png + :/image/main/icon_menu_infomation_checked.png:/image/main/icon_menu_infomation.png @@ -235,10 +254,147 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 50 + 20 + + + + + - 320 + 240 + 16777215 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 5 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + :/image/main/iconTemp.png + + + + + + + 34.5℃ + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + + + + :/image/main/iconHumi.png + + + + + + + 25%Rh + + + + + + + + + + + + + + 240 16777215 @@ -308,7 +464,7 @@ - :/image/main/icon_setting_p.png:/image/main/icon_setting_p.png + :/image/main/icon_setting.png:/image/main/icon_setting.png @@ -334,7 +490,33 @@ - :/image/main/icon_min_p.png:/image/main/icon_min_p.png + :/image/main/icon_min.png:/image/main/icon_min.png + + + + 32 + 32 + + + + + + + + + 40 + 40 + + + + 最小化 + + + + + + + :/image/main/icon_max.png:/image/main/icon_max.png @@ -360,7 +542,7 @@ - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + :/image/main/icon_close.png:/image/main/icon_close.png @@ -426,87 +608,9 @@ - - - - - 0 - 30 - - - - - 20 - - - 0 - - - 0 - - - 40 - - - 0 - - - - - Qt::Horizontal - - - - 1289 - 20 - - - - - - - - - - - - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 20 - - - - - - - - - - - - - - wdgtContent wdgtTop - wdgtFoot diff --git a/infomation/InfoMainForm.cpp b/infomation/InfoMainForm.cpp index c001199..5d0ffc8 100644 --- a/infomation/InfoMainForm.cpp +++ b/infomation/InfoMainForm.cpp @@ -21,9 +21,13 @@ void InfoMainForm::initForm() { + // 加载样式表 + QString qssStyle = QssFileUtils::loadQssFileContent(QApplication::applicationDirPath() + "/qss/infoMain.css"); + if (qssStyle.isEmpty() == false) { + this->setStyleSheet(qssStyle); // 仅本窗口生效 + } - - + ui->scrollArea->setWindowFlags(Qt::FramelessWindowHint); // 设置无边框 } void InfoMainForm::initSubMenuForms() { diff --git a/infomation/InfoMainForm.ui b/infomation/InfoMainForm.ui index 958a6b2..d9066dd 100644 --- a/infomation/InfoMainForm.ui +++ b/infomation/InfoMainForm.ui @@ -90,7 +90,7 @@ - 280 + 295 48 @@ -103,7 +103,7 @@ - 280 + 295 48 @@ -116,7 +116,7 @@ - 280 + 295 48 @@ -129,7 +129,7 @@ - 280 + 295 48 @@ -142,7 +142,7 @@ - 280 + 295 48 @@ -155,7 +155,7 @@ - 280 + 295 48 @@ -168,7 +168,7 @@ - 280 + 295 48 @@ -181,7 +181,7 @@ - 280 + 295 48 @@ -194,7 +194,7 @@ - 280 + 295 48 @@ -207,7 +207,7 @@ - 280 + 295 48 @@ -220,7 +220,7 @@ - 280 + 295 48 @@ -233,7 +233,7 @@ - 280 + 295 48 @@ -246,7 +246,7 @@ - 280 + 295 48 diff --git a/infomation/task/DeptTaskForm.cpp b/infomation/task/DeptTaskForm.cpp index ea21a9f..cc6bf31 100644 --- a/infomation/task/DeptTaskForm.cpp +++ b/infomation/task/DeptTaskForm.cpp @@ -18,12 +18,17 @@ delete ui; } -void DeptTaskForm::showEvent(QShowEvent *event) +void DeptTaskForm::showEvent(QShowEvent * event) { ui->tableDeptTask->adjustTableWidth(); getDeptTaskList(0); } +void DeptTaskForm::resizeEvent(QResizeEvent * event) +{ + ui->tableDeptTask->adjustTableWidth(); +} + void DeptTaskForm::initFormTable() { // 初始化查询条件 diff --git a/infomation/task/DeptTaskForm.h b/infomation/task/DeptTaskForm.h index 1055c36..3c1ad5b 100644 --- a/infomation/task/DeptTaskForm.h +++ b/infomation/task/DeptTaskForm.h @@ -21,7 +21,8 @@ ~DeptTaskForm(); protected: - void showEvent(QShowEvent *event) override; + void showEvent(QShowEvent * event) override; + void resizeEvent(QResizeEvent * event) override; private: Ui::DeptTaskForm *ui; diff --git a/main.cpp b/main.cpp index 525387e..0b78c87 100644 --- a/main.cpp +++ b/main.cpp @@ -1,5 +1,3 @@ -#include "MainWindow.h" - #include #include diff --git a/res/image/Index/u1176.svg b/res/image/Index/u1176.svg deleted file mode 100644 index c81ce8a..0000000 --- a/res/image/Index/u1176.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1180.svg b/res/image/Index/u1180.svg deleted file mode 100644 index 2ef24ab..0000000 --- a/res/image/Index/u1180.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1220.svg b/res/image/Index/u1220.svg deleted file mode 100644 index 43452aa..0000000 --- a/res/image/Index/u1220.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2158.svg b/res/image/Index/u2158.svg deleted file mode 100644 index fd249e0..0000000 --- a/res/image/Index/u2158.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u2188.svg b/res/image/Index/u2188.svg deleted file mode 100644 index 34f53c4..0000000 --- a/res/image/Index/u2188.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2189.svg b/res/image/Index/u2189.svg deleted file mode 100644 index 01a6bbb..0000000 --- a/res/image/Index/u2189.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2324.svg b/res/image/Index/u2324.svg deleted file mode 100644 index 797f1c5..0000000 --- a/res/image/Index/u2324.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2325.svg b/res/image/Index/u2325.svg deleted file mode 100644 index fefe01b..0000000 --- a/res/image/Index/u2325.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u642.svg b/res/image/Index/u642.svg deleted file mode 100644 index 33c9e0a..0000000 --- a/res/image/Index/u642.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u7406.svg b/res/image/Index/u7406.svg deleted file mode 100644 index 8a7a6d9..0000000 --- a/res/image/Index/u7406.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7453.svg b/res/image/Index/u7453.svg deleted file mode 100644 index 603c496..0000000 --- a/res/image/Index/u7453.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7458.svg b/res/image/Index/u7458.svg deleted file mode 100644 index b31087b..0000000 --- a/res/image/Index/u7458.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7488.svg b/res/image/Index/u7488.svg deleted file mode 100644 index 8baf439..0000000 --- a/res/image/Index/u7488.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7491.svg b/res/image/Index/u7491.svg deleted file mode 100644 index 3e41c10..0000000 --- a/res/image/Index/u7491.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7538.svg b/res/image/Index/u7538.svg deleted file mode 100644 index 417077d..0000000 --- a/res/image/Index/u7538.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u794.svg b/res/image/Index/u794.svg deleted file mode 100644 index e12cff7..0000000 --- a/res/image/Index/u794.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u8448.svg b/res/image/Index/u8448.svg deleted file mode 100644 index 7f6f4c0..0000000 --- a/res/image/Index/u8448.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u8458.svg b/res/image/Index/u8458.svg deleted file mode 100644 index 6d04a12..0000000 --- a/res/image/Index/u8458.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/main/bg_banner.png b/res/image/main/bg_banner.png new file mode 100644 index 0000000..26ddffd --- /dev/null +++ b/res/image/main/bg_banner.png Binary files differ diff --git a/res/image/main/iconHumi.png b/res/image/main/iconHumi.png index 4410d38..bd164e8 100644 --- a/res/image/main/iconHumi.png +++ b/res/image/main/iconHumi.png Binary files differ diff --git a/res/image/main/iconTemp.png b/res/image/main/iconTemp.png index 8fd059c..a2cfe4d 100644 --- a/res/image/main/iconTemp.png +++ b/res/image/main/iconTemp.png Binary files differ diff --git a/res/image/main/icon_close.png b/res/image/main/icon_close.png new file mode 100644 index 0000000..f3aa270 --- /dev/null +++ b/res/image/main/icon_close.png Binary files differ diff --git a/res/image/main/icon_close_p.png b/res/image/main/icon_close_p.png deleted file mode 100644 index b9ba30c..0000000 --- a/res/image/main/icon_close_p.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_main.png b/res/image/main/icon_main.png deleted file mode 100644 index 9d004d5..0000000 --- a/res/image/main/icon_main.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_max.png b/res/image/main/icon_max.png new file mode 100644 index 0000000..6cbf073 --- /dev/null +++ b/res/image/main/icon_max.png Binary files differ diff --git a/res/image/main/icon_menu_calibration.png b/res/image/main/icon_menu_calibration.png new file mode 100644 index 0000000..6fca8be --- /dev/null +++ b/res/image/main/icon_menu_calibration.png Binary files differ diff --git a/res/image/main/icon_menu_calibration_selected.png b/res/image/main/icon_menu_calibration_selected.png new file mode 100644 index 0000000..17f918f --- /dev/null +++ b/res/image/main/icon_menu_calibration_selected.png Binary files differ diff --git a/res/image/main/icon_menu_check.png b/res/image/main/icon_menu_check.png new file mode 100644 index 0000000..c3db5fa --- /dev/null +++ b/res/image/main/icon_menu_check.png Binary files differ diff --git a/res/image/main/icon_menu_check_selected.png b/res/image/main/icon_menu_check_selected.png new file mode 100644 index 0000000..9794c43 --- /dev/null +++ b/res/image/main/icon_menu_check_selected.png Binary files differ diff --git a/res/image/main/icon_menu_infomation.png b/res/image/main/icon_menu_infomation.png new file mode 100644 index 0000000..e272f4c --- /dev/null +++ b/res/image/main/icon_menu_infomation.png Binary files differ diff --git a/res/image/main/icon_menu_infomation_checked.png b/res/image/main/icon_menu_infomation_checked.png new file mode 100644 index 0000000..6122c7b --- /dev/null +++ b/res/image/main/icon_menu_infomation_checked.png Binary files differ diff --git a/res/image/main/icon_min.png b/res/image/main/icon_min.png new file mode 100644 index 0000000..2f524d9 --- /dev/null +++ b/res/image/main/icon_min.png Binary files differ diff --git a/res/image/main/icon_min_p.png b/res/image/main/icon_min_p.png deleted file mode 100644 index 93bd487..0000000 --- a/res/image/main/icon_min_p.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_quit_p.png b/res/image/main/icon_quit_p.png deleted file mode 100644 index 10d8bac..0000000 --- a/res/image/main/icon_quit_p.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_setting.png b/res/image/main/icon_setting.png new file mode 100644 index 0000000..8686833 --- /dev/null +++ b/res/image/main/icon_setting.png Binary files differ diff --git a/AutoCalibrationXC.pro b/AutoCalibrationXC.pro index 6bcb335..7790b37 100644 --- a/AutoCalibrationXC.pro +++ b/AutoCalibrationXC.pro @@ -24,11 +24,6 @@ include(QPagedTable/QPagedTable.pri) SOURCES += main.cpp -SOURCES += MainWindow.cpp - -HEADERS += MainWindow.h - -FORMS += MainWindow.ui RC_ICONS = res/autoCalibration.ico diff --git a/MainWindow.cpp b/MainWindow.cpp deleted file mode 100644 index ff126e8..0000000 --- a/MainWindow.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#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/MainWindow.h b/MainWindow.h deleted file mode 100644 index 4643e32..0000000 --- a/MainWindow.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#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; -}; -#endif // MAINWINDOW_H diff --git a/MainWindow.ui b/MainWindow.ui deleted file mode 100644 index b232854..0000000 --- a/MainWindow.ui +++ /dev/null @@ -1,22 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 800 - 600 - - - - MainWindow - - - - - - - - diff --git a/frame/CustomMessageBox.ui b/frame/CustomMessageBox.ui index 336be54..b545d74 100644 --- a/frame/CustomMessageBox.ui +++ b/frame/CustomMessageBox.ui @@ -84,8 +84,8 @@ - - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + + :/image/msgbox/icon_box_close.png:/image/msgbox/icon_box_close.png @@ -134,7 +134,7 @@ - :/image/msgbox/icon_box_success.png + :/image/msgbox/icon_box_success.png Qt::AlignCenter @@ -265,6 +265,8 @@ - + + + diff --git a/frame/MainWindowForm.cpp b/frame/MainWindowForm.cpp index 2ded44b..ec82cd7 100644 --- a/frame/MainWindowForm.cpp +++ b/frame/MainWindowForm.cpp @@ -1,6 +1,8 @@ #include "MainWindowForm.h" #include "ui_MainWindowForm.h" +#include + MainWindowForm::MainWindowForm(QWidget *parent) : FramelessWindow(parent), ui(new Ui::MainWindowForm) @@ -12,7 +14,7 @@ initMenuWidgets(); initFunctionButtons(); - // 每秒更新 界面上没有地方能摆 暂时先不启动定时器 + // 每秒更新 connect(TimeCounterUtil::getInstance().clockTimer, &QTimer::timeout, this, &MainWindowForm::onUpdateTimestampHandler); TimeCounterUtil::getInstance().clockTimer->start(1000); @@ -34,6 +36,7 @@ void MainWindowForm::initForm() { setWindowFlags(Qt::FramelessWindowHint); // 设置全屏 + setWindowState(Qt::WindowState::WindowMaximized); this->setTitleBar(ui->wdgtTop); // 设置窗口位置和大小 move(0, 0); @@ -120,6 +123,22 @@ setWindowState(Qt::WindowMinimized | windowState()); } +void MainWindowForm::on_btnMaxWin_clicked() +{ + QScreen *screen = QGuiApplication::primaryScreen(); + QRect screenSize = screen->availableGeometry(); // 可用区域(排除任务栏) + + if (this->isMaximized()) { + resize(screenSize.width() * 0.8, screenSize.height() * 0.8); + move(QRandomGenerator::global()->bounded(10, 100), QRandomGenerator::global()->bounded(10, 50)); + this->showNormal(); + } else { + resize(screenSize.width(), screenSize.height()); + move(0, 0); + this->showMaximized(); + } +} + void MainWindowForm::on_btnCloseWin_clicked() { // 创建一个消息框 @@ -146,18 +165,9 @@ ui->labelTime->setText(now.toString("yyyy-MM-dd HH:mm:ss")); } -void MainWindowForm::on_btnMenuMax_clicked() -{ - if (this->isMaximized()) { - this->showNormal(); - } else { - this->showMaximized(); - } -} - void MainWindowForm::titleDblClick() { - on_btnMenuMax_clicked(); + on_btnMaxWin_clicked(); } void MainWindowForm::onMenuButtonsEabled(bool enable) { diff --git a/frame/MainWindowForm.h b/frame/MainWindowForm.h index 4d206b1..9b4eae4 100644 --- a/frame/MainWindowForm.h +++ b/frame/MainWindowForm.h @@ -45,11 +45,11 @@ private slots: void on_btnMinWin_clicked(); + void on_btnMaxWin_clicked(); void on_btnCloseWin_clicked(); void onFunctionButtonsAction(); void onUpdateTimestampHandler(); - void on_btnMenuMax_clicked(); void titleDblClick(); void onMenuButtonsEabled(bool enable); diff --git a/frame/MainWindowForm.ui b/frame/MainWindowForm.ui index bd42122..f37d171 100644 --- a/frame/MainWindowForm.ui +++ b/frame/MainWindowForm.ui @@ -41,7 +41,7 @@ 0 - 120 + 100 @@ -58,7 +58,7 @@ 20 - 0 + 20 @@ -88,8 +88,8 @@ - 120 - 120 + 150 + 100 @@ -107,6 +107,22 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + @@ -158,7 +174,7 @@ 100 - 84 + 72 @@ -166,7 +182,8 @@ - :/image/main/calibration.png:/image/main/calibration.png + :/image/main/icon_menu_calibration.png + :/image/main/icon_menu_calibration_selected.png:/image/main/icon_menu_calibration.png @@ -184,7 +201,7 @@ 100 - 84 + 72 @@ -192,7 +209,8 @@ - :/image/main/rawDataRecord.png:/image/main/rawDataRecord.png + :/image/main/icon_menu_check.png + :/image/main/icon_menu_check_selected.png:/image/main/icon_menu_check.png @@ -210,7 +228,7 @@ 100 - 84 + 72 @@ -218,7 +236,8 @@ - :/image/main/fileRes.png:/image/main/fileRes.png + :/image/main/icon_menu_infomation.png + :/image/main/icon_menu_infomation_checked.png:/image/main/icon_menu_infomation.png @@ -235,10 +254,147 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 50 + 20 + + + + + - 320 + 240 + 16777215 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 5 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + :/image/main/iconTemp.png + + + + + + + 34.5℃ + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + + + + :/image/main/iconHumi.png + + + + + + + 25%Rh + + + + + + + + + + + + + + 240 16777215 @@ -308,7 +464,7 @@ - :/image/main/icon_setting_p.png:/image/main/icon_setting_p.png + :/image/main/icon_setting.png:/image/main/icon_setting.png @@ -334,7 +490,33 @@ - :/image/main/icon_min_p.png:/image/main/icon_min_p.png + :/image/main/icon_min.png:/image/main/icon_min.png + + + + 32 + 32 + + + + + + + + + 40 + 40 + + + + 最小化 + + + + + + + :/image/main/icon_max.png:/image/main/icon_max.png @@ -360,7 +542,7 @@ - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + :/image/main/icon_close.png:/image/main/icon_close.png @@ -426,87 +608,9 @@ - - - - - 0 - 30 - - - - - 20 - - - 0 - - - 0 - - - 40 - - - 0 - - - - - Qt::Horizontal - - - - 1289 - 20 - - - - - - - - - - - - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 20 - - - - - - - - - - - - - - wdgtContent wdgtTop - wdgtFoot diff --git a/infomation/InfoMainForm.cpp b/infomation/InfoMainForm.cpp index c001199..5d0ffc8 100644 --- a/infomation/InfoMainForm.cpp +++ b/infomation/InfoMainForm.cpp @@ -21,9 +21,13 @@ void InfoMainForm::initForm() { + // 加载样式表 + QString qssStyle = QssFileUtils::loadQssFileContent(QApplication::applicationDirPath() + "/qss/infoMain.css"); + if (qssStyle.isEmpty() == false) { + this->setStyleSheet(qssStyle); // 仅本窗口生效 + } - - + ui->scrollArea->setWindowFlags(Qt::FramelessWindowHint); // 设置无边框 } void InfoMainForm::initSubMenuForms() { diff --git a/infomation/InfoMainForm.ui b/infomation/InfoMainForm.ui index 958a6b2..d9066dd 100644 --- a/infomation/InfoMainForm.ui +++ b/infomation/InfoMainForm.ui @@ -90,7 +90,7 @@ - 280 + 295 48 @@ -103,7 +103,7 @@ - 280 + 295 48 @@ -116,7 +116,7 @@ - 280 + 295 48 @@ -129,7 +129,7 @@ - 280 + 295 48 @@ -142,7 +142,7 @@ - 280 + 295 48 @@ -155,7 +155,7 @@ - 280 + 295 48 @@ -168,7 +168,7 @@ - 280 + 295 48 @@ -181,7 +181,7 @@ - 280 + 295 48 @@ -194,7 +194,7 @@ - 280 + 295 48 @@ -207,7 +207,7 @@ - 280 + 295 48 @@ -220,7 +220,7 @@ - 280 + 295 48 @@ -233,7 +233,7 @@ - 280 + 295 48 @@ -246,7 +246,7 @@ - 280 + 295 48 diff --git a/infomation/task/DeptTaskForm.cpp b/infomation/task/DeptTaskForm.cpp index ea21a9f..cc6bf31 100644 --- a/infomation/task/DeptTaskForm.cpp +++ b/infomation/task/DeptTaskForm.cpp @@ -18,12 +18,17 @@ delete ui; } -void DeptTaskForm::showEvent(QShowEvent *event) +void DeptTaskForm::showEvent(QShowEvent * event) { ui->tableDeptTask->adjustTableWidth(); getDeptTaskList(0); } +void DeptTaskForm::resizeEvent(QResizeEvent * event) +{ + ui->tableDeptTask->adjustTableWidth(); +} + void DeptTaskForm::initFormTable() { // 初始化查询条件 diff --git a/infomation/task/DeptTaskForm.h b/infomation/task/DeptTaskForm.h index 1055c36..3c1ad5b 100644 --- a/infomation/task/DeptTaskForm.h +++ b/infomation/task/DeptTaskForm.h @@ -21,7 +21,8 @@ ~DeptTaskForm(); protected: - void showEvent(QShowEvent *event) override; + void showEvent(QShowEvent * event) override; + void resizeEvent(QResizeEvent * event) override; private: Ui::DeptTaskForm *ui; diff --git a/main.cpp b/main.cpp index 525387e..0b78c87 100644 --- a/main.cpp +++ b/main.cpp @@ -1,5 +1,3 @@ -#include "MainWindow.h" - #include #include diff --git a/res/image/Index/u1176.svg b/res/image/Index/u1176.svg deleted file mode 100644 index c81ce8a..0000000 --- a/res/image/Index/u1176.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1180.svg b/res/image/Index/u1180.svg deleted file mode 100644 index 2ef24ab..0000000 --- a/res/image/Index/u1180.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1220.svg b/res/image/Index/u1220.svg deleted file mode 100644 index 43452aa..0000000 --- a/res/image/Index/u1220.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2158.svg b/res/image/Index/u2158.svg deleted file mode 100644 index fd249e0..0000000 --- a/res/image/Index/u2158.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u2188.svg b/res/image/Index/u2188.svg deleted file mode 100644 index 34f53c4..0000000 --- a/res/image/Index/u2188.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2189.svg b/res/image/Index/u2189.svg deleted file mode 100644 index 01a6bbb..0000000 --- a/res/image/Index/u2189.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2324.svg b/res/image/Index/u2324.svg deleted file mode 100644 index 797f1c5..0000000 --- a/res/image/Index/u2324.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2325.svg b/res/image/Index/u2325.svg deleted file mode 100644 index fefe01b..0000000 --- a/res/image/Index/u2325.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u642.svg b/res/image/Index/u642.svg deleted file mode 100644 index 33c9e0a..0000000 --- a/res/image/Index/u642.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u7406.svg b/res/image/Index/u7406.svg deleted file mode 100644 index 8a7a6d9..0000000 --- a/res/image/Index/u7406.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7453.svg b/res/image/Index/u7453.svg deleted file mode 100644 index 603c496..0000000 --- a/res/image/Index/u7453.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7458.svg b/res/image/Index/u7458.svg deleted file mode 100644 index b31087b..0000000 --- a/res/image/Index/u7458.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7488.svg b/res/image/Index/u7488.svg deleted file mode 100644 index 8baf439..0000000 --- a/res/image/Index/u7488.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7491.svg b/res/image/Index/u7491.svg deleted file mode 100644 index 3e41c10..0000000 --- a/res/image/Index/u7491.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7538.svg b/res/image/Index/u7538.svg deleted file mode 100644 index 417077d..0000000 --- a/res/image/Index/u7538.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u794.svg b/res/image/Index/u794.svg deleted file mode 100644 index e12cff7..0000000 --- a/res/image/Index/u794.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u8448.svg b/res/image/Index/u8448.svg deleted file mode 100644 index 7f6f4c0..0000000 --- a/res/image/Index/u8448.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u8458.svg b/res/image/Index/u8458.svg deleted file mode 100644 index 6d04a12..0000000 --- a/res/image/Index/u8458.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/main/bg_banner.png b/res/image/main/bg_banner.png new file mode 100644 index 0000000..26ddffd --- /dev/null +++ b/res/image/main/bg_banner.png Binary files differ diff --git a/res/image/main/iconHumi.png b/res/image/main/iconHumi.png index 4410d38..bd164e8 100644 --- a/res/image/main/iconHumi.png +++ b/res/image/main/iconHumi.png Binary files differ diff --git a/res/image/main/iconTemp.png b/res/image/main/iconTemp.png index 8fd059c..a2cfe4d 100644 --- a/res/image/main/iconTemp.png +++ b/res/image/main/iconTemp.png Binary files differ diff --git a/res/image/main/icon_close.png b/res/image/main/icon_close.png new file mode 100644 index 0000000..f3aa270 --- /dev/null +++ b/res/image/main/icon_close.png Binary files differ diff --git a/res/image/main/icon_close_p.png b/res/image/main/icon_close_p.png deleted file mode 100644 index b9ba30c..0000000 --- a/res/image/main/icon_close_p.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_main.png b/res/image/main/icon_main.png deleted file mode 100644 index 9d004d5..0000000 --- a/res/image/main/icon_main.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_max.png b/res/image/main/icon_max.png new file mode 100644 index 0000000..6cbf073 --- /dev/null +++ b/res/image/main/icon_max.png Binary files differ diff --git a/res/image/main/icon_menu_calibration.png b/res/image/main/icon_menu_calibration.png new file mode 100644 index 0000000..6fca8be --- /dev/null +++ b/res/image/main/icon_menu_calibration.png Binary files differ diff --git a/res/image/main/icon_menu_calibration_selected.png b/res/image/main/icon_menu_calibration_selected.png new file mode 100644 index 0000000..17f918f --- /dev/null +++ b/res/image/main/icon_menu_calibration_selected.png Binary files differ diff --git a/res/image/main/icon_menu_check.png b/res/image/main/icon_menu_check.png new file mode 100644 index 0000000..c3db5fa --- /dev/null +++ b/res/image/main/icon_menu_check.png Binary files differ diff --git a/res/image/main/icon_menu_check_selected.png b/res/image/main/icon_menu_check_selected.png new file mode 100644 index 0000000..9794c43 --- /dev/null +++ b/res/image/main/icon_menu_check_selected.png Binary files differ diff --git a/res/image/main/icon_menu_infomation.png b/res/image/main/icon_menu_infomation.png new file mode 100644 index 0000000..e272f4c --- /dev/null +++ b/res/image/main/icon_menu_infomation.png Binary files differ diff --git a/res/image/main/icon_menu_infomation_checked.png b/res/image/main/icon_menu_infomation_checked.png new file mode 100644 index 0000000..6122c7b --- /dev/null +++ b/res/image/main/icon_menu_infomation_checked.png Binary files differ diff --git a/res/image/main/icon_min.png b/res/image/main/icon_min.png new file mode 100644 index 0000000..2f524d9 --- /dev/null +++ b/res/image/main/icon_min.png Binary files differ diff --git a/res/image/main/icon_min_p.png b/res/image/main/icon_min_p.png deleted file mode 100644 index 93bd487..0000000 --- a/res/image/main/icon_min_p.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_quit_p.png b/res/image/main/icon_quit_p.png deleted file mode 100644 index 10d8bac..0000000 --- a/res/image/main/icon_quit_p.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_setting.png b/res/image/main/icon_setting.png new file mode 100644 index 0000000..8686833 --- /dev/null +++ b/res/image/main/icon_setting.png Binary files differ diff --git a/res/image/main/icon_setting_p.png b/res/image/main/icon_setting_p.png deleted file mode 100644 index f6645f1..0000000 --- a/res/image/main/icon_setting_p.png +++ /dev/null Binary files differ diff --git a/AutoCalibrationXC.pro b/AutoCalibrationXC.pro index 6bcb335..7790b37 100644 --- a/AutoCalibrationXC.pro +++ b/AutoCalibrationXC.pro @@ -24,11 +24,6 @@ include(QPagedTable/QPagedTable.pri) SOURCES += main.cpp -SOURCES += MainWindow.cpp - -HEADERS += MainWindow.h - -FORMS += MainWindow.ui RC_ICONS = res/autoCalibration.ico diff --git a/MainWindow.cpp b/MainWindow.cpp deleted file mode 100644 index ff126e8..0000000 --- a/MainWindow.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#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/MainWindow.h b/MainWindow.h deleted file mode 100644 index 4643e32..0000000 --- a/MainWindow.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#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; -}; -#endif // MAINWINDOW_H diff --git a/MainWindow.ui b/MainWindow.ui deleted file mode 100644 index b232854..0000000 --- a/MainWindow.ui +++ /dev/null @@ -1,22 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 800 - 600 - - - - MainWindow - - - - - - - - diff --git a/frame/CustomMessageBox.ui b/frame/CustomMessageBox.ui index 336be54..b545d74 100644 --- a/frame/CustomMessageBox.ui +++ b/frame/CustomMessageBox.ui @@ -84,8 +84,8 @@ - - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + + :/image/msgbox/icon_box_close.png:/image/msgbox/icon_box_close.png @@ -134,7 +134,7 @@ - :/image/msgbox/icon_box_success.png + :/image/msgbox/icon_box_success.png Qt::AlignCenter @@ -265,6 +265,8 @@ - + + + diff --git a/frame/MainWindowForm.cpp b/frame/MainWindowForm.cpp index 2ded44b..ec82cd7 100644 --- a/frame/MainWindowForm.cpp +++ b/frame/MainWindowForm.cpp @@ -1,6 +1,8 @@ #include "MainWindowForm.h" #include "ui_MainWindowForm.h" +#include + MainWindowForm::MainWindowForm(QWidget *parent) : FramelessWindow(parent), ui(new Ui::MainWindowForm) @@ -12,7 +14,7 @@ initMenuWidgets(); initFunctionButtons(); - // 每秒更新 界面上没有地方能摆 暂时先不启动定时器 + // 每秒更新 connect(TimeCounterUtil::getInstance().clockTimer, &QTimer::timeout, this, &MainWindowForm::onUpdateTimestampHandler); TimeCounterUtil::getInstance().clockTimer->start(1000); @@ -34,6 +36,7 @@ void MainWindowForm::initForm() { setWindowFlags(Qt::FramelessWindowHint); // 设置全屏 + setWindowState(Qt::WindowState::WindowMaximized); this->setTitleBar(ui->wdgtTop); // 设置窗口位置和大小 move(0, 0); @@ -120,6 +123,22 @@ setWindowState(Qt::WindowMinimized | windowState()); } +void MainWindowForm::on_btnMaxWin_clicked() +{ + QScreen *screen = QGuiApplication::primaryScreen(); + QRect screenSize = screen->availableGeometry(); // 可用区域(排除任务栏) + + if (this->isMaximized()) { + resize(screenSize.width() * 0.8, screenSize.height() * 0.8); + move(QRandomGenerator::global()->bounded(10, 100), QRandomGenerator::global()->bounded(10, 50)); + this->showNormal(); + } else { + resize(screenSize.width(), screenSize.height()); + move(0, 0); + this->showMaximized(); + } +} + void MainWindowForm::on_btnCloseWin_clicked() { // 创建一个消息框 @@ -146,18 +165,9 @@ ui->labelTime->setText(now.toString("yyyy-MM-dd HH:mm:ss")); } -void MainWindowForm::on_btnMenuMax_clicked() -{ - if (this->isMaximized()) { - this->showNormal(); - } else { - this->showMaximized(); - } -} - void MainWindowForm::titleDblClick() { - on_btnMenuMax_clicked(); + on_btnMaxWin_clicked(); } void MainWindowForm::onMenuButtonsEabled(bool enable) { diff --git a/frame/MainWindowForm.h b/frame/MainWindowForm.h index 4d206b1..9b4eae4 100644 --- a/frame/MainWindowForm.h +++ b/frame/MainWindowForm.h @@ -45,11 +45,11 @@ private slots: void on_btnMinWin_clicked(); + void on_btnMaxWin_clicked(); void on_btnCloseWin_clicked(); void onFunctionButtonsAction(); void onUpdateTimestampHandler(); - void on_btnMenuMax_clicked(); void titleDblClick(); void onMenuButtonsEabled(bool enable); diff --git a/frame/MainWindowForm.ui b/frame/MainWindowForm.ui index bd42122..f37d171 100644 --- a/frame/MainWindowForm.ui +++ b/frame/MainWindowForm.ui @@ -41,7 +41,7 @@ 0 - 120 + 100 @@ -58,7 +58,7 @@ 20 - 0 + 20 @@ -88,8 +88,8 @@ - 120 - 120 + 150 + 100 @@ -107,6 +107,22 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + @@ -158,7 +174,7 @@ 100 - 84 + 72 @@ -166,7 +182,8 @@ - :/image/main/calibration.png:/image/main/calibration.png + :/image/main/icon_menu_calibration.png + :/image/main/icon_menu_calibration_selected.png:/image/main/icon_menu_calibration.png @@ -184,7 +201,7 @@ 100 - 84 + 72 @@ -192,7 +209,8 @@ - :/image/main/rawDataRecord.png:/image/main/rawDataRecord.png + :/image/main/icon_menu_check.png + :/image/main/icon_menu_check_selected.png:/image/main/icon_menu_check.png @@ -210,7 +228,7 @@ 100 - 84 + 72 @@ -218,7 +236,8 @@ - :/image/main/fileRes.png:/image/main/fileRes.png + :/image/main/icon_menu_infomation.png + :/image/main/icon_menu_infomation_checked.png:/image/main/icon_menu_infomation.png @@ -235,10 +254,147 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 50 + 20 + + + + + - 320 + 240 + 16777215 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 5 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + :/image/main/iconTemp.png + + + + + + + 34.5℃ + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + + + + :/image/main/iconHumi.png + + + + + + + 25%Rh + + + + + + + + + + + + + + 240 16777215 @@ -308,7 +464,7 @@ - :/image/main/icon_setting_p.png:/image/main/icon_setting_p.png + :/image/main/icon_setting.png:/image/main/icon_setting.png @@ -334,7 +490,33 @@ - :/image/main/icon_min_p.png:/image/main/icon_min_p.png + :/image/main/icon_min.png:/image/main/icon_min.png + + + + 32 + 32 + + + + + + + + + 40 + 40 + + + + 最小化 + + + + + + + :/image/main/icon_max.png:/image/main/icon_max.png @@ -360,7 +542,7 @@ - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + :/image/main/icon_close.png:/image/main/icon_close.png @@ -426,87 +608,9 @@ - - - - - 0 - 30 - - - - - 20 - - - 0 - - - 0 - - - 40 - - - 0 - - - - - Qt::Horizontal - - - - 1289 - 20 - - - - - - - - - - - - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 20 - - - - - - - - - - - - - - wdgtContent wdgtTop - wdgtFoot diff --git a/infomation/InfoMainForm.cpp b/infomation/InfoMainForm.cpp index c001199..5d0ffc8 100644 --- a/infomation/InfoMainForm.cpp +++ b/infomation/InfoMainForm.cpp @@ -21,9 +21,13 @@ void InfoMainForm::initForm() { + // 加载样式表 + QString qssStyle = QssFileUtils::loadQssFileContent(QApplication::applicationDirPath() + "/qss/infoMain.css"); + if (qssStyle.isEmpty() == false) { + this->setStyleSheet(qssStyle); // 仅本窗口生效 + } - - + ui->scrollArea->setWindowFlags(Qt::FramelessWindowHint); // 设置无边框 } void InfoMainForm::initSubMenuForms() { diff --git a/infomation/InfoMainForm.ui b/infomation/InfoMainForm.ui index 958a6b2..d9066dd 100644 --- a/infomation/InfoMainForm.ui +++ b/infomation/InfoMainForm.ui @@ -90,7 +90,7 @@ - 280 + 295 48 @@ -103,7 +103,7 @@ - 280 + 295 48 @@ -116,7 +116,7 @@ - 280 + 295 48 @@ -129,7 +129,7 @@ - 280 + 295 48 @@ -142,7 +142,7 @@ - 280 + 295 48 @@ -155,7 +155,7 @@ - 280 + 295 48 @@ -168,7 +168,7 @@ - 280 + 295 48 @@ -181,7 +181,7 @@ - 280 + 295 48 @@ -194,7 +194,7 @@ - 280 + 295 48 @@ -207,7 +207,7 @@ - 280 + 295 48 @@ -220,7 +220,7 @@ - 280 + 295 48 @@ -233,7 +233,7 @@ - 280 + 295 48 @@ -246,7 +246,7 @@ - 280 + 295 48 diff --git a/infomation/task/DeptTaskForm.cpp b/infomation/task/DeptTaskForm.cpp index ea21a9f..cc6bf31 100644 --- a/infomation/task/DeptTaskForm.cpp +++ b/infomation/task/DeptTaskForm.cpp @@ -18,12 +18,17 @@ delete ui; } -void DeptTaskForm::showEvent(QShowEvent *event) +void DeptTaskForm::showEvent(QShowEvent * event) { ui->tableDeptTask->adjustTableWidth(); getDeptTaskList(0); } +void DeptTaskForm::resizeEvent(QResizeEvent * event) +{ + ui->tableDeptTask->adjustTableWidth(); +} + void DeptTaskForm::initFormTable() { // 初始化查询条件 diff --git a/infomation/task/DeptTaskForm.h b/infomation/task/DeptTaskForm.h index 1055c36..3c1ad5b 100644 --- a/infomation/task/DeptTaskForm.h +++ b/infomation/task/DeptTaskForm.h @@ -21,7 +21,8 @@ ~DeptTaskForm(); protected: - void showEvent(QShowEvent *event) override; + void showEvent(QShowEvent * event) override; + void resizeEvent(QResizeEvent * event) override; private: Ui::DeptTaskForm *ui; diff --git a/main.cpp b/main.cpp index 525387e..0b78c87 100644 --- a/main.cpp +++ b/main.cpp @@ -1,5 +1,3 @@ -#include "MainWindow.h" - #include #include diff --git a/res/image/Index/u1176.svg b/res/image/Index/u1176.svg deleted file mode 100644 index c81ce8a..0000000 --- a/res/image/Index/u1176.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1180.svg b/res/image/Index/u1180.svg deleted file mode 100644 index 2ef24ab..0000000 --- a/res/image/Index/u1180.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1220.svg b/res/image/Index/u1220.svg deleted file mode 100644 index 43452aa..0000000 --- a/res/image/Index/u1220.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2158.svg b/res/image/Index/u2158.svg deleted file mode 100644 index fd249e0..0000000 --- a/res/image/Index/u2158.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u2188.svg b/res/image/Index/u2188.svg deleted file mode 100644 index 34f53c4..0000000 --- a/res/image/Index/u2188.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2189.svg b/res/image/Index/u2189.svg deleted file mode 100644 index 01a6bbb..0000000 --- a/res/image/Index/u2189.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2324.svg b/res/image/Index/u2324.svg deleted file mode 100644 index 797f1c5..0000000 --- a/res/image/Index/u2324.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2325.svg b/res/image/Index/u2325.svg deleted file mode 100644 index fefe01b..0000000 --- a/res/image/Index/u2325.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u642.svg b/res/image/Index/u642.svg deleted file mode 100644 index 33c9e0a..0000000 --- a/res/image/Index/u642.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u7406.svg b/res/image/Index/u7406.svg deleted file mode 100644 index 8a7a6d9..0000000 --- a/res/image/Index/u7406.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7453.svg b/res/image/Index/u7453.svg deleted file mode 100644 index 603c496..0000000 --- a/res/image/Index/u7453.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7458.svg b/res/image/Index/u7458.svg deleted file mode 100644 index b31087b..0000000 --- a/res/image/Index/u7458.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7488.svg b/res/image/Index/u7488.svg deleted file mode 100644 index 8baf439..0000000 --- a/res/image/Index/u7488.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7491.svg b/res/image/Index/u7491.svg deleted file mode 100644 index 3e41c10..0000000 --- a/res/image/Index/u7491.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7538.svg b/res/image/Index/u7538.svg deleted file mode 100644 index 417077d..0000000 --- a/res/image/Index/u7538.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u794.svg b/res/image/Index/u794.svg deleted file mode 100644 index e12cff7..0000000 --- a/res/image/Index/u794.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u8448.svg b/res/image/Index/u8448.svg deleted file mode 100644 index 7f6f4c0..0000000 --- a/res/image/Index/u8448.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u8458.svg b/res/image/Index/u8458.svg deleted file mode 100644 index 6d04a12..0000000 --- a/res/image/Index/u8458.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/main/bg_banner.png b/res/image/main/bg_banner.png new file mode 100644 index 0000000..26ddffd --- /dev/null +++ b/res/image/main/bg_banner.png Binary files differ diff --git a/res/image/main/iconHumi.png b/res/image/main/iconHumi.png index 4410d38..bd164e8 100644 --- a/res/image/main/iconHumi.png +++ b/res/image/main/iconHumi.png Binary files differ diff --git a/res/image/main/iconTemp.png b/res/image/main/iconTemp.png index 8fd059c..a2cfe4d 100644 --- a/res/image/main/iconTemp.png +++ b/res/image/main/iconTemp.png Binary files differ diff --git a/res/image/main/icon_close.png b/res/image/main/icon_close.png new file mode 100644 index 0000000..f3aa270 --- /dev/null +++ b/res/image/main/icon_close.png Binary files differ diff --git a/res/image/main/icon_close_p.png b/res/image/main/icon_close_p.png deleted file mode 100644 index b9ba30c..0000000 --- a/res/image/main/icon_close_p.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_main.png b/res/image/main/icon_main.png deleted file mode 100644 index 9d004d5..0000000 --- a/res/image/main/icon_main.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_max.png b/res/image/main/icon_max.png new file mode 100644 index 0000000..6cbf073 --- /dev/null +++ b/res/image/main/icon_max.png Binary files differ diff --git a/res/image/main/icon_menu_calibration.png b/res/image/main/icon_menu_calibration.png new file mode 100644 index 0000000..6fca8be --- /dev/null +++ b/res/image/main/icon_menu_calibration.png Binary files differ diff --git a/res/image/main/icon_menu_calibration_selected.png b/res/image/main/icon_menu_calibration_selected.png new file mode 100644 index 0000000..17f918f --- /dev/null +++ b/res/image/main/icon_menu_calibration_selected.png Binary files differ diff --git a/res/image/main/icon_menu_check.png b/res/image/main/icon_menu_check.png new file mode 100644 index 0000000..c3db5fa --- /dev/null +++ b/res/image/main/icon_menu_check.png Binary files differ diff --git a/res/image/main/icon_menu_check_selected.png b/res/image/main/icon_menu_check_selected.png new file mode 100644 index 0000000..9794c43 --- /dev/null +++ b/res/image/main/icon_menu_check_selected.png Binary files differ diff --git a/res/image/main/icon_menu_infomation.png b/res/image/main/icon_menu_infomation.png new file mode 100644 index 0000000..e272f4c --- /dev/null +++ b/res/image/main/icon_menu_infomation.png Binary files differ diff --git a/res/image/main/icon_menu_infomation_checked.png b/res/image/main/icon_menu_infomation_checked.png new file mode 100644 index 0000000..6122c7b --- /dev/null +++ b/res/image/main/icon_menu_infomation_checked.png Binary files differ diff --git a/res/image/main/icon_min.png b/res/image/main/icon_min.png new file mode 100644 index 0000000..2f524d9 --- /dev/null +++ b/res/image/main/icon_min.png Binary files differ diff --git a/res/image/main/icon_min_p.png b/res/image/main/icon_min_p.png deleted file mode 100644 index 93bd487..0000000 --- a/res/image/main/icon_min_p.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_quit_p.png b/res/image/main/icon_quit_p.png deleted file mode 100644 index 10d8bac..0000000 --- a/res/image/main/icon_quit_p.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_setting.png b/res/image/main/icon_setting.png new file mode 100644 index 0000000..8686833 --- /dev/null +++ b/res/image/main/icon_setting.png Binary files differ diff --git a/res/image/main/icon_setting_p.png b/res/image/main/icon_setting_p.png deleted file mode 100644 index f6645f1..0000000 --- a/res/image/main/icon_setting_p.png +++ /dev/null Binary files differ diff --git a/res/image/msgbox/icon_box_close.png b/res/image/msgbox/icon_box_close.png new file mode 100644 index 0000000..e9d00fb --- /dev/null +++ b/res/image/msgbox/icon_box_close.png Binary files differ diff --git a/AutoCalibrationXC.pro b/AutoCalibrationXC.pro index 6bcb335..7790b37 100644 --- a/AutoCalibrationXC.pro +++ b/AutoCalibrationXC.pro @@ -24,11 +24,6 @@ include(QPagedTable/QPagedTable.pri) SOURCES += main.cpp -SOURCES += MainWindow.cpp - -HEADERS += MainWindow.h - -FORMS += MainWindow.ui RC_ICONS = res/autoCalibration.ico diff --git a/MainWindow.cpp b/MainWindow.cpp deleted file mode 100644 index ff126e8..0000000 --- a/MainWindow.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#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/MainWindow.h b/MainWindow.h deleted file mode 100644 index 4643e32..0000000 --- a/MainWindow.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#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; -}; -#endif // MAINWINDOW_H diff --git a/MainWindow.ui b/MainWindow.ui deleted file mode 100644 index b232854..0000000 --- a/MainWindow.ui +++ /dev/null @@ -1,22 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 800 - 600 - - - - MainWindow - - - - - - - - diff --git a/frame/CustomMessageBox.ui b/frame/CustomMessageBox.ui index 336be54..b545d74 100644 --- a/frame/CustomMessageBox.ui +++ b/frame/CustomMessageBox.ui @@ -84,8 +84,8 @@ - - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + + :/image/msgbox/icon_box_close.png:/image/msgbox/icon_box_close.png @@ -134,7 +134,7 @@ - :/image/msgbox/icon_box_success.png + :/image/msgbox/icon_box_success.png Qt::AlignCenter @@ -265,6 +265,8 @@ - + + + diff --git a/frame/MainWindowForm.cpp b/frame/MainWindowForm.cpp index 2ded44b..ec82cd7 100644 --- a/frame/MainWindowForm.cpp +++ b/frame/MainWindowForm.cpp @@ -1,6 +1,8 @@ #include "MainWindowForm.h" #include "ui_MainWindowForm.h" +#include + MainWindowForm::MainWindowForm(QWidget *parent) : FramelessWindow(parent), ui(new Ui::MainWindowForm) @@ -12,7 +14,7 @@ initMenuWidgets(); initFunctionButtons(); - // 每秒更新 界面上没有地方能摆 暂时先不启动定时器 + // 每秒更新 connect(TimeCounterUtil::getInstance().clockTimer, &QTimer::timeout, this, &MainWindowForm::onUpdateTimestampHandler); TimeCounterUtil::getInstance().clockTimer->start(1000); @@ -34,6 +36,7 @@ void MainWindowForm::initForm() { setWindowFlags(Qt::FramelessWindowHint); // 设置全屏 + setWindowState(Qt::WindowState::WindowMaximized); this->setTitleBar(ui->wdgtTop); // 设置窗口位置和大小 move(0, 0); @@ -120,6 +123,22 @@ setWindowState(Qt::WindowMinimized | windowState()); } +void MainWindowForm::on_btnMaxWin_clicked() +{ + QScreen *screen = QGuiApplication::primaryScreen(); + QRect screenSize = screen->availableGeometry(); // 可用区域(排除任务栏) + + if (this->isMaximized()) { + resize(screenSize.width() * 0.8, screenSize.height() * 0.8); + move(QRandomGenerator::global()->bounded(10, 100), QRandomGenerator::global()->bounded(10, 50)); + this->showNormal(); + } else { + resize(screenSize.width(), screenSize.height()); + move(0, 0); + this->showMaximized(); + } +} + void MainWindowForm::on_btnCloseWin_clicked() { // 创建一个消息框 @@ -146,18 +165,9 @@ ui->labelTime->setText(now.toString("yyyy-MM-dd HH:mm:ss")); } -void MainWindowForm::on_btnMenuMax_clicked() -{ - if (this->isMaximized()) { - this->showNormal(); - } else { - this->showMaximized(); - } -} - void MainWindowForm::titleDblClick() { - on_btnMenuMax_clicked(); + on_btnMaxWin_clicked(); } void MainWindowForm::onMenuButtonsEabled(bool enable) { diff --git a/frame/MainWindowForm.h b/frame/MainWindowForm.h index 4d206b1..9b4eae4 100644 --- a/frame/MainWindowForm.h +++ b/frame/MainWindowForm.h @@ -45,11 +45,11 @@ private slots: void on_btnMinWin_clicked(); + void on_btnMaxWin_clicked(); void on_btnCloseWin_clicked(); void onFunctionButtonsAction(); void onUpdateTimestampHandler(); - void on_btnMenuMax_clicked(); void titleDblClick(); void onMenuButtonsEabled(bool enable); diff --git a/frame/MainWindowForm.ui b/frame/MainWindowForm.ui index bd42122..f37d171 100644 --- a/frame/MainWindowForm.ui +++ b/frame/MainWindowForm.ui @@ -41,7 +41,7 @@ 0 - 120 + 100 @@ -58,7 +58,7 @@ 20 - 0 + 20 @@ -88,8 +88,8 @@ - 120 - 120 + 150 + 100 @@ -107,6 +107,22 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + @@ -158,7 +174,7 @@ 100 - 84 + 72 @@ -166,7 +182,8 @@ - :/image/main/calibration.png:/image/main/calibration.png + :/image/main/icon_menu_calibration.png + :/image/main/icon_menu_calibration_selected.png:/image/main/icon_menu_calibration.png @@ -184,7 +201,7 @@ 100 - 84 + 72 @@ -192,7 +209,8 @@ - :/image/main/rawDataRecord.png:/image/main/rawDataRecord.png + :/image/main/icon_menu_check.png + :/image/main/icon_menu_check_selected.png:/image/main/icon_menu_check.png @@ -210,7 +228,7 @@ 100 - 84 + 72 @@ -218,7 +236,8 @@ - :/image/main/fileRes.png:/image/main/fileRes.png + :/image/main/icon_menu_infomation.png + :/image/main/icon_menu_infomation_checked.png:/image/main/icon_menu_infomation.png @@ -235,10 +254,147 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 50 + 20 + + + + + - 320 + 240 + 16777215 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 5 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + :/image/main/iconTemp.png + + + + + + + 34.5℃ + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + + + + :/image/main/iconHumi.png + + + + + + + 25%Rh + + + + + + + + + + + + + + 240 16777215 @@ -308,7 +464,7 @@ - :/image/main/icon_setting_p.png:/image/main/icon_setting_p.png + :/image/main/icon_setting.png:/image/main/icon_setting.png @@ -334,7 +490,33 @@ - :/image/main/icon_min_p.png:/image/main/icon_min_p.png + :/image/main/icon_min.png:/image/main/icon_min.png + + + + 32 + 32 + + + + + + + + + 40 + 40 + + + + 最小化 + + + + + + + :/image/main/icon_max.png:/image/main/icon_max.png @@ -360,7 +542,7 @@ - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + :/image/main/icon_close.png:/image/main/icon_close.png @@ -426,87 +608,9 @@ - - - - - 0 - 30 - - - - - 20 - - - 0 - - - 0 - - - 40 - - - 0 - - - - - Qt::Horizontal - - - - 1289 - 20 - - - - - - - - - - - - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 20 - - - - - - - - - - - - - - wdgtContent wdgtTop - wdgtFoot diff --git a/infomation/InfoMainForm.cpp b/infomation/InfoMainForm.cpp index c001199..5d0ffc8 100644 --- a/infomation/InfoMainForm.cpp +++ b/infomation/InfoMainForm.cpp @@ -21,9 +21,13 @@ void InfoMainForm::initForm() { + // 加载样式表 + QString qssStyle = QssFileUtils::loadQssFileContent(QApplication::applicationDirPath() + "/qss/infoMain.css"); + if (qssStyle.isEmpty() == false) { + this->setStyleSheet(qssStyle); // 仅本窗口生效 + } - - + ui->scrollArea->setWindowFlags(Qt::FramelessWindowHint); // 设置无边框 } void InfoMainForm::initSubMenuForms() { diff --git a/infomation/InfoMainForm.ui b/infomation/InfoMainForm.ui index 958a6b2..d9066dd 100644 --- a/infomation/InfoMainForm.ui +++ b/infomation/InfoMainForm.ui @@ -90,7 +90,7 @@ - 280 + 295 48 @@ -103,7 +103,7 @@ - 280 + 295 48 @@ -116,7 +116,7 @@ - 280 + 295 48 @@ -129,7 +129,7 @@ - 280 + 295 48 @@ -142,7 +142,7 @@ - 280 + 295 48 @@ -155,7 +155,7 @@ - 280 + 295 48 @@ -168,7 +168,7 @@ - 280 + 295 48 @@ -181,7 +181,7 @@ - 280 + 295 48 @@ -194,7 +194,7 @@ - 280 + 295 48 @@ -207,7 +207,7 @@ - 280 + 295 48 @@ -220,7 +220,7 @@ - 280 + 295 48 @@ -233,7 +233,7 @@ - 280 + 295 48 @@ -246,7 +246,7 @@ - 280 + 295 48 diff --git a/infomation/task/DeptTaskForm.cpp b/infomation/task/DeptTaskForm.cpp index ea21a9f..cc6bf31 100644 --- a/infomation/task/DeptTaskForm.cpp +++ b/infomation/task/DeptTaskForm.cpp @@ -18,12 +18,17 @@ delete ui; } -void DeptTaskForm::showEvent(QShowEvent *event) +void DeptTaskForm::showEvent(QShowEvent * event) { ui->tableDeptTask->adjustTableWidth(); getDeptTaskList(0); } +void DeptTaskForm::resizeEvent(QResizeEvent * event) +{ + ui->tableDeptTask->adjustTableWidth(); +} + void DeptTaskForm::initFormTable() { // 初始化查询条件 diff --git a/infomation/task/DeptTaskForm.h b/infomation/task/DeptTaskForm.h index 1055c36..3c1ad5b 100644 --- a/infomation/task/DeptTaskForm.h +++ b/infomation/task/DeptTaskForm.h @@ -21,7 +21,8 @@ ~DeptTaskForm(); protected: - void showEvent(QShowEvent *event) override; + void showEvent(QShowEvent * event) override; + void resizeEvent(QResizeEvent * event) override; private: Ui::DeptTaskForm *ui; diff --git a/main.cpp b/main.cpp index 525387e..0b78c87 100644 --- a/main.cpp +++ b/main.cpp @@ -1,5 +1,3 @@ -#include "MainWindow.h" - #include #include diff --git a/res/image/Index/u1176.svg b/res/image/Index/u1176.svg deleted file mode 100644 index c81ce8a..0000000 --- a/res/image/Index/u1176.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1180.svg b/res/image/Index/u1180.svg deleted file mode 100644 index 2ef24ab..0000000 --- a/res/image/Index/u1180.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1220.svg b/res/image/Index/u1220.svg deleted file mode 100644 index 43452aa..0000000 --- a/res/image/Index/u1220.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2158.svg b/res/image/Index/u2158.svg deleted file mode 100644 index fd249e0..0000000 --- a/res/image/Index/u2158.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u2188.svg b/res/image/Index/u2188.svg deleted file mode 100644 index 34f53c4..0000000 --- a/res/image/Index/u2188.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2189.svg b/res/image/Index/u2189.svg deleted file mode 100644 index 01a6bbb..0000000 --- a/res/image/Index/u2189.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2324.svg b/res/image/Index/u2324.svg deleted file mode 100644 index 797f1c5..0000000 --- a/res/image/Index/u2324.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2325.svg b/res/image/Index/u2325.svg deleted file mode 100644 index fefe01b..0000000 --- a/res/image/Index/u2325.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u642.svg b/res/image/Index/u642.svg deleted file mode 100644 index 33c9e0a..0000000 --- a/res/image/Index/u642.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u7406.svg b/res/image/Index/u7406.svg deleted file mode 100644 index 8a7a6d9..0000000 --- a/res/image/Index/u7406.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7453.svg b/res/image/Index/u7453.svg deleted file mode 100644 index 603c496..0000000 --- a/res/image/Index/u7453.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7458.svg b/res/image/Index/u7458.svg deleted file mode 100644 index b31087b..0000000 --- a/res/image/Index/u7458.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7488.svg b/res/image/Index/u7488.svg deleted file mode 100644 index 8baf439..0000000 --- a/res/image/Index/u7488.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7491.svg b/res/image/Index/u7491.svg deleted file mode 100644 index 3e41c10..0000000 --- a/res/image/Index/u7491.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7538.svg b/res/image/Index/u7538.svg deleted file mode 100644 index 417077d..0000000 --- a/res/image/Index/u7538.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u794.svg b/res/image/Index/u794.svg deleted file mode 100644 index e12cff7..0000000 --- a/res/image/Index/u794.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u8448.svg b/res/image/Index/u8448.svg deleted file mode 100644 index 7f6f4c0..0000000 --- a/res/image/Index/u8448.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u8458.svg b/res/image/Index/u8458.svg deleted file mode 100644 index 6d04a12..0000000 --- a/res/image/Index/u8458.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/main/bg_banner.png b/res/image/main/bg_banner.png new file mode 100644 index 0000000..26ddffd --- /dev/null +++ b/res/image/main/bg_banner.png Binary files differ diff --git a/res/image/main/iconHumi.png b/res/image/main/iconHumi.png index 4410d38..bd164e8 100644 --- a/res/image/main/iconHumi.png +++ b/res/image/main/iconHumi.png Binary files differ diff --git a/res/image/main/iconTemp.png b/res/image/main/iconTemp.png index 8fd059c..a2cfe4d 100644 --- a/res/image/main/iconTemp.png +++ b/res/image/main/iconTemp.png Binary files differ diff --git a/res/image/main/icon_close.png b/res/image/main/icon_close.png new file mode 100644 index 0000000..f3aa270 --- /dev/null +++ b/res/image/main/icon_close.png Binary files differ diff --git a/res/image/main/icon_close_p.png b/res/image/main/icon_close_p.png deleted file mode 100644 index b9ba30c..0000000 --- a/res/image/main/icon_close_p.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_main.png b/res/image/main/icon_main.png deleted file mode 100644 index 9d004d5..0000000 --- a/res/image/main/icon_main.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_max.png b/res/image/main/icon_max.png new file mode 100644 index 0000000..6cbf073 --- /dev/null +++ b/res/image/main/icon_max.png Binary files differ diff --git a/res/image/main/icon_menu_calibration.png b/res/image/main/icon_menu_calibration.png new file mode 100644 index 0000000..6fca8be --- /dev/null +++ b/res/image/main/icon_menu_calibration.png Binary files differ diff --git a/res/image/main/icon_menu_calibration_selected.png b/res/image/main/icon_menu_calibration_selected.png new file mode 100644 index 0000000..17f918f --- /dev/null +++ b/res/image/main/icon_menu_calibration_selected.png Binary files differ diff --git a/res/image/main/icon_menu_check.png b/res/image/main/icon_menu_check.png new file mode 100644 index 0000000..c3db5fa --- /dev/null +++ b/res/image/main/icon_menu_check.png Binary files differ diff --git a/res/image/main/icon_menu_check_selected.png b/res/image/main/icon_menu_check_selected.png new file mode 100644 index 0000000..9794c43 --- /dev/null +++ b/res/image/main/icon_menu_check_selected.png Binary files differ diff --git a/res/image/main/icon_menu_infomation.png b/res/image/main/icon_menu_infomation.png new file mode 100644 index 0000000..e272f4c --- /dev/null +++ b/res/image/main/icon_menu_infomation.png Binary files differ diff --git a/res/image/main/icon_menu_infomation_checked.png b/res/image/main/icon_menu_infomation_checked.png new file mode 100644 index 0000000..6122c7b --- /dev/null +++ b/res/image/main/icon_menu_infomation_checked.png Binary files differ diff --git a/res/image/main/icon_min.png b/res/image/main/icon_min.png new file mode 100644 index 0000000..2f524d9 --- /dev/null +++ b/res/image/main/icon_min.png Binary files differ diff --git a/res/image/main/icon_min_p.png b/res/image/main/icon_min_p.png deleted file mode 100644 index 93bd487..0000000 --- a/res/image/main/icon_min_p.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_quit_p.png b/res/image/main/icon_quit_p.png deleted file mode 100644 index 10d8bac..0000000 --- a/res/image/main/icon_quit_p.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_setting.png b/res/image/main/icon_setting.png new file mode 100644 index 0000000..8686833 --- /dev/null +++ b/res/image/main/icon_setting.png Binary files differ diff --git a/res/image/main/icon_setting_p.png b/res/image/main/icon_setting_p.png deleted file mode 100644 index f6645f1..0000000 --- a/res/image/main/icon_setting_p.png +++ /dev/null Binary files differ diff --git a/res/image/msgbox/icon_box_close.png b/res/image/msgbox/icon_box_close.png new file mode 100644 index 0000000..e9d00fb --- /dev/null +++ b/res/image/msgbox/icon_box_close.png Binary files differ diff --git a/res/images.qrc b/res/images.qrc index 68608e9..a6ba788 100644 --- a/res/images.qrc +++ b/res/images.qrc @@ -27,27 +27,9 @@ image/Index/u709.svg image/Index/u712.svg image/Index/u715.svg - image/Index/u1176.svg - image/Index/u1180.svg - image/Index/u1220.svg - image/Index/u7406.svg - image/Index/u7453.svg - image/Index/u7458.svg - image/Index/u7488.svg - image/Index/u7491.svg - image/Index/u7538.svg - image/Index/u2324.svg - image/Index/u2325.svg - image/Index/u2158.svg - image/Index/u8448.svg - image/Index/u8458.svg image/Index/u2327.svg image/Index/u5496.svg image/Index/u7313.svg - image/Index/u2188.svg - image/Index/u2189.svg - image/Index/u642.svg - image/Index/u794.svg image/Index/u5089.png image/Index/u138.png image/Index/btnPageFirst.png @@ -96,13 +78,6 @@ image/login/icon_min.png image/login/icon_setting.png image/login/icon_quit.png - image/main/icon_main.png - image/main/iconHumi.png - image/main/iconTemp.png - image/main/icon_close_p.png - image/main/icon_min_p.png - image/main/icon_quit_p.png - image/main/icon_setting_p.png image/main/arrow_down.png image/main/arrow_up.png image/main/icon_btn_pause.png @@ -115,5 +90,19 @@ image/msgbox/icon_box_warning.png image/msgbox/icon_box_fail.png image/login/logo.png + image/main/bg_banner.png + image/main/icon_close.png + image/main/icon_max.png + image/main/icon_min.png + image/main/icon_setting.png + image/main/iconHumi.png + image/main/iconTemp.png + image/main/icon_menu_calibration.png + image/main/icon_menu_calibration_selected.png + image/main/icon_menu_check.png + image/main/icon_menu_check_selected.png + image/main/icon_menu_infomation.png + image/main/icon_menu_infomation_checked.png + image/msgbox/icon_box_close.png diff --git a/AutoCalibrationXC.pro b/AutoCalibrationXC.pro index 6bcb335..7790b37 100644 --- a/AutoCalibrationXC.pro +++ b/AutoCalibrationXC.pro @@ -24,11 +24,6 @@ include(QPagedTable/QPagedTable.pri) SOURCES += main.cpp -SOURCES += MainWindow.cpp - -HEADERS += MainWindow.h - -FORMS += MainWindow.ui RC_ICONS = res/autoCalibration.ico diff --git a/MainWindow.cpp b/MainWindow.cpp deleted file mode 100644 index ff126e8..0000000 --- a/MainWindow.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#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/MainWindow.h b/MainWindow.h deleted file mode 100644 index 4643e32..0000000 --- a/MainWindow.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#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; -}; -#endif // MAINWINDOW_H diff --git a/MainWindow.ui b/MainWindow.ui deleted file mode 100644 index b232854..0000000 --- a/MainWindow.ui +++ /dev/null @@ -1,22 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 800 - 600 - - - - MainWindow - - - - - - - - diff --git a/frame/CustomMessageBox.ui b/frame/CustomMessageBox.ui index 336be54..b545d74 100644 --- a/frame/CustomMessageBox.ui +++ b/frame/CustomMessageBox.ui @@ -84,8 +84,8 @@ - - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + + :/image/msgbox/icon_box_close.png:/image/msgbox/icon_box_close.png @@ -134,7 +134,7 @@ - :/image/msgbox/icon_box_success.png + :/image/msgbox/icon_box_success.png Qt::AlignCenter @@ -265,6 +265,8 @@ - + + + diff --git a/frame/MainWindowForm.cpp b/frame/MainWindowForm.cpp index 2ded44b..ec82cd7 100644 --- a/frame/MainWindowForm.cpp +++ b/frame/MainWindowForm.cpp @@ -1,6 +1,8 @@ #include "MainWindowForm.h" #include "ui_MainWindowForm.h" +#include + MainWindowForm::MainWindowForm(QWidget *parent) : FramelessWindow(parent), ui(new Ui::MainWindowForm) @@ -12,7 +14,7 @@ initMenuWidgets(); initFunctionButtons(); - // 每秒更新 界面上没有地方能摆 暂时先不启动定时器 + // 每秒更新 connect(TimeCounterUtil::getInstance().clockTimer, &QTimer::timeout, this, &MainWindowForm::onUpdateTimestampHandler); TimeCounterUtil::getInstance().clockTimer->start(1000); @@ -34,6 +36,7 @@ void MainWindowForm::initForm() { setWindowFlags(Qt::FramelessWindowHint); // 设置全屏 + setWindowState(Qt::WindowState::WindowMaximized); this->setTitleBar(ui->wdgtTop); // 设置窗口位置和大小 move(0, 0); @@ -120,6 +123,22 @@ setWindowState(Qt::WindowMinimized | windowState()); } +void MainWindowForm::on_btnMaxWin_clicked() +{ + QScreen *screen = QGuiApplication::primaryScreen(); + QRect screenSize = screen->availableGeometry(); // 可用区域(排除任务栏) + + if (this->isMaximized()) { + resize(screenSize.width() * 0.8, screenSize.height() * 0.8); + move(QRandomGenerator::global()->bounded(10, 100), QRandomGenerator::global()->bounded(10, 50)); + this->showNormal(); + } else { + resize(screenSize.width(), screenSize.height()); + move(0, 0); + this->showMaximized(); + } +} + void MainWindowForm::on_btnCloseWin_clicked() { // 创建一个消息框 @@ -146,18 +165,9 @@ ui->labelTime->setText(now.toString("yyyy-MM-dd HH:mm:ss")); } -void MainWindowForm::on_btnMenuMax_clicked() -{ - if (this->isMaximized()) { - this->showNormal(); - } else { - this->showMaximized(); - } -} - void MainWindowForm::titleDblClick() { - on_btnMenuMax_clicked(); + on_btnMaxWin_clicked(); } void MainWindowForm::onMenuButtonsEabled(bool enable) { diff --git a/frame/MainWindowForm.h b/frame/MainWindowForm.h index 4d206b1..9b4eae4 100644 --- a/frame/MainWindowForm.h +++ b/frame/MainWindowForm.h @@ -45,11 +45,11 @@ private slots: void on_btnMinWin_clicked(); + void on_btnMaxWin_clicked(); void on_btnCloseWin_clicked(); void onFunctionButtonsAction(); void onUpdateTimestampHandler(); - void on_btnMenuMax_clicked(); void titleDblClick(); void onMenuButtonsEabled(bool enable); diff --git a/frame/MainWindowForm.ui b/frame/MainWindowForm.ui index bd42122..f37d171 100644 --- a/frame/MainWindowForm.ui +++ b/frame/MainWindowForm.ui @@ -41,7 +41,7 @@ 0 - 120 + 100 @@ -58,7 +58,7 @@ 20 - 0 + 20 @@ -88,8 +88,8 @@ - 120 - 120 + 150 + 100 @@ -107,6 +107,22 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + @@ -158,7 +174,7 @@ 100 - 84 + 72 @@ -166,7 +182,8 @@ - :/image/main/calibration.png:/image/main/calibration.png + :/image/main/icon_menu_calibration.png + :/image/main/icon_menu_calibration_selected.png:/image/main/icon_menu_calibration.png @@ -184,7 +201,7 @@ 100 - 84 + 72 @@ -192,7 +209,8 @@ - :/image/main/rawDataRecord.png:/image/main/rawDataRecord.png + :/image/main/icon_menu_check.png + :/image/main/icon_menu_check_selected.png:/image/main/icon_menu_check.png @@ -210,7 +228,7 @@ 100 - 84 + 72 @@ -218,7 +236,8 @@ - :/image/main/fileRes.png:/image/main/fileRes.png + :/image/main/icon_menu_infomation.png + :/image/main/icon_menu_infomation_checked.png:/image/main/icon_menu_infomation.png @@ -235,10 +254,147 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 50 + 20 + + + + + - 320 + 240 + 16777215 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 5 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + :/image/main/iconTemp.png + + + + + + + 34.5℃ + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + + + + :/image/main/iconHumi.png + + + + + + + 25%Rh + + + + + + + + + + + + + + 240 16777215 @@ -308,7 +464,7 @@ - :/image/main/icon_setting_p.png:/image/main/icon_setting_p.png + :/image/main/icon_setting.png:/image/main/icon_setting.png @@ -334,7 +490,33 @@ - :/image/main/icon_min_p.png:/image/main/icon_min_p.png + :/image/main/icon_min.png:/image/main/icon_min.png + + + + 32 + 32 + + + + + + + + + 40 + 40 + + + + 最小化 + + + + + + + :/image/main/icon_max.png:/image/main/icon_max.png @@ -360,7 +542,7 @@ - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + :/image/main/icon_close.png:/image/main/icon_close.png @@ -426,87 +608,9 @@ - - - - - 0 - 30 - - - - - 20 - - - 0 - - - 0 - - - 40 - - - 0 - - - - - Qt::Horizontal - - - - 1289 - 20 - - - - - - - - - - - - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 20 - - - - - - - - - - - - - - wdgtContent wdgtTop - wdgtFoot diff --git a/infomation/InfoMainForm.cpp b/infomation/InfoMainForm.cpp index c001199..5d0ffc8 100644 --- a/infomation/InfoMainForm.cpp +++ b/infomation/InfoMainForm.cpp @@ -21,9 +21,13 @@ void InfoMainForm::initForm() { + // 加载样式表 + QString qssStyle = QssFileUtils::loadQssFileContent(QApplication::applicationDirPath() + "/qss/infoMain.css"); + if (qssStyle.isEmpty() == false) { + this->setStyleSheet(qssStyle); // 仅本窗口生效 + } - - + ui->scrollArea->setWindowFlags(Qt::FramelessWindowHint); // 设置无边框 } void InfoMainForm::initSubMenuForms() { diff --git a/infomation/InfoMainForm.ui b/infomation/InfoMainForm.ui index 958a6b2..d9066dd 100644 --- a/infomation/InfoMainForm.ui +++ b/infomation/InfoMainForm.ui @@ -90,7 +90,7 @@ - 280 + 295 48 @@ -103,7 +103,7 @@ - 280 + 295 48 @@ -116,7 +116,7 @@ - 280 + 295 48 @@ -129,7 +129,7 @@ - 280 + 295 48 @@ -142,7 +142,7 @@ - 280 + 295 48 @@ -155,7 +155,7 @@ - 280 + 295 48 @@ -168,7 +168,7 @@ - 280 + 295 48 @@ -181,7 +181,7 @@ - 280 + 295 48 @@ -194,7 +194,7 @@ - 280 + 295 48 @@ -207,7 +207,7 @@ - 280 + 295 48 @@ -220,7 +220,7 @@ - 280 + 295 48 @@ -233,7 +233,7 @@ - 280 + 295 48 @@ -246,7 +246,7 @@ - 280 + 295 48 diff --git a/infomation/task/DeptTaskForm.cpp b/infomation/task/DeptTaskForm.cpp index ea21a9f..cc6bf31 100644 --- a/infomation/task/DeptTaskForm.cpp +++ b/infomation/task/DeptTaskForm.cpp @@ -18,12 +18,17 @@ delete ui; } -void DeptTaskForm::showEvent(QShowEvent *event) +void DeptTaskForm::showEvent(QShowEvent * event) { ui->tableDeptTask->adjustTableWidth(); getDeptTaskList(0); } +void DeptTaskForm::resizeEvent(QResizeEvent * event) +{ + ui->tableDeptTask->adjustTableWidth(); +} + void DeptTaskForm::initFormTable() { // 初始化查询条件 diff --git a/infomation/task/DeptTaskForm.h b/infomation/task/DeptTaskForm.h index 1055c36..3c1ad5b 100644 --- a/infomation/task/DeptTaskForm.h +++ b/infomation/task/DeptTaskForm.h @@ -21,7 +21,8 @@ ~DeptTaskForm(); protected: - void showEvent(QShowEvent *event) override; + void showEvent(QShowEvent * event) override; + void resizeEvent(QResizeEvent * event) override; private: Ui::DeptTaskForm *ui; diff --git a/main.cpp b/main.cpp index 525387e..0b78c87 100644 --- a/main.cpp +++ b/main.cpp @@ -1,5 +1,3 @@ -#include "MainWindow.h" - #include #include diff --git a/res/image/Index/u1176.svg b/res/image/Index/u1176.svg deleted file mode 100644 index c81ce8a..0000000 --- a/res/image/Index/u1176.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1180.svg b/res/image/Index/u1180.svg deleted file mode 100644 index 2ef24ab..0000000 --- a/res/image/Index/u1180.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1220.svg b/res/image/Index/u1220.svg deleted file mode 100644 index 43452aa..0000000 --- a/res/image/Index/u1220.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2158.svg b/res/image/Index/u2158.svg deleted file mode 100644 index fd249e0..0000000 --- a/res/image/Index/u2158.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u2188.svg b/res/image/Index/u2188.svg deleted file mode 100644 index 34f53c4..0000000 --- a/res/image/Index/u2188.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2189.svg b/res/image/Index/u2189.svg deleted file mode 100644 index 01a6bbb..0000000 --- a/res/image/Index/u2189.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2324.svg b/res/image/Index/u2324.svg deleted file mode 100644 index 797f1c5..0000000 --- a/res/image/Index/u2324.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2325.svg b/res/image/Index/u2325.svg deleted file mode 100644 index fefe01b..0000000 --- a/res/image/Index/u2325.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u642.svg b/res/image/Index/u642.svg deleted file mode 100644 index 33c9e0a..0000000 --- a/res/image/Index/u642.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u7406.svg b/res/image/Index/u7406.svg deleted file mode 100644 index 8a7a6d9..0000000 --- a/res/image/Index/u7406.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7453.svg b/res/image/Index/u7453.svg deleted file mode 100644 index 603c496..0000000 --- a/res/image/Index/u7453.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7458.svg b/res/image/Index/u7458.svg deleted file mode 100644 index b31087b..0000000 --- a/res/image/Index/u7458.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7488.svg b/res/image/Index/u7488.svg deleted file mode 100644 index 8baf439..0000000 --- a/res/image/Index/u7488.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7491.svg b/res/image/Index/u7491.svg deleted file mode 100644 index 3e41c10..0000000 --- a/res/image/Index/u7491.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7538.svg b/res/image/Index/u7538.svg deleted file mode 100644 index 417077d..0000000 --- a/res/image/Index/u7538.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u794.svg b/res/image/Index/u794.svg deleted file mode 100644 index e12cff7..0000000 --- a/res/image/Index/u794.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u8448.svg b/res/image/Index/u8448.svg deleted file mode 100644 index 7f6f4c0..0000000 --- a/res/image/Index/u8448.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u8458.svg b/res/image/Index/u8458.svg deleted file mode 100644 index 6d04a12..0000000 --- a/res/image/Index/u8458.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/main/bg_banner.png b/res/image/main/bg_banner.png new file mode 100644 index 0000000..26ddffd --- /dev/null +++ b/res/image/main/bg_banner.png Binary files differ diff --git a/res/image/main/iconHumi.png b/res/image/main/iconHumi.png index 4410d38..bd164e8 100644 --- a/res/image/main/iconHumi.png +++ b/res/image/main/iconHumi.png Binary files differ diff --git a/res/image/main/iconTemp.png b/res/image/main/iconTemp.png index 8fd059c..a2cfe4d 100644 --- a/res/image/main/iconTemp.png +++ b/res/image/main/iconTemp.png Binary files differ diff --git a/res/image/main/icon_close.png b/res/image/main/icon_close.png new file mode 100644 index 0000000..f3aa270 --- /dev/null +++ b/res/image/main/icon_close.png Binary files differ diff --git a/res/image/main/icon_close_p.png b/res/image/main/icon_close_p.png deleted file mode 100644 index b9ba30c..0000000 --- a/res/image/main/icon_close_p.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_main.png b/res/image/main/icon_main.png deleted file mode 100644 index 9d004d5..0000000 --- a/res/image/main/icon_main.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_max.png b/res/image/main/icon_max.png new file mode 100644 index 0000000..6cbf073 --- /dev/null +++ b/res/image/main/icon_max.png Binary files differ diff --git a/res/image/main/icon_menu_calibration.png b/res/image/main/icon_menu_calibration.png new file mode 100644 index 0000000..6fca8be --- /dev/null +++ b/res/image/main/icon_menu_calibration.png Binary files differ diff --git a/res/image/main/icon_menu_calibration_selected.png b/res/image/main/icon_menu_calibration_selected.png new file mode 100644 index 0000000..17f918f --- /dev/null +++ b/res/image/main/icon_menu_calibration_selected.png Binary files differ diff --git a/res/image/main/icon_menu_check.png b/res/image/main/icon_menu_check.png new file mode 100644 index 0000000..c3db5fa --- /dev/null +++ b/res/image/main/icon_menu_check.png Binary files differ diff --git a/res/image/main/icon_menu_check_selected.png b/res/image/main/icon_menu_check_selected.png new file mode 100644 index 0000000..9794c43 --- /dev/null +++ b/res/image/main/icon_menu_check_selected.png Binary files differ diff --git a/res/image/main/icon_menu_infomation.png b/res/image/main/icon_menu_infomation.png new file mode 100644 index 0000000..e272f4c --- /dev/null +++ b/res/image/main/icon_menu_infomation.png Binary files differ diff --git a/res/image/main/icon_menu_infomation_checked.png b/res/image/main/icon_menu_infomation_checked.png new file mode 100644 index 0000000..6122c7b --- /dev/null +++ b/res/image/main/icon_menu_infomation_checked.png Binary files differ diff --git a/res/image/main/icon_min.png b/res/image/main/icon_min.png new file mode 100644 index 0000000..2f524d9 --- /dev/null +++ b/res/image/main/icon_min.png Binary files differ diff --git a/res/image/main/icon_min_p.png b/res/image/main/icon_min_p.png deleted file mode 100644 index 93bd487..0000000 --- a/res/image/main/icon_min_p.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_quit_p.png b/res/image/main/icon_quit_p.png deleted file mode 100644 index 10d8bac..0000000 --- a/res/image/main/icon_quit_p.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_setting.png b/res/image/main/icon_setting.png new file mode 100644 index 0000000..8686833 --- /dev/null +++ b/res/image/main/icon_setting.png Binary files differ diff --git a/res/image/main/icon_setting_p.png b/res/image/main/icon_setting_p.png deleted file mode 100644 index f6645f1..0000000 --- a/res/image/main/icon_setting_p.png +++ /dev/null Binary files differ diff --git a/res/image/msgbox/icon_box_close.png b/res/image/msgbox/icon_box_close.png new file mode 100644 index 0000000..e9d00fb --- /dev/null +++ b/res/image/msgbox/icon_box_close.png Binary files differ diff --git a/res/images.qrc b/res/images.qrc index 68608e9..a6ba788 100644 --- a/res/images.qrc +++ b/res/images.qrc @@ -27,27 +27,9 @@ image/Index/u709.svg image/Index/u712.svg image/Index/u715.svg - image/Index/u1176.svg - image/Index/u1180.svg - image/Index/u1220.svg - image/Index/u7406.svg - image/Index/u7453.svg - image/Index/u7458.svg - image/Index/u7488.svg - image/Index/u7491.svg - image/Index/u7538.svg - image/Index/u2324.svg - image/Index/u2325.svg - image/Index/u2158.svg - image/Index/u8448.svg - image/Index/u8458.svg image/Index/u2327.svg image/Index/u5496.svg image/Index/u7313.svg - image/Index/u2188.svg - image/Index/u2189.svg - image/Index/u642.svg - image/Index/u794.svg image/Index/u5089.png image/Index/u138.png image/Index/btnPageFirst.png @@ -96,13 +78,6 @@ image/login/icon_min.png image/login/icon_setting.png image/login/icon_quit.png - image/main/icon_main.png - image/main/iconHumi.png - image/main/iconTemp.png - image/main/icon_close_p.png - image/main/icon_min_p.png - image/main/icon_quit_p.png - image/main/icon_setting_p.png image/main/arrow_down.png image/main/arrow_up.png image/main/icon_btn_pause.png @@ -115,5 +90,19 @@ image/msgbox/icon_box_warning.png image/msgbox/icon_box_fail.png image/login/logo.png + image/main/bg_banner.png + image/main/icon_close.png + image/main/icon_max.png + image/main/icon_min.png + image/main/icon_setting.png + image/main/iconHumi.png + image/main/iconTemp.png + image/main/icon_menu_calibration.png + image/main/icon_menu_calibration_selected.png + image/main/icon_menu_check.png + image/main/icon_menu_check_selected.png + image/main/icon_menu_infomation.png + image/main/icon_menu_infomation_checked.png + image/msgbox/icon_box_close.png diff --git a/res/qss.qrc b/res/qss.qrc index 56752bb..fbb36c0 100644 --- a/res/qss.qrc +++ b/res/qss.qrc @@ -1,14 +1,10 @@ - qss/Index.css qss/preCheck.css - qss/dialogcheckresul.css - qss/tf_testdevice.css - qss/generalStyle.css - qss/checkWin.css qss/loginForm.css qss/mainForm.css qss/baseInfomation.css qss/messageBox.css + qss/infoMain.css diff --git a/AutoCalibrationXC.pro b/AutoCalibrationXC.pro index 6bcb335..7790b37 100644 --- a/AutoCalibrationXC.pro +++ b/AutoCalibrationXC.pro @@ -24,11 +24,6 @@ include(QPagedTable/QPagedTable.pri) SOURCES += main.cpp -SOURCES += MainWindow.cpp - -HEADERS += MainWindow.h - -FORMS += MainWindow.ui RC_ICONS = res/autoCalibration.ico diff --git a/MainWindow.cpp b/MainWindow.cpp deleted file mode 100644 index ff126e8..0000000 --- a/MainWindow.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#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/MainWindow.h b/MainWindow.h deleted file mode 100644 index 4643e32..0000000 --- a/MainWindow.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#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; -}; -#endif // MAINWINDOW_H diff --git a/MainWindow.ui b/MainWindow.ui deleted file mode 100644 index b232854..0000000 --- a/MainWindow.ui +++ /dev/null @@ -1,22 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 800 - 600 - - - - MainWindow - - - - - - - - diff --git a/frame/CustomMessageBox.ui b/frame/CustomMessageBox.ui index 336be54..b545d74 100644 --- a/frame/CustomMessageBox.ui +++ b/frame/CustomMessageBox.ui @@ -84,8 +84,8 @@ - - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + + :/image/msgbox/icon_box_close.png:/image/msgbox/icon_box_close.png @@ -134,7 +134,7 @@ - :/image/msgbox/icon_box_success.png + :/image/msgbox/icon_box_success.png Qt::AlignCenter @@ -265,6 +265,8 @@ - + + + diff --git a/frame/MainWindowForm.cpp b/frame/MainWindowForm.cpp index 2ded44b..ec82cd7 100644 --- a/frame/MainWindowForm.cpp +++ b/frame/MainWindowForm.cpp @@ -1,6 +1,8 @@ #include "MainWindowForm.h" #include "ui_MainWindowForm.h" +#include + MainWindowForm::MainWindowForm(QWidget *parent) : FramelessWindow(parent), ui(new Ui::MainWindowForm) @@ -12,7 +14,7 @@ initMenuWidgets(); initFunctionButtons(); - // 每秒更新 界面上没有地方能摆 暂时先不启动定时器 + // 每秒更新 connect(TimeCounterUtil::getInstance().clockTimer, &QTimer::timeout, this, &MainWindowForm::onUpdateTimestampHandler); TimeCounterUtil::getInstance().clockTimer->start(1000); @@ -34,6 +36,7 @@ void MainWindowForm::initForm() { setWindowFlags(Qt::FramelessWindowHint); // 设置全屏 + setWindowState(Qt::WindowState::WindowMaximized); this->setTitleBar(ui->wdgtTop); // 设置窗口位置和大小 move(0, 0); @@ -120,6 +123,22 @@ setWindowState(Qt::WindowMinimized | windowState()); } +void MainWindowForm::on_btnMaxWin_clicked() +{ + QScreen *screen = QGuiApplication::primaryScreen(); + QRect screenSize = screen->availableGeometry(); // 可用区域(排除任务栏) + + if (this->isMaximized()) { + resize(screenSize.width() * 0.8, screenSize.height() * 0.8); + move(QRandomGenerator::global()->bounded(10, 100), QRandomGenerator::global()->bounded(10, 50)); + this->showNormal(); + } else { + resize(screenSize.width(), screenSize.height()); + move(0, 0); + this->showMaximized(); + } +} + void MainWindowForm::on_btnCloseWin_clicked() { // 创建一个消息框 @@ -146,18 +165,9 @@ ui->labelTime->setText(now.toString("yyyy-MM-dd HH:mm:ss")); } -void MainWindowForm::on_btnMenuMax_clicked() -{ - if (this->isMaximized()) { - this->showNormal(); - } else { - this->showMaximized(); - } -} - void MainWindowForm::titleDblClick() { - on_btnMenuMax_clicked(); + on_btnMaxWin_clicked(); } void MainWindowForm::onMenuButtonsEabled(bool enable) { diff --git a/frame/MainWindowForm.h b/frame/MainWindowForm.h index 4d206b1..9b4eae4 100644 --- a/frame/MainWindowForm.h +++ b/frame/MainWindowForm.h @@ -45,11 +45,11 @@ private slots: void on_btnMinWin_clicked(); + void on_btnMaxWin_clicked(); void on_btnCloseWin_clicked(); void onFunctionButtonsAction(); void onUpdateTimestampHandler(); - void on_btnMenuMax_clicked(); void titleDblClick(); void onMenuButtonsEabled(bool enable); diff --git a/frame/MainWindowForm.ui b/frame/MainWindowForm.ui index bd42122..f37d171 100644 --- a/frame/MainWindowForm.ui +++ b/frame/MainWindowForm.ui @@ -41,7 +41,7 @@ 0 - 120 + 100 @@ -58,7 +58,7 @@ 20 - 0 + 20 @@ -88,8 +88,8 @@ - 120 - 120 + 150 + 100 @@ -107,6 +107,22 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + @@ -158,7 +174,7 @@ 100 - 84 + 72 @@ -166,7 +182,8 @@ - :/image/main/calibration.png:/image/main/calibration.png + :/image/main/icon_menu_calibration.png + :/image/main/icon_menu_calibration_selected.png:/image/main/icon_menu_calibration.png @@ -184,7 +201,7 @@ 100 - 84 + 72 @@ -192,7 +209,8 @@ - :/image/main/rawDataRecord.png:/image/main/rawDataRecord.png + :/image/main/icon_menu_check.png + :/image/main/icon_menu_check_selected.png:/image/main/icon_menu_check.png @@ -210,7 +228,7 @@ 100 - 84 + 72 @@ -218,7 +236,8 @@ - :/image/main/fileRes.png:/image/main/fileRes.png + :/image/main/icon_menu_infomation.png + :/image/main/icon_menu_infomation_checked.png:/image/main/icon_menu_infomation.png @@ -235,10 +254,147 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 50 + 20 + + + + + - 320 + 240 + 16777215 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 5 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + :/image/main/iconTemp.png + + + + + + + 34.5℃ + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + + + + :/image/main/iconHumi.png + + + + + + + 25%Rh + + + + + + + + + + + + + + 240 16777215 @@ -308,7 +464,7 @@ - :/image/main/icon_setting_p.png:/image/main/icon_setting_p.png + :/image/main/icon_setting.png:/image/main/icon_setting.png @@ -334,7 +490,33 @@ - :/image/main/icon_min_p.png:/image/main/icon_min_p.png + :/image/main/icon_min.png:/image/main/icon_min.png + + + + 32 + 32 + + + + + + + + + 40 + 40 + + + + 最小化 + + + + + + + :/image/main/icon_max.png:/image/main/icon_max.png @@ -360,7 +542,7 @@ - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + :/image/main/icon_close.png:/image/main/icon_close.png @@ -426,87 +608,9 @@ - - - - - 0 - 30 - - - - - 20 - - - 0 - - - 0 - - - 40 - - - 0 - - - - - Qt::Horizontal - - - - 1289 - 20 - - - - - - - - - - - - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 20 - - - - - - - - - - - - - - wdgtContent wdgtTop - wdgtFoot diff --git a/infomation/InfoMainForm.cpp b/infomation/InfoMainForm.cpp index c001199..5d0ffc8 100644 --- a/infomation/InfoMainForm.cpp +++ b/infomation/InfoMainForm.cpp @@ -21,9 +21,13 @@ void InfoMainForm::initForm() { + // 加载样式表 + QString qssStyle = QssFileUtils::loadQssFileContent(QApplication::applicationDirPath() + "/qss/infoMain.css"); + if (qssStyle.isEmpty() == false) { + this->setStyleSheet(qssStyle); // 仅本窗口生效 + } - - + ui->scrollArea->setWindowFlags(Qt::FramelessWindowHint); // 设置无边框 } void InfoMainForm::initSubMenuForms() { diff --git a/infomation/InfoMainForm.ui b/infomation/InfoMainForm.ui index 958a6b2..d9066dd 100644 --- a/infomation/InfoMainForm.ui +++ b/infomation/InfoMainForm.ui @@ -90,7 +90,7 @@ - 280 + 295 48 @@ -103,7 +103,7 @@ - 280 + 295 48 @@ -116,7 +116,7 @@ - 280 + 295 48 @@ -129,7 +129,7 @@ - 280 + 295 48 @@ -142,7 +142,7 @@ - 280 + 295 48 @@ -155,7 +155,7 @@ - 280 + 295 48 @@ -168,7 +168,7 @@ - 280 + 295 48 @@ -181,7 +181,7 @@ - 280 + 295 48 @@ -194,7 +194,7 @@ - 280 + 295 48 @@ -207,7 +207,7 @@ - 280 + 295 48 @@ -220,7 +220,7 @@ - 280 + 295 48 @@ -233,7 +233,7 @@ - 280 + 295 48 @@ -246,7 +246,7 @@ - 280 + 295 48 diff --git a/infomation/task/DeptTaskForm.cpp b/infomation/task/DeptTaskForm.cpp index ea21a9f..cc6bf31 100644 --- a/infomation/task/DeptTaskForm.cpp +++ b/infomation/task/DeptTaskForm.cpp @@ -18,12 +18,17 @@ delete ui; } -void DeptTaskForm::showEvent(QShowEvent *event) +void DeptTaskForm::showEvent(QShowEvent * event) { ui->tableDeptTask->adjustTableWidth(); getDeptTaskList(0); } +void DeptTaskForm::resizeEvent(QResizeEvent * event) +{ + ui->tableDeptTask->adjustTableWidth(); +} + void DeptTaskForm::initFormTable() { // 初始化查询条件 diff --git a/infomation/task/DeptTaskForm.h b/infomation/task/DeptTaskForm.h index 1055c36..3c1ad5b 100644 --- a/infomation/task/DeptTaskForm.h +++ b/infomation/task/DeptTaskForm.h @@ -21,7 +21,8 @@ ~DeptTaskForm(); protected: - void showEvent(QShowEvent *event) override; + void showEvent(QShowEvent * event) override; + void resizeEvent(QResizeEvent * event) override; private: Ui::DeptTaskForm *ui; diff --git a/main.cpp b/main.cpp index 525387e..0b78c87 100644 --- a/main.cpp +++ b/main.cpp @@ -1,5 +1,3 @@ -#include "MainWindow.h" - #include #include diff --git a/res/image/Index/u1176.svg b/res/image/Index/u1176.svg deleted file mode 100644 index c81ce8a..0000000 --- a/res/image/Index/u1176.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1180.svg b/res/image/Index/u1180.svg deleted file mode 100644 index 2ef24ab..0000000 --- a/res/image/Index/u1180.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1220.svg b/res/image/Index/u1220.svg deleted file mode 100644 index 43452aa..0000000 --- a/res/image/Index/u1220.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2158.svg b/res/image/Index/u2158.svg deleted file mode 100644 index fd249e0..0000000 --- a/res/image/Index/u2158.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u2188.svg b/res/image/Index/u2188.svg deleted file mode 100644 index 34f53c4..0000000 --- a/res/image/Index/u2188.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2189.svg b/res/image/Index/u2189.svg deleted file mode 100644 index 01a6bbb..0000000 --- a/res/image/Index/u2189.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2324.svg b/res/image/Index/u2324.svg deleted file mode 100644 index 797f1c5..0000000 --- a/res/image/Index/u2324.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2325.svg b/res/image/Index/u2325.svg deleted file mode 100644 index fefe01b..0000000 --- a/res/image/Index/u2325.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u642.svg b/res/image/Index/u642.svg deleted file mode 100644 index 33c9e0a..0000000 --- a/res/image/Index/u642.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u7406.svg b/res/image/Index/u7406.svg deleted file mode 100644 index 8a7a6d9..0000000 --- a/res/image/Index/u7406.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7453.svg b/res/image/Index/u7453.svg deleted file mode 100644 index 603c496..0000000 --- a/res/image/Index/u7453.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7458.svg b/res/image/Index/u7458.svg deleted file mode 100644 index b31087b..0000000 --- a/res/image/Index/u7458.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7488.svg b/res/image/Index/u7488.svg deleted file mode 100644 index 8baf439..0000000 --- a/res/image/Index/u7488.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7491.svg b/res/image/Index/u7491.svg deleted file mode 100644 index 3e41c10..0000000 --- a/res/image/Index/u7491.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7538.svg b/res/image/Index/u7538.svg deleted file mode 100644 index 417077d..0000000 --- a/res/image/Index/u7538.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u794.svg b/res/image/Index/u794.svg deleted file mode 100644 index e12cff7..0000000 --- a/res/image/Index/u794.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u8448.svg b/res/image/Index/u8448.svg deleted file mode 100644 index 7f6f4c0..0000000 --- a/res/image/Index/u8448.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u8458.svg b/res/image/Index/u8458.svg deleted file mode 100644 index 6d04a12..0000000 --- a/res/image/Index/u8458.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/main/bg_banner.png b/res/image/main/bg_banner.png new file mode 100644 index 0000000..26ddffd --- /dev/null +++ b/res/image/main/bg_banner.png Binary files differ diff --git a/res/image/main/iconHumi.png b/res/image/main/iconHumi.png index 4410d38..bd164e8 100644 --- a/res/image/main/iconHumi.png +++ b/res/image/main/iconHumi.png Binary files differ diff --git a/res/image/main/iconTemp.png b/res/image/main/iconTemp.png index 8fd059c..a2cfe4d 100644 --- a/res/image/main/iconTemp.png +++ b/res/image/main/iconTemp.png Binary files differ diff --git a/res/image/main/icon_close.png b/res/image/main/icon_close.png new file mode 100644 index 0000000..f3aa270 --- /dev/null +++ b/res/image/main/icon_close.png Binary files differ diff --git a/res/image/main/icon_close_p.png b/res/image/main/icon_close_p.png deleted file mode 100644 index b9ba30c..0000000 --- a/res/image/main/icon_close_p.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_main.png b/res/image/main/icon_main.png deleted file mode 100644 index 9d004d5..0000000 --- a/res/image/main/icon_main.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_max.png b/res/image/main/icon_max.png new file mode 100644 index 0000000..6cbf073 --- /dev/null +++ b/res/image/main/icon_max.png Binary files differ diff --git a/res/image/main/icon_menu_calibration.png b/res/image/main/icon_menu_calibration.png new file mode 100644 index 0000000..6fca8be --- /dev/null +++ b/res/image/main/icon_menu_calibration.png Binary files differ diff --git a/res/image/main/icon_menu_calibration_selected.png b/res/image/main/icon_menu_calibration_selected.png new file mode 100644 index 0000000..17f918f --- /dev/null +++ b/res/image/main/icon_menu_calibration_selected.png Binary files differ diff --git a/res/image/main/icon_menu_check.png b/res/image/main/icon_menu_check.png new file mode 100644 index 0000000..c3db5fa --- /dev/null +++ b/res/image/main/icon_menu_check.png Binary files differ diff --git a/res/image/main/icon_menu_check_selected.png b/res/image/main/icon_menu_check_selected.png new file mode 100644 index 0000000..9794c43 --- /dev/null +++ b/res/image/main/icon_menu_check_selected.png Binary files differ diff --git a/res/image/main/icon_menu_infomation.png b/res/image/main/icon_menu_infomation.png new file mode 100644 index 0000000..e272f4c --- /dev/null +++ b/res/image/main/icon_menu_infomation.png Binary files differ diff --git a/res/image/main/icon_menu_infomation_checked.png b/res/image/main/icon_menu_infomation_checked.png new file mode 100644 index 0000000..6122c7b --- /dev/null +++ b/res/image/main/icon_menu_infomation_checked.png Binary files differ diff --git a/res/image/main/icon_min.png b/res/image/main/icon_min.png new file mode 100644 index 0000000..2f524d9 --- /dev/null +++ b/res/image/main/icon_min.png Binary files differ diff --git a/res/image/main/icon_min_p.png b/res/image/main/icon_min_p.png deleted file mode 100644 index 93bd487..0000000 --- a/res/image/main/icon_min_p.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_quit_p.png b/res/image/main/icon_quit_p.png deleted file mode 100644 index 10d8bac..0000000 --- a/res/image/main/icon_quit_p.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_setting.png b/res/image/main/icon_setting.png new file mode 100644 index 0000000..8686833 --- /dev/null +++ b/res/image/main/icon_setting.png Binary files differ diff --git a/res/image/main/icon_setting_p.png b/res/image/main/icon_setting_p.png deleted file mode 100644 index f6645f1..0000000 --- a/res/image/main/icon_setting_p.png +++ /dev/null Binary files differ diff --git a/res/image/msgbox/icon_box_close.png b/res/image/msgbox/icon_box_close.png new file mode 100644 index 0000000..e9d00fb --- /dev/null +++ b/res/image/msgbox/icon_box_close.png Binary files differ diff --git a/res/images.qrc b/res/images.qrc index 68608e9..a6ba788 100644 --- a/res/images.qrc +++ b/res/images.qrc @@ -27,27 +27,9 @@ image/Index/u709.svg image/Index/u712.svg image/Index/u715.svg - image/Index/u1176.svg - image/Index/u1180.svg - image/Index/u1220.svg - image/Index/u7406.svg - image/Index/u7453.svg - image/Index/u7458.svg - image/Index/u7488.svg - image/Index/u7491.svg - image/Index/u7538.svg - image/Index/u2324.svg - image/Index/u2325.svg - image/Index/u2158.svg - image/Index/u8448.svg - image/Index/u8458.svg image/Index/u2327.svg image/Index/u5496.svg image/Index/u7313.svg - image/Index/u2188.svg - image/Index/u2189.svg - image/Index/u642.svg - image/Index/u794.svg image/Index/u5089.png image/Index/u138.png image/Index/btnPageFirst.png @@ -96,13 +78,6 @@ image/login/icon_min.png image/login/icon_setting.png image/login/icon_quit.png - image/main/icon_main.png - image/main/iconHumi.png - image/main/iconTemp.png - image/main/icon_close_p.png - image/main/icon_min_p.png - image/main/icon_quit_p.png - image/main/icon_setting_p.png image/main/arrow_down.png image/main/arrow_up.png image/main/icon_btn_pause.png @@ -115,5 +90,19 @@ image/msgbox/icon_box_warning.png image/msgbox/icon_box_fail.png image/login/logo.png + image/main/bg_banner.png + image/main/icon_close.png + image/main/icon_max.png + image/main/icon_min.png + image/main/icon_setting.png + image/main/iconHumi.png + image/main/iconTemp.png + image/main/icon_menu_calibration.png + image/main/icon_menu_calibration_selected.png + image/main/icon_menu_check.png + image/main/icon_menu_check_selected.png + image/main/icon_menu_infomation.png + image/main/icon_menu_infomation_checked.png + image/msgbox/icon_box_close.png diff --git a/res/qss.qrc b/res/qss.qrc index 56752bb..fbb36c0 100644 --- a/res/qss.qrc +++ b/res/qss.qrc @@ -1,14 +1,10 @@ - qss/Index.css qss/preCheck.css - qss/dialogcheckresul.css - qss/tf_testdevice.css - qss/generalStyle.css - qss/checkWin.css qss/loginForm.css qss/mainForm.css qss/baseInfomation.css qss/messageBox.css + qss/infoMain.css diff --git a/res/qss/Index.css b/res/qss/Index.css deleted file mode 100644 index 8842775..0000000 --- a/res/qss/Index.css +++ /dev/null @@ -1,190 +0,0 @@ -*{ -color:black; -} -QLabel { - font-family: "Microsoft YaHei"; -} -QWidget#centralwidget -{ -background-image: url(:/image/Index/u15.png); -background-color:white; -} -QToolButton#tb1:hover{ - background-image: url(:/image/Index/u26_mouseOver.svg); -} -QToolButton#tb2:hover{ - background-image: url(:/image/Index/u26_mouseOver.svg); -} -QToolButton#tb3:hover{ - background-image: url(:/image/Index/u26_mouseOver.svg); -}QToolButton#tb4:hover{ -background-image: url(:/image/Index/u26_mouseOver.svg); -}QToolButton#tb5:hover{ -background-image: url(:/image/Index/u26_mouseOver.svg); -} -QToolButton#tb6:hover{ - background-image: url(:/image/Index/u26_mouseOver.svg); -} -QToolButton#tb1{ -color: white; -background-image: url(:/image/Index/u26.svg); -font-weight: bold; -border-radius: 5px; -text-align: center; -margin:10; -margin-right: 180px; -font: 18pt 微软雅黑; -} -QToolButton#tb2{ -color: white; -background-image: url(:/image/Index/u26.svg); -font-weight: bold; -border-radius: 5px; -text-align: center; -margin:10; -margin-right: 180px; -font: 18pt 微软雅黑; -} -QToolButton#tb3{ -color: white; -background-image: url(:/image/Index/u26.svg); -font-weight: bold; -border-radius: 5px; -text-align: center; -margin:10; -margin-right: 180px; -font: 18pt 微软雅黑; -}QToolButton#tb4{ -color: white; -background-image: url(:/image/Index/u26.svg); -font-weight: bold; -border-radius: 5px; -text-align: center; -margin:10; -margin-right: 180px; -font: 18pt 微软雅黑; -}QToolButton#tb5{ -color: white; -background-image: url(:/image/Index/u26.svg); -font-weight: bold; -border-radius: 5px; -text-align: center; -margin:10; -margin-right: 180px; -font: 18pt 微软雅黑; -}QToolButton#tb6{ -color: white; -background-image: url(:/image/Index/u26.svg); -font-weight: bold; -border-radius: 5px; -text-align: center; -margin:10; -margin-right: 180px; -font: 18pt 微软雅黑; -} - -/******** NewCheckMethod页面 ********/ -QLabel#labelNcmInfo, QLabel#labelNcmGraph, QLabel#labelNcmConfig, QLabel#labelNcmComm { - font-size: 24px; - min-height: 40px; -} - -QLabel[class="ncmFormLabel"] { - font-size: 18px; - padding: 10px 20px; -} - -QLineEdit[class="ncmFormInput"] { - border-radius: 6px; - font-family: "Microsoft YaHei"; - color: #333333; - border: 1px solid #CCCCCC; - font-size: 18px; -} - -QDateEdit[class="ncmFormDate"] { - border-radius: 6px; - font-family: "Microsoft YaHei"; - border: 1px solid #CCCCCC; - font-size: 18px; -} - -QCheckBox { - color: #FFFFFF; - font-family: "Microsoft YaHei"; - font-size: 16px; - /*padding-left: 5px;*/ -} -QCheckBox::indicator { - width: 20px; - height: 20px; - border-radius: 5px; - border: 2px solid #2F6FC6; -} -QCheckBox::indicator::unchecked { - background: #FFFFFF; - /*border: 2px solid #CCCCC;*/ -} -QCheckBox::indicator::checked { - background: #2F6FC6; -} - -QComboBox { - border-radius: 6px; - font-family: "Microsoft YaHei"; - padding-left: 16px; - color: #333333; - border: 1px solid #CCCCCC; - font-size: 18px; -} - -QComboBox::down-arrow { - image: url(":/image/Index/arrowDown.png"); -} -QComboBox::down-arrow::on { - image: url(":/image/Index/arrowUp.png"); -} - -QComboBox::drop-down { - subcontrol-origin: padding; - subcontrol-position: top right; - width: 20px; - border: 0px; - padding-right: 15px; -} - -QComboBox QAbstractItemView { - color: #333333; - background-color: #E1E1ED; - selection-background-color: #2F6FC6; - selection-color: #FFFFFF; - font-family: "Microsoft YaHei"; - outline: 0px; -} - -QComboBox QAbstractItemView::item{ - min-height: 36px; - line-height: 36px; - color: #333333; - padding-left: 9px; - background-color: #FFFFFF; -} - -QComboBox QScrollBar::vertical { - width: 10px; - background: #FFFFFF; - border: none; -} - -QComboBox QScrollBar::handle::vertical { - width: 10px; - background: #2F6FC6; - border: none; -} - -QComboBox QScrollBar::add-line::vertical { - border: none; -} -QComboBox QScrollBar::sub-line::vertical { - border: none; -} diff --git a/AutoCalibrationXC.pro b/AutoCalibrationXC.pro index 6bcb335..7790b37 100644 --- a/AutoCalibrationXC.pro +++ b/AutoCalibrationXC.pro @@ -24,11 +24,6 @@ include(QPagedTable/QPagedTable.pri) SOURCES += main.cpp -SOURCES += MainWindow.cpp - -HEADERS += MainWindow.h - -FORMS += MainWindow.ui RC_ICONS = res/autoCalibration.ico diff --git a/MainWindow.cpp b/MainWindow.cpp deleted file mode 100644 index ff126e8..0000000 --- a/MainWindow.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#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/MainWindow.h b/MainWindow.h deleted file mode 100644 index 4643e32..0000000 --- a/MainWindow.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#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; -}; -#endif // MAINWINDOW_H diff --git a/MainWindow.ui b/MainWindow.ui deleted file mode 100644 index b232854..0000000 --- a/MainWindow.ui +++ /dev/null @@ -1,22 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 800 - 600 - - - - MainWindow - - - - - - - - diff --git a/frame/CustomMessageBox.ui b/frame/CustomMessageBox.ui index 336be54..b545d74 100644 --- a/frame/CustomMessageBox.ui +++ b/frame/CustomMessageBox.ui @@ -84,8 +84,8 @@ - - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + + :/image/msgbox/icon_box_close.png:/image/msgbox/icon_box_close.png @@ -134,7 +134,7 @@ - :/image/msgbox/icon_box_success.png + :/image/msgbox/icon_box_success.png Qt::AlignCenter @@ -265,6 +265,8 @@ - + + + diff --git a/frame/MainWindowForm.cpp b/frame/MainWindowForm.cpp index 2ded44b..ec82cd7 100644 --- a/frame/MainWindowForm.cpp +++ b/frame/MainWindowForm.cpp @@ -1,6 +1,8 @@ #include "MainWindowForm.h" #include "ui_MainWindowForm.h" +#include + MainWindowForm::MainWindowForm(QWidget *parent) : FramelessWindow(parent), ui(new Ui::MainWindowForm) @@ -12,7 +14,7 @@ initMenuWidgets(); initFunctionButtons(); - // 每秒更新 界面上没有地方能摆 暂时先不启动定时器 + // 每秒更新 connect(TimeCounterUtil::getInstance().clockTimer, &QTimer::timeout, this, &MainWindowForm::onUpdateTimestampHandler); TimeCounterUtil::getInstance().clockTimer->start(1000); @@ -34,6 +36,7 @@ void MainWindowForm::initForm() { setWindowFlags(Qt::FramelessWindowHint); // 设置全屏 + setWindowState(Qt::WindowState::WindowMaximized); this->setTitleBar(ui->wdgtTop); // 设置窗口位置和大小 move(0, 0); @@ -120,6 +123,22 @@ setWindowState(Qt::WindowMinimized | windowState()); } +void MainWindowForm::on_btnMaxWin_clicked() +{ + QScreen *screen = QGuiApplication::primaryScreen(); + QRect screenSize = screen->availableGeometry(); // 可用区域(排除任务栏) + + if (this->isMaximized()) { + resize(screenSize.width() * 0.8, screenSize.height() * 0.8); + move(QRandomGenerator::global()->bounded(10, 100), QRandomGenerator::global()->bounded(10, 50)); + this->showNormal(); + } else { + resize(screenSize.width(), screenSize.height()); + move(0, 0); + this->showMaximized(); + } +} + void MainWindowForm::on_btnCloseWin_clicked() { // 创建一个消息框 @@ -146,18 +165,9 @@ ui->labelTime->setText(now.toString("yyyy-MM-dd HH:mm:ss")); } -void MainWindowForm::on_btnMenuMax_clicked() -{ - if (this->isMaximized()) { - this->showNormal(); - } else { - this->showMaximized(); - } -} - void MainWindowForm::titleDblClick() { - on_btnMenuMax_clicked(); + on_btnMaxWin_clicked(); } void MainWindowForm::onMenuButtonsEabled(bool enable) { diff --git a/frame/MainWindowForm.h b/frame/MainWindowForm.h index 4d206b1..9b4eae4 100644 --- a/frame/MainWindowForm.h +++ b/frame/MainWindowForm.h @@ -45,11 +45,11 @@ private slots: void on_btnMinWin_clicked(); + void on_btnMaxWin_clicked(); void on_btnCloseWin_clicked(); void onFunctionButtonsAction(); void onUpdateTimestampHandler(); - void on_btnMenuMax_clicked(); void titleDblClick(); void onMenuButtonsEabled(bool enable); diff --git a/frame/MainWindowForm.ui b/frame/MainWindowForm.ui index bd42122..f37d171 100644 --- a/frame/MainWindowForm.ui +++ b/frame/MainWindowForm.ui @@ -41,7 +41,7 @@ 0 - 120 + 100 @@ -58,7 +58,7 @@ 20 - 0 + 20 @@ -88,8 +88,8 @@ - 120 - 120 + 150 + 100 @@ -107,6 +107,22 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + @@ -158,7 +174,7 @@ 100 - 84 + 72 @@ -166,7 +182,8 @@ - :/image/main/calibration.png:/image/main/calibration.png + :/image/main/icon_menu_calibration.png + :/image/main/icon_menu_calibration_selected.png:/image/main/icon_menu_calibration.png @@ -184,7 +201,7 @@ 100 - 84 + 72 @@ -192,7 +209,8 @@ - :/image/main/rawDataRecord.png:/image/main/rawDataRecord.png + :/image/main/icon_menu_check.png + :/image/main/icon_menu_check_selected.png:/image/main/icon_menu_check.png @@ -210,7 +228,7 @@ 100 - 84 + 72 @@ -218,7 +236,8 @@ - :/image/main/fileRes.png:/image/main/fileRes.png + :/image/main/icon_menu_infomation.png + :/image/main/icon_menu_infomation_checked.png:/image/main/icon_menu_infomation.png @@ -235,10 +254,147 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 50 + 20 + + + + + - 320 + 240 + 16777215 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 5 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + :/image/main/iconTemp.png + + + + + + + 34.5℃ + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + + + + :/image/main/iconHumi.png + + + + + + + 25%Rh + + + + + + + + + + + + + + 240 16777215 @@ -308,7 +464,7 @@ - :/image/main/icon_setting_p.png:/image/main/icon_setting_p.png + :/image/main/icon_setting.png:/image/main/icon_setting.png @@ -334,7 +490,33 @@ - :/image/main/icon_min_p.png:/image/main/icon_min_p.png + :/image/main/icon_min.png:/image/main/icon_min.png + + + + 32 + 32 + + + + + + + + + 40 + 40 + + + + 最小化 + + + + + + + :/image/main/icon_max.png:/image/main/icon_max.png @@ -360,7 +542,7 @@ - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + :/image/main/icon_close.png:/image/main/icon_close.png @@ -426,87 +608,9 @@ - - - - - 0 - 30 - - - - - 20 - - - 0 - - - 0 - - - 40 - - - 0 - - - - - Qt::Horizontal - - - - 1289 - 20 - - - - - - - - - - - - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 20 - - - - - - - - - - - - - - wdgtContent wdgtTop - wdgtFoot diff --git a/infomation/InfoMainForm.cpp b/infomation/InfoMainForm.cpp index c001199..5d0ffc8 100644 --- a/infomation/InfoMainForm.cpp +++ b/infomation/InfoMainForm.cpp @@ -21,9 +21,13 @@ void InfoMainForm::initForm() { + // 加载样式表 + QString qssStyle = QssFileUtils::loadQssFileContent(QApplication::applicationDirPath() + "/qss/infoMain.css"); + if (qssStyle.isEmpty() == false) { + this->setStyleSheet(qssStyle); // 仅本窗口生效 + } - - + ui->scrollArea->setWindowFlags(Qt::FramelessWindowHint); // 设置无边框 } void InfoMainForm::initSubMenuForms() { diff --git a/infomation/InfoMainForm.ui b/infomation/InfoMainForm.ui index 958a6b2..d9066dd 100644 --- a/infomation/InfoMainForm.ui +++ b/infomation/InfoMainForm.ui @@ -90,7 +90,7 @@ - 280 + 295 48 @@ -103,7 +103,7 @@ - 280 + 295 48 @@ -116,7 +116,7 @@ - 280 + 295 48 @@ -129,7 +129,7 @@ - 280 + 295 48 @@ -142,7 +142,7 @@ - 280 + 295 48 @@ -155,7 +155,7 @@ - 280 + 295 48 @@ -168,7 +168,7 @@ - 280 + 295 48 @@ -181,7 +181,7 @@ - 280 + 295 48 @@ -194,7 +194,7 @@ - 280 + 295 48 @@ -207,7 +207,7 @@ - 280 + 295 48 @@ -220,7 +220,7 @@ - 280 + 295 48 @@ -233,7 +233,7 @@ - 280 + 295 48 @@ -246,7 +246,7 @@ - 280 + 295 48 diff --git a/infomation/task/DeptTaskForm.cpp b/infomation/task/DeptTaskForm.cpp index ea21a9f..cc6bf31 100644 --- a/infomation/task/DeptTaskForm.cpp +++ b/infomation/task/DeptTaskForm.cpp @@ -18,12 +18,17 @@ delete ui; } -void DeptTaskForm::showEvent(QShowEvent *event) +void DeptTaskForm::showEvent(QShowEvent * event) { ui->tableDeptTask->adjustTableWidth(); getDeptTaskList(0); } +void DeptTaskForm::resizeEvent(QResizeEvent * event) +{ + ui->tableDeptTask->adjustTableWidth(); +} + void DeptTaskForm::initFormTable() { // 初始化查询条件 diff --git a/infomation/task/DeptTaskForm.h b/infomation/task/DeptTaskForm.h index 1055c36..3c1ad5b 100644 --- a/infomation/task/DeptTaskForm.h +++ b/infomation/task/DeptTaskForm.h @@ -21,7 +21,8 @@ ~DeptTaskForm(); protected: - void showEvent(QShowEvent *event) override; + void showEvent(QShowEvent * event) override; + void resizeEvent(QResizeEvent * event) override; private: Ui::DeptTaskForm *ui; diff --git a/main.cpp b/main.cpp index 525387e..0b78c87 100644 --- a/main.cpp +++ b/main.cpp @@ -1,5 +1,3 @@ -#include "MainWindow.h" - #include #include diff --git a/res/image/Index/u1176.svg b/res/image/Index/u1176.svg deleted file mode 100644 index c81ce8a..0000000 --- a/res/image/Index/u1176.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1180.svg b/res/image/Index/u1180.svg deleted file mode 100644 index 2ef24ab..0000000 --- a/res/image/Index/u1180.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1220.svg b/res/image/Index/u1220.svg deleted file mode 100644 index 43452aa..0000000 --- a/res/image/Index/u1220.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2158.svg b/res/image/Index/u2158.svg deleted file mode 100644 index fd249e0..0000000 --- a/res/image/Index/u2158.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u2188.svg b/res/image/Index/u2188.svg deleted file mode 100644 index 34f53c4..0000000 --- a/res/image/Index/u2188.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2189.svg b/res/image/Index/u2189.svg deleted file mode 100644 index 01a6bbb..0000000 --- a/res/image/Index/u2189.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2324.svg b/res/image/Index/u2324.svg deleted file mode 100644 index 797f1c5..0000000 --- a/res/image/Index/u2324.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2325.svg b/res/image/Index/u2325.svg deleted file mode 100644 index fefe01b..0000000 --- a/res/image/Index/u2325.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u642.svg b/res/image/Index/u642.svg deleted file mode 100644 index 33c9e0a..0000000 --- a/res/image/Index/u642.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u7406.svg b/res/image/Index/u7406.svg deleted file mode 100644 index 8a7a6d9..0000000 --- a/res/image/Index/u7406.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7453.svg b/res/image/Index/u7453.svg deleted file mode 100644 index 603c496..0000000 --- a/res/image/Index/u7453.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7458.svg b/res/image/Index/u7458.svg deleted file mode 100644 index b31087b..0000000 --- a/res/image/Index/u7458.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7488.svg b/res/image/Index/u7488.svg deleted file mode 100644 index 8baf439..0000000 --- a/res/image/Index/u7488.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7491.svg b/res/image/Index/u7491.svg deleted file mode 100644 index 3e41c10..0000000 --- a/res/image/Index/u7491.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7538.svg b/res/image/Index/u7538.svg deleted file mode 100644 index 417077d..0000000 --- a/res/image/Index/u7538.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u794.svg b/res/image/Index/u794.svg deleted file mode 100644 index e12cff7..0000000 --- a/res/image/Index/u794.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u8448.svg b/res/image/Index/u8448.svg deleted file mode 100644 index 7f6f4c0..0000000 --- a/res/image/Index/u8448.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u8458.svg b/res/image/Index/u8458.svg deleted file mode 100644 index 6d04a12..0000000 --- a/res/image/Index/u8458.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/main/bg_banner.png b/res/image/main/bg_banner.png new file mode 100644 index 0000000..26ddffd --- /dev/null +++ b/res/image/main/bg_banner.png Binary files differ diff --git a/res/image/main/iconHumi.png b/res/image/main/iconHumi.png index 4410d38..bd164e8 100644 --- a/res/image/main/iconHumi.png +++ b/res/image/main/iconHumi.png Binary files differ diff --git a/res/image/main/iconTemp.png b/res/image/main/iconTemp.png index 8fd059c..a2cfe4d 100644 --- a/res/image/main/iconTemp.png +++ b/res/image/main/iconTemp.png Binary files differ diff --git a/res/image/main/icon_close.png b/res/image/main/icon_close.png new file mode 100644 index 0000000..f3aa270 --- /dev/null +++ b/res/image/main/icon_close.png Binary files differ diff --git a/res/image/main/icon_close_p.png b/res/image/main/icon_close_p.png deleted file mode 100644 index b9ba30c..0000000 --- a/res/image/main/icon_close_p.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_main.png b/res/image/main/icon_main.png deleted file mode 100644 index 9d004d5..0000000 --- a/res/image/main/icon_main.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_max.png b/res/image/main/icon_max.png new file mode 100644 index 0000000..6cbf073 --- /dev/null +++ b/res/image/main/icon_max.png Binary files differ diff --git a/res/image/main/icon_menu_calibration.png b/res/image/main/icon_menu_calibration.png new file mode 100644 index 0000000..6fca8be --- /dev/null +++ b/res/image/main/icon_menu_calibration.png Binary files differ diff --git a/res/image/main/icon_menu_calibration_selected.png b/res/image/main/icon_menu_calibration_selected.png new file mode 100644 index 0000000..17f918f --- /dev/null +++ b/res/image/main/icon_menu_calibration_selected.png Binary files differ diff --git a/res/image/main/icon_menu_check.png b/res/image/main/icon_menu_check.png new file mode 100644 index 0000000..c3db5fa --- /dev/null +++ b/res/image/main/icon_menu_check.png Binary files differ diff --git a/res/image/main/icon_menu_check_selected.png b/res/image/main/icon_menu_check_selected.png new file mode 100644 index 0000000..9794c43 --- /dev/null +++ b/res/image/main/icon_menu_check_selected.png Binary files differ diff --git a/res/image/main/icon_menu_infomation.png b/res/image/main/icon_menu_infomation.png new file mode 100644 index 0000000..e272f4c --- /dev/null +++ b/res/image/main/icon_menu_infomation.png Binary files differ diff --git a/res/image/main/icon_menu_infomation_checked.png b/res/image/main/icon_menu_infomation_checked.png new file mode 100644 index 0000000..6122c7b --- /dev/null +++ b/res/image/main/icon_menu_infomation_checked.png Binary files differ diff --git a/res/image/main/icon_min.png b/res/image/main/icon_min.png new file mode 100644 index 0000000..2f524d9 --- /dev/null +++ b/res/image/main/icon_min.png Binary files differ diff --git a/res/image/main/icon_min_p.png b/res/image/main/icon_min_p.png deleted file mode 100644 index 93bd487..0000000 --- a/res/image/main/icon_min_p.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_quit_p.png b/res/image/main/icon_quit_p.png deleted file mode 100644 index 10d8bac..0000000 --- a/res/image/main/icon_quit_p.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_setting.png b/res/image/main/icon_setting.png new file mode 100644 index 0000000..8686833 --- /dev/null +++ b/res/image/main/icon_setting.png Binary files differ diff --git a/res/image/main/icon_setting_p.png b/res/image/main/icon_setting_p.png deleted file mode 100644 index f6645f1..0000000 --- a/res/image/main/icon_setting_p.png +++ /dev/null Binary files differ diff --git a/res/image/msgbox/icon_box_close.png b/res/image/msgbox/icon_box_close.png new file mode 100644 index 0000000..e9d00fb --- /dev/null +++ b/res/image/msgbox/icon_box_close.png Binary files differ diff --git a/res/images.qrc b/res/images.qrc index 68608e9..a6ba788 100644 --- a/res/images.qrc +++ b/res/images.qrc @@ -27,27 +27,9 @@ image/Index/u709.svg image/Index/u712.svg image/Index/u715.svg - image/Index/u1176.svg - image/Index/u1180.svg - image/Index/u1220.svg - image/Index/u7406.svg - image/Index/u7453.svg - image/Index/u7458.svg - image/Index/u7488.svg - image/Index/u7491.svg - image/Index/u7538.svg - image/Index/u2324.svg - image/Index/u2325.svg - image/Index/u2158.svg - image/Index/u8448.svg - image/Index/u8458.svg image/Index/u2327.svg image/Index/u5496.svg image/Index/u7313.svg - image/Index/u2188.svg - image/Index/u2189.svg - image/Index/u642.svg - image/Index/u794.svg image/Index/u5089.png image/Index/u138.png image/Index/btnPageFirst.png @@ -96,13 +78,6 @@ image/login/icon_min.png image/login/icon_setting.png image/login/icon_quit.png - image/main/icon_main.png - image/main/iconHumi.png - image/main/iconTemp.png - image/main/icon_close_p.png - image/main/icon_min_p.png - image/main/icon_quit_p.png - image/main/icon_setting_p.png image/main/arrow_down.png image/main/arrow_up.png image/main/icon_btn_pause.png @@ -115,5 +90,19 @@ image/msgbox/icon_box_warning.png image/msgbox/icon_box_fail.png image/login/logo.png + image/main/bg_banner.png + image/main/icon_close.png + image/main/icon_max.png + image/main/icon_min.png + image/main/icon_setting.png + image/main/iconHumi.png + image/main/iconTemp.png + image/main/icon_menu_calibration.png + image/main/icon_menu_calibration_selected.png + image/main/icon_menu_check.png + image/main/icon_menu_check_selected.png + image/main/icon_menu_infomation.png + image/main/icon_menu_infomation_checked.png + image/msgbox/icon_box_close.png diff --git a/res/qss.qrc b/res/qss.qrc index 56752bb..fbb36c0 100644 --- a/res/qss.qrc +++ b/res/qss.qrc @@ -1,14 +1,10 @@ - qss/Index.css qss/preCheck.css - qss/dialogcheckresul.css - qss/tf_testdevice.css - qss/generalStyle.css - qss/checkWin.css qss/loginForm.css qss/mainForm.css qss/baseInfomation.css qss/messageBox.css + qss/infoMain.css diff --git a/res/qss/Index.css b/res/qss/Index.css deleted file mode 100644 index 8842775..0000000 --- a/res/qss/Index.css +++ /dev/null @@ -1,190 +0,0 @@ -*{ -color:black; -} -QLabel { - font-family: "Microsoft YaHei"; -} -QWidget#centralwidget -{ -background-image: url(:/image/Index/u15.png); -background-color:white; -} -QToolButton#tb1:hover{ - background-image: url(:/image/Index/u26_mouseOver.svg); -} -QToolButton#tb2:hover{ - background-image: url(:/image/Index/u26_mouseOver.svg); -} -QToolButton#tb3:hover{ - background-image: url(:/image/Index/u26_mouseOver.svg); -}QToolButton#tb4:hover{ -background-image: url(:/image/Index/u26_mouseOver.svg); -}QToolButton#tb5:hover{ -background-image: url(:/image/Index/u26_mouseOver.svg); -} -QToolButton#tb6:hover{ - background-image: url(:/image/Index/u26_mouseOver.svg); -} -QToolButton#tb1{ -color: white; -background-image: url(:/image/Index/u26.svg); -font-weight: bold; -border-radius: 5px; -text-align: center; -margin:10; -margin-right: 180px; -font: 18pt 微软雅黑; -} -QToolButton#tb2{ -color: white; -background-image: url(:/image/Index/u26.svg); -font-weight: bold; -border-radius: 5px; -text-align: center; -margin:10; -margin-right: 180px; -font: 18pt 微软雅黑; -} -QToolButton#tb3{ -color: white; -background-image: url(:/image/Index/u26.svg); -font-weight: bold; -border-radius: 5px; -text-align: center; -margin:10; -margin-right: 180px; -font: 18pt 微软雅黑; -}QToolButton#tb4{ -color: white; -background-image: url(:/image/Index/u26.svg); -font-weight: bold; -border-radius: 5px; -text-align: center; -margin:10; -margin-right: 180px; -font: 18pt 微软雅黑; -}QToolButton#tb5{ -color: white; -background-image: url(:/image/Index/u26.svg); -font-weight: bold; -border-radius: 5px; -text-align: center; -margin:10; -margin-right: 180px; -font: 18pt 微软雅黑; -}QToolButton#tb6{ -color: white; -background-image: url(:/image/Index/u26.svg); -font-weight: bold; -border-radius: 5px; -text-align: center; -margin:10; -margin-right: 180px; -font: 18pt 微软雅黑; -} - -/******** NewCheckMethod页面 ********/ -QLabel#labelNcmInfo, QLabel#labelNcmGraph, QLabel#labelNcmConfig, QLabel#labelNcmComm { - font-size: 24px; - min-height: 40px; -} - -QLabel[class="ncmFormLabel"] { - font-size: 18px; - padding: 10px 20px; -} - -QLineEdit[class="ncmFormInput"] { - border-radius: 6px; - font-family: "Microsoft YaHei"; - color: #333333; - border: 1px solid #CCCCCC; - font-size: 18px; -} - -QDateEdit[class="ncmFormDate"] { - border-radius: 6px; - font-family: "Microsoft YaHei"; - border: 1px solid #CCCCCC; - font-size: 18px; -} - -QCheckBox { - color: #FFFFFF; - font-family: "Microsoft YaHei"; - font-size: 16px; - /*padding-left: 5px;*/ -} -QCheckBox::indicator { - width: 20px; - height: 20px; - border-radius: 5px; - border: 2px solid #2F6FC6; -} -QCheckBox::indicator::unchecked { - background: #FFFFFF; - /*border: 2px solid #CCCCC;*/ -} -QCheckBox::indicator::checked { - background: #2F6FC6; -} - -QComboBox { - border-radius: 6px; - font-family: "Microsoft YaHei"; - padding-left: 16px; - color: #333333; - border: 1px solid #CCCCCC; - font-size: 18px; -} - -QComboBox::down-arrow { - image: url(":/image/Index/arrowDown.png"); -} -QComboBox::down-arrow::on { - image: url(":/image/Index/arrowUp.png"); -} - -QComboBox::drop-down { - subcontrol-origin: padding; - subcontrol-position: top right; - width: 20px; - border: 0px; - padding-right: 15px; -} - -QComboBox QAbstractItemView { - color: #333333; - background-color: #E1E1ED; - selection-background-color: #2F6FC6; - selection-color: #FFFFFF; - font-family: "Microsoft YaHei"; - outline: 0px; -} - -QComboBox QAbstractItemView::item{ - min-height: 36px; - line-height: 36px; - color: #333333; - padding-left: 9px; - background-color: #FFFFFF; -} - -QComboBox QScrollBar::vertical { - width: 10px; - background: #FFFFFF; - border: none; -} - -QComboBox QScrollBar::handle::vertical { - width: 10px; - background: #2F6FC6; - border: none; -} - -QComboBox QScrollBar::add-line::vertical { - border: none; -} -QComboBox QScrollBar::sub-line::vertical { - border: none; -} diff --git a/res/qss/baseInfomation.css b/res/qss/baseInfomation.css index 636c382..1c6783c 100644 --- a/res/qss/baseInfomation.css +++ b/res/qss/baseInfomation.css @@ -1,5 +1,3 @@ -/*QPalette{background:#FFFFFF;}*/ - QWidget { background-color: #FFFFFF; } @@ -11,7 +9,7 @@ /** 普通按钮 **/ QToolButton[class="btnDefault"] { border-radius: 12px; - background-color: #504897; + background-color: #2F6FC6; color: #FFFFFF; font-family: "Microsoft YaHei"; font-size: 18px; @@ -19,16 +17,16 @@ /** 查询重置按钮 **/ QToolButton[class="btnOpposite"] { border-radius: 12px; - border: 1px solid #504897; + border: 1px solid #2F6FC6; background-color: #FFFFFF; - color: #504897; + color: #2F6FC6; font-family: "Microsoft YaHei"; font-size: 18px; } /** 表格顶端的标题栏 **/ QLabel[class="frameLabel"]{ - background-color: #504897; + background-color: #2F6FC6; border: 0px; border-radius: 0px; border-top-left-radius: 10px; @@ -87,11 +85,11 @@ } QComboBox[class="defaultSelect"] QAbstractItemView::item:hover{ color: #FFFFFF; - background-color: #504897; + background-color: #2F6FC6; } QComboBox[class="defaultSelect"] QAbstractItemView::item:selected{ color: #FFFFFF; - background-color: #504897; + background-color: #2F6FC6; } QComboBox[class="defaultSelect"] QScrollBar::vertical { width: 5px; @@ -100,7 +98,7 @@ } QComboBox[class="defaultSelect"] QScrollBar::handle::vertical { width: 5px; - background: #504897; + background: #2F6FC6; border: none; } QComboBox[class="defaultSelect"] QScrollBar::add-line::vertical { @@ -113,7 +111,7 @@ /** 查询普通按钮 **/ QWidget#wdgtQueryBox QToolButton { border-radius: 12px; - background-color: #504897; + background-color: #2F6FC6; color: #FFFFFF; font-family: "Microsoft YaHei"; font-size: 18px; @@ -121,9 +119,9 @@ /** 查询重置按钮 **/ QWidget#wdgtQueryBox QToolButton[class="btnResetQuery"] { border-radius: 12px; - border: 1px solid #504897; + border: 1px solid #2F6FC6; background-color: #FFFFFF; - color: #504897; + color: #2F6FC6; font-family: "Microsoft YaHei"; font-size: 18px; } @@ -136,7 +134,7 @@ } QTableWidget QHeaderView::section { - background-color: #504897; + background-color: #2F6FC6; border: 1px solid #FFFFFF; color: #FFFFFF; font-size: 18px; @@ -151,7 +149,7 @@ QTableWidget::item::selected { /*background: #FFFFFF; */ - color: #504897; + color: #2F6FC6; } QTableWidget QWidget[class="wdgtOper"] { @@ -189,7 +187,7 @@ /** 分页组件 **/ QWidget[class="wdgtPageBtn"] { - background: #504897; + background: #2F6FC6; border-radius: 6px; } QWidget[class="wdgtPageBtn"] QToolButton { @@ -203,7 +201,7 @@ /** 对话框弹窗顶端的标题栏 **/ QWidget[class="dlgTitle"]{ - background-color: #504897; + background-color: #2F6FC6; border: 0px; padding: 10px; } @@ -284,11 +282,11 @@ } QWidget[class="detailTable"] QComboBox QAbstractItemView::item:hover{ color: #FFFFFF; - background-color: #504897; + background-color: #2F6FC6; } QWidget[class="detailTable"] QComboBox QAbstractItemView::item:selected{ color: #FFFFFF; - background-color: #504897; + background-color: #2F6FC6; } QCheckBox[class="defaultSolid"] { @@ -301,14 +299,14 @@ width: 20px; height: 20px; border-radius: 5px; - border: 2px solid #504897; + border: 2px solid #2F6FC6; } QCheckBox[class="defaultSolid"]::indicator::unchecked { background: #FFFFFF; /*border: 2px solid #CCCCC;*/ } QCheckBox[class="defaultSolid"]::indicator::checked { - background: #504897; + background: #2F6FC6; } /* @@ -482,7 +480,7 @@ } /* 子标题样式 */ QWidget[class="subTitle"] QLabel { - color: #504897; + color: #2F6FC6; font-weight: bold; font-size: 20px; min-height: 40px; @@ -500,4 +498,4 @@ border: 1px solid #CCCCCC; font-size: 18px; } -*/ \ No newline at end of file +*/ diff --git a/AutoCalibrationXC.pro b/AutoCalibrationXC.pro index 6bcb335..7790b37 100644 --- a/AutoCalibrationXC.pro +++ b/AutoCalibrationXC.pro @@ -24,11 +24,6 @@ include(QPagedTable/QPagedTable.pri) SOURCES += main.cpp -SOURCES += MainWindow.cpp - -HEADERS += MainWindow.h - -FORMS += MainWindow.ui RC_ICONS = res/autoCalibration.ico diff --git a/MainWindow.cpp b/MainWindow.cpp deleted file mode 100644 index ff126e8..0000000 --- a/MainWindow.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#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/MainWindow.h b/MainWindow.h deleted file mode 100644 index 4643e32..0000000 --- a/MainWindow.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#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; -}; -#endif // MAINWINDOW_H diff --git a/MainWindow.ui b/MainWindow.ui deleted file mode 100644 index b232854..0000000 --- a/MainWindow.ui +++ /dev/null @@ -1,22 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 800 - 600 - - - - MainWindow - - - - - - - - diff --git a/frame/CustomMessageBox.ui b/frame/CustomMessageBox.ui index 336be54..b545d74 100644 --- a/frame/CustomMessageBox.ui +++ b/frame/CustomMessageBox.ui @@ -84,8 +84,8 @@ - - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + + :/image/msgbox/icon_box_close.png:/image/msgbox/icon_box_close.png @@ -134,7 +134,7 @@ - :/image/msgbox/icon_box_success.png + :/image/msgbox/icon_box_success.png Qt::AlignCenter @@ -265,6 +265,8 @@ - + + + diff --git a/frame/MainWindowForm.cpp b/frame/MainWindowForm.cpp index 2ded44b..ec82cd7 100644 --- a/frame/MainWindowForm.cpp +++ b/frame/MainWindowForm.cpp @@ -1,6 +1,8 @@ #include "MainWindowForm.h" #include "ui_MainWindowForm.h" +#include + MainWindowForm::MainWindowForm(QWidget *parent) : FramelessWindow(parent), ui(new Ui::MainWindowForm) @@ -12,7 +14,7 @@ initMenuWidgets(); initFunctionButtons(); - // 每秒更新 界面上没有地方能摆 暂时先不启动定时器 + // 每秒更新 connect(TimeCounterUtil::getInstance().clockTimer, &QTimer::timeout, this, &MainWindowForm::onUpdateTimestampHandler); TimeCounterUtil::getInstance().clockTimer->start(1000); @@ -34,6 +36,7 @@ void MainWindowForm::initForm() { setWindowFlags(Qt::FramelessWindowHint); // 设置全屏 + setWindowState(Qt::WindowState::WindowMaximized); this->setTitleBar(ui->wdgtTop); // 设置窗口位置和大小 move(0, 0); @@ -120,6 +123,22 @@ setWindowState(Qt::WindowMinimized | windowState()); } +void MainWindowForm::on_btnMaxWin_clicked() +{ + QScreen *screen = QGuiApplication::primaryScreen(); + QRect screenSize = screen->availableGeometry(); // 可用区域(排除任务栏) + + if (this->isMaximized()) { + resize(screenSize.width() * 0.8, screenSize.height() * 0.8); + move(QRandomGenerator::global()->bounded(10, 100), QRandomGenerator::global()->bounded(10, 50)); + this->showNormal(); + } else { + resize(screenSize.width(), screenSize.height()); + move(0, 0); + this->showMaximized(); + } +} + void MainWindowForm::on_btnCloseWin_clicked() { // 创建一个消息框 @@ -146,18 +165,9 @@ ui->labelTime->setText(now.toString("yyyy-MM-dd HH:mm:ss")); } -void MainWindowForm::on_btnMenuMax_clicked() -{ - if (this->isMaximized()) { - this->showNormal(); - } else { - this->showMaximized(); - } -} - void MainWindowForm::titleDblClick() { - on_btnMenuMax_clicked(); + on_btnMaxWin_clicked(); } void MainWindowForm::onMenuButtonsEabled(bool enable) { diff --git a/frame/MainWindowForm.h b/frame/MainWindowForm.h index 4d206b1..9b4eae4 100644 --- a/frame/MainWindowForm.h +++ b/frame/MainWindowForm.h @@ -45,11 +45,11 @@ private slots: void on_btnMinWin_clicked(); + void on_btnMaxWin_clicked(); void on_btnCloseWin_clicked(); void onFunctionButtonsAction(); void onUpdateTimestampHandler(); - void on_btnMenuMax_clicked(); void titleDblClick(); void onMenuButtonsEabled(bool enable); diff --git a/frame/MainWindowForm.ui b/frame/MainWindowForm.ui index bd42122..f37d171 100644 --- a/frame/MainWindowForm.ui +++ b/frame/MainWindowForm.ui @@ -41,7 +41,7 @@ 0 - 120 + 100 @@ -58,7 +58,7 @@ 20 - 0 + 20 @@ -88,8 +88,8 @@ - 120 - 120 + 150 + 100 @@ -107,6 +107,22 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + @@ -158,7 +174,7 @@ 100 - 84 + 72 @@ -166,7 +182,8 @@ - :/image/main/calibration.png:/image/main/calibration.png + :/image/main/icon_menu_calibration.png + :/image/main/icon_menu_calibration_selected.png:/image/main/icon_menu_calibration.png @@ -184,7 +201,7 @@ 100 - 84 + 72 @@ -192,7 +209,8 @@ - :/image/main/rawDataRecord.png:/image/main/rawDataRecord.png + :/image/main/icon_menu_check.png + :/image/main/icon_menu_check_selected.png:/image/main/icon_menu_check.png @@ -210,7 +228,7 @@ 100 - 84 + 72 @@ -218,7 +236,8 @@ - :/image/main/fileRes.png:/image/main/fileRes.png + :/image/main/icon_menu_infomation.png + :/image/main/icon_menu_infomation_checked.png:/image/main/icon_menu_infomation.png @@ -235,10 +254,147 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 50 + 20 + + + + + - 320 + 240 + 16777215 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 5 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + :/image/main/iconTemp.png + + + + + + + 34.5℃ + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + + + + :/image/main/iconHumi.png + + + + + + + 25%Rh + + + + + + + + + + + + + + 240 16777215 @@ -308,7 +464,7 @@ - :/image/main/icon_setting_p.png:/image/main/icon_setting_p.png + :/image/main/icon_setting.png:/image/main/icon_setting.png @@ -334,7 +490,33 @@ - :/image/main/icon_min_p.png:/image/main/icon_min_p.png + :/image/main/icon_min.png:/image/main/icon_min.png + + + + 32 + 32 + + + + + + + + + 40 + 40 + + + + 最小化 + + + + + + + :/image/main/icon_max.png:/image/main/icon_max.png @@ -360,7 +542,7 @@ - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + :/image/main/icon_close.png:/image/main/icon_close.png @@ -426,87 +608,9 @@ - - - - - 0 - 30 - - - - - 20 - - - 0 - - - 0 - - - 40 - - - 0 - - - - - Qt::Horizontal - - - - 1289 - 20 - - - - - - - - - - - - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 20 - - - - - - - - - - - - - - wdgtContent wdgtTop - wdgtFoot diff --git a/infomation/InfoMainForm.cpp b/infomation/InfoMainForm.cpp index c001199..5d0ffc8 100644 --- a/infomation/InfoMainForm.cpp +++ b/infomation/InfoMainForm.cpp @@ -21,9 +21,13 @@ void InfoMainForm::initForm() { + // 加载样式表 + QString qssStyle = QssFileUtils::loadQssFileContent(QApplication::applicationDirPath() + "/qss/infoMain.css"); + if (qssStyle.isEmpty() == false) { + this->setStyleSheet(qssStyle); // 仅本窗口生效 + } - - + ui->scrollArea->setWindowFlags(Qt::FramelessWindowHint); // 设置无边框 } void InfoMainForm::initSubMenuForms() { diff --git a/infomation/InfoMainForm.ui b/infomation/InfoMainForm.ui index 958a6b2..d9066dd 100644 --- a/infomation/InfoMainForm.ui +++ b/infomation/InfoMainForm.ui @@ -90,7 +90,7 @@ - 280 + 295 48 @@ -103,7 +103,7 @@ - 280 + 295 48 @@ -116,7 +116,7 @@ - 280 + 295 48 @@ -129,7 +129,7 @@ - 280 + 295 48 @@ -142,7 +142,7 @@ - 280 + 295 48 @@ -155,7 +155,7 @@ - 280 + 295 48 @@ -168,7 +168,7 @@ - 280 + 295 48 @@ -181,7 +181,7 @@ - 280 + 295 48 @@ -194,7 +194,7 @@ - 280 + 295 48 @@ -207,7 +207,7 @@ - 280 + 295 48 @@ -220,7 +220,7 @@ - 280 + 295 48 @@ -233,7 +233,7 @@ - 280 + 295 48 @@ -246,7 +246,7 @@ - 280 + 295 48 diff --git a/infomation/task/DeptTaskForm.cpp b/infomation/task/DeptTaskForm.cpp index ea21a9f..cc6bf31 100644 --- a/infomation/task/DeptTaskForm.cpp +++ b/infomation/task/DeptTaskForm.cpp @@ -18,12 +18,17 @@ delete ui; } -void DeptTaskForm::showEvent(QShowEvent *event) +void DeptTaskForm::showEvent(QShowEvent * event) { ui->tableDeptTask->adjustTableWidth(); getDeptTaskList(0); } +void DeptTaskForm::resizeEvent(QResizeEvent * event) +{ + ui->tableDeptTask->adjustTableWidth(); +} + void DeptTaskForm::initFormTable() { // 初始化查询条件 diff --git a/infomation/task/DeptTaskForm.h b/infomation/task/DeptTaskForm.h index 1055c36..3c1ad5b 100644 --- a/infomation/task/DeptTaskForm.h +++ b/infomation/task/DeptTaskForm.h @@ -21,7 +21,8 @@ ~DeptTaskForm(); protected: - void showEvent(QShowEvent *event) override; + void showEvent(QShowEvent * event) override; + void resizeEvent(QResizeEvent * event) override; private: Ui::DeptTaskForm *ui; diff --git a/main.cpp b/main.cpp index 525387e..0b78c87 100644 --- a/main.cpp +++ b/main.cpp @@ -1,5 +1,3 @@ -#include "MainWindow.h" - #include #include diff --git a/res/image/Index/u1176.svg b/res/image/Index/u1176.svg deleted file mode 100644 index c81ce8a..0000000 --- a/res/image/Index/u1176.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1180.svg b/res/image/Index/u1180.svg deleted file mode 100644 index 2ef24ab..0000000 --- a/res/image/Index/u1180.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1220.svg b/res/image/Index/u1220.svg deleted file mode 100644 index 43452aa..0000000 --- a/res/image/Index/u1220.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2158.svg b/res/image/Index/u2158.svg deleted file mode 100644 index fd249e0..0000000 --- a/res/image/Index/u2158.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u2188.svg b/res/image/Index/u2188.svg deleted file mode 100644 index 34f53c4..0000000 --- a/res/image/Index/u2188.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2189.svg b/res/image/Index/u2189.svg deleted file mode 100644 index 01a6bbb..0000000 --- a/res/image/Index/u2189.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2324.svg b/res/image/Index/u2324.svg deleted file mode 100644 index 797f1c5..0000000 --- a/res/image/Index/u2324.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2325.svg b/res/image/Index/u2325.svg deleted file mode 100644 index fefe01b..0000000 --- a/res/image/Index/u2325.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u642.svg b/res/image/Index/u642.svg deleted file mode 100644 index 33c9e0a..0000000 --- a/res/image/Index/u642.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u7406.svg b/res/image/Index/u7406.svg deleted file mode 100644 index 8a7a6d9..0000000 --- a/res/image/Index/u7406.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7453.svg b/res/image/Index/u7453.svg deleted file mode 100644 index 603c496..0000000 --- a/res/image/Index/u7453.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7458.svg b/res/image/Index/u7458.svg deleted file mode 100644 index b31087b..0000000 --- a/res/image/Index/u7458.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7488.svg b/res/image/Index/u7488.svg deleted file mode 100644 index 8baf439..0000000 --- a/res/image/Index/u7488.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7491.svg b/res/image/Index/u7491.svg deleted file mode 100644 index 3e41c10..0000000 --- a/res/image/Index/u7491.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7538.svg b/res/image/Index/u7538.svg deleted file mode 100644 index 417077d..0000000 --- a/res/image/Index/u7538.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u794.svg b/res/image/Index/u794.svg deleted file mode 100644 index e12cff7..0000000 --- a/res/image/Index/u794.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u8448.svg b/res/image/Index/u8448.svg deleted file mode 100644 index 7f6f4c0..0000000 --- a/res/image/Index/u8448.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u8458.svg b/res/image/Index/u8458.svg deleted file mode 100644 index 6d04a12..0000000 --- a/res/image/Index/u8458.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/main/bg_banner.png b/res/image/main/bg_banner.png new file mode 100644 index 0000000..26ddffd --- /dev/null +++ b/res/image/main/bg_banner.png Binary files differ diff --git a/res/image/main/iconHumi.png b/res/image/main/iconHumi.png index 4410d38..bd164e8 100644 --- a/res/image/main/iconHumi.png +++ b/res/image/main/iconHumi.png Binary files differ diff --git a/res/image/main/iconTemp.png b/res/image/main/iconTemp.png index 8fd059c..a2cfe4d 100644 --- a/res/image/main/iconTemp.png +++ b/res/image/main/iconTemp.png Binary files differ diff --git a/res/image/main/icon_close.png b/res/image/main/icon_close.png new file mode 100644 index 0000000..f3aa270 --- /dev/null +++ b/res/image/main/icon_close.png Binary files differ diff --git a/res/image/main/icon_close_p.png b/res/image/main/icon_close_p.png deleted file mode 100644 index b9ba30c..0000000 --- a/res/image/main/icon_close_p.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_main.png b/res/image/main/icon_main.png deleted file mode 100644 index 9d004d5..0000000 --- a/res/image/main/icon_main.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_max.png b/res/image/main/icon_max.png new file mode 100644 index 0000000..6cbf073 --- /dev/null +++ b/res/image/main/icon_max.png Binary files differ diff --git a/res/image/main/icon_menu_calibration.png b/res/image/main/icon_menu_calibration.png new file mode 100644 index 0000000..6fca8be --- /dev/null +++ b/res/image/main/icon_menu_calibration.png Binary files differ diff --git a/res/image/main/icon_menu_calibration_selected.png b/res/image/main/icon_menu_calibration_selected.png new file mode 100644 index 0000000..17f918f --- /dev/null +++ b/res/image/main/icon_menu_calibration_selected.png Binary files differ diff --git a/res/image/main/icon_menu_check.png b/res/image/main/icon_menu_check.png new file mode 100644 index 0000000..c3db5fa --- /dev/null +++ b/res/image/main/icon_menu_check.png Binary files differ diff --git a/res/image/main/icon_menu_check_selected.png b/res/image/main/icon_menu_check_selected.png new file mode 100644 index 0000000..9794c43 --- /dev/null +++ b/res/image/main/icon_menu_check_selected.png Binary files differ diff --git a/res/image/main/icon_menu_infomation.png b/res/image/main/icon_menu_infomation.png new file mode 100644 index 0000000..e272f4c --- /dev/null +++ b/res/image/main/icon_menu_infomation.png Binary files differ diff --git a/res/image/main/icon_menu_infomation_checked.png b/res/image/main/icon_menu_infomation_checked.png new file mode 100644 index 0000000..6122c7b --- /dev/null +++ b/res/image/main/icon_menu_infomation_checked.png Binary files differ diff --git a/res/image/main/icon_min.png b/res/image/main/icon_min.png new file mode 100644 index 0000000..2f524d9 --- /dev/null +++ b/res/image/main/icon_min.png Binary files differ diff --git a/res/image/main/icon_min_p.png b/res/image/main/icon_min_p.png deleted file mode 100644 index 93bd487..0000000 --- a/res/image/main/icon_min_p.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_quit_p.png b/res/image/main/icon_quit_p.png deleted file mode 100644 index 10d8bac..0000000 --- a/res/image/main/icon_quit_p.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_setting.png b/res/image/main/icon_setting.png new file mode 100644 index 0000000..8686833 --- /dev/null +++ b/res/image/main/icon_setting.png Binary files differ diff --git a/res/image/main/icon_setting_p.png b/res/image/main/icon_setting_p.png deleted file mode 100644 index f6645f1..0000000 --- a/res/image/main/icon_setting_p.png +++ /dev/null Binary files differ diff --git a/res/image/msgbox/icon_box_close.png b/res/image/msgbox/icon_box_close.png new file mode 100644 index 0000000..e9d00fb --- /dev/null +++ b/res/image/msgbox/icon_box_close.png Binary files differ diff --git a/res/images.qrc b/res/images.qrc index 68608e9..a6ba788 100644 --- a/res/images.qrc +++ b/res/images.qrc @@ -27,27 +27,9 @@ image/Index/u709.svg image/Index/u712.svg image/Index/u715.svg - image/Index/u1176.svg - image/Index/u1180.svg - image/Index/u1220.svg - image/Index/u7406.svg - image/Index/u7453.svg - image/Index/u7458.svg - image/Index/u7488.svg - image/Index/u7491.svg - image/Index/u7538.svg - image/Index/u2324.svg - image/Index/u2325.svg - image/Index/u2158.svg - image/Index/u8448.svg - image/Index/u8458.svg image/Index/u2327.svg image/Index/u5496.svg image/Index/u7313.svg - image/Index/u2188.svg - image/Index/u2189.svg - image/Index/u642.svg - image/Index/u794.svg image/Index/u5089.png image/Index/u138.png image/Index/btnPageFirst.png @@ -96,13 +78,6 @@ image/login/icon_min.png image/login/icon_setting.png image/login/icon_quit.png - image/main/icon_main.png - image/main/iconHumi.png - image/main/iconTemp.png - image/main/icon_close_p.png - image/main/icon_min_p.png - image/main/icon_quit_p.png - image/main/icon_setting_p.png image/main/arrow_down.png image/main/arrow_up.png image/main/icon_btn_pause.png @@ -115,5 +90,19 @@ image/msgbox/icon_box_warning.png image/msgbox/icon_box_fail.png image/login/logo.png + image/main/bg_banner.png + image/main/icon_close.png + image/main/icon_max.png + image/main/icon_min.png + image/main/icon_setting.png + image/main/iconHumi.png + image/main/iconTemp.png + image/main/icon_menu_calibration.png + image/main/icon_menu_calibration_selected.png + image/main/icon_menu_check.png + image/main/icon_menu_check_selected.png + image/main/icon_menu_infomation.png + image/main/icon_menu_infomation_checked.png + image/msgbox/icon_box_close.png diff --git a/res/qss.qrc b/res/qss.qrc index 56752bb..fbb36c0 100644 --- a/res/qss.qrc +++ b/res/qss.qrc @@ -1,14 +1,10 @@ - qss/Index.css qss/preCheck.css - qss/dialogcheckresul.css - qss/tf_testdevice.css - qss/generalStyle.css - qss/checkWin.css qss/loginForm.css qss/mainForm.css qss/baseInfomation.css qss/messageBox.css + qss/infoMain.css diff --git a/res/qss/Index.css b/res/qss/Index.css deleted file mode 100644 index 8842775..0000000 --- a/res/qss/Index.css +++ /dev/null @@ -1,190 +0,0 @@ -*{ -color:black; -} -QLabel { - font-family: "Microsoft YaHei"; -} -QWidget#centralwidget -{ -background-image: url(:/image/Index/u15.png); -background-color:white; -} -QToolButton#tb1:hover{ - background-image: url(:/image/Index/u26_mouseOver.svg); -} -QToolButton#tb2:hover{ - background-image: url(:/image/Index/u26_mouseOver.svg); -} -QToolButton#tb3:hover{ - background-image: url(:/image/Index/u26_mouseOver.svg); -}QToolButton#tb4:hover{ -background-image: url(:/image/Index/u26_mouseOver.svg); -}QToolButton#tb5:hover{ -background-image: url(:/image/Index/u26_mouseOver.svg); -} -QToolButton#tb6:hover{ - background-image: url(:/image/Index/u26_mouseOver.svg); -} -QToolButton#tb1{ -color: white; -background-image: url(:/image/Index/u26.svg); -font-weight: bold; -border-radius: 5px; -text-align: center; -margin:10; -margin-right: 180px; -font: 18pt 微软雅黑; -} -QToolButton#tb2{ -color: white; -background-image: url(:/image/Index/u26.svg); -font-weight: bold; -border-radius: 5px; -text-align: center; -margin:10; -margin-right: 180px; -font: 18pt 微软雅黑; -} -QToolButton#tb3{ -color: white; -background-image: url(:/image/Index/u26.svg); -font-weight: bold; -border-radius: 5px; -text-align: center; -margin:10; -margin-right: 180px; -font: 18pt 微软雅黑; -}QToolButton#tb4{ -color: white; -background-image: url(:/image/Index/u26.svg); -font-weight: bold; -border-radius: 5px; -text-align: center; -margin:10; -margin-right: 180px; -font: 18pt 微软雅黑; -}QToolButton#tb5{ -color: white; -background-image: url(:/image/Index/u26.svg); -font-weight: bold; -border-radius: 5px; -text-align: center; -margin:10; -margin-right: 180px; -font: 18pt 微软雅黑; -}QToolButton#tb6{ -color: white; -background-image: url(:/image/Index/u26.svg); -font-weight: bold; -border-radius: 5px; -text-align: center; -margin:10; -margin-right: 180px; -font: 18pt 微软雅黑; -} - -/******** NewCheckMethod页面 ********/ -QLabel#labelNcmInfo, QLabel#labelNcmGraph, QLabel#labelNcmConfig, QLabel#labelNcmComm { - font-size: 24px; - min-height: 40px; -} - -QLabel[class="ncmFormLabel"] { - font-size: 18px; - padding: 10px 20px; -} - -QLineEdit[class="ncmFormInput"] { - border-radius: 6px; - font-family: "Microsoft YaHei"; - color: #333333; - border: 1px solid #CCCCCC; - font-size: 18px; -} - -QDateEdit[class="ncmFormDate"] { - border-radius: 6px; - font-family: "Microsoft YaHei"; - border: 1px solid #CCCCCC; - font-size: 18px; -} - -QCheckBox { - color: #FFFFFF; - font-family: "Microsoft YaHei"; - font-size: 16px; - /*padding-left: 5px;*/ -} -QCheckBox::indicator { - width: 20px; - height: 20px; - border-radius: 5px; - border: 2px solid #2F6FC6; -} -QCheckBox::indicator::unchecked { - background: #FFFFFF; - /*border: 2px solid #CCCCC;*/ -} -QCheckBox::indicator::checked { - background: #2F6FC6; -} - -QComboBox { - border-radius: 6px; - font-family: "Microsoft YaHei"; - padding-left: 16px; - color: #333333; - border: 1px solid #CCCCCC; - font-size: 18px; -} - -QComboBox::down-arrow { - image: url(":/image/Index/arrowDown.png"); -} -QComboBox::down-arrow::on { - image: url(":/image/Index/arrowUp.png"); -} - -QComboBox::drop-down { - subcontrol-origin: padding; - subcontrol-position: top right; - width: 20px; - border: 0px; - padding-right: 15px; -} - -QComboBox QAbstractItemView { - color: #333333; - background-color: #E1E1ED; - selection-background-color: #2F6FC6; - selection-color: #FFFFFF; - font-family: "Microsoft YaHei"; - outline: 0px; -} - -QComboBox QAbstractItemView::item{ - min-height: 36px; - line-height: 36px; - color: #333333; - padding-left: 9px; - background-color: #FFFFFF; -} - -QComboBox QScrollBar::vertical { - width: 10px; - background: #FFFFFF; - border: none; -} - -QComboBox QScrollBar::handle::vertical { - width: 10px; - background: #2F6FC6; - border: none; -} - -QComboBox QScrollBar::add-line::vertical { - border: none; -} -QComboBox QScrollBar::sub-line::vertical { - border: none; -} diff --git a/res/qss/baseInfomation.css b/res/qss/baseInfomation.css index 636c382..1c6783c 100644 --- a/res/qss/baseInfomation.css +++ b/res/qss/baseInfomation.css @@ -1,5 +1,3 @@ -/*QPalette{background:#FFFFFF;}*/ - QWidget { background-color: #FFFFFF; } @@ -11,7 +9,7 @@ /** 普通按钮 **/ QToolButton[class="btnDefault"] { border-radius: 12px; - background-color: #504897; + background-color: #2F6FC6; color: #FFFFFF; font-family: "Microsoft YaHei"; font-size: 18px; @@ -19,16 +17,16 @@ /** 查询重置按钮 **/ QToolButton[class="btnOpposite"] { border-radius: 12px; - border: 1px solid #504897; + border: 1px solid #2F6FC6; background-color: #FFFFFF; - color: #504897; + color: #2F6FC6; font-family: "Microsoft YaHei"; font-size: 18px; } /** 表格顶端的标题栏 **/ QLabel[class="frameLabel"]{ - background-color: #504897; + background-color: #2F6FC6; border: 0px; border-radius: 0px; border-top-left-radius: 10px; @@ -87,11 +85,11 @@ } QComboBox[class="defaultSelect"] QAbstractItemView::item:hover{ color: #FFFFFF; - background-color: #504897; + background-color: #2F6FC6; } QComboBox[class="defaultSelect"] QAbstractItemView::item:selected{ color: #FFFFFF; - background-color: #504897; + background-color: #2F6FC6; } QComboBox[class="defaultSelect"] QScrollBar::vertical { width: 5px; @@ -100,7 +98,7 @@ } QComboBox[class="defaultSelect"] QScrollBar::handle::vertical { width: 5px; - background: #504897; + background: #2F6FC6; border: none; } QComboBox[class="defaultSelect"] QScrollBar::add-line::vertical { @@ -113,7 +111,7 @@ /** 查询普通按钮 **/ QWidget#wdgtQueryBox QToolButton { border-radius: 12px; - background-color: #504897; + background-color: #2F6FC6; color: #FFFFFF; font-family: "Microsoft YaHei"; font-size: 18px; @@ -121,9 +119,9 @@ /** 查询重置按钮 **/ QWidget#wdgtQueryBox QToolButton[class="btnResetQuery"] { border-radius: 12px; - border: 1px solid #504897; + border: 1px solid #2F6FC6; background-color: #FFFFFF; - color: #504897; + color: #2F6FC6; font-family: "Microsoft YaHei"; font-size: 18px; } @@ -136,7 +134,7 @@ } QTableWidget QHeaderView::section { - background-color: #504897; + background-color: #2F6FC6; border: 1px solid #FFFFFF; color: #FFFFFF; font-size: 18px; @@ -151,7 +149,7 @@ QTableWidget::item::selected { /*background: #FFFFFF; */ - color: #504897; + color: #2F6FC6; } QTableWidget QWidget[class="wdgtOper"] { @@ -189,7 +187,7 @@ /** 分页组件 **/ QWidget[class="wdgtPageBtn"] { - background: #504897; + background: #2F6FC6; border-radius: 6px; } QWidget[class="wdgtPageBtn"] QToolButton { @@ -203,7 +201,7 @@ /** 对话框弹窗顶端的标题栏 **/ QWidget[class="dlgTitle"]{ - background-color: #504897; + background-color: #2F6FC6; border: 0px; padding: 10px; } @@ -284,11 +282,11 @@ } QWidget[class="detailTable"] QComboBox QAbstractItemView::item:hover{ color: #FFFFFF; - background-color: #504897; + background-color: #2F6FC6; } QWidget[class="detailTable"] QComboBox QAbstractItemView::item:selected{ color: #FFFFFF; - background-color: #504897; + background-color: #2F6FC6; } QCheckBox[class="defaultSolid"] { @@ -301,14 +299,14 @@ width: 20px; height: 20px; border-radius: 5px; - border: 2px solid #504897; + border: 2px solid #2F6FC6; } QCheckBox[class="defaultSolid"]::indicator::unchecked { background: #FFFFFF; /*border: 2px solid #CCCCC;*/ } QCheckBox[class="defaultSolid"]::indicator::checked { - background: #504897; + background: #2F6FC6; } /* @@ -482,7 +480,7 @@ } /* 子标题样式 */ QWidget[class="subTitle"] QLabel { - color: #504897; + color: #2F6FC6; font-weight: bold; font-size: 20px; min-height: 40px; @@ -500,4 +498,4 @@ border: 1px solid #CCCCCC; font-size: 18px; } -*/ \ No newline at end of file +*/ diff --git a/res/qss/checkWin.css b/res/qss/checkWin.css deleted file mode 100644 index c5083da..0000000 --- a/res/qss/checkWin.css +++ /dev/null @@ -1,147 +0,0 @@ -QLabel { - font-family: Microsoft YaHei; - font-size: 18px; -} - -QPushButton[class="default"] { - font-family: Microsoft YaHei; - background-color:#504897; - font-size:16px; - font-weight: bold; - color:white; - border-radius: 5px; -} -QPushButton[class="default"]::hover { - color:white; - font-size: 17px; -} - -QPushButton[class="defEx"] { - font-family: Microsoft YaHei; - background-color:#169bd5; - font-size:16px; - font-weight: bold; - color:white; - border-radius: 5px; -} -QPushButton[class="defEx"]::hover { - color:white; - font-size: 17px; -} -QTableWidget[class="defTable"]{ - font-size: 22px; - color: #333333; - border: 1px solid #4b4b4b; - border-radius: 6px; - background-color: transparent; -} -QTableWidget[class="checkItemTable"]{ - font-size: 22px; - color: black; - border: 1px solid #4b4b4b; - border-radius: 6px; - background-color: white; -} -QTableWidget[class="checkItemTable"]::item::selected { - background: #504897; - color: #ffffff; -} -QTableWidget[class="defTable"]::item::selected { - background: #504897; - color: #ffffff; -} -QHeaderView[class="defTableHead"]::section{ - background-color: #504897; - border: 0px; - color: #ffffff; - font-size: 20px; -} -QLineEdit[class="Inputdef"]{ -background-color: white; /* 背景色:浅灰色 */ -border: 2px solid #cccccc; /* 边框:灰色 */ -border-radius: 8px; /* 圆角边框 */ -padding: 5px 10px; /* 内边距,增加输入区域的间距 */ -font-size: 20px; /* 字体大小 */ -font-family: "Segoe UI", sans-serif; /* 字体 */ -color: black; /* 字体颜色 */ -} -QLineEdit[class="Inputdef"]:focus { - border: 2px solid #f89a5c; - background-color: #ffffff; -} -QLineEdit[class="Inputdef"]:readonly { - background-color: #dddddd; - border: 1px solid #dddddd; - color: #636363; - -} -QWidget[class="defGBox"]{ - background-color:#f5ede0; - border: 1px solid #cccccc; - font-size: 18px; -} -QComboBox[class="Comboxdef"] { - background-color: white; - border: 1px solid #cccccc; - border-radius: 4px; - padding: 5px 10px; - font-size: 20px; - font-family: "Segoe UI", sans-serif; /* 字体 */ - color: black; /* 字体颜色 */ - min-width: 50px; /* 设置最小宽度 */ -} -QComboBox[class="Comboxdef"]:hover { - border: 1px solid #f89a5c; /* 鼠标悬浮时边框颜色变为绿色 */ -} - -QComboBox[class="Comboxdef"]:focus { - border: 1px solid #f89a5c; /* 聚焦时边框颜色变为 */ - background-color: #f9f9f9; /* 聚焦时背景色 */ -} - -QComboBox[class="Comboxdef"]::down-arrow { - - width: 12px; /* 设置箭头的宽度 */ - height: 12px; /* 设置箭头的高度 */ -} -QComboBox[class="Comboxdef"] QAbstractItemView { - border: 1px solid #cccccc; /* 下拉列表边框 */ - background-color: #ffffff; /* 下拉列表背景色 */ - selection-background-color: #f89a5c; /* 选中项背景色 */ - selection-color: white; /* 选中项文本颜色 */ - padding: 5px; /* 下拉项内边距 */ -} - -QComboBox[class="Comboxdef"]:disabled { - background-color: #dddddd; /* 禁用状态背景 */ - border: 1px solid #dddddd; /* 禁用状态下边框 */ - color: #636363; /* 禁用状态字体颜色 */ -} -QScrollArea[class="defscrollArea"]{ - background-color: transparent; -} - -QPushButton[class="defTest"] { - font-family: Microsoft YaHei; - background-color:#5481ba; - font-size:16px; - font-weight: bold; - color:white; - border-radius: 5px; -} -QPushButton[class="defTest"]::hover { - color:white; - font-size: 17px; -} -QPushButton[class="defTestStop"] { - font-family: Microsoft YaHei; - background-color:#e03d3e; - font-size:16px; - font-weight: bold; - color:white; - border-radius: 5px; -} -QPushButton[class="defTestStop"]::hover { - color:white; - font-size: 17px; -} diff --git a/AutoCalibrationXC.pro b/AutoCalibrationXC.pro index 6bcb335..7790b37 100644 --- a/AutoCalibrationXC.pro +++ b/AutoCalibrationXC.pro @@ -24,11 +24,6 @@ include(QPagedTable/QPagedTable.pri) SOURCES += main.cpp -SOURCES += MainWindow.cpp - -HEADERS += MainWindow.h - -FORMS += MainWindow.ui RC_ICONS = res/autoCalibration.ico diff --git a/MainWindow.cpp b/MainWindow.cpp deleted file mode 100644 index ff126e8..0000000 --- a/MainWindow.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#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/MainWindow.h b/MainWindow.h deleted file mode 100644 index 4643e32..0000000 --- a/MainWindow.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#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; -}; -#endif // MAINWINDOW_H diff --git a/MainWindow.ui b/MainWindow.ui deleted file mode 100644 index b232854..0000000 --- a/MainWindow.ui +++ /dev/null @@ -1,22 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 800 - 600 - - - - MainWindow - - - - - - - - diff --git a/frame/CustomMessageBox.ui b/frame/CustomMessageBox.ui index 336be54..b545d74 100644 --- a/frame/CustomMessageBox.ui +++ b/frame/CustomMessageBox.ui @@ -84,8 +84,8 @@ - - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + + :/image/msgbox/icon_box_close.png:/image/msgbox/icon_box_close.png @@ -134,7 +134,7 @@ - :/image/msgbox/icon_box_success.png + :/image/msgbox/icon_box_success.png Qt::AlignCenter @@ -265,6 +265,8 @@ - + + + diff --git a/frame/MainWindowForm.cpp b/frame/MainWindowForm.cpp index 2ded44b..ec82cd7 100644 --- a/frame/MainWindowForm.cpp +++ b/frame/MainWindowForm.cpp @@ -1,6 +1,8 @@ #include "MainWindowForm.h" #include "ui_MainWindowForm.h" +#include + MainWindowForm::MainWindowForm(QWidget *parent) : FramelessWindow(parent), ui(new Ui::MainWindowForm) @@ -12,7 +14,7 @@ initMenuWidgets(); initFunctionButtons(); - // 每秒更新 界面上没有地方能摆 暂时先不启动定时器 + // 每秒更新 connect(TimeCounterUtil::getInstance().clockTimer, &QTimer::timeout, this, &MainWindowForm::onUpdateTimestampHandler); TimeCounterUtil::getInstance().clockTimer->start(1000); @@ -34,6 +36,7 @@ void MainWindowForm::initForm() { setWindowFlags(Qt::FramelessWindowHint); // 设置全屏 + setWindowState(Qt::WindowState::WindowMaximized); this->setTitleBar(ui->wdgtTop); // 设置窗口位置和大小 move(0, 0); @@ -120,6 +123,22 @@ setWindowState(Qt::WindowMinimized | windowState()); } +void MainWindowForm::on_btnMaxWin_clicked() +{ + QScreen *screen = QGuiApplication::primaryScreen(); + QRect screenSize = screen->availableGeometry(); // 可用区域(排除任务栏) + + if (this->isMaximized()) { + resize(screenSize.width() * 0.8, screenSize.height() * 0.8); + move(QRandomGenerator::global()->bounded(10, 100), QRandomGenerator::global()->bounded(10, 50)); + this->showNormal(); + } else { + resize(screenSize.width(), screenSize.height()); + move(0, 0); + this->showMaximized(); + } +} + void MainWindowForm::on_btnCloseWin_clicked() { // 创建一个消息框 @@ -146,18 +165,9 @@ ui->labelTime->setText(now.toString("yyyy-MM-dd HH:mm:ss")); } -void MainWindowForm::on_btnMenuMax_clicked() -{ - if (this->isMaximized()) { - this->showNormal(); - } else { - this->showMaximized(); - } -} - void MainWindowForm::titleDblClick() { - on_btnMenuMax_clicked(); + on_btnMaxWin_clicked(); } void MainWindowForm::onMenuButtonsEabled(bool enable) { diff --git a/frame/MainWindowForm.h b/frame/MainWindowForm.h index 4d206b1..9b4eae4 100644 --- a/frame/MainWindowForm.h +++ b/frame/MainWindowForm.h @@ -45,11 +45,11 @@ private slots: void on_btnMinWin_clicked(); + void on_btnMaxWin_clicked(); void on_btnCloseWin_clicked(); void onFunctionButtonsAction(); void onUpdateTimestampHandler(); - void on_btnMenuMax_clicked(); void titleDblClick(); void onMenuButtonsEabled(bool enable); diff --git a/frame/MainWindowForm.ui b/frame/MainWindowForm.ui index bd42122..f37d171 100644 --- a/frame/MainWindowForm.ui +++ b/frame/MainWindowForm.ui @@ -41,7 +41,7 @@ 0 - 120 + 100 @@ -58,7 +58,7 @@ 20 - 0 + 20 @@ -88,8 +88,8 @@ - 120 - 120 + 150 + 100 @@ -107,6 +107,22 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + @@ -158,7 +174,7 @@ 100 - 84 + 72 @@ -166,7 +182,8 @@ - :/image/main/calibration.png:/image/main/calibration.png + :/image/main/icon_menu_calibration.png + :/image/main/icon_menu_calibration_selected.png:/image/main/icon_menu_calibration.png @@ -184,7 +201,7 @@ 100 - 84 + 72 @@ -192,7 +209,8 @@ - :/image/main/rawDataRecord.png:/image/main/rawDataRecord.png + :/image/main/icon_menu_check.png + :/image/main/icon_menu_check_selected.png:/image/main/icon_menu_check.png @@ -210,7 +228,7 @@ 100 - 84 + 72 @@ -218,7 +236,8 @@ - :/image/main/fileRes.png:/image/main/fileRes.png + :/image/main/icon_menu_infomation.png + :/image/main/icon_menu_infomation_checked.png:/image/main/icon_menu_infomation.png @@ -235,10 +254,147 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 50 + 20 + + + + + - 320 + 240 + 16777215 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 5 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + :/image/main/iconTemp.png + + + + + + + 34.5℃ + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + + + + :/image/main/iconHumi.png + + + + + + + 25%Rh + + + + + + + + + + + + + + 240 16777215 @@ -308,7 +464,7 @@ - :/image/main/icon_setting_p.png:/image/main/icon_setting_p.png + :/image/main/icon_setting.png:/image/main/icon_setting.png @@ -334,7 +490,33 @@ - :/image/main/icon_min_p.png:/image/main/icon_min_p.png + :/image/main/icon_min.png:/image/main/icon_min.png + + + + 32 + 32 + + + + + + + + + 40 + 40 + + + + 最小化 + + + + + + + :/image/main/icon_max.png:/image/main/icon_max.png @@ -360,7 +542,7 @@ - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + :/image/main/icon_close.png:/image/main/icon_close.png @@ -426,87 +608,9 @@ - - - - - 0 - 30 - - - - - 20 - - - 0 - - - 0 - - - 40 - - - 0 - - - - - Qt::Horizontal - - - - 1289 - 20 - - - - - - - - - - - - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 20 - - - - - - - - - - - - - - wdgtContent wdgtTop - wdgtFoot diff --git a/infomation/InfoMainForm.cpp b/infomation/InfoMainForm.cpp index c001199..5d0ffc8 100644 --- a/infomation/InfoMainForm.cpp +++ b/infomation/InfoMainForm.cpp @@ -21,9 +21,13 @@ void InfoMainForm::initForm() { + // 加载样式表 + QString qssStyle = QssFileUtils::loadQssFileContent(QApplication::applicationDirPath() + "/qss/infoMain.css"); + if (qssStyle.isEmpty() == false) { + this->setStyleSheet(qssStyle); // 仅本窗口生效 + } - - + ui->scrollArea->setWindowFlags(Qt::FramelessWindowHint); // 设置无边框 } void InfoMainForm::initSubMenuForms() { diff --git a/infomation/InfoMainForm.ui b/infomation/InfoMainForm.ui index 958a6b2..d9066dd 100644 --- a/infomation/InfoMainForm.ui +++ b/infomation/InfoMainForm.ui @@ -90,7 +90,7 @@ - 280 + 295 48 @@ -103,7 +103,7 @@ - 280 + 295 48 @@ -116,7 +116,7 @@ - 280 + 295 48 @@ -129,7 +129,7 @@ - 280 + 295 48 @@ -142,7 +142,7 @@ - 280 + 295 48 @@ -155,7 +155,7 @@ - 280 + 295 48 @@ -168,7 +168,7 @@ - 280 + 295 48 @@ -181,7 +181,7 @@ - 280 + 295 48 @@ -194,7 +194,7 @@ - 280 + 295 48 @@ -207,7 +207,7 @@ - 280 + 295 48 @@ -220,7 +220,7 @@ - 280 + 295 48 @@ -233,7 +233,7 @@ - 280 + 295 48 @@ -246,7 +246,7 @@ - 280 + 295 48 diff --git a/infomation/task/DeptTaskForm.cpp b/infomation/task/DeptTaskForm.cpp index ea21a9f..cc6bf31 100644 --- a/infomation/task/DeptTaskForm.cpp +++ b/infomation/task/DeptTaskForm.cpp @@ -18,12 +18,17 @@ delete ui; } -void DeptTaskForm::showEvent(QShowEvent *event) +void DeptTaskForm::showEvent(QShowEvent * event) { ui->tableDeptTask->adjustTableWidth(); getDeptTaskList(0); } +void DeptTaskForm::resizeEvent(QResizeEvent * event) +{ + ui->tableDeptTask->adjustTableWidth(); +} + void DeptTaskForm::initFormTable() { // 初始化查询条件 diff --git a/infomation/task/DeptTaskForm.h b/infomation/task/DeptTaskForm.h index 1055c36..3c1ad5b 100644 --- a/infomation/task/DeptTaskForm.h +++ b/infomation/task/DeptTaskForm.h @@ -21,7 +21,8 @@ ~DeptTaskForm(); protected: - void showEvent(QShowEvent *event) override; + void showEvent(QShowEvent * event) override; + void resizeEvent(QResizeEvent * event) override; private: Ui::DeptTaskForm *ui; diff --git a/main.cpp b/main.cpp index 525387e..0b78c87 100644 --- a/main.cpp +++ b/main.cpp @@ -1,5 +1,3 @@ -#include "MainWindow.h" - #include #include diff --git a/res/image/Index/u1176.svg b/res/image/Index/u1176.svg deleted file mode 100644 index c81ce8a..0000000 --- a/res/image/Index/u1176.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1180.svg b/res/image/Index/u1180.svg deleted file mode 100644 index 2ef24ab..0000000 --- a/res/image/Index/u1180.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1220.svg b/res/image/Index/u1220.svg deleted file mode 100644 index 43452aa..0000000 --- a/res/image/Index/u1220.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2158.svg b/res/image/Index/u2158.svg deleted file mode 100644 index fd249e0..0000000 --- a/res/image/Index/u2158.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u2188.svg b/res/image/Index/u2188.svg deleted file mode 100644 index 34f53c4..0000000 --- a/res/image/Index/u2188.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2189.svg b/res/image/Index/u2189.svg deleted file mode 100644 index 01a6bbb..0000000 --- a/res/image/Index/u2189.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2324.svg b/res/image/Index/u2324.svg deleted file mode 100644 index 797f1c5..0000000 --- a/res/image/Index/u2324.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2325.svg b/res/image/Index/u2325.svg deleted file mode 100644 index fefe01b..0000000 --- a/res/image/Index/u2325.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u642.svg b/res/image/Index/u642.svg deleted file mode 100644 index 33c9e0a..0000000 --- a/res/image/Index/u642.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u7406.svg b/res/image/Index/u7406.svg deleted file mode 100644 index 8a7a6d9..0000000 --- a/res/image/Index/u7406.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7453.svg b/res/image/Index/u7453.svg deleted file mode 100644 index 603c496..0000000 --- a/res/image/Index/u7453.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7458.svg b/res/image/Index/u7458.svg deleted file mode 100644 index b31087b..0000000 --- a/res/image/Index/u7458.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7488.svg b/res/image/Index/u7488.svg deleted file mode 100644 index 8baf439..0000000 --- a/res/image/Index/u7488.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7491.svg b/res/image/Index/u7491.svg deleted file mode 100644 index 3e41c10..0000000 --- a/res/image/Index/u7491.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7538.svg b/res/image/Index/u7538.svg deleted file mode 100644 index 417077d..0000000 --- a/res/image/Index/u7538.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u794.svg b/res/image/Index/u794.svg deleted file mode 100644 index e12cff7..0000000 --- a/res/image/Index/u794.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u8448.svg b/res/image/Index/u8448.svg deleted file mode 100644 index 7f6f4c0..0000000 --- a/res/image/Index/u8448.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u8458.svg b/res/image/Index/u8458.svg deleted file mode 100644 index 6d04a12..0000000 --- a/res/image/Index/u8458.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/main/bg_banner.png b/res/image/main/bg_banner.png new file mode 100644 index 0000000..26ddffd --- /dev/null +++ b/res/image/main/bg_banner.png Binary files differ diff --git a/res/image/main/iconHumi.png b/res/image/main/iconHumi.png index 4410d38..bd164e8 100644 --- a/res/image/main/iconHumi.png +++ b/res/image/main/iconHumi.png Binary files differ diff --git a/res/image/main/iconTemp.png b/res/image/main/iconTemp.png index 8fd059c..a2cfe4d 100644 --- a/res/image/main/iconTemp.png +++ b/res/image/main/iconTemp.png Binary files differ diff --git a/res/image/main/icon_close.png b/res/image/main/icon_close.png new file mode 100644 index 0000000..f3aa270 --- /dev/null +++ b/res/image/main/icon_close.png Binary files differ diff --git a/res/image/main/icon_close_p.png b/res/image/main/icon_close_p.png deleted file mode 100644 index b9ba30c..0000000 --- a/res/image/main/icon_close_p.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_main.png b/res/image/main/icon_main.png deleted file mode 100644 index 9d004d5..0000000 --- a/res/image/main/icon_main.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_max.png b/res/image/main/icon_max.png new file mode 100644 index 0000000..6cbf073 --- /dev/null +++ b/res/image/main/icon_max.png Binary files differ diff --git a/res/image/main/icon_menu_calibration.png b/res/image/main/icon_menu_calibration.png new file mode 100644 index 0000000..6fca8be --- /dev/null +++ b/res/image/main/icon_menu_calibration.png Binary files differ diff --git a/res/image/main/icon_menu_calibration_selected.png b/res/image/main/icon_menu_calibration_selected.png new file mode 100644 index 0000000..17f918f --- /dev/null +++ b/res/image/main/icon_menu_calibration_selected.png Binary files differ diff --git a/res/image/main/icon_menu_check.png b/res/image/main/icon_menu_check.png new file mode 100644 index 0000000..c3db5fa --- /dev/null +++ b/res/image/main/icon_menu_check.png Binary files differ diff --git a/res/image/main/icon_menu_check_selected.png b/res/image/main/icon_menu_check_selected.png new file mode 100644 index 0000000..9794c43 --- /dev/null +++ b/res/image/main/icon_menu_check_selected.png Binary files differ diff --git a/res/image/main/icon_menu_infomation.png b/res/image/main/icon_menu_infomation.png new file mode 100644 index 0000000..e272f4c --- /dev/null +++ b/res/image/main/icon_menu_infomation.png Binary files differ diff --git a/res/image/main/icon_menu_infomation_checked.png b/res/image/main/icon_menu_infomation_checked.png new file mode 100644 index 0000000..6122c7b --- /dev/null +++ b/res/image/main/icon_menu_infomation_checked.png Binary files differ diff --git a/res/image/main/icon_min.png b/res/image/main/icon_min.png new file mode 100644 index 0000000..2f524d9 --- /dev/null +++ b/res/image/main/icon_min.png Binary files differ diff --git a/res/image/main/icon_min_p.png b/res/image/main/icon_min_p.png deleted file mode 100644 index 93bd487..0000000 --- a/res/image/main/icon_min_p.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_quit_p.png b/res/image/main/icon_quit_p.png deleted file mode 100644 index 10d8bac..0000000 --- a/res/image/main/icon_quit_p.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_setting.png b/res/image/main/icon_setting.png new file mode 100644 index 0000000..8686833 --- /dev/null +++ b/res/image/main/icon_setting.png Binary files differ diff --git a/res/image/main/icon_setting_p.png b/res/image/main/icon_setting_p.png deleted file mode 100644 index f6645f1..0000000 --- a/res/image/main/icon_setting_p.png +++ /dev/null Binary files differ diff --git a/res/image/msgbox/icon_box_close.png b/res/image/msgbox/icon_box_close.png new file mode 100644 index 0000000..e9d00fb --- /dev/null +++ b/res/image/msgbox/icon_box_close.png Binary files differ diff --git a/res/images.qrc b/res/images.qrc index 68608e9..a6ba788 100644 --- a/res/images.qrc +++ b/res/images.qrc @@ -27,27 +27,9 @@ image/Index/u709.svg image/Index/u712.svg image/Index/u715.svg - image/Index/u1176.svg - image/Index/u1180.svg - image/Index/u1220.svg - image/Index/u7406.svg - image/Index/u7453.svg - image/Index/u7458.svg - image/Index/u7488.svg - image/Index/u7491.svg - image/Index/u7538.svg - image/Index/u2324.svg - image/Index/u2325.svg - image/Index/u2158.svg - image/Index/u8448.svg - image/Index/u8458.svg image/Index/u2327.svg image/Index/u5496.svg image/Index/u7313.svg - image/Index/u2188.svg - image/Index/u2189.svg - image/Index/u642.svg - image/Index/u794.svg image/Index/u5089.png image/Index/u138.png image/Index/btnPageFirst.png @@ -96,13 +78,6 @@ image/login/icon_min.png image/login/icon_setting.png image/login/icon_quit.png - image/main/icon_main.png - image/main/iconHumi.png - image/main/iconTemp.png - image/main/icon_close_p.png - image/main/icon_min_p.png - image/main/icon_quit_p.png - image/main/icon_setting_p.png image/main/arrow_down.png image/main/arrow_up.png image/main/icon_btn_pause.png @@ -115,5 +90,19 @@ image/msgbox/icon_box_warning.png image/msgbox/icon_box_fail.png image/login/logo.png + image/main/bg_banner.png + image/main/icon_close.png + image/main/icon_max.png + image/main/icon_min.png + image/main/icon_setting.png + image/main/iconHumi.png + image/main/iconTemp.png + image/main/icon_menu_calibration.png + image/main/icon_menu_calibration_selected.png + image/main/icon_menu_check.png + image/main/icon_menu_check_selected.png + image/main/icon_menu_infomation.png + image/main/icon_menu_infomation_checked.png + image/msgbox/icon_box_close.png diff --git a/res/qss.qrc b/res/qss.qrc index 56752bb..fbb36c0 100644 --- a/res/qss.qrc +++ b/res/qss.qrc @@ -1,14 +1,10 @@ - qss/Index.css qss/preCheck.css - qss/dialogcheckresul.css - qss/tf_testdevice.css - qss/generalStyle.css - qss/checkWin.css qss/loginForm.css qss/mainForm.css qss/baseInfomation.css qss/messageBox.css + qss/infoMain.css diff --git a/res/qss/Index.css b/res/qss/Index.css deleted file mode 100644 index 8842775..0000000 --- a/res/qss/Index.css +++ /dev/null @@ -1,190 +0,0 @@ -*{ -color:black; -} -QLabel { - font-family: "Microsoft YaHei"; -} -QWidget#centralwidget -{ -background-image: url(:/image/Index/u15.png); -background-color:white; -} -QToolButton#tb1:hover{ - background-image: url(:/image/Index/u26_mouseOver.svg); -} -QToolButton#tb2:hover{ - background-image: url(:/image/Index/u26_mouseOver.svg); -} -QToolButton#tb3:hover{ - background-image: url(:/image/Index/u26_mouseOver.svg); -}QToolButton#tb4:hover{ -background-image: url(:/image/Index/u26_mouseOver.svg); -}QToolButton#tb5:hover{ -background-image: url(:/image/Index/u26_mouseOver.svg); -} -QToolButton#tb6:hover{ - background-image: url(:/image/Index/u26_mouseOver.svg); -} -QToolButton#tb1{ -color: white; -background-image: url(:/image/Index/u26.svg); -font-weight: bold; -border-radius: 5px; -text-align: center; -margin:10; -margin-right: 180px; -font: 18pt 微软雅黑; -} -QToolButton#tb2{ -color: white; -background-image: url(:/image/Index/u26.svg); -font-weight: bold; -border-radius: 5px; -text-align: center; -margin:10; -margin-right: 180px; -font: 18pt 微软雅黑; -} -QToolButton#tb3{ -color: white; -background-image: url(:/image/Index/u26.svg); -font-weight: bold; -border-radius: 5px; -text-align: center; -margin:10; -margin-right: 180px; -font: 18pt 微软雅黑; -}QToolButton#tb4{ -color: white; -background-image: url(:/image/Index/u26.svg); -font-weight: bold; -border-radius: 5px; -text-align: center; -margin:10; -margin-right: 180px; -font: 18pt 微软雅黑; -}QToolButton#tb5{ -color: white; -background-image: url(:/image/Index/u26.svg); -font-weight: bold; -border-radius: 5px; -text-align: center; -margin:10; -margin-right: 180px; -font: 18pt 微软雅黑; -}QToolButton#tb6{ -color: white; -background-image: url(:/image/Index/u26.svg); -font-weight: bold; -border-radius: 5px; -text-align: center; -margin:10; -margin-right: 180px; -font: 18pt 微软雅黑; -} - -/******** NewCheckMethod页面 ********/ -QLabel#labelNcmInfo, QLabel#labelNcmGraph, QLabel#labelNcmConfig, QLabel#labelNcmComm { - font-size: 24px; - min-height: 40px; -} - -QLabel[class="ncmFormLabel"] { - font-size: 18px; - padding: 10px 20px; -} - -QLineEdit[class="ncmFormInput"] { - border-radius: 6px; - font-family: "Microsoft YaHei"; - color: #333333; - border: 1px solid #CCCCCC; - font-size: 18px; -} - -QDateEdit[class="ncmFormDate"] { - border-radius: 6px; - font-family: "Microsoft YaHei"; - border: 1px solid #CCCCCC; - font-size: 18px; -} - -QCheckBox { - color: #FFFFFF; - font-family: "Microsoft YaHei"; - font-size: 16px; - /*padding-left: 5px;*/ -} -QCheckBox::indicator { - width: 20px; - height: 20px; - border-radius: 5px; - border: 2px solid #2F6FC6; -} -QCheckBox::indicator::unchecked { - background: #FFFFFF; - /*border: 2px solid #CCCCC;*/ -} -QCheckBox::indicator::checked { - background: #2F6FC6; -} - -QComboBox { - border-radius: 6px; - font-family: "Microsoft YaHei"; - padding-left: 16px; - color: #333333; - border: 1px solid #CCCCCC; - font-size: 18px; -} - -QComboBox::down-arrow { - image: url(":/image/Index/arrowDown.png"); -} -QComboBox::down-arrow::on { - image: url(":/image/Index/arrowUp.png"); -} - -QComboBox::drop-down { - subcontrol-origin: padding; - subcontrol-position: top right; - width: 20px; - border: 0px; - padding-right: 15px; -} - -QComboBox QAbstractItemView { - color: #333333; - background-color: #E1E1ED; - selection-background-color: #2F6FC6; - selection-color: #FFFFFF; - font-family: "Microsoft YaHei"; - outline: 0px; -} - -QComboBox QAbstractItemView::item{ - min-height: 36px; - line-height: 36px; - color: #333333; - padding-left: 9px; - background-color: #FFFFFF; -} - -QComboBox QScrollBar::vertical { - width: 10px; - background: #FFFFFF; - border: none; -} - -QComboBox QScrollBar::handle::vertical { - width: 10px; - background: #2F6FC6; - border: none; -} - -QComboBox QScrollBar::add-line::vertical { - border: none; -} -QComboBox QScrollBar::sub-line::vertical { - border: none; -} diff --git a/res/qss/baseInfomation.css b/res/qss/baseInfomation.css index 636c382..1c6783c 100644 --- a/res/qss/baseInfomation.css +++ b/res/qss/baseInfomation.css @@ -1,5 +1,3 @@ -/*QPalette{background:#FFFFFF;}*/ - QWidget { background-color: #FFFFFF; } @@ -11,7 +9,7 @@ /** 普通按钮 **/ QToolButton[class="btnDefault"] { border-radius: 12px; - background-color: #504897; + background-color: #2F6FC6; color: #FFFFFF; font-family: "Microsoft YaHei"; font-size: 18px; @@ -19,16 +17,16 @@ /** 查询重置按钮 **/ QToolButton[class="btnOpposite"] { border-radius: 12px; - border: 1px solid #504897; + border: 1px solid #2F6FC6; background-color: #FFFFFF; - color: #504897; + color: #2F6FC6; font-family: "Microsoft YaHei"; font-size: 18px; } /** 表格顶端的标题栏 **/ QLabel[class="frameLabel"]{ - background-color: #504897; + background-color: #2F6FC6; border: 0px; border-radius: 0px; border-top-left-radius: 10px; @@ -87,11 +85,11 @@ } QComboBox[class="defaultSelect"] QAbstractItemView::item:hover{ color: #FFFFFF; - background-color: #504897; + background-color: #2F6FC6; } QComboBox[class="defaultSelect"] QAbstractItemView::item:selected{ color: #FFFFFF; - background-color: #504897; + background-color: #2F6FC6; } QComboBox[class="defaultSelect"] QScrollBar::vertical { width: 5px; @@ -100,7 +98,7 @@ } QComboBox[class="defaultSelect"] QScrollBar::handle::vertical { width: 5px; - background: #504897; + background: #2F6FC6; border: none; } QComboBox[class="defaultSelect"] QScrollBar::add-line::vertical { @@ -113,7 +111,7 @@ /** 查询普通按钮 **/ QWidget#wdgtQueryBox QToolButton { border-radius: 12px; - background-color: #504897; + background-color: #2F6FC6; color: #FFFFFF; font-family: "Microsoft YaHei"; font-size: 18px; @@ -121,9 +119,9 @@ /** 查询重置按钮 **/ QWidget#wdgtQueryBox QToolButton[class="btnResetQuery"] { border-radius: 12px; - border: 1px solid #504897; + border: 1px solid #2F6FC6; background-color: #FFFFFF; - color: #504897; + color: #2F6FC6; font-family: "Microsoft YaHei"; font-size: 18px; } @@ -136,7 +134,7 @@ } QTableWidget QHeaderView::section { - background-color: #504897; + background-color: #2F6FC6; border: 1px solid #FFFFFF; color: #FFFFFF; font-size: 18px; @@ -151,7 +149,7 @@ QTableWidget::item::selected { /*background: #FFFFFF; */ - color: #504897; + color: #2F6FC6; } QTableWidget QWidget[class="wdgtOper"] { @@ -189,7 +187,7 @@ /** 分页组件 **/ QWidget[class="wdgtPageBtn"] { - background: #504897; + background: #2F6FC6; border-radius: 6px; } QWidget[class="wdgtPageBtn"] QToolButton { @@ -203,7 +201,7 @@ /** 对话框弹窗顶端的标题栏 **/ QWidget[class="dlgTitle"]{ - background-color: #504897; + background-color: #2F6FC6; border: 0px; padding: 10px; } @@ -284,11 +282,11 @@ } QWidget[class="detailTable"] QComboBox QAbstractItemView::item:hover{ color: #FFFFFF; - background-color: #504897; + background-color: #2F6FC6; } QWidget[class="detailTable"] QComboBox QAbstractItemView::item:selected{ color: #FFFFFF; - background-color: #504897; + background-color: #2F6FC6; } QCheckBox[class="defaultSolid"] { @@ -301,14 +299,14 @@ width: 20px; height: 20px; border-radius: 5px; - border: 2px solid #504897; + border: 2px solid #2F6FC6; } QCheckBox[class="defaultSolid"]::indicator::unchecked { background: #FFFFFF; /*border: 2px solid #CCCCC;*/ } QCheckBox[class="defaultSolid"]::indicator::checked { - background: #504897; + background: #2F6FC6; } /* @@ -482,7 +480,7 @@ } /* 子标题样式 */ QWidget[class="subTitle"] QLabel { - color: #504897; + color: #2F6FC6; font-weight: bold; font-size: 20px; min-height: 40px; @@ -500,4 +498,4 @@ border: 1px solid #CCCCCC; font-size: 18px; } -*/ \ No newline at end of file +*/ diff --git a/res/qss/checkWin.css b/res/qss/checkWin.css deleted file mode 100644 index c5083da..0000000 --- a/res/qss/checkWin.css +++ /dev/null @@ -1,147 +0,0 @@ -QLabel { - font-family: Microsoft YaHei; - font-size: 18px; -} - -QPushButton[class="default"] { - font-family: Microsoft YaHei; - background-color:#504897; - font-size:16px; - font-weight: bold; - color:white; - border-radius: 5px; -} -QPushButton[class="default"]::hover { - color:white; - font-size: 17px; -} - -QPushButton[class="defEx"] { - font-family: Microsoft YaHei; - background-color:#169bd5; - font-size:16px; - font-weight: bold; - color:white; - border-radius: 5px; -} -QPushButton[class="defEx"]::hover { - color:white; - font-size: 17px; -} -QTableWidget[class="defTable"]{ - font-size: 22px; - color: #333333; - border: 1px solid #4b4b4b; - border-radius: 6px; - background-color: transparent; -} -QTableWidget[class="checkItemTable"]{ - font-size: 22px; - color: black; - border: 1px solid #4b4b4b; - border-radius: 6px; - background-color: white; -} -QTableWidget[class="checkItemTable"]::item::selected { - background: #504897; - color: #ffffff; -} -QTableWidget[class="defTable"]::item::selected { - background: #504897; - color: #ffffff; -} -QHeaderView[class="defTableHead"]::section{ - background-color: #504897; - border: 0px; - color: #ffffff; - font-size: 20px; -} -QLineEdit[class="Inputdef"]{ -background-color: white; /* 背景色:浅灰色 */ -border: 2px solid #cccccc; /* 边框:灰色 */ -border-radius: 8px; /* 圆角边框 */ -padding: 5px 10px; /* 内边距,增加输入区域的间距 */ -font-size: 20px; /* 字体大小 */ -font-family: "Segoe UI", sans-serif; /* 字体 */ -color: black; /* 字体颜色 */ -} -QLineEdit[class="Inputdef"]:focus { - border: 2px solid #f89a5c; - background-color: #ffffff; -} -QLineEdit[class="Inputdef"]:readonly { - background-color: #dddddd; - border: 1px solid #dddddd; - color: #636363; - -} -QWidget[class="defGBox"]{ - background-color:#f5ede0; - border: 1px solid #cccccc; - font-size: 18px; -} -QComboBox[class="Comboxdef"] { - background-color: white; - border: 1px solid #cccccc; - border-radius: 4px; - padding: 5px 10px; - font-size: 20px; - font-family: "Segoe UI", sans-serif; /* 字体 */ - color: black; /* 字体颜色 */ - min-width: 50px; /* 设置最小宽度 */ -} -QComboBox[class="Comboxdef"]:hover { - border: 1px solid #f89a5c; /* 鼠标悬浮时边框颜色变为绿色 */ -} - -QComboBox[class="Comboxdef"]:focus { - border: 1px solid #f89a5c; /* 聚焦时边框颜色变为 */ - background-color: #f9f9f9; /* 聚焦时背景色 */ -} - -QComboBox[class="Comboxdef"]::down-arrow { - - width: 12px; /* 设置箭头的宽度 */ - height: 12px; /* 设置箭头的高度 */ -} -QComboBox[class="Comboxdef"] QAbstractItemView { - border: 1px solid #cccccc; /* 下拉列表边框 */ - background-color: #ffffff; /* 下拉列表背景色 */ - selection-background-color: #f89a5c; /* 选中项背景色 */ - selection-color: white; /* 选中项文本颜色 */ - padding: 5px; /* 下拉项内边距 */ -} - -QComboBox[class="Comboxdef"]:disabled { - background-color: #dddddd; /* 禁用状态背景 */ - border: 1px solid #dddddd; /* 禁用状态下边框 */ - color: #636363; /* 禁用状态字体颜色 */ -} -QScrollArea[class="defscrollArea"]{ - background-color: transparent; -} - -QPushButton[class="defTest"] { - font-family: Microsoft YaHei; - background-color:#5481ba; - font-size:16px; - font-weight: bold; - color:white; - border-radius: 5px; -} -QPushButton[class="defTest"]::hover { - color:white; - font-size: 17px; -} -QPushButton[class="defTestStop"] { - font-family: Microsoft YaHei; - background-color:#e03d3e; - font-size:16px; - font-weight: bold; - color:white; - border-radius: 5px; -} -QPushButton[class="defTestStop"]::hover { - color:white; - font-size: 17px; -} diff --git a/res/qss/dialogcheckresul.css b/res/qss/dialogcheckresul.css deleted file mode 100644 index 0fd89db..0000000 --- a/res/qss/dialogcheckresul.css +++ /dev/null @@ -1,71 +0,0 @@ -QPushButton[class="ButtonSave"] { - -background-color: rgb(51, 69, 130); -color: rgb(255, 255, 255); -} -QPushButton[class="ButtonPrint"] { -background-color: rgb(100, 132, 68); -color: rgb(255, 255, 255); -} -QToolButton[class="ButtonSave"]::hover { -background-color: rgb(5, 69, 154); -} -QToolButton[class="ButtonSave"]:pressed { -background-color: rgb(3, 61, 139); -} -QComboBox[class="Comboxdef"] { - background-color: white; - border: 1px solid #cccccc; - border-radius: 4px; - padding: 5px 10px; - font-size: 20px; - font-family: "Segoe UI", sans-serif; /* 字体 */ - color: black; /* 字体颜色 */ - min-width: 50px; /* 设置最小宽度 */ -} -QComboBox[class="Comboxdef"]:hover { - border: 1px solid #f89a5c; /* 鼠标悬浮时边框颜色变为绿色 */ -} - -QComboBox[class="Comboxdef"]:focus { - border: 1px solid #f89a5c; /* 聚焦时边框颜色变为 */ - background-color: #f9f9f9; /* 聚焦时背景色 */ -} - -QComboBox[class="Comboxdef"]::down-arrow { - - width: 12px; /* 设置箭头的宽度 */ - height: 12px; /* 设置箭头的高度 */ -} -QComboBox[class="Comboxdef"] QAbstractItemView { - border: 1px solid #cccccc; /* 下拉列表边框 */ - background-color: #ffffff; /* 下拉列表背景色 */ - selection-background-color: #f89a5c; /* 选中项背景色 */ - selection-color: white; /* 选中项文本颜色 */ - padding: 5px; /* 下拉项内边距 */ -} - -QComboBox[class="Comboxdef"]:disabled { - background-color: #dddddd; /* 禁用状态背景 */ - border: 1px solid #dddddd; /* 禁用状态下边框 */ - color: #636363; /* 禁用状态字体颜色 */ -} -QLineEdit[class="Inputdef"]{ -background-color: white; /* 背景色:浅灰色 */ -border: 2px solid #cccccc; /* 边框:灰色 */ -border-radius: 8px; /* 圆角边框 */ -padding: 5px 10px; /* 内边距,增加输入区域的间距 */ -font-size: 20px; /* 字体大小 */ -font-family: "Segoe UI", sans-serif; /* 字体 */ -color: black; /* 字体颜色 */ -} -QLineEdit[class="Inputdef"]:focus { - border: 2px solid #f89a5c; - background-color: #ffffff; -} -QLineEdit[class="Inputdef"]:readonly { - background-color: #dddddd; - border: 1px solid #dddddd; - color: #636363; - -} diff --git a/AutoCalibrationXC.pro b/AutoCalibrationXC.pro index 6bcb335..7790b37 100644 --- a/AutoCalibrationXC.pro +++ b/AutoCalibrationXC.pro @@ -24,11 +24,6 @@ include(QPagedTable/QPagedTable.pri) SOURCES += main.cpp -SOURCES += MainWindow.cpp - -HEADERS += MainWindow.h - -FORMS += MainWindow.ui RC_ICONS = res/autoCalibration.ico diff --git a/MainWindow.cpp b/MainWindow.cpp deleted file mode 100644 index ff126e8..0000000 --- a/MainWindow.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#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/MainWindow.h b/MainWindow.h deleted file mode 100644 index 4643e32..0000000 --- a/MainWindow.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#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; -}; -#endif // MAINWINDOW_H diff --git a/MainWindow.ui b/MainWindow.ui deleted file mode 100644 index b232854..0000000 --- a/MainWindow.ui +++ /dev/null @@ -1,22 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 800 - 600 - - - - MainWindow - - - - - - - - diff --git a/frame/CustomMessageBox.ui b/frame/CustomMessageBox.ui index 336be54..b545d74 100644 --- a/frame/CustomMessageBox.ui +++ b/frame/CustomMessageBox.ui @@ -84,8 +84,8 @@ - - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + + :/image/msgbox/icon_box_close.png:/image/msgbox/icon_box_close.png @@ -134,7 +134,7 @@ - :/image/msgbox/icon_box_success.png + :/image/msgbox/icon_box_success.png Qt::AlignCenter @@ -265,6 +265,8 @@ - + + + diff --git a/frame/MainWindowForm.cpp b/frame/MainWindowForm.cpp index 2ded44b..ec82cd7 100644 --- a/frame/MainWindowForm.cpp +++ b/frame/MainWindowForm.cpp @@ -1,6 +1,8 @@ #include "MainWindowForm.h" #include "ui_MainWindowForm.h" +#include + MainWindowForm::MainWindowForm(QWidget *parent) : FramelessWindow(parent), ui(new Ui::MainWindowForm) @@ -12,7 +14,7 @@ initMenuWidgets(); initFunctionButtons(); - // 每秒更新 界面上没有地方能摆 暂时先不启动定时器 + // 每秒更新 connect(TimeCounterUtil::getInstance().clockTimer, &QTimer::timeout, this, &MainWindowForm::onUpdateTimestampHandler); TimeCounterUtil::getInstance().clockTimer->start(1000); @@ -34,6 +36,7 @@ void MainWindowForm::initForm() { setWindowFlags(Qt::FramelessWindowHint); // 设置全屏 + setWindowState(Qt::WindowState::WindowMaximized); this->setTitleBar(ui->wdgtTop); // 设置窗口位置和大小 move(0, 0); @@ -120,6 +123,22 @@ setWindowState(Qt::WindowMinimized | windowState()); } +void MainWindowForm::on_btnMaxWin_clicked() +{ + QScreen *screen = QGuiApplication::primaryScreen(); + QRect screenSize = screen->availableGeometry(); // 可用区域(排除任务栏) + + if (this->isMaximized()) { + resize(screenSize.width() * 0.8, screenSize.height() * 0.8); + move(QRandomGenerator::global()->bounded(10, 100), QRandomGenerator::global()->bounded(10, 50)); + this->showNormal(); + } else { + resize(screenSize.width(), screenSize.height()); + move(0, 0); + this->showMaximized(); + } +} + void MainWindowForm::on_btnCloseWin_clicked() { // 创建一个消息框 @@ -146,18 +165,9 @@ ui->labelTime->setText(now.toString("yyyy-MM-dd HH:mm:ss")); } -void MainWindowForm::on_btnMenuMax_clicked() -{ - if (this->isMaximized()) { - this->showNormal(); - } else { - this->showMaximized(); - } -} - void MainWindowForm::titleDblClick() { - on_btnMenuMax_clicked(); + on_btnMaxWin_clicked(); } void MainWindowForm::onMenuButtonsEabled(bool enable) { diff --git a/frame/MainWindowForm.h b/frame/MainWindowForm.h index 4d206b1..9b4eae4 100644 --- a/frame/MainWindowForm.h +++ b/frame/MainWindowForm.h @@ -45,11 +45,11 @@ private slots: void on_btnMinWin_clicked(); + void on_btnMaxWin_clicked(); void on_btnCloseWin_clicked(); void onFunctionButtonsAction(); void onUpdateTimestampHandler(); - void on_btnMenuMax_clicked(); void titleDblClick(); void onMenuButtonsEabled(bool enable); diff --git a/frame/MainWindowForm.ui b/frame/MainWindowForm.ui index bd42122..f37d171 100644 --- a/frame/MainWindowForm.ui +++ b/frame/MainWindowForm.ui @@ -41,7 +41,7 @@ 0 - 120 + 100 @@ -58,7 +58,7 @@ 20 - 0 + 20 @@ -88,8 +88,8 @@ - 120 - 120 + 150 + 100 @@ -107,6 +107,22 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + @@ -158,7 +174,7 @@ 100 - 84 + 72 @@ -166,7 +182,8 @@ - :/image/main/calibration.png:/image/main/calibration.png + :/image/main/icon_menu_calibration.png + :/image/main/icon_menu_calibration_selected.png:/image/main/icon_menu_calibration.png @@ -184,7 +201,7 @@ 100 - 84 + 72 @@ -192,7 +209,8 @@ - :/image/main/rawDataRecord.png:/image/main/rawDataRecord.png + :/image/main/icon_menu_check.png + :/image/main/icon_menu_check_selected.png:/image/main/icon_menu_check.png @@ -210,7 +228,7 @@ 100 - 84 + 72 @@ -218,7 +236,8 @@ - :/image/main/fileRes.png:/image/main/fileRes.png + :/image/main/icon_menu_infomation.png + :/image/main/icon_menu_infomation_checked.png:/image/main/icon_menu_infomation.png @@ -235,10 +254,147 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 50 + 20 + + + + + - 320 + 240 + 16777215 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 5 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + :/image/main/iconTemp.png + + + + + + + 34.5℃ + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + + + + :/image/main/iconHumi.png + + + + + + + 25%Rh + + + + + + + + + + + + + + 240 16777215 @@ -308,7 +464,7 @@ - :/image/main/icon_setting_p.png:/image/main/icon_setting_p.png + :/image/main/icon_setting.png:/image/main/icon_setting.png @@ -334,7 +490,33 @@ - :/image/main/icon_min_p.png:/image/main/icon_min_p.png + :/image/main/icon_min.png:/image/main/icon_min.png + + + + 32 + 32 + + + + + + + + + 40 + 40 + + + + 最小化 + + + + + + + :/image/main/icon_max.png:/image/main/icon_max.png @@ -360,7 +542,7 @@ - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + :/image/main/icon_close.png:/image/main/icon_close.png @@ -426,87 +608,9 @@ - - - - - 0 - 30 - - - - - 20 - - - 0 - - - 0 - - - 40 - - - 0 - - - - - Qt::Horizontal - - - - 1289 - 20 - - - - - - - - - - - - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 20 - - - - - - - - - - - - - - wdgtContent wdgtTop - wdgtFoot diff --git a/infomation/InfoMainForm.cpp b/infomation/InfoMainForm.cpp index c001199..5d0ffc8 100644 --- a/infomation/InfoMainForm.cpp +++ b/infomation/InfoMainForm.cpp @@ -21,9 +21,13 @@ void InfoMainForm::initForm() { + // 加载样式表 + QString qssStyle = QssFileUtils::loadQssFileContent(QApplication::applicationDirPath() + "/qss/infoMain.css"); + if (qssStyle.isEmpty() == false) { + this->setStyleSheet(qssStyle); // 仅本窗口生效 + } - - + ui->scrollArea->setWindowFlags(Qt::FramelessWindowHint); // 设置无边框 } void InfoMainForm::initSubMenuForms() { diff --git a/infomation/InfoMainForm.ui b/infomation/InfoMainForm.ui index 958a6b2..d9066dd 100644 --- a/infomation/InfoMainForm.ui +++ b/infomation/InfoMainForm.ui @@ -90,7 +90,7 @@ - 280 + 295 48 @@ -103,7 +103,7 @@ - 280 + 295 48 @@ -116,7 +116,7 @@ - 280 + 295 48 @@ -129,7 +129,7 @@ - 280 + 295 48 @@ -142,7 +142,7 @@ - 280 + 295 48 @@ -155,7 +155,7 @@ - 280 + 295 48 @@ -168,7 +168,7 @@ - 280 + 295 48 @@ -181,7 +181,7 @@ - 280 + 295 48 @@ -194,7 +194,7 @@ - 280 + 295 48 @@ -207,7 +207,7 @@ - 280 + 295 48 @@ -220,7 +220,7 @@ - 280 + 295 48 @@ -233,7 +233,7 @@ - 280 + 295 48 @@ -246,7 +246,7 @@ - 280 + 295 48 diff --git a/infomation/task/DeptTaskForm.cpp b/infomation/task/DeptTaskForm.cpp index ea21a9f..cc6bf31 100644 --- a/infomation/task/DeptTaskForm.cpp +++ b/infomation/task/DeptTaskForm.cpp @@ -18,12 +18,17 @@ delete ui; } -void DeptTaskForm::showEvent(QShowEvent *event) +void DeptTaskForm::showEvent(QShowEvent * event) { ui->tableDeptTask->adjustTableWidth(); getDeptTaskList(0); } +void DeptTaskForm::resizeEvent(QResizeEvent * event) +{ + ui->tableDeptTask->adjustTableWidth(); +} + void DeptTaskForm::initFormTable() { // 初始化查询条件 diff --git a/infomation/task/DeptTaskForm.h b/infomation/task/DeptTaskForm.h index 1055c36..3c1ad5b 100644 --- a/infomation/task/DeptTaskForm.h +++ b/infomation/task/DeptTaskForm.h @@ -21,7 +21,8 @@ ~DeptTaskForm(); protected: - void showEvent(QShowEvent *event) override; + void showEvent(QShowEvent * event) override; + void resizeEvent(QResizeEvent * event) override; private: Ui::DeptTaskForm *ui; diff --git a/main.cpp b/main.cpp index 525387e..0b78c87 100644 --- a/main.cpp +++ b/main.cpp @@ -1,5 +1,3 @@ -#include "MainWindow.h" - #include #include diff --git a/res/image/Index/u1176.svg b/res/image/Index/u1176.svg deleted file mode 100644 index c81ce8a..0000000 --- a/res/image/Index/u1176.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1180.svg b/res/image/Index/u1180.svg deleted file mode 100644 index 2ef24ab..0000000 --- a/res/image/Index/u1180.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1220.svg b/res/image/Index/u1220.svg deleted file mode 100644 index 43452aa..0000000 --- a/res/image/Index/u1220.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2158.svg b/res/image/Index/u2158.svg deleted file mode 100644 index fd249e0..0000000 --- a/res/image/Index/u2158.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u2188.svg b/res/image/Index/u2188.svg deleted file mode 100644 index 34f53c4..0000000 --- a/res/image/Index/u2188.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2189.svg b/res/image/Index/u2189.svg deleted file mode 100644 index 01a6bbb..0000000 --- a/res/image/Index/u2189.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2324.svg b/res/image/Index/u2324.svg deleted file mode 100644 index 797f1c5..0000000 --- a/res/image/Index/u2324.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2325.svg b/res/image/Index/u2325.svg deleted file mode 100644 index fefe01b..0000000 --- a/res/image/Index/u2325.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u642.svg b/res/image/Index/u642.svg deleted file mode 100644 index 33c9e0a..0000000 --- a/res/image/Index/u642.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u7406.svg b/res/image/Index/u7406.svg deleted file mode 100644 index 8a7a6d9..0000000 --- a/res/image/Index/u7406.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7453.svg b/res/image/Index/u7453.svg deleted file mode 100644 index 603c496..0000000 --- a/res/image/Index/u7453.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7458.svg b/res/image/Index/u7458.svg deleted file mode 100644 index b31087b..0000000 --- a/res/image/Index/u7458.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7488.svg b/res/image/Index/u7488.svg deleted file mode 100644 index 8baf439..0000000 --- a/res/image/Index/u7488.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7491.svg b/res/image/Index/u7491.svg deleted file mode 100644 index 3e41c10..0000000 --- a/res/image/Index/u7491.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7538.svg b/res/image/Index/u7538.svg deleted file mode 100644 index 417077d..0000000 --- a/res/image/Index/u7538.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u794.svg b/res/image/Index/u794.svg deleted file mode 100644 index e12cff7..0000000 --- a/res/image/Index/u794.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u8448.svg b/res/image/Index/u8448.svg deleted file mode 100644 index 7f6f4c0..0000000 --- a/res/image/Index/u8448.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u8458.svg b/res/image/Index/u8458.svg deleted file mode 100644 index 6d04a12..0000000 --- a/res/image/Index/u8458.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/main/bg_banner.png b/res/image/main/bg_banner.png new file mode 100644 index 0000000..26ddffd --- /dev/null +++ b/res/image/main/bg_banner.png Binary files differ diff --git a/res/image/main/iconHumi.png b/res/image/main/iconHumi.png index 4410d38..bd164e8 100644 --- a/res/image/main/iconHumi.png +++ b/res/image/main/iconHumi.png Binary files differ diff --git a/res/image/main/iconTemp.png b/res/image/main/iconTemp.png index 8fd059c..a2cfe4d 100644 --- a/res/image/main/iconTemp.png +++ b/res/image/main/iconTemp.png Binary files differ diff --git a/res/image/main/icon_close.png b/res/image/main/icon_close.png new file mode 100644 index 0000000..f3aa270 --- /dev/null +++ b/res/image/main/icon_close.png Binary files differ diff --git a/res/image/main/icon_close_p.png b/res/image/main/icon_close_p.png deleted file mode 100644 index b9ba30c..0000000 --- a/res/image/main/icon_close_p.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_main.png b/res/image/main/icon_main.png deleted file mode 100644 index 9d004d5..0000000 --- a/res/image/main/icon_main.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_max.png b/res/image/main/icon_max.png new file mode 100644 index 0000000..6cbf073 --- /dev/null +++ b/res/image/main/icon_max.png Binary files differ diff --git a/res/image/main/icon_menu_calibration.png b/res/image/main/icon_menu_calibration.png new file mode 100644 index 0000000..6fca8be --- /dev/null +++ b/res/image/main/icon_menu_calibration.png Binary files differ diff --git a/res/image/main/icon_menu_calibration_selected.png b/res/image/main/icon_menu_calibration_selected.png new file mode 100644 index 0000000..17f918f --- /dev/null +++ b/res/image/main/icon_menu_calibration_selected.png Binary files differ diff --git a/res/image/main/icon_menu_check.png b/res/image/main/icon_menu_check.png new file mode 100644 index 0000000..c3db5fa --- /dev/null +++ b/res/image/main/icon_menu_check.png Binary files differ diff --git a/res/image/main/icon_menu_check_selected.png b/res/image/main/icon_menu_check_selected.png new file mode 100644 index 0000000..9794c43 --- /dev/null +++ b/res/image/main/icon_menu_check_selected.png Binary files differ diff --git a/res/image/main/icon_menu_infomation.png b/res/image/main/icon_menu_infomation.png new file mode 100644 index 0000000..e272f4c --- /dev/null +++ b/res/image/main/icon_menu_infomation.png Binary files differ diff --git a/res/image/main/icon_menu_infomation_checked.png b/res/image/main/icon_menu_infomation_checked.png new file mode 100644 index 0000000..6122c7b --- /dev/null +++ b/res/image/main/icon_menu_infomation_checked.png Binary files differ diff --git a/res/image/main/icon_min.png b/res/image/main/icon_min.png new file mode 100644 index 0000000..2f524d9 --- /dev/null +++ b/res/image/main/icon_min.png Binary files differ diff --git a/res/image/main/icon_min_p.png b/res/image/main/icon_min_p.png deleted file mode 100644 index 93bd487..0000000 --- a/res/image/main/icon_min_p.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_quit_p.png b/res/image/main/icon_quit_p.png deleted file mode 100644 index 10d8bac..0000000 --- a/res/image/main/icon_quit_p.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_setting.png b/res/image/main/icon_setting.png new file mode 100644 index 0000000..8686833 --- /dev/null +++ b/res/image/main/icon_setting.png Binary files differ diff --git a/res/image/main/icon_setting_p.png b/res/image/main/icon_setting_p.png deleted file mode 100644 index f6645f1..0000000 --- a/res/image/main/icon_setting_p.png +++ /dev/null Binary files differ diff --git a/res/image/msgbox/icon_box_close.png b/res/image/msgbox/icon_box_close.png new file mode 100644 index 0000000..e9d00fb --- /dev/null +++ b/res/image/msgbox/icon_box_close.png Binary files differ diff --git a/res/images.qrc b/res/images.qrc index 68608e9..a6ba788 100644 --- a/res/images.qrc +++ b/res/images.qrc @@ -27,27 +27,9 @@ image/Index/u709.svg image/Index/u712.svg image/Index/u715.svg - image/Index/u1176.svg - image/Index/u1180.svg - image/Index/u1220.svg - image/Index/u7406.svg - image/Index/u7453.svg - image/Index/u7458.svg - image/Index/u7488.svg - image/Index/u7491.svg - image/Index/u7538.svg - image/Index/u2324.svg - image/Index/u2325.svg - image/Index/u2158.svg - image/Index/u8448.svg - image/Index/u8458.svg image/Index/u2327.svg image/Index/u5496.svg image/Index/u7313.svg - image/Index/u2188.svg - image/Index/u2189.svg - image/Index/u642.svg - image/Index/u794.svg image/Index/u5089.png image/Index/u138.png image/Index/btnPageFirst.png @@ -96,13 +78,6 @@ image/login/icon_min.png image/login/icon_setting.png image/login/icon_quit.png - image/main/icon_main.png - image/main/iconHumi.png - image/main/iconTemp.png - image/main/icon_close_p.png - image/main/icon_min_p.png - image/main/icon_quit_p.png - image/main/icon_setting_p.png image/main/arrow_down.png image/main/arrow_up.png image/main/icon_btn_pause.png @@ -115,5 +90,19 @@ image/msgbox/icon_box_warning.png image/msgbox/icon_box_fail.png image/login/logo.png + image/main/bg_banner.png + image/main/icon_close.png + image/main/icon_max.png + image/main/icon_min.png + image/main/icon_setting.png + image/main/iconHumi.png + image/main/iconTemp.png + image/main/icon_menu_calibration.png + image/main/icon_menu_calibration_selected.png + image/main/icon_menu_check.png + image/main/icon_menu_check_selected.png + image/main/icon_menu_infomation.png + image/main/icon_menu_infomation_checked.png + image/msgbox/icon_box_close.png diff --git a/res/qss.qrc b/res/qss.qrc index 56752bb..fbb36c0 100644 --- a/res/qss.qrc +++ b/res/qss.qrc @@ -1,14 +1,10 @@ - qss/Index.css qss/preCheck.css - qss/dialogcheckresul.css - qss/tf_testdevice.css - qss/generalStyle.css - qss/checkWin.css qss/loginForm.css qss/mainForm.css qss/baseInfomation.css qss/messageBox.css + qss/infoMain.css diff --git a/res/qss/Index.css b/res/qss/Index.css deleted file mode 100644 index 8842775..0000000 --- a/res/qss/Index.css +++ /dev/null @@ -1,190 +0,0 @@ -*{ -color:black; -} -QLabel { - font-family: "Microsoft YaHei"; -} -QWidget#centralwidget -{ -background-image: url(:/image/Index/u15.png); -background-color:white; -} -QToolButton#tb1:hover{ - background-image: url(:/image/Index/u26_mouseOver.svg); -} -QToolButton#tb2:hover{ - background-image: url(:/image/Index/u26_mouseOver.svg); -} -QToolButton#tb3:hover{ - background-image: url(:/image/Index/u26_mouseOver.svg); -}QToolButton#tb4:hover{ -background-image: url(:/image/Index/u26_mouseOver.svg); -}QToolButton#tb5:hover{ -background-image: url(:/image/Index/u26_mouseOver.svg); -} -QToolButton#tb6:hover{ - background-image: url(:/image/Index/u26_mouseOver.svg); -} -QToolButton#tb1{ -color: white; -background-image: url(:/image/Index/u26.svg); -font-weight: bold; -border-radius: 5px; -text-align: center; -margin:10; -margin-right: 180px; -font: 18pt 微软雅黑; -} -QToolButton#tb2{ -color: white; -background-image: url(:/image/Index/u26.svg); -font-weight: bold; -border-radius: 5px; -text-align: center; -margin:10; -margin-right: 180px; -font: 18pt 微软雅黑; -} -QToolButton#tb3{ -color: white; -background-image: url(:/image/Index/u26.svg); -font-weight: bold; -border-radius: 5px; -text-align: center; -margin:10; -margin-right: 180px; -font: 18pt 微软雅黑; -}QToolButton#tb4{ -color: white; -background-image: url(:/image/Index/u26.svg); -font-weight: bold; -border-radius: 5px; -text-align: center; -margin:10; -margin-right: 180px; -font: 18pt 微软雅黑; -}QToolButton#tb5{ -color: white; -background-image: url(:/image/Index/u26.svg); -font-weight: bold; -border-radius: 5px; -text-align: center; -margin:10; -margin-right: 180px; -font: 18pt 微软雅黑; -}QToolButton#tb6{ -color: white; -background-image: url(:/image/Index/u26.svg); -font-weight: bold; -border-radius: 5px; -text-align: center; -margin:10; -margin-right: 180px; -font: 18pt 微软雅黑; -} - -/******** NewCheckMethod页面 ********/ -QLabel#labelNcmInfo, QLabel#labelNcmGraph, QLabel#labelNcmConfig, QLabel#labelNcmComm { - font-size: 24px; - min-height: 40px; -} - -QLabel[class="ncmFormLabel"] { - font-size: 18px; - padding: 10px 20px; -} - -QLineEdit[class="ncmFormInput"] { - border-radius: 6px; - font-family: "Microsoft YaHei"; - color: #333333; - border: 1px solid #CCCCCC; - font-size: 18px; -} - -QDateEdit[class="ncmFormDate"] { - border-radius: 6px; - font-family: "Microsoft YaHei"; - border: 1px solid #CCCCCC; - font-size: 18px; -} - -QCheckBox { - color: #FFFFFF; - font-family: "Microsoft YaHei"; - font-size: 16px; - /*padding-left: 5px;*/ -} -QCheckBox::indicator { - width: 20px; - height: 20px; - border-radius: 5px; - border: 2px solid #2F6FC6; -} -QCheckBox::indicator::unchecked { - background: #FFFFFF; - /*border: 2px solid #CCCCC;*/ -} -QCheckBox::indicator::checked { - background: #2F6FC6; -} - -QComboBox { - border-radius: 6px; - font-family: "Microsoft YaHei"; - padding-left: 16px; - color: #333333; - border: 1px solid #CCCCCC; - font-size: 18px; -} - -QComboBox::down-arrow { - image: url(":/image/Index/arrowDown.png"); -} -QComboBox::down-arrow::on { - image: url(":/image/Index/arrowUp.png"); -} - -QComboBox::drop-down { - subcontrol-origin: padding; - subcontrol-position: top right; - width: 20px; - border: 0px; - padding-right: 15px; -} - -QComboBox QAbstractItemView { - color: #333333; - background-color: #E1E1ED; - selection-background-color: #2F6FC6; - selection-color: #FFFFFF; - font-family: "Microsoft YaHei"; - outline: 0px; -} - -QComboBox QAbstractItemView::item{ - min-height: 36px; - line-height: 36px; - color: #333333; - padding-left: 9px; - background-color: #FFFFFF; -} - -QComboBox QScrollBar::vertical { - width: 10px; - background: #FFFFFF; - border: none; -} - -QComboBox QScrollBar::handle::vertical { - width: 10px; - background: #2F6FC6; - border: none; -} - -QComboBox QScrollBar::add-line::vertical { - border: none; -} -QComboBox QScrollBar::sub-line::vertical { - border: none; -} diff --git a/res/qss/baseInfomation.css b/res/qss/baseInfomation.css index 636c382..1c6783c 100644 --- a/res/qss/baseInfomation.css +++ b/res/qss/baseInfomation.css @@ -1,5 +1,3 @@ -/*QPalette{background:#FFFFFF;}*/ - QWidget { background-color: #FFFFFF; } @@ -11,7 +9,7 @@ /** 普通按钮 **/ QToolButton[class="btnDefault"] { border-radius: 12px; - background-color: #504897; + background-color: #2F6FC6; color: #FFFFFF; font-family: "Microsoft YaHei"; font-size: 18px; @@ -19,16 +17,16 @@ /** 查询重置按钮 **/ QToolButton[class="btnOpposite"] { border-radius: 12px; - border: 1px solid #504897; + border: 1px solid #2F6FC6; background-color: #FFFFFF; - color: #504897; + color: #2F6FC6; font-family: "Microsoft YaHei"; font-size: 18px; } /** 表格顶端的标题栏 **/ QLabel[class="frameLabel"]{ - background-color: #504897; + background-color: #2F6FC6; border: 0px; border-radius: 0px; border-top-left-radius: 10px; @@ -87,11 +85,11 @@ } QComboBox[class="defaultSelect"] QAbstractItemView::item:hover{ color: #FFFFFF; - background-color: #504897; + background-color: #2F6FC6; } QComboBox[class="defaultSelect"] QAbstractItemView::item:selected{ color: #FFFFFF; - background-color: #504897; + background-color: #2F6FC6; } QComboBox[class="defaultSelect"] QScrollBar::vertical { width: 5px; @@ -100,7 +98,7 @@ } QComboBox[class="defaultSelect"] QScrollBar::handle::vertical { width: 5px; - background: #504897; + background: #2F6FC6; border: none; } QComboBox[class="defaultSelect"] QScrollBar::add-line::vertical { @@ -113,7 +111,7 @@ /** 查询普通按钮 **/ QWidget#wdgtQueryBox QToolButton { border-radius: 12px; - background-color: #504897; + background-color: #2F6FC6; color: #FFFFFF; font-family: "Microsoft YaHei"; font-size: 18px; @@ -121,9 +119,9 @@ /** 查询重置按钮 **/ QWidget#wdgtQueryBox QToolButton[class="btnResetQuery"] { border-radius: 12px; - border: 1px solid #504897; + border: 1px solid #2F6FC6; background-color: #FFFFFF; - color: #504897; + color: #2F6FC6; font-family: "Microsoft YaHei"; font-size: 18px; } @@ -136,7 +134,7 @@ } QTableWidget QHeaderView::section { - background-color: #504897; + background-color: #2F6FC6; border: 1px solid #FFFFFF; color: #FFFFFF; font-size: 18px; @@ -151,7 +149,7 @@ QTableWidget::item::selected { /*background: #FFFFFF; */ - color: #504897; + color: #2F6FC6; } QTableWidget QWidget[class="wdgtOper"] { @@ -189,7 +187,7 @@ /** 分页组件 **/ QWidget[class="wdgtPageBtn"] { - background: #504897; + background: #2F6FC6; border-radius: 6px; } QWidget[class="wdgtPageBtn"] QToolButton { @@ -203,7 +201,7 @@ /** 对话框弹窗顶端的标题栏 **/ QWidget[class="dlgTitle"]{ - background-color: #504897; + background-color: #2F6FC6; border: 0px; padding: 10px; } @@ -284,11 +282,11 @@ } QWidget[class="detailTable"] QComboBox QAbstractItemView::item:hover{ color: #FFFFFF; - background-color: #504897; + background-color: #2F6FC6; } QWidget[class="detailTable"] QComboBox QAbstractItemView::item:selected{ color: #FFFFFF; - background-color: #504897; + background-color: #2F6FC6; } QCheckBox[class="defaultSolid"] { @@ -301,14 +299,14 @@ width: 20px; height: 20px; border-radius: 5px; - border: 2px solid #504897; + border: 2px solid #2F6FC6; } QCheckBox[class="defaultSolid"]::indicator::unchecked { background: #FFFFFF; /*border: 2px solid #CCCCC;*/ } QCheckBox[class="defaultSolid"]::indicator::checked { - background: #504897; + background: #2F6FC6; } /* @@ -482,7 +480,7 @@ } /* 子标题样式 */ QWidget[class="subTitle"] QLabel { - color: #504897; + color: #2F6FC6; font-weight: bold; font-size: 20px; min-height: 40px; @@ -500,4 +498,4 @@ border: 1px solid #CCCCCC; font-size: 18px; } -*/ \ No newline at end of file +*/ diff --git a/res/qss/checkWin.css b/res/qss/checkWin.css deleted file mode 100644 index c5083da..0000000 --- a/res/qss/checkWin.css +++ /dev/null @@ -1,147 +0,0 @@ -QLabel { - font-family: Microsoft YaHei; - font-size: 18px; -} - -QPushButton[class="default"] { - font-family: Microsoft YaHei; - background-color:#504897; - font-size:16px; - font-weight: bold; - color:white; - border-radius: 5px; -} -QPushButton[class="default"]::hover { - color:white; - font-size: 17px; -} - -QPushButton[class="defEx"] { - font-family: Microsoft YaHei; - background-color:#169bd5; - font-size:16px; - font-weight: bold; - color:white; - border-radius: 5px; -} -QPushButton[class="defEx"]::hover { - color:white; - font-size: 17px; -} -QTableWidget[class="defTable"]{ - font-size: 22px; - color: #333333; - border: 1px solid #4b4b4b; - border-radius: 6px; - background-color: transparent; -} -QTableWidget[class="checkItemTable"]{ - font-size: 22px; - color: black; - border: 1px solid #4b4b4b; - border-radius: 6px; - background-color: white; -} -QTableWidget[class="checkItemTable"]::item::selected { - background: #504897; - color: #ffffff; -} -QTableWidget[class="defTable"]::item::selected { - background: #504897; - color: #ffffff; -} -QHeaderView[class="defTableHead"]::section{ - background-color: #504897; - border: 0px; - color: #ffffff; - font-size: 20px; -} -QLineEdit[class="Inputdef"]{ -background-color: white; /* 背景色:浅灰色 */ -border: 2px solid #cccccc; /* 边框:灰色 */ -border-radius: 8px; /* 圆角边框 */ -padding: 5px 10px; /* 内边距,增加输入区域的间距 */ -font-size: 20px; /* 字体大小 */ -font-family: "Segoe UI", sans-serif; /* 字体 */ -color: black; /* 字体颜色 */ -} -QLineEdit[class="Inputdef"]:focus { - border: 2px solid #f89a5c; - background-color: #ffffff; -} -QLineEdit[class="Inputdef"]:readonly { - background-color: #dddddd; - border: 1px solid #dddddd; - color: #636363; - -} -QWidget[class="defGBox"]{ - background-color:#f5ede0; - border: 1px solid #cccccc; - font-size: 18px; -} -QComboBox[class="Comboxdef"] { - background-color: white; - border: 1px solid #cccccc; - border-radius: 4px; - padding: 5px 10px; - font-size: 20px; - font-family: "Segoe UI", sans-serif; /* 字体 */ - color: black; /* 字体颜色 */ - min-width: 50px; /* 设置最小宽度 */ -} -QComboBox[class="Comboxdef"]:hover { - border: 1px solid #f89a5c; /* 鼠标悬浮时边框颜色变为绿色 */ -} - -QComboBox[class="Comboxdef"]:focus { - border: 1px solid #f89a5c; /* 聚焦时边框颜色变为 */ - background-color: #f9f9f9; /* 聚焦时背景色 */ -} - -QComboBox[class="Comboxdef"]::down-arrow { - - width: 12px; /* 设置箭头的宽度 */ - height: 12px; /* 设置箭头的高度 */ -} -QComboBox[class="Comboxdef"] QAbstractItemView { - border: 1px solid #cccccc; /* 下拉列表边框 */ - background-color: #ffffff; /* 下拉列表背景色 */ - selection-background-color: #f89a5c; /* 选中项背景色 */ - selection-color: white; /* 选中项文本颜色 */ - padding: 5px; /* 下拉项内边距 */ -} - -QComboBox[class="Comboxdef"]:disabled { - background-color: #dddddd; /* 禁用状态背景 */ - border: 1px solid #dddddd; /* 禁用状态下边框 */ - color: #636363; /* 禁用状态字体颜色 */ -} -QScrollArea[class="defscrollArea"]{ - background-color: transparent; -} - -QPushButton[class="defTest"] { - font-family: Microsoft YaHei; - background-color:#5481ba; - font-size:16px; - font-weight: bold; - color:white; - border-radius: 5px; -} -QPushButton[class="defTest"]::hover { - color:white; - font-size: 17px; -} -QPushButton[class="defTestStop"] { - font-family: Microsoft YaHei; - background-color:#e03d3e; - font-size:16px; - font-weight: bold; - color:white; - border-radius: 5px; -} -QPushButton[class="defTestStop"]::hover { - color:white; - font-size: 17px; -} diff --git a/res/qss/dialogcheckresul.css b/res/qss/dialogcheckresul.css deleted file mode 100644 index 0fd89db..0000000 --- a/res/qss/dialogcheckresul.css +++ /dev/null @@ -1,71 +0,0 @@ -QPushButton[class="ButtonSave"] { - -background-color: rgb(51, 69, 130); -color: rgb(255, 255, 255); -} -QPushButton[class="ButtonPrint"] { -background-color: rgb(100, 132, 68); -color: rgb(255, 255, 255); -} -QToolButton[class="ButtonSave"]::hover { -background-color: rgb(5, 69, 154); -} -QToolButton[class="ButtonSave"]:pressed { -background-color: rgb(3, 61, 139); -} -QComboBox[class="Comboxdef"] { - background-color: white; - border: 1px solid #cccccc; - border-radius: 4px; - padding: 5px 10px; - font-size: 20px; - font-family: "Segoe UI", sans-serif; /* 字体 */ - color: black; /* 字体颜色 */ - min-width: 50px; /* 设置最小宽度 */ -} -QComboBox[class="Comboxdef"]:hover { - border: 1px solid #f89a5c; /* 鼠标悬浮时边框颜色变为绿色 */ -} - -QComboBox[class="Comboxdef"]:focus { - border: 1px solid #f89a5c; /* 聚焦时边框颜色变为 */ - background-color: #f9f9f9; /* 聚焦时背景色 */ -} - -QComboBox[class="Comboxdef"]::down-arrow { - - width: 12px; /* 设置箭头的宽度 */ - height: 12px; /* 设置箭头的高度 */ -} -QComboBox[class="Comboxdef"] QAbstractItemView { - border: 1px solid #cccccc; /* 下拉列表边框 */ - background-color: #ffffff; /* 下拉列表背景色 */ - selection-background-color: #f89a5c; /* 选中项背景色 */ - selection-color: white; /* 选中项文本颜色 */ - padding: 5px; /* 下拉项内边距 */ -} - -QComboBox[class="Comboxdef"]:disabled { - background-color: #dddddd; /* 禁用状态背景 */ - border: 1px solid #dddddd; /* 禁用状态下边框 */ - color: #636363; /* 禁用状态字体颜色 */ -} -QLineEdit[class="Inputdef"]{ -background-color: white; /* 背景色:浅灰色 */ -border: 2px solid #cccccc; /* 边框:灰色 */ -border-radius: 8px; /* 圆角边框 */ -padding: 5px 10px; /* 内边距,增加输入区域的间距 */ -font-size: 20px; /* 字体大小 */ -font-family: "Segoe UI", sans-serif; /* 字体 */ -color: black; /* 字体颜色 */ -} -QLineEdit[class="Inputdef"]:focus { - border: 2px solid #f89a5c; - background-color: #ffffff; -} -QLineEdit[class="Inputdef"]:readonly { - background-color: #dddddd; - border: 1px solid #dddddd; - color: #636363; - -} diff --git a/res/qss/generalStyle.css b/res/qss/generalStyle.css deleted file mode 100644 index eceebd4..0000000 --- a/res/qss/generalStyle.css +++ /dev/null @@ -1,6 +0,0 @@ - - -QStackedWidget[class="BasestackedWidget"]{ - background: qlineargradient(y1: 0, y2: 1,stop: 0 rgba(255, 255, 255, 255),stop: 1 rgba(237, 221, 196, 255)); - background: qlineargradient(y1: 0, y2: 1,stop: 0 rgba(255, 255, 255, 255),stop: 1 rgba(237, 221, 196, 255)); -} diff --git a/AutoCalibrationXC.pro b/AutoCalibrationXC.pro index 6bcb335..7790b37 100644 --- a/AutoCalibrationXC.pro +++ b/AutoCalibrationXC.pro @@ -24,11 +24,6 @@ include(QPagedTable/QPagedTable.pri) SOURCES += main.cpp -SOURCES += MainWindow.cpp - -HEADERS += MainWindow.h - -FORMS += MainWindow.ui RC_ICONS = res/autoCalibration.ico diff --git a/MainWindow.cpp b/MainWindow.cpp deleted file mode 100644 index ff126e8..0000000 --- a/MainWindow.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#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/MainWindow.h b/MainWindow.h deleted file mode 100644 index 4643e32..0000000 --- a/MainWindow.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#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; -}; -#endif // MAINWINDOW_H diff --git a/MainWindow.ui b/MainWindow.ui deleted file mode 100644 index b232854..0000000 --- a/MainWindow.ui +++ /dev/null @@ -1,22 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 800 - 600 - - - - MainWindow - - - - - - - - diff --git a/frame/CustomMessageBox.ui b/frame/CustomMessageBox.ui index 336be54..b545d74 100644 --- a/frame/CustomMessageBox.ui +++ b/frame/CustomMessageBox.ui @@ -84,8 +84,8 @@ - - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + + :/image/msgbox/icon_box_close.png:/image/msgbox/icon_box_close.png @@ -134,7 +134,7 @@ - :/image/msgbox/icon_box_success.png + :/image/msgbox/icon_box_success.png Qt::AlignCenter @@ -265,6 +265,8 @@ - + + + diff --git a/frame/MainWindowForm.cpp b/frame/MainWindowForm.cpp index 2ded44b..ec82cd7 100644 --- a/frame/MainWindowForm.cpp +++ b/frame/MainWindowForm.cpp @@ -1,6 +1,8 @@ #include "MainWindowForm.h" #include "ui_MainWindowForm.h" +#include + MainWindowForm::MainWindowForm(QWidget *parent) : FramelessWindow(parent), ui(new Ui::MainWindowForm) @@ -12,7 +14,7 @@ initMenuWidgets(); initFunctionButtons(); - // 每秒更新 界面上没有地方能摆 暂时先不启动定时器 + // 每秒更新 connect(TimeCounterUtil::getInstance().clockTimer, &QTimer::timeout, this, &MainWindowForm::onUpdateTimestampHandler); TimeCounterUtil::getInstance().clockTimer->start(1000); @@ -34,6 +36,7 @@ void MainWindowForm::initForm() { setWindowFlags(Qt::FramelessWindowHint); // 设置全屏 + setWindowState(Qt::WindowState::WindowMaximized); this->setTitleBar(ui->wdgtTop); // 设置窗口位置和大小 move(0, 0); @@ -120,6 +123,22 @@ setWindowState(Qt::WindowMinimized | windowState()); } +void MainWindowForm::on_btnMaxWin_clicked() +{ + QScreen *screen = QGuiApplication::primaryScreen(); + QRect screenSize = screen->availableGeometry(); // 可用区域(排除任务栏) + + if (this->isMaximized()) { + resize(screenSize.width() * 0.8, screenSize.height() * 0.8); + move(QRandomGenerator::global()->bounded(10, 100), QRandomGenerator::global()->bounded(10, 50)); + this->showNormal(); + } else { + resize(screenSize.width(), screenSize.height()); + move(0, 0); + this->showMaximized(); + } +} + void MainWindowForm::on_btnCloseWin_clicked() { // 创建一个消息框 @@ -146,18 +165,9 @@ ui->labelTime->setText(now.toString("yyyy-MM-dd HH:mm:ss")); } -void MainWindowForm::on_btnMenuMax_clicked() -{ - if (this->isMaximized()) { - this->showNormal(); - } else { - this->showMaximized(); - } -} - void MainWindowForm::titleDblClick() { - on_btnMenuMax_clicked(); + on_btnMaxWin_clicked(); } void MainWindowForm::onMenuButtonsEabled(bool enable) { diff --git a/frame/MainWindowForm.h b/frame/MainWindowForm.h index 4d206b1..9b4eae4 100644 --- a/frame/MainWindowForm.h +++ b/frame/MainWindowForm.h @@ -45,11 +45,11 @@ private slots: void on_btnMinWin_clicked(); + void on_btnMaxWin_clicked(); void on_btnCloseWin_clicked(); void onFunctionButtonsAction(); void onUpdateTimestampHandler(); - void on_btnMenuMax_clicked(); void titleDblClick(); void onMenuButtonsEabled(bool enable); diff --git a/frame/MainWindowForm.ui b/frame/MainWindowForm.ui index bd42122..f37d171 100644 --- a/frame/MainWindowForm.ui +++ b/frame/MainWindowForm.ui @@ -41,7 +41,7 @@ 0 - 120 + 100 @@ -58,7 +58,7 @@ 20 - 0 + 20 @@ -88,8 +88,8 @@ - 120 - 120 + 150 + 100 @@ -107,6 +107,22 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + @@ -158,7 +174,7 @@ 100 - 84 + 72 @@ -166,7 +182,8 @@ - :/image/main/calibration.png:/image/main/calibration.png + :/image/main/icon_menu_calibration.png + :/image/main/icon_menu_calibration_selected.png:/image/main/icon_menu_calibration.png @@ -184,7 +201,7 @@ 100 - 84 + 72 @@ -192,7 +209,8 @@ - :/image/main/rawDataRecord.png:/image/main/rawDataRecord.png + :/image/main/icon_menu_check.png + :/image/main/icon_menu_check_selected.png:/image/main/icon_menu_check.png @@ -210,7 +228,7 @@ 100 - 84 + 72 @@ -218,7 +236,8 @@ - :/image/main/fileRes.png:/image/main/fileRes.png + :/image/main/icon_menu_infomation.png + :/image/main/icon_menu_infomation_checked.png:/image/main/icon_menu_infomation.png @@ -235,10 +254,147 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 50 + 20 + + + + + - 320 + 240 + 16777215 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 5 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + :/image/main/iconTemp.png + + + + + + + 34.5℃ + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + + + + :/image/main/iconHumi.png + + + + + + + 25%Rh + + + + + + + + + + + + + + 240 16777215 @@ -308,7 +464,7 @@ - :/image/main/icon_setting_p.png:/image/main/icon_setting_p.png + :/image/main/icon_setting.png:/image/main/icon_setting.png @@ -334,7 +490,33 @@ - :/image/main/icon_min_p.png:/image/main/icon_min_p.png + :/image/main/icon_min.png:/image/main/icon_min.png + + + + 32 + 32 + + + + + + + + + 40 + 40 + + + + 最小化 + + + + + + + :/image/main/icon_max.png:/image/main/icon_max.png @@ -360,7 +542,7 @@ - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + :/image/main/icon_close.png:/image/main/icon_close.png @@ -426,87 +608,9 @@ - - - - - 0 - 30 - - - - - 20 - - - 0 - - - 0 - - - 40 - - - 0 - - - - - Qt::Horizontal - - - - 1289 - 20 - - - - - - - - - - - - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 20 - - - - - - - - - - - - - - wdgtContent wdgtTop - wdgtFoot diff --git a/infomation/InfoMainForm.cpp b/infomation/InfoMainForm.cpp index c001199..5d0ffc8 100644 --- a/infomation/InfoMainForm.cpp +++ b/infomation/InfoMainForm.cpp @@ -21,9 +21,13 @@ void InfoMainForm::initForm() { + // 加载样式表 + QString qssStyle = QssFileUtils::loadQssFileContent(QApplication::applicationDirPath() + "/qss/infoMain.css"); + if (qssStyle.isEmpty() == false) { + this->setStyleSheet(qssStyle); // 仅本窗口生效 + } - - + ui->scrollArea->setWindowFlags(Qt::FramelessWindowHint); // 设置无边框 } void InfoMainForm::initSubMenuForms() { diff --git a/infomation/InfoMainForm.ui b/infomation/InfoMainForm.ui index 958a6b2..d9066dd 100644 --- a/infomation/InfoMainForm.ui +++ b/infomation/InfoMainForm.ui @@ -90,7 +90,7 @@ - 280 + 295 48 @@ -103,7 +103,7 @@ - 280 + 295 48 @@ -116,7 +116,7 @@ - 280 + 295 48 @@ -129,7 +129,7 @@ - 280 + 295 48 @@ -142,7 +142,7 @@ - 280 + 295 48 @@ -155,7 +155,7 @@ - 280 + 295 48 @@ -168,7 +168,7 @@ - 280 + 295 48 @@ -181,7 +181,7 @@ - 280 + 295 48 @@ -194,7 +194,7 @@ - 280 + 295 48 @@ -207,7 +207,7 @@ - 280 + 295 48 @@ -220,7 +220,7 @@ - 280 + 295 48 @@ -233,7 +233,7 @@ - 280 + 295 48 @@ -246,7 +246,7 @@ - 280 + 295 48 diff --git a/infomation/task/DeptTaskForm.cpp b/infomation/task/DeptTaskForm.cpp index ea21a9f..cc6bf31 100644 --- a/infomation/task/DeptTaskForm.cpp +++ b/infomation/task/DeptTaskForm.cpp @@ -18,12 +18,17 @@ delete ui; } -void DeptTaskForm::showEvent(QShowEvent *event) +void DeptTaskForm::showEvent(QShowEvent * event) { ui->tableDeptTask->adjustTableWidth(); getDeptTaskList(0); } +void DeptTaskForm::resizeEvent(QResizeEvent * event) +{ + ui->tableDeptTask->adjustTableWidth(); +} + void DeptTaskForm::initFormTable() { // 初始化查询条件 diff --git a/infomation/task/DeptTaskForm.h b/infomation/task/DeptTaskForm.h index 1055c36..3c1ad5b 100644 --- a/infomation/task/DeptTaskForm.h +++ b/infomation/task/DeptTaskForm.h @@ -21,7 +21,8 @@ ~DeptTaskForm(); protected: - void showEvent(QShowEvent *event) override; + void showEvent(QShowEvent * event) override; + void resizeEvent(QResizeEvent * event) override; private: Ui::DeptTaskForm *ui; diff --git a/main.cpp b/main.cpp index 525387e..0b78c87 100644 --- a/main.cpp +++ b/main.cpp @@ -1,5 +1,3 @@ -#include "MainWindow.h" - #include #include diff --git a/res/image/Index/u1176.svg b/res/image/Index/u1176.svg deleted file mode 100644 index c81ce8a..0000000 --- a/res/image/Index/u1176.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1180.svg b/res/image/Index/u1180.svg deleted file mode 100644 index 2ef24ab..0000000 --- a/res/image/Index/u1180.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1220.svg b/res/image/Index/u1220.svg deleted file mode 100644 index 43452aa..0000000 --- a/res/image/Index/u1220.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2158.svg b/res/image/Index/u2158.svg deleted file mode 100644 index fd249e0..0000000 --- a/res/image/Index/u2158.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u2188.svg b/res/image/Index/u2188.svg deleted file mode 100644 index 34f53c4..0000000 --- a/res/image/Index/u2188.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2189.svg b/res/image/Index/u2189.svg deleted file mode 100644 index 01a6bbb..0000000 --- a/res/image/Index/u2189.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2324.svg b/res/image/Index/u2324.svg deleted file mode 100644 index 797f1c5..0000000 --- a/res/image/Index/u2324.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2325.svg b/res/image/Index/u2325.svg deleted file mode 100644 index fefe01b..0000000 --- a/res/image/Index/u2325.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u642.svg b/res/image/Index/u642.svg deleted file mode 100644 index 33c9e0a..0000000 --- a/res/image/Index/u642.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u7406.svg b/res/image/Index/u7406.svg deleted file mode 100644 index 8a7a6d9..0000000 --- a/res/image/Index/u7406.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7453.svg b/res/image/Index/u7453.svg deleted file mode 100644 index 603c496..0000000 --- a/res/image/Index/u7453.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7458.svg b/res/image/Index/u7458.svg deleted file mode 100644 index b31087b..0000000 --- a/res/image/Index/u7458.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7488.svg b/res/image/Index/u7488.svg deleted file mode 100644 index 8baf439..0000000 --- a/res/image/Index/u7488.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7491.svg b/res/image/Index/u7491.svg deleted file mode 100644 index 3e41c10..0000000 --- a/res/image/Index/u7491.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7538.svg b/res/image/Index/u7538.svg deleted file mode 100644 index 417077d..0000000 --- a/res/image/Index/u7538.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u794.svg b/res/image/Index/u794.svg deleted file mode 100644 index e12cff7..0000000 --- a/res/image/Index/u794.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u8448.svg b/res/image/Index/u8448.svg deleted file mode 100644 index 7f6f4c0..0000000 --- a/res/image/Index/u8448.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u8458.svg b/res/image/Index/u8458.svg deleted file mode 100644 index 6d04a12..0000000 --- a/res/image/Index/u8458.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/main/bg_banner.png b/res/image/main/bg_banner.png new file mode 100644 index 0000000..26ddffd --- /dev/null +++ b/res/image/main/bg_banner.png Binary files differ diff --git a/res/image/main/iconHumi.png b/res/image/main/iconHumi.png index 4410d38..bd164e8 100644 --- a/res/image/main/iconHumi.png +++ b/res/image/main/iconHumi.png Binary files differ diff --git a/res/image/main/iconTemp.png b/res/image/main/iconTemp.png index 8fd059c..a2cfe4d 100644 --- a/res/image/main/iconTemp.png +++ b/res/image/main/iconTemp.png Binary files differ diff --git a/res/image/main/icon_close.png b/res/image/main/icon_close.png new file mode 100644 index 0000000..f3aa270 --- /dev/null +++ b/res/image/main/icon_close.png Binary files differ diff --git a/res/image/main/icon_close_p.png b/res/image/main/icon_close_p.png deleted file mode 100644 index b9ba30c..0000000 --- a/res/image/main/icon_close_p.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_main.png b/res/image/main/icon_main.png deleted file mode 100644 index 9d004d5..0000000 --- a/res/image/main/icon_main.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_max.png b/res/image/main/icon_max.png new file mode 100644 index 0000000..6cbf073 --- /dev/null +++ b/res/image/main/icon_max.png Binary files differ diff --git a/res/image/main/icon_menu_calibration.png b/res/image/main/icon_menu_calibration.png new file mode 100644 index 0000000..6fca8be --- /dev/null +++ b/res/image/main/icon_menu_calibration.png Binary files differ diff --git a/res/image/main/icon_menu_calibration_selected.png b/res/image/main/icon_menu_calibration_selected.png new file mode 100644 index 0000000..17f918f --- /dev/null +++ b/res/image/main/icon_menu_calibration_selected.png Binary files differ diff --git a/res/image/main/icon_menu_check.png b/res/image/main/icon_menu_check.png new file mode 100644 index 0000000..c3db5fa --- /dev/null +++ b/res/image/main/icon_menu_check.png Binary files differ diff --git a/res/image/main/icon_menu_check_selected.png b/res/image/main/icon_menu_check_selected.png new file mode 100644 index 0000000..9794c43 --- /dev/null +++ b/res/image/main/icon_menu_check_selected.png Binary files differ diff --git a/res/image/main/icon_menu_infomation.png b/res/image/main/icon_menu_infomation.png new file mode 100644 index 0000000..e272f4c --- /dev/null +++ b/res/image/main/icon_menu_infomation.png Binary files differ diff --git a/res/image/main/icon_menu_infomation_checked.png b/res/image/main/icon_menu_infomation_checked.png new file mode 100644 index 0000000..6122c7b --- /dev/null +++ b/res/image/main/icon_menu_infomation_checked.png Binary files differ diff --git a/res/image/main/icon_min.png b/res/image/main/icon_min.png new file mode 100644 index 0000000..2f524d9 --- /dev/null +++ b/res/image/main/icon_min.png Binary files differ diff --git a/res/image/main/icon_min_p.png b/res/image/main/icon_min_p.png deleted file mode 100644 index 93bd487..0000000 --- a/res/image/main/icon_min_p.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_quit_p.png b/res/image/main/icon_quit_p.png deleted file mode 100644 index 10d8bac..0000000 --- a/res/image/main/icon_quit_p.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_setting.png b/res/image/main/icon_setting.png new file mode 100644 index 0000000..8686833 --- /dev/null +++ b/res/image/main/icon_setting.png Binary files differ diff --git a/res/image/main/icon_setting_p.png b/res/image/main/icon_setting_p.png deleted file mode 100644 index f6645f1..0000000 --- a/res/image/main/icon_setting_p.png +++ /dev/null Binary files differ diff --git a/res/image/msgbox/icon_box_close.png b/res/image/msgbox/icon_box_close.png new file mode 100644 index 0000000..e9d00fb --- /dev/null +++ b/res/image/msgbox/icon_box_close.png Binary files differ diff --git a/res/images.qrc b/res/images.qrc index 68608e9..a6ba788 100644 --- a/res/images.qrc +++ b/res/images.qrc @@ -27,27 +27,9 @@ image/Index/u709.svg image/Index/u712.svg image/Index/u715.svg - image/Index/u1176.svg - image/Index/u1180.svg - image/Index/u1220.svg - image/Index/u7406.svg - image/Index/u7453.svg - image/Index/u7458.svg - image/Index/u7488.svg - image/Index/u7491.svg - image/Index/u7538.svg - image/Index/u2324.svg - image/Index/u2325.svg - image/Index/u2158.svg - image/Index/u8448.svg - image/Index/u8458.svg image/Index/u2327.svg image/Index/u5496.svg image/Index/u7313.svg - image/Index/u2188.svg - image/Index/u2189.svg - image/Index/u642.svg - image/Index/u794.svg image/Index/u5089.png image/Index/u138.png image/Index/btnPageFirst.png @@ -96,13 +78,6 @@ image/login/icon_min.png image/login/icon_setting.png image/login/icon_quit.png - image/main/icon_main.png - image/main/iconHumi.png - image/main/iconTemp.png - image/main/icon_close_p.png - image/main/icon_min_p.png - image/main/icon_quit_p.png - image/main/icon_setting_p.png image/main/arrow_down.png image/main/arrow_up.png image/main/icon_btn_pause.png @@ -115,5 +90,19 @@ image/msgbox/icon_box_warning.png image/msgbox/icon_box_fail.png image/login/logo.png + image/main/bg_banner.png + image/main/icon_close.png + image/main/icon_max.png + image/main/icon_min.png + image/main/icon_setting.png + image/main/iconHumi.png + image/main/iconTemp.png + image/main/icon_menu_calibration.png + image/main/icon_menu_calibration_selected.png + image/main/icon_menu_check.png + image/main/icon_menu_check_selected.png + image/main/icon_menu_infomation.png + image/main/icon_menu_infomation_checked.png + image/msgbox/icon_box_close.png diff --git a/res/qss.qrc b/res/qss.qrc index 56752bb..fbb36c0 100644 --- a/res/qss.qrc +++ b/res/qss.qrc @@ -1,14 +1,10 @@ - qss/Index.css qss/preCheck.css - qss/dialogcheckresul.css - qss/tf_testdevice.css - qss/generalStyle.css - qss/checkWin.css qss/loginForm.css qss/mainForm.css qss/baseInfomation.css qss/messageBox.css + qss/infoMain.css diff --git a/res/qss/Index.css b/res/qss/Index.css deleted file mode 100644 index 8842775..0000000 --- a/res/qss/Index.css +++ /dev/null @@ -1,190 +0,0 @@ -*{ -color:black; -} -QLabel { - font-family: "Microsoft YaHei"; -} -QWidget#centralwidget -{ -background-image: url(:/image/Index/u15.png); -background-color:white; -} -QToolButton#tb1:hover{ - background-image: url(:/image/Index/u26_mouseOver.svg); -} -QToolButton#tb2:hover{ - background-image: url(:/image/Index/u26_mouseOver.svg); -} -QToolButton#tb3:hover{ - background-image: url(:/image/Index/u26_mouseOver.svg); -}QToolButton#tb4:hover{ -background-image: url(:/image/Index/u26_mouseOver.svg); -}QToolButton#tb5:hover{ -background-image: url(:/image/Index/u26_mouseOver.svg); -} -QToolButton#tb6:hover{ - background-image: url(:/image/Index/u26_mouseOver.svg); -} -QToolButton#tb1{ -color: white; -background-image: url(:/image/Index/u26.svg); -font-weight: bold; -border-radius: 5px; -text-align: center; -margin:10; -margin-right: 180px; -font: 18pt 微软雅黑; -} -QToolButton#tb2{ -color: white; -background-image: url(:/image/Index/u26.svg); -font-weight: bold; -border-radius: 5px; -text-align: center; -margin:10; -margin-right: 180px; -font: 18pt 微软雅黑; -} -QToolButton#tb3{ -color: white; -background-image: url(:/image/Index/u26.svg); -font-weight: bold; -border-radius: 5px; -text-align: center; -margin:10; -margin-right: 180px; -font: 18pt 微软雅黑; -}QToolButton#tb4{ -color: white; -background-image: url(:/image/Index/u26.svg); -font-weight: bold; -border-radius: 5px; -text-align: center; -margin:10; -margin-right: 180px; -font: 18pt 微软雅黑; -}QToolButton#tb5{ -color: white; -background-image: url(:/image/Index/u26.svg); -font-weight: bold; -border-radius: 5px; -text-align: center; -margin:10; -margin-right: 180px; -font: 18pt 微软雅黑; -}QToolButton#tb6{ -color: white; -background-image: url(:/image/Index/u26.svg); -font-weight: bold; -border-radius: 5px; -text-align: center; -margin:10; -margin-right: 180px; -font: 18pt 微软雅黑; -} - -/******** NewCheckMethod页面 ********/ -QLabel#labelNcmInfo, QLabel#labelNcmGraph, QLabel#labelNcmConfig, QLabel#labelNcmComm { - font-size: 24px; - min-height: 40px; -} - -QLabel[class="ncmFormLabel"] { - font-size: 18px; - padding: 10px 20px; -} - -QLineEdit[class="ncmFormInput"] { - border-radius: 6px; - font-family: "Microsoft YaHei"; - color: #333333; - border: 1px solid #CCCCCC; - font-size: 18px; -} - -QDateEdit[class="ncmFormDate"] { - border-radius: 6px; - font-family: "Microsoft YaHei"; - border: 1px solid #CCCCCC; - font-size: 18px; -} - -QCheckBox { - color: #FFFFFF; - font-family: "Microsoft YaHei"; - font-size: 16px; - /*padding-left: 5px;*/ -} -QCheckBox::indicator { - width: 20px; - height: 20px; - border-radius: 5px; - border: 2px solid #2F6FC6; -} -QCheckBox::indicator::unchecked { - background: #FFFFFF; - /*border: 2px solid #CCCCC;*/ -} -QCheckBox::indicator::checked { - background: #2F6FC6; -} - -QComboBox { - border-radius: 6px; - font-family: "Microsoft YaHei"; - padding-left: 16px; - color: #333333; - border: 1px solid #CCCCCC; - font-size: 18px; -} - -QComboBox::down-arrow { - image: url(":/image/Index/arrowDown.png"); -} -QComboBox::down-arrow::on { - image: url(":/image/Index/arrowUp.png"); -} - -QComboBox::drop-down { - subcontrol-origin: padding; - subcontrol-position: top right; - width: 20px; - border: 0px; - padding-right: 15px; -} - -QComboBox QAbstractItemView { - color: #333333; - background-color: #E1E1ED; - selection-background-color: #2F6FC6; - selection-color: #FFFFFF; - font-family: "Microsoft YaHei"; - outline: 0px; -} - -QComboBox QAbstractItemView::item{ - min-height: 36px; - line-height: 36px; - color: #333333; - padding-left: 9px; - background-color: #FFFFFF; -} - -QComboBox QScrollBar::vertical { - width: 10px; - background: #FFFFFF; - border: none; -} - -QComboBox QScrollBar::handle::vertical { - width: 10px; - background: #2F6FC6; - border: none; -} - -QComboBox QScrollBar::add-line::vertical { - border: none; -} -QComboBox QScrollBar::sub-line::vertical { - border: none; -} diff --git a/res/qss/baseInfomation.css b/res/qss/baseInfomation.css index 636c382..1c6783c 100644 --- a/res/qss/baseInfomation.css +++ b/res/qss/baseInfomation.css @@ -1,5 +1,3 @@ -/*QPalette{background:#FFFFFF;}*/ - QWidget { background-color: #FFFFFF; } @@ -11,7 +9,7 @@ /** 普通按钮 **/ QToolButton[class="btnDefault"] { border-radius: 12px; - background-color: #504897; + background-color: #2F6FC6; color: #FFFFFF; font-family: "Microsoft YaHei"; font-size: 18px; @@ -19,16 +17,16 @@ /** 查询重置按钮 **/ QToolButton[class="btnOpposite"] { border-radius: 12px; - border: 1px solid #504897; + border: 1px solid #2F6FC6; background-color: #FFFFFF; - color: #504897; + color: #2F6FC6; font-family: "Microsoft YaHei"; font-size: 18px; } /** 表格顶端的标题栏 **/ QLabel[class="frameLabel"]{ - background-color: #504897; + background-color: #2F6FC6; border: 0px; border-radius: 0px; border-top-left-radius: 10px; @@ -87,11 +85,11 @@ } QComboBox[class="defaultSelect"] QAbstractItemView::item:hover{ color: #FFFFFF; - background-color: #504897; + background-color: #2F6FC6; } QComboBox[class="defaultSelect"] QAbstractItemView::item:selected{ color: #FFFFFF; - background-color: #504897; + background-color: #2F6FC6; } QComboBox[class="defaultSelect"] QScrollBar::vertical { width: 5px; @@ -100,7 +98,7 @@ } QComboBox[class="defaultSelect"] QScrollBar::handle::vertical { width: 5px; - background: #504897; + background: #2F6FC6; border: none; } QComboBox[class="defaultSelect"] QScrollBar::add-line::vertical { @@ -113,7 +111,7 @@ /** 查询普通按钮 **/ QWidget#wdgtQueryBox QToolButton { border-radius: 12px; - background-color: #504897; + background-color: #2F6FC6; color: #FFFFFF; font-family: "Microsoft YaHei"; font-size: 18px; @@ -121,9 +119,9 @@ /** 查询重置按钮 **/ QWidget#wdgtQueryBox QToolButton[class="btnResetQuery"] { border-radius: 12px; - border: 1px solid #504897; + border: 1px solid #2F6FC6; background-color: #FFFFFF; - color: #504897; + color: #2F6FC6; font-family: "Microsoft YaHei"; font-size: 18px; } @@ -136,7 +134,7 @@ } QTableWidget QHeaderView::section { - background-color: #504897; + background-color: #2F6FC6; border: 1px solid #FFFFFF; color: #FFFFFF; font-size: 18px; @@ -151,7 +149,7 @@ QTableWidget::item::selected { /*background: #FFFFFF; */ - color: #504897; + color: #2F6FC6; } QTableWidget QWidget[class="wdgtOper"] { @@ -189,7 +187,7 @@ /** 分页组件 **/ QWidget[class="wdgtPageBtn"] { - background: #504897; + background: #2F6FC6; border-radius: 6px; } QWidget[class="wdgtPageBtn"] QToolButton { @@ -203,7 +201,7 @@ /** 对话框弹窗顶端的标题栏 **/ QWidget[class="dlgTitle"]{ - background-color: #504897; + background-color: #2F6FC6; border: 0px; padding: 10px; } @@ -284,11 +282,11 @@ } QWidget[class="detailTable"] QComboBox QAbstractItemView::item:hover{ color: #FFFFFF; - background-color: #504897; + background-color: #2F6FC6; } QWidget[class="detailTable"] QComboBox QAbstractItemView::item:selected{ color: #FFFFFF; - background-color: #504897; + background-color: #2F6FC6; } QCheckBox[class="defaultSolid"] { @@ -301,14 +299,14 @@ width: 20px; height: 20px; border-radius: 5px; - border: 2px solid #504897; + border: 2px solid #2F6FC6; } QCheckBox[class="defaultSolid"]::indicator::unchecked { background: #FFFFFF; /*border: 2px solid #CCCCC;*/ } QCheckBox[class="defaultSolid"]::indicator::checked { - background: #504897; + background: #2F6FC6; } /* @@ -482,7 +480,7 @@ } /* 子标题样式 */ QWidget[class="subTitle"] QLabel { - color: #504897; + color: #2F6FC6; font-weight: bold; font-size: 20px; min-height: 40px; @@ -500,4 +498,4 @@ border: 1px solid #CCCCCC; font-size: 18px; } -*/ \ No newline at end of file +*/ diff --git a/res/qss/checkWin.css b/res/qss/checkWin.css deleted file mode 100644 index c5083da..0000000 --- a/res/qss/checkWin.css +++ /dev/null @@ -1,147 +0,0 @@ -QLabel { - font-family: Microsoft YaHei; - font-size: 18px; -} - -QPushButton[class="default"] { - font-family: Microsoft YaHei; - background-color:#504897; - font-size:16px; - font-weight: bold; - color:white; - border-radius: 5px; -} -QPushButton[class="default"]::hover { - color:white; - font-size: 17px; -} - -QPushButton[class="defEx"] { - font-family: Microsoft YaHei; - background-color:#169bd5; - font-size:16px; - font-weight: bold; - color:white; - border-radius: 5px; -} -QPushButton[class="defEx"]::hover { - color:white; - font-size: 17px; -} -QTableWidget[class="defTable"]{ - font-size: 22px; - color: #333333; - border: 1px solid #4b4b4b; - border-radius: 6px; - background-color: transparent; -} -QTableWidget[class="checkItemTable"]{ - font-size: 22px; - color: black; - border: 1px solid #4b4b4b; - border-radius: 6px; - background-color: white; -} -QTableWidget[class="checkItemTable"]::item::selected { - background: #504897; - color: #ffffff; -} -QTableWidget[class="defTable"]::item::selected { - background: #504897; - color: #ffffff; -} -QHeaderView[class="defTableHead"]::section{ - background-color: #504897; - border: 0px; - color: #ffffff; - font-size: 20px; -} -QLineEdit[class="Inputdef"]{ -background-color: white; /* 背景色:浅灰色 */ -border: 2px solid #cccccc; /* 边框:灰色 */ -border-radius: 8px; /* 圆角边框 */ -padding: 5px 10px; /* 内边距,增加输入区域的间距 */ -font-size: 20px; /* 字体大小 */ -font-family: "Segoe UI", sans-serif; /* 字体 */ -color: black; /* 字体颜色 */ -} -QLineEdit[class="Inputdef"]:focus { - border: 2px solid #f89a5c; - background-color: #ffffff; -} -QLineEdit[class="Inputdef"]:readonly { - background-color: #dddddd; - border: 1px solid #dddddd; - color: #636363; - -} -QWidget[class="defGBox"]{ - background-color:#f5ede0; - border: 1px solid #cccccc; - font-size: 18px; -} -QComboBox[class="Comboxdef"] { - background-color: white; - border: 1px solid #cccccc; - border-radius: 4px; - padding: 5px 10px; - font-size: 20px; - font-family: "Segoe UI", sans-serif; /* 字体 */ - color: black; /* 字体颜色 */ - min-width: 50px; /* 设置最小宽度 */ -} -QComboBox[class="Comboxdef"]:hover { - border: 1px solid #f89a5c; /* 鼠标悬浮时边框颜色变为绿色 */ -} - -QComboBox[class="Comboxdef"]:focus { - border: 1px solid #f89a5c; /* 聚焦时边框颜色变为 */ - background-color: #f9f9f9; /* 聚焦时背景色 */ -} - -QComboBox[class="Comboxdef"]::down-arrow { - - width: 12px; /* 设置箭头的宽度 */ - height: 12px; /* 设置箭头的高度 */ -} -QComboBox[class="Comboxdef"] QAbstractItemView { - border: 1px solid #cccccc; /* 下拉列表边框 */ - background-color: #ffffff; /* 下拉列表背景色 */ - selection-background-color: #f89a5c; /* 选中项背景色 */ - selection-color: white; /* 选中项文本颜色 */ - padding: 5px; /* 下拉项内边距 */ -} - -QComboBox[class="Comboxdef"]:disabled { - background-color: #dddddd; /* 禁用状态背景 */ - border: 1px solid #dddddd; /* 禁用状态下边框 */ - color: #636363; /* 禁用状态字体颜色 */ -} -QScrollArea[class="defscrollArea"]{ - background-color: transparent; -} - -QPushButton[class="defTest"] { - font-family: Microsoft YaHei; - background-color:#5481ba; - font-size:16px; - font-weight: bold; - color:white; - border-radius: 5px; -} -QPushButton[class="defTest"]::hover { - color:white; - font-size: 17px; -} -QPushButton[class="defTestStop"] { - font-family: Microsoft YaHei; - background-color:#e03d3e; - font-size:16px; - font-weight: bold; - color:white; - border-radius: 5px; -} -QPushButton[class="defTestStop"]::hover { - color:white; - font-size: 17px; -} diff --git a/res/qss/dialogcheckresul.css b/res/qss/dialogcheckresul.css deleted file mode 100644 index 0fd89db..0000000 --- a/res/qss/dialogcheckresul.css +++ /dev/null @@ -1,71 +0,0 @@ -QPushButton[class="ButtonSave"] { - -background-color: rgb(51, 69, 130); -color: rgb(255, 255, 255); -} -QPushButton[class="ButtonPrint"] { -background-color: rgb(100, 132, 68); -color: rgb(255, 255, 255); -} -QToolButton[class="ButtonSave"]::hover { -background-color: rgb(5, 69, 154); -} -QToolButton[class="ButtonSave"]:pressed { -background-color: rgb(3, 61, 139); -} -QComboBox[class="Comboxdef"] { - background-color: white; - border: 1px solid #cccccc; - border-radius: 4px; - padding: 5px 10px; - font-size: 20px; - font-family: "Segoe UI", sans-serif; /* 字体 */ - color: black; /* 字体颜色 */ - min-width: 50px; /* 设置最小宽度 */ -} -QComboBox[class="Comboxdef"]:hover { - border: 1px solid #f89a5c; /* 鼠标悬浮时边框颜色变为绿色 */ -} - -QComboBox[class="Comboxdef"]:focus { - border: 1px solid #f89a5c; /* 聚焦时边框颜色变为 */ - background-color: #f9f9f9; /* 聚焦时背景色 */ -} - -QComboBox[class="Comboxdef"]::down-arrow { - - width: 12px; /* 设置箭头的宽度 */ - height: 12px; /* 设置箭头的高度 */ -} -QComboBox[class="Comboxdef"] QAbstractItemView { - border: 1px solid #cccccc; /* 下拉列表边框 */ - background-color: #ffffff; /* 下拉列表背景色 */ - selection-background-color: #f89a5c; /* 选中项背景色 */ - selection-color: white; /* 选中项文本颜色 */ - padding: 5px; /* 下拉项内边距 */ -} - -QComboBox[class="Comboxdef"]:disabled { - background-color: #dddddd; /* 禁用状态背景 */ - border: 1px solid #dddddd; /* 禁用状态下边框 */ - color: #636363; /* 禁用状态字体颜色 */ -} -QLineEdit[class="Inputdef"]{ -background-color: white; /* 背景色:浅灰色 */ -border: 2px solid #cccccc; /* 边框:灰色 */ -border-radius: 8px; /* 圆角边框 */ -padding: 5px 10px; /* 内边距,增加输入区域的间距 */ -font-size: 20px; /* 字体大小 */ -font-family: "Segoe UI", sans-serif; /* 字体 */ -color: black; /* 字体颜色 */ -} -QLineEdit[class="Inputdef"]:focus { - border: 2px solid #f89a5c; - background-color: #ffffff; -} -QLineEdit[class="Inputdef"]:readonly { - background-color: #dddddd; - border: 1px solid #dddddd; - color: #636363; - -} diff --git a/res/qss/generalStyle.css b/res/qss/generalStyle.css deleted file mode 100644 index eceebd4..0000000 --- a/res/qss/generalStyle.css +++ /dev/null @@ -1,6 +0,0 @@ - - -QStackedWidget[class="BasestackedWidget"]{ - background: qlineargradient(y1: 0, y2: 1,stop: 0 rgba(255, 255, 255, 255),stop: 1 rgba(237, 221, 196, 255)); - background: qlineargradient(y1: 0, y2: 1,stop: 0 rgba(255, 255, 255, 255),stop: 1 rgba(237, 221, 196, 255)); -} diff --git a/res/qss/infoMain.css b/res/qss/infoMain.css new file mode 100644 index 0000000..2f178c7 --- /dev/null +++ b/res/qss/infoMain.css @@ -0,0 +1,26 @@ +QWidget { + background-color: #FFFFFF; +} +QLabel { + font-family: Microsoft YaHei; + font-size: 18px; +} +QScrollArea { + border: none; +} +QScrollBar::vertical { + width: 5px; + background: #FFFFFF; + border: none; +} +QScrollBar::handle::vertical { + width: 5px; + background: #2F6FC6; + border: none; +} +QScrollBar::add-line::vertical { + border: none; +} +QScrollBar::sub-line::vertical { + border: none; +} \ No newline at end of file diff --git a/AutoCalibrationXC.pro b/AutoCalibrationXC.pro index 6bcb335..7790b37 100644 --- a/AutoCalibrationXC.pro +++ b/AutoCalibrationXC.pro @@ -24,11 +24,6 @@ include(QPagedTable/QPagedTable.pri) SOURCES += main.cpp -SOURCES += MainWindow.cpp - -HEADERS += MainWindow.h - -FORMS += MainWindow.ui RC_ICONS = res/autoCalibration.ico diff --git a/MainWindow.cpp b/MainWindow.cpp deleted file mode 100644 index ff126e8..0000000 --- a/MainWindow.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#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/MainWindow.h b/MainWindow.h deleted file mode 100644 index 4643e32..0000000 --- a/MainWindow.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#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; -}; -#endif // MAINWINDOW_H diff --git a/MainWindow.ui b/MainWindow.ui deleted file mode 100644 index b232854..0000000 --- a/MainWindow.ui +++ /dev/null @@ -1,22 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 800 - 600 - - - - MainWindow - - - - - - - - diff --git a/frame/CustomMessageBox.ui b/frame/CustomMessageBox.ui index 336be54..b545d74 100644 --- a/frame/CustomMessageBox.ui +++ b/frame/CustomMessageBox.ui @@ -84,8 +84,8 @@ - - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + + :/image/msgbox/icon_box_close.png:/image/msgbox/icon_box_close.png @@ -134,7 +134,7 @@ - :/image/msgbox/icon_box_success.png + :/image/msgbox/icon_box_success.png Qt::AlignCenter @@ -265,6 +265,8 @@ - + + + diff --git a/frame/MainWindowForm.cpp b/frame/MainWindowForm.cpp index 2ded44b..ec82cd7 100644 --- a/frame/MainWindowForm.cpp +++ b/frame/MainWindowForm.cpp @@ -1,6 +1,8 @@ #include "MainWindowForm.h" #include "ui_MainWindowForm.h" +#include + MainWindowForm::MainWindowForm(QWidget *parent) : FramelessWindow(parent), ui(new Ui::MainWindowForm) @@ -12,7 +14,7 @@ initMenuWidgets(); initFunctionButtons(); - // 每秒更新 界面上没有地方能摆 暂时先不启动定时器 + // 每秒更新 connect(TimeCounterUtil::getInstance().clockTimer, &QTimer::timeout, this, &MainWindowForm::onUpdateTimestampHandler); TimeCounterUtil::getInstance().clockTimer->start(1000); @@ -34,6 +36,7 @@ void MainWindowForm::initForm() { setWindowFlags(Qt::FramelessWindowHint); // 设置全屏 + setWindowState(Qt::WindowState::WindowMaximized); this->setTitleBar(ui->wdgtTop); // 设置窗口位置和大小 move(0, 0); @@ -120,6 +123,22 @@ setWindowState(Qt::WindowMinimized | windowState()); } +void MainWindowForm::on_btnMaxWin_clicked() +{ + QScreen *screen = QGuiApplication::primaryScreen(); + QRect screenSize = screen->availableGeometry(); // 可用区域(排除任务栏) + + if (this->isMaximized()) { + resize(screenSize.width() * 0.8, screenSize.height() * 0.8); + move(QRandomGenerator::global()->bounded(10, 100), QRandomGenerator::global()->bounded(10, 50)); + this->showNormal(); + } else { + resize(screenSize.width(), screenSize.height()); + move(0, 0); + this->showMaximized(); + } +} + void MainWindowForm::on_btnCloseWin_clicked() { // 创建一个消息框 @@ -146,18 +165,9 @@ ui->labelTime->setText(now.toString("yyyy-MM-dd HH:mm:ss")); } -void MainWindowForm::on_btnMenuMax_clicked() -{ - if (this->isMaximized()) { - this->showNormal(); - } else { - this->showMaximized(); - } -} - void MainWindowForm::titleDblClick() { - on_btnMenuMax_clicked(); + on_btnMaxWin_clicked(); } void MainWindowForm::onMenuButtonsEabled(bool enable) { diff --git a/frame/MainWindowForm.h b/frame/MainWindowForm.h index 4d206b1..9b4eae4 100644 --- a/frame/MainWindowForm.h +++ b/frame/MainWindowForm.h @@ -45,11 +45,11 @@ private slots: void on_btnMinWin_clicked(); + void on_btnMaxWin_clicked(); void on_btnCloseWin_clicked(); void onFunctionButtonsAction(); void onUpdateTimestampHandler(); - void on_btnMenuMax_clicked(); void titleDblClick(); void onMenuButtonsEabled(bool enable); diff --git a/frame/MainWindowForm.ui b/frame/MainWindowForm.ui index bd42122..f37d171 100644 --- a/frame/MainWindowForm.ui +++ b/frame/MainWindowForm.ui @@ -41,7 +41,7 @@ 0 - 120 + 100 @@ -58,7 +58,7 @@ 20 - 0 + 20 @@ -88,8 +88,8 @@ - 120 - 120 + 150 + 100 @@ -107,6 +107,22 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + @@ -158,7 +174,7 @@ 100 - 84 + 72 @@ -166,7 +182,8 @@ - :/image/main/calibration.png:/image/main/calibration.png + :/image/main/icon_menu_calibration.png + :/image/main/icon_menu_calibration_selected.png:/image/main/icon_menu_calibration.png @@ -184,7 +201,7 @@ 100 - 84 + 72 @@ -192,7 +209,8 @@ - :/image/main/rawDataRecord.png:/image/main/rawDataRecord.png + :/image/main/icon_menu_check.png + :/image/main/icon_menu_check_selected.png:/image/main/icon_menu_check.png @@ -210,7 +228,7 @@ 100 - 84 + 72 @@ -218,7 +236,8 @@ - :/image/main/fileRes.png:/image/main/fileRes.png + :/image/main/icon_menu_infomation.png + :/image/main/icon_menu_infomation_checked.png:/image/main/icon_menu_infomation.png @@ -235,10 +254,147 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 50 + 20 + + + + + - 320 + 240 + 16777215 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 5 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + :/image/main/iconTemp.png + + + + + + + 34.5℃ + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + + + + :/image/main/iconHumi.png + + + + + + + 25%Rh + + + + + + + + + + + + + + 240 16777215 @@ -308,7 +464,7 @@ - :/image/main/icon_setting_p.png:/image/main/icon_setting_p.png + :/image/main/icon_setting.png:/image/main/icon_setting.png @@ -334,7 +490,33 @@ - :/image/main/icon_min_p.png:/image/main/icon_min_p.png + :/image/main/icon_min.png:/image/main/icon_min.png + + + + 32 + 32 + + + + + + + + + 40 + 40 + + + + 最小化 + + + + + + + :/image/main/icon_max.png:/image/main/icon_max.png @@ -360,7 +542,7 @@ - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + :/image/main/icon_close.png:/image/main/icon_close.png @@ -426,87 +608,9 @@ - - - - - 0 - 30 - - - - - 20 - - - 0 - - - 0 - - - 40 - - - 0 - - - - - Qt::Horizontal - - - - 1289 - 20 - - - - - - - - - - - - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 20 - - - - - - - - - - - - - - wdgtContent wdgtTop - wdgtFoot diff --git a/infomation/InfoMainForm.cpp b/infomation/InfoMainForm.cpp index c001199..5d0ffc8 100644 --- a/infomation/InfoMainForm.cpp +++ b/infomation/InfoMainForm.cpp @@ -21,9 +21,13 @@ void InfoMainForm::initForm() { + // 加载样式表 + QString qssStyle = QssFileUtils::loadQssFileContent(QApplication::applicationDirPath() + "/qss/infoMain.css"); + if (qssStyle.isEmpty() == false) { + this->setStyleSheet(qssStyle); // 仅本窗口生效 + } - - + ui->scrollArea->setWindowFlags(Qt::FramelessWindowHint); // 设置无边框 } void InfoMainForm::initSubMenuForms() { diff --git a/infomation/InfoMainForm.ui b/infomation/InfoMainForm.ui index 958a6b2..d9066dd 100644 --- a/infomation/InfoMainForm.ui +++ b/infomation/InfoMainForm.ui @@ -90,7 +90,7 @@ - 280 + 295 48 @@ -103,7 +103,7 @@ - 280 + 295 48 @@ -116,7 +116,7 @@ - 280 + 295 48 @@ -129,7 +129,7 @@ - 280 + 295 48 @@ -142,7 +142,7 @@ - 280 + 295 48 @@ -155,7 +155,7 @@ - 280 + 295 48 @@ -168,7 +168,7 @@ - 280 + 295 48 @@ -181,7 +181,7 @@ - 280 + 295 48 @@ -194,7 +194,7 @@ - 280 + 295 48 @@ -207,7 +207,7 @@ - 280 + 295 48 @@ -220,7 +220,7 @@ - 280 + 295 48 @@ -233,7 +233,7 @@ - 280 + 295 48 @@ -246,7 +246,7 @@ - 280 + 295 48 diff --git a/infomation/task/DeptTaskForm.cpp b/infomation/task/DeptTaskForm.cpp index ea21a9f..cc6bf31 100644 --- a/infomation/task/DeptTaskForm.cpp +++ b/infomation/task/DeptTaskForm.cpp @@ -18,12 +18,17 @@ delete ui; } -void DeptTaskForm::showEvent(QShowEvent *event) +void DeptTaskForm::showEvent(QShowEvent * event) { ui->tableDeptTask->adjustTableWidth(); getDeptTaskList(0); } +void DeptTaskForm::resizeEvent(QResizeEvent * event) +{ + ui->tableDeptTask->adjustTableWidth(); +} + void DeptTaskForm::initFormTable() { // 初始化查询条件 diff --git a/infomation/task/DeptTaskForm.h b/infomation/task/DeptTaskForm.h index 1055c36..3c1ad5b 100644 --- a/infomation/task/DeptTaskForm.h +++ b/infomation/task/DeptTaskForm.h @@ -21,7 +21,8 @@ ~DeptTaskForm(); protected: - void showEvent(QShowEvent *event) override; + void showEvent(QShowEvent * event) override; + void resizeEvent(QResizeEvent * event) override; private: Ui::DeptTaskForm *ui; diff --git a/main.cpp b/main.cpp index 525387e..0b78c87 100644 --- a/main.cpp +++ b/main.cpp @@ -1,5 +1,3 @@ -#include "MainWindow.h" - #include #include diff --git a/res/image/Index/u1176.svg b/res/image/Index/u1176.svg deleted file mode 100644 index c81ce8a..0000000 --- a/res/image/Index/u1176.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1180.svg b/res/image/Index/u1180.svg deleted file mode 100644 index 2ef24ab..0000000 --- a/res/image/Index/u1180.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1220.svg b/res/image/Index/u1220.svg deleted file mode 100644 index 43452aa..0000000 --- a/res/image/Index/u1220.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2158.svg b/res/image/Index/u2158.svg deleted file mode 100644 index fd249e0..0000000 --- a/res/image/Index/u2158.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u2188.svg b/res/image/Index/u2188.svg deleted file mode 100644 index 34f53c4..0000000 --- a/res/image/Index/u2188.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2189.svg b/res/image/Index/u2189.svg deleted file mode 100644 index 01a6bbb..0000000 --- a/res/image/Index/u2189.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2324.svg b/res/image/Index/u2324.svg deleted file mode 100644 index 797f1c5..0000000 --- a/res/image/Index/u2324.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2325.svg b/res/image/Index/u2325.svg deleted file mode 100644 index fefe01b..0000000 --- a/res/image/Index/u2325.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u642.svg b/res/image/Index/u642.svg deleted file mode 100644 index 33c9e0a..0000000 --- a/res/image/Index/u642.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u7406.svg b/res/image/Index/u7406.svg deleted file mode 100644 index 8a7a6d9..0000000 --- a/res/image/Index/u7406.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7453.svg b/res/image/Index/u7453.svg deleted file mode 100644 index 603c496..0000000 --- a/res/image/Index/u7453.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7458.svg b/res/image/Index/u7458.svg deleted file mode 100644 index b31087b..0000000 --- a/res/image/Index/u7458.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7488.svg b/res/image/Index/u7488.svg deleted file mode 100644 index 8baf439..0000000 --- a/res/image/Index/u7488.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7491.svg b/res/image/Index/u7491.svg deleted file mode 100644 index 3e41c10..0000000 --- a/res/image/Index/u7491.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7538.svg b/res/image/Index/u7538.svg deleted file mode 100644 index 417077d..0000000 --- a/res/image/Index/u7538.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u794.svg b/res/image/Index/u794.svg deleted file mode 100644 index e12cff7..0000000 --- a/res/image/Index/u794.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u8448.svg b/res/image/Index/u8448.svg deleted file mode 100644 index 7f6f4c0..0000000 --- a/res/image/Index/u8448.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u8458.svg b/res/image/Index/u8458.svg deleted file mode 100644 index 6d04a12..0000000 --- a/res/image/Index/u8458.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/main/bg_banner.png b/res/image/main/bg_banner.png new file mode 100644 index 0000000..26ddffd --- /dev/null +++ b/res/image/main/bg_banner.png Binary files differ diff --git a/res/image/main/iconHumi.png b/res/image/main/iconHumi.png index 4410d38..bd164e8 100644 --- a/res/image/main/iconHumi.png +++ b/res/image/main/iconHumi.png Binary files differ diff --git a/res/image/main/iconTemp.png b/res/image/main/iconTemp.png index 8fd059c..a2cfe4d 100644 --- a/res/image/main/iconTemp.png +++ b/res/image/main/iconTemp.png Binary files differ diff --git a/res/image/main/icon_close.png b/res/image/main/icon_close.png new file mode 100644 index 0000000..f3aa270 --- /dev/null +++ b/res/image/main/icon_close.png Binary files differ diff --git a/res/image/main/icon_close_p.png b/res/image/main/icon_close_p.png deleted file mode 100644 index b9ba30c..0000000 --- a/res/image/main/icon_close_p.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_main.png b/res/image/main/icon_main.png deleted file mode 100644 index 9d004d5..0000000 --- a/res/image/main/icon_main.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_max.png b/res/image/main/icon_max.png new file mode 100644 index 0000000..6cbf073 --- /dev/null +++ b/res/image/main/icon_max.png Binary files differ diff --git a/res/image/main/icon_menu_calibration.png b/res/image/main/icon_menu_calibration.png new file mode 100644 index 0000000..6fca8be --- /dev/null +++ b/res/image/main/icon_menu_calibration.png Binary files differ diff --git a/res/image/main/icon_menu_calibration_selected.png b/res/image/main/icon_menu_calibration_selected.png new file mode 100644 index 0000000..17f918f --- /dev/null +++ b/res/image/main/icon_menu_calibration_selected.png Binary files differ diff --git a/res/image/main/icon_menu_check.png b/res/image/main/icon_menu_check.png new file mode 100644 index 0000000..c3db5fa --- /dev/null +++ b/res/image/main/icon_menu_check.png Binary files differ diff --git a/res/image/main/icon_menu_check_selected.png b/res/image/main/icon_menu_check_selected.png new file mode 100644 index 0000000..9794c43 --- /dev/null +++ b/res/image/main/icon_menu_check_selected.png Binary files differ diff --git a/res/image/main/icon_menu_infomation.png b/res/image/main/icon_menu_infomation.png new file mode 100644 index 0000000..e272f4c --- /dev/null +++ b/res/image/main/icon_menu_infomation.png Binary files differ diff --git a/res/image/main/icon_menu_infomation_checked.png b/res/image/main/icon_menu_infomation_checked.png new file mode 100644 index 0000000..6122c7b --- /dev/null +++ b/res/image/main/icon_menu_infomation_checked.png Binary files differ diff --git a/res/image/main/icon_min.png b/res/image/main/icon_min.png new file mode 100644 index 0000000..2f524d9 --- /dev/null +++ b/res/image/main/icon_min.png Binary files differ diff --git a/res/image/main/icon_min_p.png b/res/image/main/icon_min_p.png deleted file mode 100644 index 93bd487..0000000 --- a/res/image/main/icon_min_p.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_quit_p.png b/res/image/main/icon_quit_p.png deleted file mode 100644 index 10d8bac..0000000 --- a/res/image/main/icon_quit_p.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_setting.png b/res/image/main/icon_setting.png new file mode 100644 index 0000000..8686833 --- /dev/null +++ b/res/image/main/icon_setting.png Binary files differ diff --git a/res/image/main/icon_setting_p.png b/res/image/main/icon_setting_p.png deleted file mode 100644 index f6645f1..0000000 --- a/res/image/main/icon_setting_p.png +++ /dev/null Binary files differ diff --git a/res/image/msgbox/icon_box_close.png b/res/image/msgbox/icon_box_close.png new file mode 100644 index 0000000..e9d00fb --- /dev/null +++ b/res/image/msgbox/icon_box_close.png Binary files differ diff --git a/res/images.qrc b/res/images.qrc index 68608e9..a6ba788 100644 --- a/res/images.qrc +++ b/res/images.qrc @@ -27,27 +27,9 @@ image/Index/u709.svg image/Index/u712.svg image/Index/u715.svg - image/Index/u1176.svg - image/Index/u1180.svg - image/Index/u1220.svg - image/Index/u7406.svg - image/Index/u7453.svg - image/Index/u7458.svg - image/Index/u7488.svg - image/Index/u7491.svg - image/Index/u7538.svg - image/Index/u2324.svg - image/Index/u2325.svg - image/Index/u2158.svg - image/Index/u8448.svg - image/Index/u8458.svg image/Index/u2327.svg image/Index/u5496.svg image/Index/u7313.svg - image/Index/u2188.svg - image/Index/u2189.svg - image/Index/u642.svg - image/Index/u794.svg image/Index/u5089.png image/Index/u138.png image/Index/btnPageFirst.png @@ -96,13 +78,6 @@ image/login/icon_min.png image/login/icon_setting.png image/login/icon_quit.png - image/main/icon_main.png - image/main/iconHumi.png - image/main/iconTemp.png - image/main/icon_close_p.png - image/main/icon_min_p.png - image/main/icon_quit_p.png - image/main/icon_setting_p.png image/main/arrow_down.png image/main/arrow_up.png image/main/icon_btn_pause.png @@ -115,5 +90,19 @@ image/msgbox/icon_box_warning.png image/msgbox/icon_box_fail.png image/login/logo.png + image/main/bg_banner.png + image/main/icon_close.png + image/main/icon_max.png + image/main/icon_min.png + image/main/icon_setting.png + image/main/iconHumi.png + image/main/iconTemp.png + image/main/icon_menu_calibration.png + image/main/icon_menu_calibration_selected.png + image/main/icon_menu_check.png + image/main/icon_menu_check_selected.png + image/main/icon_menu_infomation.png + image/main/icon_menu_infomation_checked.png + image/msgbox/icon_box_close.png diff --git a/res/qss.qrc b/res/qss.qrc index 56752bb..fbb36c0 100644 --- a/res/qss.qrc +++ b/res/qss.qrc @@ -1,14 +1,10 @@ - qss/Index.css qss/preCheck.css - qss/dialogcheckresul.css - qss/tf_testdevice.css - qss/generalStyle.css - qss/checkWin.css qss/loginForm.css qss/mainForm.css qss/baseInfomation.css qss/messageBox.css + qss/infoMain.css diff --git a/res/qss/Index.css b/res/qss/Index.css deleted file mode 100644 index 8842775..0000000 --- a/res/qss/Index.css +++ /dev/null @@ -1,190 +0,0 @@ -*{ -color:black; -} -QLabel { - font-family: "Microsoft YaHei"; -} -QWidget#centralwidget -{ -background-image: url(:/image/Index/u15.png); -background-color:white; -} -QToolButton#tb1:hover{ - background-image: url(:/image/Index/u26_mouseOver.svg); -} -QToolButton#tb2:hover{ - background-image: url(:/image/Index/u26_mouseOver.svg); -} -QToolButton#tb3:hover{ - background-image: url(:/image/Index/u26_mouseOver.svg); -}QToolButton#tb4:hover{ -background-image: url(:/image/Index/u26_mouseOver.svg); -}QToolButton#tb5:hover{ -background-image: url(:/image/Index/u26_mouseOver.svg); -} -QToolButton#tb6:hover{ - background-image: url(:/image/Index/u26_mouseOver.svg); -} -QToolButton#tb1{ -color: white; -background-image: url(:/image/Index/u26.svg); -font-weight: bold; -border-radius: 5px; -text-align: center; -margin:10; -margin-right: 180px; -font: 18pt 微软雅黑; -} -QToolButton#tb2{ -color: white; -background-image: url(:/image/Index/u26.svg); -font-weight: bold; -border-radius: 5px; -text-align: center; -margin:10; -margin-right: 180px; -font: 18pt 微软雅黑; -} -QToolButton#tb3{ -color: white; -background-image: url(:/image/Index/u26.svg); -font-weight: bold; -border-radius: 5px; -text-align: center; -margin:10; -margin-right: 180px; -font: 18pt 微软雅黑; -}QToolButton#tb4{ -color: white; -background-image: url(:/image/Index/u26.svg); -font-weight: bold; -border-radius: 5px; -text-align: center; -margin:10; -margin-right: 180px; -font: 18pt 微软雅黑; -}QToolButton#tb5{ -color: white; -background-image: url(:/image/Index/u26.svg); -font-weight: bold; -border-radius: 5px; -text-align: center; -margin:10; -margin-right: 180px; -font: 18pt 微软雅黑; -}QToolButton#tb6{ -color: white; -background-image: url(:/image/Index/u26.svg); -font-weight: bold; -border-radius: 5px; -text-align: center; -margin:10; -margin-right: 180px; -font: 18pt 微软雅黑; -} - -/******** NewCheckMethod页面 ********/ -QLabel#labelNcmInfo, QLabel#labelNcmGraph, QLabel#labelNcmConfig, QLabel#labelNcmComm { - font-size: 24px; - min-height: 40px; -} - -QLabel[class="ncmFormLabel"] { - font-size: 18px; - padding: 10px 20px; -} - -QLineEdit[class="ncmFormInput"] { - border-radius: 6px; - font-family: "Microsoft YaHei"; - color: #333333; - border: 1px solid #CCCCCC; - font-size: 18px; -} - -QDateEdit[class="ncmFormDate"] { - border-radius: 6px; - font-family: "Microsoft YaHei"; - border: 1px solid #CCCCCC; - font-size: 18px; -} - -QCheckBox { - color: #FFFFFF; - font-family: "Microsoft YaHei"; - font-size: 16px; - /*padding-left: 5px;*/ -} -QCheckBox::indicator { - width: 20px; - height: 20px; - border-radius: 5px; - border: 2px solid #2F6FC6; -} -QCheckBox::indicator::unchecked { - background: #FFFFFF; - /*border: 2px solid #CCCCC;*/ -} -QCheckBox::indicator::checked { - background: #2F6FC6; -} - -QComboBox { - border-radius: 6px; - font-family: "Microsoft YaHei"; - padding-left: 16px; - color: #333333; - border: 1px solid #CCCCCC; - font-size: 18px; -} - -QComboBox::down-arrow { - image: url(":/image/Index/arrowDown.png"); -} -QComboBox::down-arrow::on { - image: url(":/image/Index/arrowUp.png"); -} - -QComboBox::drop-down { - subcontrol-origin: padding; - subcontrol-position: top right; - width: 20px; - border: 0px; - padding-right: 15px; -} - -QComboBox QAbstractItemView { - color: #333333; - background-color: #E1E1ED; - selection-background-color: #2F6FC6; - selection-color: #FFFFFF; - font-family: "Microsoft YaHei"; - outline: 0px; -} - -QComboBox QAbstractItemView::item{ - min-height: 36px; - line-height: 36px; - color: #333333; - padding-left: 9px; - background-color: #FFFFFF; -} - -QComboBox QScrollBar::vertical { - width: 10px; - background: #FFFFFF; - border: none; -} - -QComboBox QScrollBar::handle::vertical { - width: 10px; - background: #2F6FC6; - border: none; -} - -QComboBox QScrollBar::add-line::vertical { - border: none; -} -QComboBox QScrollBar::sub-line::vertical { - border: none; -} diff --git a/res/qss/baseInfomation.css b/res/qss/baseInfomation.css index 636c382..1c6783c 100644 --- a/res/qss/baseInfomation.css +++ b/res/qss/baseInfomation.css @@ -1,5 +1,3 @@ -/*QPalette{background:#FFFFFF;}*/ - QWidget { background-color: #FFFFFF; } @@ -11,7 +9,7 @@ /** 普通按钮 **/ QToolButton[class="btnDefault"] { border-radius: 12px; - background-color: #504897; + background-color: #2F6FC6; color: #FFFFFF; font-family: "Microsoft YaHei"; font-size: 18px; @@ -19,16 +17,16 @@ /** 查询重置按钮 **/ QToolButton[class="btnOpposite"] { border-radius: 12px; - border: 1px solid #504897; + border: 1px solid #2F6FC6; background-color: #FFFFFF; - color: #504897; + color: #2F6FC6; font-family: "Microsoft YaHei"; font-size: 18px; } /** 表格顶端的标题栏 **/ QLabel[class="frameLabel"]{ - background-color: #504897; + background-color: #2F6FC6; border: 0px; border-radius: 0px; border-top-left-radius: 10px; @@ -87,11 +85,11 @@ } QComboBox[class="defaultSelect"] QAbstractItemView::item:hover{ color: #FFFFFF; - background-color: #504897; + background-color: #2F6FC6; } QComboBox[class="defaultSelect"] QAbstractItemView::item:selected{ color: #FFFFFF; - background-color: #504897; + background-color: #2F6FC6; } QComboBox[class="defaultSelect"] QScrollBar::vertical { width: 5px; @@ -100,7 +98,7 @@ } QComboBox[class="defaultSelect"] QScrollBar::handle::vertical { width: 5px; - background: #504897; + background: #2F6FC6; border: none; } QComboBox[class="defaultSelect"] QScrollBar::add-line::vertical { @@ -113,7 +111,7 @@ /** 查询普通按钮 **/ QWidget#wdgtQueryBox QToolButton { border-radius: 12px; - background-color: #504897; + background-color: #2F6FC6; color: #FFFFFF; font-family: "Microsoft YaHei"; font-size: 18px; @@ -121,9 +119,9 @@ /** 查询重置按钮 **/ QWidget#wdgtQueryBox QToolButton[class="btnResetQuery"] { border-radius: 12px; - border: 1px solid #504897; + border: 1px solid #2F6FC6; background-color: #FFFFFF; - color: #504897; + color: #2F6FC6; font-family: "Microsoft YaHei"; font-size: 18px; } @@ -136,7 +134,7 @@ } QTableWidget QHeaderView::section { - background-color: #504897; + background-color: #2F6FC6; border: 1px solid #FFFFFF; color: #FFFFFF; font-size: 18px; @@ -151,7 +149,7 @@ QTableWidget::item::selected { /*background: #FFFFFF; */ - color: #504897; + color: #2F6FC6; } QTableWidget QWidget[class="wdgtOper"] { @@ -189,7 +187,7 @@ /** 分页组件 **/ QWidget[class="wdgtPageBtn"] { - background: #504897; + background: #2F6FC6; border-radius: 6px; } QWidget[class="wdgtPageBtn"] QToolButton { @@ -203,7 +201,7 @@ /** 对话框弹窗顶端的标题栏 **/ QWidget[class="dlgTitle"]{ - background-color: #504897; + background-color: #2F6FC6; border: 0px; padding: 10px; } @@ -284,11 +282,11 @@ } QWidget[class="detailTable"] QComboBox QAbstractItemView::item:hover{ color: #FFFFFF; - background-color: #504897; + background-color: #2F6FC6; } QWidget[class="detailTable"] QComboBox QAbstractItemView::item:selected{ color: #FFFFFF; - background-color: #504897; + background-color: #2F6FC6; } QCheckBox[class="defaultSolid"] { @@ -301,14 +299,14 @@ width: 20px; height: 20px; border-radius: 5px; - border: 2px solid #504897; + border: 2px solid #2F6FC6; } QCheckBox[class="defaultSolid"]::indicator::unchecked { background: #FFFFFF; /*border: 2px solid #CCCCC;*/ } QCheckBox[class="defaultSolid"]::indicator::checked { - background: #504897; + background: #2F6FC6; } /* @@ -482,7 +480,7 @@ } /* 子标题样式 */ QWidget[class="subTitle"] QLabel { - color: #504897; + color: #2F6FC6; font-weight: bold; font-size: 20px; min-height: 40px; @@ -500,4 +498,4 @@ border: 1px solid #CCCCCC; font-size: 18px; } -*/ \ No newline at end of file +*/ diff --git a/res/qss/checkWin.css b/res/qss/checkWin.css deleted file mode 100644 index c5083da..0000000 --- a/res/qss/checkWin.css +++ /dev/null @@ -1,147 +0,0 @@ -QLabel { - font-family: Microsoft YaHei; - font-size: 18px; -} - -QPushButton[class="default"] { - font-family: Microsoft YaHei; - background-color:#504897; - font-size:16px; - font-weight: bold; - color:white; - border-radius: 5px; -} -QPushButton[class="default"]::hover { - color:white; - font-size: 17px; -} - -QPushButton[class="defEx"] { - font-family: Microsoft YaHei; - background-color:#169bd5; - font-size:16px; - font-weight: bold; - color:white; - border-radius: 5px; -} -QPushButton[class="defEx"]::hover { - color:white; - font-size: 17px; -} -QTableWidget[class="defTable"]{ - font-size: 22px; - color: #333333; - border: 1px solid #4b4b4b; - border-radius: 6px; - background-color: transparent; -} -QTableWidget[class="checkItemTable"]{ - font-size: 22px; - color: black; - border: 1px solid #4b4b4b; - border-radius: 6px; - background-color: white; -} -QTableWidget[class="checkItemTable"]::item::selected { - background: #504897; - color: #ffffff; -} -QTableWidget[class="defTable"]::item::selected { - background: #504897; - color: #ffffff; -} -QHeaderView[class="defTableHead"]::section{ - background-color: #504897; - border: 0px; - color: #ffffff; - font-size: 20px; -} -QLineEdit[class="Inputdef"]{ -background-color: white; /* 背景色:浅灰色 */ -border: 2px solid #cccccc; /* 边框:灰色 */ -border-radius: 8px; /* 圆角边框 */ -padding: 5px 10px; /* 内边距,增加输入区域的间距 */ -font-size: 20px; /* 字体大小 */ -font-family: "Segoe UI", sans-serif; /* 字体 */ -color: black; /* 字体颜色 */ -} -QLineEdit[class="Inputdef"]:focus { - border: 2px solid #f89a5c; - background-color: #ffffff; -} -QLineEdit[class="Inputdef"]:readonly { - background-color: #dddddd; - border: 1px solid #dddddd; - color: #636363; - -} -QWidget[class="defGBox"]{ - background-color:#f5ede0; - border: 1px solid #cccccc; - font-size: 18px; -} -QComboBox[class="Comboxdef"] { - background-color: white; - border: 1px solid #cccccc; - border-radius: 4px; - padding: 5px 10px; - font-size: 20px; - font-family: "Segoe UI", sans-serif; /* 字体 */ - color: black; /* 字体颜色 */ - min-width: 50px; /* 设置最小宽度 */ -} -QComboBox[class="Comboxdef"]:hover { - border: 1px solid #f89a5c; /* 鼠标悬浮时边框颜色变为绿色 */ -} - -QComboBox[class="Comboxdef"]:focus { - border: 1px solid #f89a5c; /* 聚焦时边框颜色变为 */ - background-color: #f9f9f9; /* 聚焦时背景色 */ -} - -QComboBox[class="Comboxdef"]::down-arrow { - - width: 12px; /* 设置箭头的宽度 */ - height: 12px; /* 设置箭头的高度 */ -} -QComboBox[class="Comboxdef"] QAbstractItemView { - border: 1px solid #cccccc; /* 下拉列表边框 */ - background-color: #ffffff; /* 下拉列表背景色 */ - selection-background-color: #f89a5c; /* 选中项背景色 */ - selection-color: white; /* 选中项文本颜色 */ - padding: 5px; /* 下拉项内边距 */ -} - -QComboBox[class="Comboxdef"]:disabled { - background-color: #dddddd; /* 禁用状态背景 */ - border: 1px solid #dddddd; /* 禁用状态下边框 */ - color: #636363; /* 禁用状态字体颜色 */ -} -QScrollArea[class="defscrollArea"]{ - background-color: transparent; -} - -QPushButton[class="defTest"] { - font-family: Microsoft YaHei; - background-color:#5481ba; - font-size:16px; - font-weight: bold; - color:white; - border-radius: 5px; -} -QPushButton[class="defTest"]::hover { - color:white; - font-size: 17px; -} -QPushButton[class="defTestStop"] { - font-family: Microsoft YaHei; - background-color:#e03d3e; - font-size:16px; - font-weight: bold; - color:white; - border-radius: 5px; -} -QPushButton[class="defTestStop"]::hover { - color:white; - font-size: 17px; -} diff --git a/res/qss/dialogcheckresul.css b/res/qss/dialogcheckresul.css deleted file mode 100644 index 0fd89db..0000000 --- a/res/qss/dialogcheckresul.css +++ /dev/null @@ -1,71 +0,0 @@ -QPushButton[class="ButtonSave"] { - -background-color: rgb(51, 69, 130); -color: rgb(255, 255, 255); -} -QPushButton[class="ButtonPrint"] { -background-color: rgb(100, 132, 68); -color: rgb(255, 255, 255); -} -QToolButton[class="ButtonSave"]::hover { -background-color: rgb(5, 69, 154); -} -QToolButton[class="ButtonSave"]:pressed { -background-color: rgb(3, 61, 139); -} -QComboBox[class="Comboxdef"] { - background-color: white; - border: 1px solid #cccccc; - border-radius: 4px; - padding: 5px 10px; - font-size: 20px; - font-family: "Segoe UI", sans-serif; /* 字体 */ - color: black; /* 字体颜色 */ - min-width: 50px; /* 设置最小宽度 */ -} -QComboBox[class="Comboxdef"]:hover { - border: 1px solid #f89a5c; /* 鼠标悬浮时边框颜色变为绿色 */ -} - -QComboBox[class="Comboxdef"]:focus { - border: 1px solid #f89a5c; /* 聚焦时边框颜色变为 */ - background-color: #f9f9f9; /* 聚焦时背景色 */ -} - -QComboBox[class="Comboxdef"]::down-arrow { - - width: 12px; /* 设置箭头的宽度 */ - height: 12px; /* 设置箭头的高度 */ -} -QComboBox[class="Comboxdef"] QAbstractItemView { - border: 1px solid #cccccc; /* 下拉列表边框 */ - background-color: #ffffff; /* 下拉列表背景色 */ - selection-background-color: #f89a5c; /* 选中项背景色 */ - selection-color: white; /* 选中项文本颜色 */ - padding: 5px; /* 下拉项内边距 */ -} - -QComboBox[class="Comboxdef"]:disabled { - background-color: #dddddd; /* 禁用状态背景 */ - border: 1px solid #dddddd; /* 禁用状态下边框 */ - color: #636363; /* 禁用状态字体颜色 */ -} -QLineEdit[class="Inputdef"]{ -background-color: white; /* 背景色:浅灰色 */ -border: 2px solid #cccccc; /* 边框:灰色 */ -border-radius: 8px; /* 圆角边框 */ -padding: 5px 10px; /* 内边距,增加输入区域的间距 */ -font-size: 20px; /* 字体大小 */ -font-family: "Segoe UI", sans-serif; /* 字体 */ -color: black; /* 字体颜色 */ -} -QLineEdit[class="Inputdef"]:focus { - border: 2px solid #f89a5c; - background-color: #ffffff; -} -QLineEdit[class="Inputdef"]:readonly { - background-color: #dddddd; - border: 1px solid #dddddd; - color: #636363; - -} diff --git a/res/qss/generalStyle.css b/res/qss/generalStyle.css deleted file mode 100644 index eceebd4..0000000 --- a/res/qss/generalStyle.css +++ /dev/null @@ -1,6 +0,0 @@ - - -QStackedWidget[class="BasestackedWidget"]{ - background: qlineargradient(y1: 0, y2: 1,stop: 0 rgba(255, 255, 255, 255),stop: 1 rgba(237, 221, 196, 255)); - background: qlineargradient(y1: 0, y2: 1,stop: 0 rgba(255, 255, 255, 255),stop: 1 rgba(237, 221, 196, 255)); -} diff --git a/res/qss/infoMain.css b/res/qss/infoMain.css new file mode 100644 index 0000000..2f178c7 --- /dev/null +++ b/res/qss/infoMain.css @@ -0,0 +1,26 @@ +QWidget { + background-color: #FFFFFF; +} +QLabel { + font-family: Microsoft YaHei; + font-size: 18px; +} +QScrollArea { + border: none; +} +QScrollBar::vertical { + width: 5px; + background: #FFFFFF; + border: none; +} +QScrollBar::handle::vertical { + width: 5px; + background: #2F6FC6; + border: none; +} +QScrollBar::add-line::vertical { + border: none; +} +QScrollBar::sub-line::vertical { + border: none; +} \ No newline at end of file diff --git a/res/qss/mainForm.css b/res/qss/mainForm.css index 666e8de..cf39f4e 100644 --- a/res/qss/mainForm.css +++ b/res/qss/mainForm.css @@ -1,43 +1,46 @@ -/*QPalette{background:#DFEBF2;}*/ - QWidget { - background-color: #DFEBF2; + background: transparent; } - QLable { font-size: 16px; color: #333333; + background: transparent; +} +QToolButton { + background: transparent; +} + +QWidget#wdgtTop { + background: qlineargradient(x1:0, y1:0, x2:1, y2:1, stop:0 #71b5ff, stop:1 #3d7eff); } /** 左上角LOGO和TITLE **/ QWidget#wdgtTitle QLabel#labelLogo{ margin: 10px; - font-family: "Microsoft YaHei"; } QWidget#wdgtTitle QLabel#labelTitle{ - color: #504897; + color: #FFFFFF; font-size: 30px; font-weight: bold; - /*font-style: italic;*/ - font-family: "Microsoft YaHei"; + font-family: "Microsoft YaHei"; } + /** 中间菜单按钮区域 **/ QWidget#wdgtFunc QToolButton { - background: transparent; border: 0px; border-radius: 10px; + font-size: 18px; font-family: "Microsoft YaHei"; - font-size: 20px; - color: #333333; - padding: 16px; + color: #FFFFFF; + padding: 10px; } QWidget#wdgtFunc QToolButton:checked { - background: #504897; + background: #69C2F7; color: #FFFFFF; } QWidget#wdgtFunc QToolButton:checked:hover { - background: #504897; + background: #69C2F7; color: #FFFFFF; } QWidget#wdgtFunc QToolButton:hover { @@ -46,6 +49,13 @@ } +/** 温湿度环境 **/ +QWidget#wdgtEnv QLabel{ + font-size: 20px; + color: #FFFFFF; + font-family: "Microsoft YaHei"; +} + /** 右上角关闭最小化按钮 **/ QWidget#wdgtBtnWin QToolButton{ @@ -56,22 +66,7 @@ QWidget#wdgtLoginUser QLabel{ font-size: 20px; - color: #504897; - font-family: "Microsoft YaHei"; - font-weight: bold; - /*font-style: italic;*/ -} - -QWidget#wdgtTemp QLabel{ - font-size: 20px; - color: #333333; + color: #FFFFFF; font-family: "Microsoft YaHei"; -} - - -/** 状态栏 **/ -QWidget#wdgtFoot QLabel{ - font-size: 18px; - color: #333333; - font-family: "Microsoft YaHei"; + /*font-weight: bold;*/ } diff --git a/AutoCalibrationXC.pro b/AutoCalibrationXC.pro index 6bcb335..7790b37 100644 --- a/AutoCalibrationXC.pro +++ b/AutoCalibrationXC.pro @@ -24,11 +24,6 @@ include(QPagedTable/QPagedTable.pri) SOURCES += main.cpp -SOURCES += MainWindow.cpp - -HEADERS += MainWindow.h - -FORMS += MainWindow.ui RC_ICONS = res/autoCalibration.ico diff --git a/MainWindow.cpp b/MainWindow.cpp deleted file mode 100644 index ff126e8..0000000 --- a/MainWindow.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#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/MainWindow.h b/MainWindow.h deleted file mode 100644 index 4643e32..0000000 --- a/MainWindow.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#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; -}; -#endif // MAINWINDOW_H diff --git a/MainWindow.ui b/MainWindow.ui deleted file mode 100644 index b232854..0000000 --- a/MainWindow.ui +++ /dev/null @@ -1,22 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 800 - 600 - - - - MainWindow - - - - - - - - diff --git a/frame/CustomMessageBox.ui b/frame/CustomMessageBox.ui index 336be54..b545d74 100644 --- a/frame/CustomMessageBox.ui +++ b/frame/CustomMessageBox.ui @@ -84,8 +84,8 @@ - - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + + :/image/msgbox/icon_box_close.png:/image/msgbox/icon_box_close.png @@ -134,7 +134,7 @@ - :/image/msgbox/icon_box_success.png + :/image/msgbox/icon_box_success.png Qt::AlignCenter @@ -265,6 +265,8 @@ - + + + diff --git a/frame/MainWindowForm.cpp b/frame/MainWindowForm.cpp index 2ded44b..ec82cd7 100644 --- a/frame/MainWindowForm.cpp +++ b/frame/MainWindowForm.cpp @@ -1,6 +1,8 @@ #include "MainWindowForm.h" #include "ui_MainWindowForm.h" +#include + MainWindowForm::MainWindowForm(QWidget *parent) : FramelessWindow(parent), ui(new Ui::MainWindowForm) @@ -12,7 +14,7 @@ initMenuWidgets(); initFunctionButtons(); - // 每秒更新 界面上没有地方能摆 暂时先不启动定时器 + // 每秒更新 connect(TimeCounterUtil::getInstance().clockTimer, &QTimer::timeout, this, &MainWindowForm::onUpdateTimestampHandler); TimeCounterUtil::getInstance().clockTimer->start(1000); @@ -34,6 +36,7 @@ void MainWindowForm::initForm() { setWindowFlags(Qt::FramelessWindowHint); // 设置全屏 + setWindowState(Qt::WindowState::WindowMaximized); this->setTitleBar(ui->wdgtTop); // 设置窗口位置和大小 move(0, 0); @@ -120,6 +123,22 @@ setWindowState(Qt::WindowMinimized | windowState()); } +void MainWindowForm::on_btnMaxWin_clicked() +{ + QScreen *screen = QGuiApplication::primaryScreen(); + QRect screenSize = screen->availableGeometry(); // 可用区域(排除任务栏) + + if (this->isMaximized()) { + resize(screenSize.width() * 0.8, screenSize.height() * 0.8); + move(QRandomGenerator::global()->bounded(10, 100), QRandomGenerator::global()->bounded(10, 50)); + this->showNormal(); + } else { + resize(screenSize.width(), screenSize.height()); + move(0, 0); + this->showMaximized(); + } +} + void MainWindowForm::on_btnCloseWin_clicked() { // 创建一个消息框 @@ -146,18 +165,9 @@ ui->labelTime->setText(now.toString("yyyy-MM-dd HH:mm:ss")); } -void MainWindowForm::on_btnMenuMax_clicked() -{ - if (this->isMaximized()) { - this->showNormal(); - } else { - this->showMaximized(); - } -} - void MainWindowForm::titleDblClick() { - on_btnMenuMax_clicked(); + on_btnMaxWin_clicked(); } void MainWindowForm::onMenuButtonsEabled(bool enable) { diff --git a/frame/MainWindowForm.h b/frame/MainWindowForm.h index 4d206b1..9b4eae4 100644 --- a/frame/MainWindowForm.h +++ b/frame/MainWindowForm.h @@ -45,11 +45,11 @@ private slots: void on_btnMinWin_clicked(); + void on_btnMaxWin_clicked(); void on_btnCloseWin_clicked(); void onFunctionButtonsAction(); void onUpdateTimestampHandler(); - void on_btnMenuMax_clicked(); void titleDblClick(); void onMenuButtonsEabled(bool enable); diff --git a/frame/MainWindowForm.ui b/frame/MainWindowForm.ui index bd42122..f37d171 100644 --- a/frame/MainWindowForm.ui +++ b/frame/MainWindowForm.ui @@ -41,7 +41,7 @@ 0 - 120 + 100 @@ -58,7 +58,7 @@ 20 - 0 + 20 @@ -88,8 +88,8 @@ - 120 - 120 + 150 + 100 @@ -107,6 +107,22 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + @@ -158,7 +174,7 @@ 100 - 84 + 72 @@ -166,7 +182,8 @@ - :/image/main/calibration.png:/image/main/calibration.png + :/image/main/icon_menu_calibration.png + :/image/main/icon_menu_calibration_selected.png:/image/main/icon_menu_calibration.png @@ -184,7 +201,7 @@ 100 - 84 + 72 @@ -192,7 +209,8 @@ - :/image/main/rawDataRecord.png:/image/main/rawDataRecord.png + :/image/main/icon_menu_check.png + :/image/main/icon_menu_check_selected.png:/image/main/icon_menu_check.png @@ -210,7 +228,7 @@ 100 - 84 + 72 @@ -218,7 +236,8 @@ - :/image/main/fileRes.png:/image/main/fileRes.png + :/image/main/icon_menu_infomation.png + :/image/main/icon_menu_infomation_checked.png:/image/main/icon_menu_infomation.png @@ -235,10 +254,147 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 50 + 20 + + + + + - 320 + 240 + 16777215 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 5 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + :/image/main/iconTemp.png + + + + + + + 34.5℃ + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + + + + :/image/main/iconHumi.png + + + + + + + 25%Rh + + + + + + + + + + + + + + 240 16777215 @@ -308,7 +464,7 @@ - :/image/main/icon_setting_p.png:/image/main/icon_setting_p.png + :/image/main/icon_setting.png:/image/main/icon_setting.png @@ -334,7 +490,33 @@ - :/image/main/icon_min_p.png:/image/main/icon_min_p.png + :/image/main/icon_min.png:/image/main/icon_min.png + + + + 32 + 32 + + + + + + + + + 40 + 40 + + + + 最小化 + + + + + + + :/image/main/icon_max.png:/image/main/icon_max.png @@ -360,7 +542,7 @@ - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + :/image/main/icon_close.png:/image/main/icon_close.png @@ -426,87 +608,9 @@ - - - - - 0 - 30 - - - - - 20 - - - 0 - - - 0 - - - 40 - - - 0 - - - - - Qt::Horizontal - - - - 1289 - 20 - - - - - - - - - - - - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 20 - - - - - - - - - - - - - - wdgtContent wdgtTop - wdgtFoot diff --git a/infomation/InfoMainForm.cpp b/infomation/InfoMainForm.cpp index c001199..5d0ffc8 100644 --- a/infomation/InfoMainForm.cpp +++ b/infomation/InfoMainForm.cpp @@ -21,9 +21,13 @@ void InfoMainForm::initForm() { + // 加载样式表 + QString qssStyle = QssFileUtils::loadQssFileContent(QApplication::applicationDirPath() + "/qss/infoMain.css"); + if (qssStyle.isEmpty() == false) { + this->setStyleSheet(qssStyle); // 仅本窗口生效 + } - - + ui->scrollArea->setWindowFlags(Qt::FramelessWindowHint); // 设置无边框 } void InfoMainForm::initSubMenuForms() { diff --git a/infomation/InfoMainForm.ui b/infomation/InfoMainForm.ui index 958a6b2..d9066dd 100644 --- a/infomation/InfoMainForm.ui +++ b/infomation/InfoMainForm.ui @@ -90,7 +90,7 @@ - 280 + 295 48 @@ -103,7 +103,7 @@ - 280 + 295 48 @@ -116,7 +116,7 @@ - 280 + 295 48 @@ -129,7 +129,7 @@ - 280 + 295 48 @@ -142,7 +142,7 @@ - 280 + 295 48 @@ -155,7 +155,7 @@ - 280 + 295 48 @@ -168,7 +168,7 @@ - 280 + 295 48 @@ -181,7 +181,7 @@ - 280 + 295 48 @@ -194,7 +194,7 @@ - 280 + 295 48 @@ -207,7 +207,7 @@ - 280 + 295 48 @@ -220,7 +220,7 @@ - 280 + 295 48 @@ -233,7 +233,7 @@ - 280 + 295 48 @@ -246,7 +246,7 @@ - 280 + 295 48 diff --git a/infomation/task/DeptTaskForm.cpp b/infomation/task/DeptTaskForm.cpp index ea21a9f..cc6bf31 100644 --- a/infomation/task/DeptTaskForm.cpp +++ b/infomation/task/DeptTaskForm.cpp @@ -18,12 +18,17 @@ delete ui; } -void DeptTaskForm::showEvent(QShowEvent *event) +void DeptTaskForm::showEvent(QShowEvent * event) { ui->tableDeptTask->adjustTableWidth(); getDeptTaskList(0); } +void DeptTaskForm::resizeEvent(QResizeEvent * event) +{ + ui->tableDeptTask->adjustTableWidth(); +} + void DeptTaskForm::initFormTable() { // 初始化查询条件 diff --git a/infomation/task/DeptTaskForm.h b/infomation/task/DeptTaskForm.h index 1055c36..3c1ad5b 100644 --- a/infomation/task/DeptTaskForm.h +++ b/infomation/task/DeptTaskForm.h @@ -21,7 +21,8 @@ ~DeptTaskForm(); protected: - void showEvent(QShowEvent *event) override; + void showEvent(QShowEvent * event) override; + void resizeEvent(QResizeEvent * event) override; private: Ui::DeptTaskForm *ui; diff --git a/main.cpp b/main.cpp index 525387e..0b78c87 100644 --- a/main.cpp +++ b/main.cpp @@ -1,5 +1,3 @@ -#include "MainWindow.h" - #include #include diff --git a/res/image/Index/u1176.svg b/res/image/Index/u1176.svg deleted file mode 100644 index c81ce8a..0000000 --- a/res/image/Index/u1176.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1180.svg b/res/image/Index/u1180.svg deleted file mode 100644 index 2ef24ab..0000000 --- a/res/image/Index/u1180.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1220.svg b/res/image/Index/u1220.svg deleted file mode 100644 index 43452aa..0000000 --- a/res/image/Index/u1220.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2158.svg b/res/image/Index/u2158.svg deleted file mode 100644 index fd249e0..0000000 --- a/res/image/Index/u2158.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u2188.svg b/res/image/Index/u2188.svg deleted file mode 100644 index 34f53c4..0000000 --- a/res/image/Index/u2188.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2189.svg b/res/image/Index/u2189.svg deleted file mode 100644 index 01a6bbb..0000000 --- a/res/image/Index/u2189.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2324.svg b/res/image/Index/u2324.svg deleted file mode 100644 index 797f1c5..0000000 --- a/res/image/Index/u2324.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2325.svg b/res/image/Index/u2325.svg deleted file mode 100644 index fefe01b..0000000 --- a/res/image/Index/u2325.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u642.svg b/res/image/Index/u642.svg deleted file mode 100644 index 33c9e0a..0000000 --- a/res/image/Index/u642.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u7406.svg b/res/image/Index/u7406.svg deleted file mode 100644 index 8a7a6d9..0000000 --- a/res/image/Index/u7406.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7453.svg b/res/image/Index/u7453.svg deleted file mode 100644 index 603c496..0000000 --- a/res/image/Index/u7453.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7458.svg b/res/image/Index/u7458.svg deleted file mode 100644 index b31087b..0000000 --- a/res/image/Index/u7458.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7488.svg b/res/image/Index/u7488.svg deleted file mode 100644 index 8baf439..0000000 --- a/res/image/Index/u7488.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7491.svg b/res/image/Index/u7491.svg deleted file mode 100644 index 3e41c10..0000000 --- a/res/image/Index/u7491.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7538.svg b/res/image/Index/u7538.svg deleted file mode 100644 index 417077d..0000000 --- a/res/image/Index/u7538.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u794.svg b/res/image/Index/u794.svg deleted file mode 100644 index e12cff7..0000000 --- a/res/image/Index/u794.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u8448.svg b/res/image/Index/u8448.svg deleted file mode 100644 index 7f6f4c0..0000000 --- a/res/image/Index/u8448.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u8458.svg b/res/image/Index/u8458.svg deleted file mode 100644 index 6d04a12..0000000 --- a/res/image/Index/u8458.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/main/bg_banner.png b/res/image/main/bg_banner.png new file mode 100644 index 0000000..26ddffd --- /dev/null +++ b/res/image/main/bg_banner.png Binary files differ diff --git a/res/image/main/iconHumi.png b/res/image/main/iconHumi.png index 4410d38..bd164e8 100644 --- a/res/image/main/iconHumi.png +++ b/res/image/main/iconHumi.png Binary files differ diff --git a/res/image/main/iconTemp.png b/res/image/main/iconTemp.png index 8fd059c..a2cfe4d 100644 --- a/res/image/main/iconTemp.png +++ b/res/image/main/iconTemp.png Binary files differ diff --git a/res/image/main/icon_close.png b/res/image/main/icon_close.png new file mode 100644 index 0000000..f3aa270 --- /dev/null +++ b/res/image/main/icon_close.png Binary files differ diff --git a/res/image/main/icon_close_p.png b/res/image/main/icon_close_p.png deleted file mode 100644 index b9ba30c..0000000 --- a/res/image/main/icon_close_p.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_main.png b/res/image/main/icon_main.png deleted file mode 100644 index 9d004d5..0000000 --- a/res/image/main/icon_main.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_max.png b/res/image/main/icon_max.png new file mode 100644 index 0000000..6cbf073 --- /dev/null +++ b/res/image/main/icon_max.png Binary files differ diff --git a/res/image/main/icon_menu_calibration.png b/res/image/main/icon_menu_calibration.png new file mode 100644 index 0000000..6fca8be --- /dev/null +++ b/res/image/main/icon_menu_calibration.png Binary files differ diff --git a/res/image/main/icon_menu_calibration_selected.png b/res/image/main/icon_menu_calibration_selected.png new file mode 100644 index 0000000..17f918f --- /dev/null +++ b/res/image/main/icon_menu_calibration_selected.png Binary files differ diff --git a/res/image/main/icon_menu_check.png b/res/image/main/icon_menu_check.png new file mode 100644 index 0000000..c3db5fa --- /dev/null +++ b/res/image/main/icon_menu_check.png Binary files differ diff --git a/res/image/main/icon_menu_check_selected.png b/res/image/main/icon_menu_check_selected.png new file mode 100644 index 0000000..9794c43 --- /dev/null +++ b/res/image/main/icon_menu_check_selected.png Binary files differ diff --git a/res/image/main/icon_menu_infomation.png b/res/image/main/icon_menu_infomation.png new file mode 100644 index 0000000..e272f4c --- /dev/null +++ b/res/image/main/icon_menu_infomation.png Binary files differ diff --git a/res/image/main/icon_menu_infomation_checked.png b/res/image/main/icon_menu_infomation_checked.png new file mode 100644 index 0000000..6122c7b --- /dev/null +++ b/res/image/main/icon_menu_infomation_checked.png Binary files differ diff --git a/res/image/main/icon_min.png b/res/image/main/icon_min.png new file mode 100644 index 0000000..2f524d9 --- /dev/null +++ b/res/image/main/icon_min.png Binary files differ diff --git a/res/image/main/icon_min_p.png b/res/image/main/icon_min_p.png deleted file mode 100644 index 93bd487..0000000 --- a/res/image/main/icon_min_p.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_quit_p.png b/res/image/main/icon_quit_p.png deleted file mode 100644 index 10d8bac..0000000 --- a/res/image/main/icon_quit_p.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_setting.png b/res/image/main/icon_setting.png new file mode 100644 index 0000000..8686833 --- /dev/null +++ b/res/image/main/icon_setting.png Binary files differ diff --git a/res/image/main/icon_setting_p.png b/res/image/main/icon_setting_p.png deleted file mode 100644 index f6645f1..0000000 --- a/res/image/main/icon_setting_p.png +++ /dev/null Binary files differ diff --git a/res/image/msgbox/icon_box_close.png b/res/image/msgbox/icon_box_close.png new file mode 100644 index 0000000..e9d00fb --- /dev/null +++ b/res/image/msgbox/icon_box_close.png Binary files differ diff --git a/res/images.qrc b/res/images.qrc index 68608e9..a6ba788 100644 --- a/res/images.qrc +++ b/res/images.qrc @@ -27,27 +27,9 @@ image/Index/u709.svg image/Index/u712.svg image/Index/u715.svg - image/Index/u1176.svg - image/Index/u1180.svg - image/Index/u1220.svg - image/Index/u7406.svg - image/Index/u7453.svg - image/Index/u7458.svg - image/Index/u7488.svg - image/Index/u7491.svg - image/Index/u7538.svg - image/Index/u2324.svg - image/Index/u2325.svg - image/Index/u2158.svg - image/Index/u8448.svg - image/Index/u8458.svg image/Index/u2327.svg image/Index/u5496.svg image/Index/u7313.svg - image/Index/u2188.svg - image/Index/u2189.svg - image/Index/u642.svg - image/Index/u794.svg image/Index/u5089.png image/Index/u138.png image/Index/btnPageFirst.png @@ -96,13 +78,6 @@ image/login/icon_min.png image/login/icon_setting.png image/login/icon_quit.png - image/main/icon_main.png - image/main/iconHumi.png - image/main/iconTemp.png - image/main/icon_close_p.png - image/main/icon_min_p.png - image/main/icon_quit_p.png - image/main/icon_setting_p.png image/main/arrow_down.png image/main/arrow_up.png image/main/icon_btn_pause.png @@ -115,5 +90,19 @@ image/msgbox/icon_box_warning.png image/msgbox/icon_box_fail.png image/login/logo.png + image/main/bg_banner.png + image/main/icon_close.png + image/main/icon_max.png + image/main/icon_min.png + image/main/icon_setting.png + image/main/iconHumi.png + image/main/iconTemp.png + image/main/icon_menu_calibration.png + image/main/icon_menu_calibration_selected.png + image/main/icon_menu_check.png + image/main/icon_menu_check_selected.png + image/main/icon_menu_infomation.png + image/main/icon_menu_infomation_checked.png + image/msgbox/icon_box_close.png diff --git a/res/qss.qrc b/res/qss.qrc index 56752bb..fbb36c0 100644 --- a/res/qss.qrc +++ b/res/qss.qrc @@ -1,14 +1,10 @@ - qss/Index.css qss/preCheck.css - qss/dialogcheckresul.css - qss/tf_testdevice.css - qss/generalStyle.css - qss/checkWin.css qss/loginForm.css qss/mainForm.css qss/baseInfomation.css qss/messageBox.css + qss/infoMain.css diff --git a/res/qss/Index.css b/res/qss/Index.css deleted file mode 100644 index 8842775..0000000 --- a/res/qss/Index.css +++ /dev/null @@ -1,190 +0,0 @@ -*{ -color:black; -} -QLabel { - font-family: "Microsoft YaHei"; -} -QWidget#centralwidget -{ -background-image: url(:/image/Index/u15.png); -background-color:white; -} -QToolButton#tb1:hover{ - background-image: url(:/image/Index/u26_mouseOver.svg); -} -QToolButton#tb2:hover{ - background-image: url(:/image/Index/u26_mouseOver.svg); -} -QToolButton#tb3:hover{ - background-image: url(:/image/Index/u26_mouseOver.svg); -}QToolButton#tb4:hover{ -background-image: url(:/image/Index/u26_mouseOver.svg); -}QToolButton#tb5:hover{ -background-image: url(:/image/Index/u26_mouseOver.svg); -} -QToolButton#tb6:hover{ - background-image: url(:/image/Index/u26_mouseOver.svg); -} -QToolButton#tb1{ -color: white; -background-image: url(:/image/Index/u26.svg); -font-weight: bold; -border-radius: 5px; -text-align: center; -margin:10; -margin-right: 180px; -font: 18pt 微软雅黑; -} -QToolButton#tb2{ -color: white; -background-image: url(:/image/Index/u26.svg); -font-weight: bold; -border-radius: 5px; -text-align: center; -margin:10; -margin-right: 180px; -font: 18pt 微软雅黑; -} -QToolButton#tb3{ -color: white; -background-image: url(:/image/Index/u26.svg); -font-weight: bold; -border-radius: 5px; -text-align: center; -margin:10; -margin-right: 180px; -font: 18pt 微软雅黑; -}QToolButton#tb4{ -color: white; -background-image: url(:/image/Index/u26.svg); -font-weight: bold; -border-radius: 5px; -text-align: center; -margin:10; -margin-right: 180px; -font: 18pt 微软雅黑; -}QToolButton#tb5{ -color: white; -background-image: url(:/image/Index/u26.svg); -font-weight: bold; -border-radius: 5px; -text-align: center; -margin:10; -margin-right: 180px; -font: 18pt 微软雅黑; -}QToolButton#tb6{ -color: white; -background-image: url(:/image/Index/u26.svg); -font-weight: bold; -border-radius: 5px; -text-align: center; -margin:10; -margin-right: 180px; -font: 18pt 微软雅黑; -} - -/******** NewCheckMethod页面 ********/ -QLabel#labelNcmInfo, QLabel#labelNcmGraph, QLabel#labelNcmConfig, QLabel#labelNcmComm { - font-size: 24px; - min-height: 40px; -} - -QLabel[class="ncmFormLabel"] { - font-size: 18px; - padding: 10px 20px; -} - -QLineEdit[class="ncmFormInput"] { - border-radius: 6px; - font-family: "Microsoft YaHei"; - color: #333333; - border: 1px solid #CCCCCC; - font-size: 18px; -} - -QDateEdit[class="ncmFormDate"] { - border-radius: 6px; - font-family: "Microsoft YaHei"; - border: 1px solid #CCCCCC; - font-size: 18px; -} - -QCheckBox { - color: #FFFFFF; - font-family: "Microsoft YaHei"; - font-size: 16px; - /*padding-left: 5px;*/ -} -QCheckBox::indicator { - width: 20px; - height: 20px; - border-radius: 5px; - border: 2px solid #2F6FC6; -} -QCheckBox::indicator::unchecked { - background: #FFFFFF; - /*border: 2px solid #CCCCC;*/ -} -QCheckBox::indicator::checked { - background: #2F6FC6; -} - -QComboBox { - border-radius: 6px; - font-family: "Microsoft YaHei"; - padding-left: 16px; - color: #333333; - border: 1px solid #CCCCCC; - font-size: 18px; -} - -QComboBox::down-arrow { - image: url(":/image/Index/arrowDown.png"); -} -QComboBox::down-arrow::on { - image: url(":/image/Index/arrowUp.png"); -} - -QComboBox::drop-down { - subcontrol-origin: padding; - subcontrol-position: top right; - width: 20px; - border: 0px; - padding-right: 15px; -} - -QComboBox QAbstractItemView { - color: #333333; - background-color: #E1E1ED; - selection-background-color: #2F6FC6; - selection-color: #FFFFFF; - font-family: "Microsoft YaHei"; - outline: 0px; -} - -QComboBox QAbstractItemView::item{ - min-height: 36px; - line-height: 36px; - color: #333333; - padding-left: 9px; - background-color: #FFFFFF; -} - -QComboBox QScrollBar::vertical { - width: 10px; - background: #FFFFFF; - border: none; -} - -QComboBox QScrollBar::handle::vertical { - width: 10px; - background: #2F6FC6; - border: none; -} - -QComboBox QScrollBar::add-line::vertical { - border: none; -} -QComboBox QScrollBar::sub-line::vertical { - border: none; -} diff --git a/res/qss/baseInfomation.css b/res/qss/baseInfomation.css index 636c382..1c6783c 100644 --- a/res/qss/baseInfomation.css +++ b/res/qss/baseInfomation.css @@ -1,5 +1,3 @@ -/*QPalette{background:#FFFFFF;}*/ - QWidget { background-color: #FFFFFF; } @@ -11,7 +9,7 @@ /** 普通按钮 **/ QToolButton[class="btnDefault"] { border-radius: 12px; - background-color: #504897; + background-color: #2F6FC6; color: #FFFFFF; font-family: "Microsoft YaHei"; font-size: 18px; @@ -19,16 +17,16 @@ /** 查询重置按钮 **/ QToolButton[class="btnOpposite"] { border-radius: 12px; - border: 1px solid #504897; + border: 1px solid #2F6FC6; background-color: #FFFFFF; - color: #504897; + color: #2F6FC6; font-family: "Microsoft YaHei"; font-size: 18px; } /** 表格顶端的标题栏 **/ QLabel[class="frameLabel"]{ - background-color: #504897; + background-color: #2F6FC6; border: 0px; border-radius: 0px; border-top-left-radius: 10px; @@ -87,11 +85,11 @@ } QComboBox[class="defaultSelect"] QAbstractItemView::item:hover{ color: #FFFFFF; - background-color: #504897; + background-color: #2F6FC6; } QComboBox[class="defaultSelect"] QAbstractItemView::item:selected{ color: #FFFFFF; - background-color: #504897; + background-color: #2F6FC6; } QComboBox[class="defaultSelect"] QScrollBar::vertical { width: 5px; @@ -100,7 +98,7 @@ } QComboBox[class="defaultSelect"] QScrollBar::handle::vertical { width: 5px; - background: #504897; + background: #2F6FC6; border: none; } QComboBox[class="defaultSelect"] QScrollBar::add-line::vertical { @@ -113,7 +111,7 @@ /** 查询普通按钮 **/ QWidget#wdgtQueryBox QToolButton { border-radius: 12px; - background-color: #504897; + background-color: #2F6FC6; color: #FFFFFF; font-family: "Microsoft YaHei"; font-size: 18px; @@ -121,9 +119,9 @@ /** 查询重置按钮 **/ QWidget#wdgtQueryBox QToolButton[class="btnResetQuery"] { border-radius: 12px; - border: 1px solid #504897; + border: 1px solid #2F6FC6; background-color: #FFFFFF; - color: #504897; + color: #2F6FC6; font-family: "Microsoft YaHei"; font-size: 18px; } @@ -136,7 +134,7 @@ } QTableWidget QHeaderView::section { - background-color: #504897; + background-color: #2F6FC6; border: 1px solid #FFFFFF; color: #FFFFFF; font-size: 18px; @@ -151,7 +149,7 @@ QTableWidget::item::selected { /*background: #FFFFFF; */ - color: #504897; + color: #2F6FC6; } QTableWidget QWidget[class="wdgtOper"] { @@ -189,7 +187,7 @@ /** 分页组件 **/ QWidget[class="wdgtPageBtn"] { - background: #504897; + background: #2F6FC6; border-radius: 6px; } QWidget[class="wdgtPageBtn"] QToolButton { @@ -203,7 +201,7 @@ /** 对话框弹窗顶端的标题栏 **/ QWidget[class="dlgTitle"]{ - background-color: #504897; + background-color: #2F6FC6; border: 0px; padding: 10px; } @@ -284,11 +282,11 @@ } QWidget[class="detailTable"] QComboBox QAbstractItemView::item:hover{ color: #FFFFFF; - background-color: #504897; + background-color: #2F6FC6; } QWidget[class="detailTable"] QComboBox QAbstractItemView::item:selected{ color: #FFFFFF; - background-color: #504897; + background-color: #2F6FC6; } QCheckBox[class="defaultSolid"] { @@ -301,14 +299,14 @@ width: 20px; height: 20px; border-radius: 5px; - border: 2px solid #504897; + border: 2px solid #2F6FC6; } QCheckBox[class="defaultSolid"]::indicator::unchecked { background: #FFFFFF; /*border: 2px solid #CCCCC;*/ } QCheckBox[class="defaultSolid"]::indicator::checked { - background: #504897; + background: #2F6FC6; } /* @@ -482,7 +480,7 @@ } /* 子标题样式 */ QWidget[class="subTitle"] QLabel { - color: #504897; + color: #2F6FC6; font-weight: bold; font-size: 20px; min-height: 40px; @@ -500,4 +498,4 @@ border: 1px solid #CCCCCC; font-size: 18px; } -*/ \ No newline at end of file +*/ diff --git a/res/qss/checkWin.css b/res/qss/checkWin.css deleted file mode 100644 index c5083da..0000000 --- a/res/qss/checkWin.css +++ /dev/null @@ -1,147 +0,0 @@ -QLabel { - font-family: Microsoft YaHei; - font-size: 18px; -} - -QPushButton[class="default"] { - font-family: Microsoft YaHei; - background-color:#504897; - font-size:16px; - font-weight: bold; - color:white; - border-radius: 5px; -} -QPushButton[class="default"]::hover { - color:white; - font-size: 17px; -} - -QPushButton[class="defEx"] { - font-family: Microsoft YaHei; - background-color:#169bd5; - font-size:16px; - font-weight: bold; - color:white; - border-radius: 5px; -} -QPushButton[class="defEx"]::hover { - color:white; - font-size: 17px; -} -QTableWidget[class="defTable"]{ - font-size: 22px; - color: #333333; - border: 1px solid #4b4b4b; - border-radius: 6px; - background-color: transparent; -} -QTableWidget[class="checkItemTable"]{ - font-size: 22px; - color: black; - border: 1px solid #4b4b4b; - border-radius: 6px; - background-color: white; -} -QTableWidget[class="checkItemTable"]::item::selected { - background: #504897; - color: #ffffff; -} -QTableWidget[class="defTable"]::item::selected { - background: #504897; - color: #ffffff; -} -QHeaderView[class="defTableHead"]::section{ - background-color: #504897; - border: 0px; - color: #ffffff; - font-size: 20px; -} -QLineEdit[class="Inputdef"]{ -background-color: white; /* 背景色:浅灰色 */ -border: 2px solid #cccccc; /* 边框:灰色 */ -border-radius: 8px; /* 圆角边框 */ -padding: 5px 10px; /* 内边距,增加输入区域的间距 */ -font-size: 20px; /* 字体大小 */ -font-family: "Segoe UI", sans-serif; /* 字体 */ -color: black; /* 字体颜色 */ -} -QLineEdit[class="Inputdef"]:focus { - border: 2px solid #f89a5c; - background-color: #ffffff; -} -QLineEdit[class="Inputdef"]:readonly { - background-color: #dddddd; - border: 1px solid #dddddd; - color: #636363; - -} -QWidget[class="defGBox"]{ - background-color:#f5ede0; - border: 1px solid #cccccc; - font-size: 18px; -} -QComboBox[class="Comboxdef"] { - background-color: white; - border: 1px solid #cccccc; - border-radius: 4px; - padding: 5px 10px; - font-size: 20px; - font-family: "Segoe UI", sans-serif; /* 字体 */ - color: black; /* 字体颜色 */ - min-width: 50px; /* 设置最小宽度 */ -} -QComboBox[class="Comboxdef"]:hover { - border: 1px solid #f89a5c; /* 鼠标悬浮时边框颜色变为绿色 */ -} - -QComboBox[class="Comboxdef"]:focus { - border: 1px solid #f89a5c; /* 聚焦时边框颜色变为 */ - background-color: #f9f9f9; /* 聚焦时背景色 */ -} - -QComboBox[class="Comboxdef"]::down-arrow { - - width: 12px; /* 设置箭头的宽度 */ - height: 12px; /* 设置箭头的高度 */ -} -QComboBox[class="Comboxdef"] QAbstractItemView { - border: 1px solid #cccccc; /* 下拉列表边框 */ - background-color: #ffffff; /* 下拉列表背景色 */ - selection-background-color: #f89a5c; /* 选中项背景色 */ - selection-color: white; /* 选中项文本颜色 */ - padding: 5px; /* 下拉项内边距 */ -} - -QComboBox[class="Comboxdef"]:disabled { - background-color: #dddddd; /* 禁用状态背景 */ - border: 1px solid #dddddd; /* 禁用状态下边框 */ - color: #636363; /* 禁用状态字体颜色 */ -} -QScrollArea[class="defscrollArea"]{ - background-color: transparent; -} - -QPushButton[class="defTest"] { - font-family: Microsoft YaHei; - background-color:#5481ba; - font-size:16px; - font-weight: bold; - color:white; - border-radius: 5px; -} -QPushButton[class="defTest"]::hover { - color:white; - font-size: 17px; -} -QPushButton[class="defTestStop"] { - font-family: Microsoft YaHei; - background-color:#e03d3e; - font-size:16px; - font-weight: bold; - color:white; - border-radius: 5px; -} -QPushButton[class="defTestStop"]::hover { - color:white; - font-size: 17px; -} diff --git a/res/qss/dialogcheckresul.css b/res/qss/dialogcheckresul.css deleted file mode 100644 index 0fd89db..0000000 --- a/res/qss/dialogcheckresul.css +++ /dev/null @@ -1,71 +0,0 @@ -QPushButton[class="ButtonSave"] { - -background-color: rgb(51, 69, 130); -color: rgb(255, 255, 255); -} -QPushButton[class="ButtonPrint"] { -background-color: rgb(100, 132, 68); -color: rgb(255, 255, 255); -} -QToolButton[class="ButtonSave"]::hover { -background-color: rgb(5, 69, 154); -} -QToolButton[class="ButtonSave"]:pressed { -background-color: rgb(3, 61, 139); -} -QComboBox[class="Comboxdef"] { - background-color: white; - border: 1px solid #cccccc; - border-radius: 4px; - padding: 5px 10px; - font-size: 20px; - font-family: "Segoe UI", sans-serif; /* 字体 */ - color: black; /* 字体颜色 */ - min-width: 50px; /* 设置最小宽度 */ -} -QComboBox[class="Comboxdef"]:hover { - border: 1px solid #f89a5c; /* 鼠标悬浮时边框颜色变为绿色 */ -} - -QComboBox[class="Comboxdef"]:focus { - border: 1px solid #f89a5c; /* 聚焦时边框颜色变为 */ - background-color: #f9f9f9; /* 聚焦时背景色 */ -} - -QComboBox[class="Comboxdef"]::down-arrow { - - width: 12px; /* 设置箭头的宽度 */ - height: 12px; /* 设置箭头的高度 */ -} -QComboBox[class="Comboxdef"] QAbstractItemView { - border: 1px solid #cccccc; /* 下拉列表边框 */ - background-color: #ffffff; /* 下拉列表背景色 */ - selection-background-color: #f89a5c; /* 选中项背景色 */ - selection-color: white; /* 选中项文本颜色 */ - padding: 5px; /* 下拉项内边距 */ -} - -QComboBox[class="Comboxdef"]:disabled { - background-color: #dddddd; /* 禁用状态背景 */ - border: 1px solid #dddddd; /* 禁用状态下边框 */ - color: #636363; /* 禁用状态字体颜色 */ -} -QLineEdit[class="Inputdef"]{ -background-color: white; /* 背景色:浅灰色 */ -border: 2px solid #cccccc; /* 边框:灰色 */ -border-radius: 8px; /* 圆角边框 */ -padding: 5px 10px; /* 内边距,增加输入区域的间距 */ -font-size: 20px; /* 字体大小 */ -font-family: "Segoe UI", sans-serif; /* 字体 */ -color: black; /* 字体颜色 */ -} -QLineEdit[class="Inputdef"]:focus { - border: 2px solid #f89a5c; - background-color: #ffffff; -} -QLineEdit[class="Inputdef"]:readonly { - background-color: #dddddd; - border: 1px solid #dddddd; - color: #636363; - -} diff --git a/res/qss/generalStyle.css b/res/qss/generalStyle.css deleted file mode 100644 index eceebd4..0000000 --- a/res/qss/generalStyle.css +++ /dev/null @@ -1,6 +0,0 @@ - - -QStackedWidget[class="BasestackedWidget"]{ - background: qlineargradient(y1: 0, y2: 1,stop: 0 rgba(255, 255, 255, 255),stop: 1 rgba(237, 221, 196, 255)); - background: qlineargradient(y1: 0, y2: 1,stop: 0 rgba(255, 255, 255, 255),stop: 1 rgba(237, 221, 196, 255)); -} diff --git a/res/qss/infoMain.css b/res/qss/infoMain.css new file mode 100644 index 0000000..2f178c7 --- /dev/null +++ b/res/qss/infoMain.css @@ -0,0 +1,26 @@ +QWidget { + background-color: #FFFFFF; +} +QLabel { + font-family: Microsoft YaHei; + font-size: 18px; +} +QScrollArea { + border: none; +} +QScrollBar::vertical { + width: 5px; + background: #FFFFFF; + border: none; +} +QScrollBar::handle::vertical { + width: 5px; + background: #2F6FC6; + border: none; +} +QScrollBar::add-line::vertical { + border: none; +} +QScrollBar::sub-line::vertical { + border: none; +} \ No newline at end of file diff --git a/res/qss/mainForm.css b/res/qss/mainForm.css index 666e8de..cf39f4e 100644 --- a/res/qss/mainForm.css +++ b/res/qss/mainForm.css @@ -1,43 +1,46 @@ -/*QPalette{background:#DFEBF2;}*/ - QWidget { - background-color: #DFEBF2; + background: transparent; } - QLable { font-size: 16px; color: #333333; + background: transparent; +} +QToolButton { + background: transparent; +} + +QWidget#wdgtTop { + background: qlineargradient(x1:0, y1:0, x2:1, y2:1, stop:0 #71b5ff, stop:1 #3d7eff); } /** 左上角LOGO和TITLE **/ QWidget#wdgtTitle QLabel#labelLogo{ margin: 10px; - font-family: "Microsoft YaHei"; } QWidget#wdgtTitle QLabel#labelTitle{ - color: #504897; + color: #FFFFFF; font-size: 30px; font-weight: bold; - /*font-style: italic;*/ - font-family: "Microsoft YaHei"; + font-family: "Microsoft YaHei"; } + /** 中间菜单按钮区域 **/ QWidget#wdgtFunc QToolButton { - background: transparent; border: 0px; border-radius: 10px; + font-size: 18px; font-family: "Microsoft YaHei"; - font-size: 20px; - color: #333333; - padding: 16px; + color: #FFFFFF; + padding: 10px; } QWidget#wdgtFunc QToolButton:checked { - background: #504897; + background: #69C2F7; color: #FFFFFF; } QWidget#wdgtFunc QToolButton:checked:hover { - background: #504897; + background: #69C2F7; color: #FFFFFF; } QWidget#wdgtFunc QToolButton:hover { @@ -46,6 +49,13 @@ } +/** 温湿度环境 **/ +QWidget#wdgtEnv QLabel{ + font-size: 20px; + color: #FFFFFF; + font-family: "Microsoft YaHei"; +} + /** 右上角关闭最小化按钮 **/ QWidget#wdgtBtnWin QToolButton{ @@ -56,22 +66,7 @@ QWidget#wdgtLoginUser QLabel{ font-size: 20px; - color: #504897; - font-family: "Microsoft YaHei"; - font-weight: bold; - /*font-style: italic;*/ -} - -QWidget#wdgtTemp QLabel{ - font-size: 20px; - color: #333333; + color: #FFFFFF; font-family: "Microsoft YaHei"; -} - - -/** 状态栏 **/ -QWidget#wdgtFoot QLabel{ - font-size: 18px; - color: #333333; - font-family: "Microsoft YaHei"; + /*font-weight: bold;*/ } diff --git a/res/qss/messageBox.css b/res/qss/messageBox.css index 9d2c76e..d038fd9 100644 --- a/res/qss/messageBox.css +++ b/res/qss/messageBox.css @@ -26,7 +26,7 @@ border-radius: 12px; border: 1px solid #2F6FC6; background-color: #FFFFFF; - color: #504897; + color: #2F6FC6; font-family: "Microsoft YaHei"; font-size: 18px; } @@ -112,7 +112,7 @@ } QComboBox[class="defaultSelect"] QScrollBar::handle::vertical { width: 5px; - background: #504897; + background: #2F6FC6; border: none; } QComboBox[class="defaultSelect"] QScrollBar::add-line::vertical { @@ -125,7 +125,7 @@ /** 查询普通按钮 **/ QWidget#wdgtQueryBox QToolButton { border-radius: 12px; - background-color: #504897; + background-color: #2F6FC6; color: #FFFFFF; font-family: "Microsoft YaHei"; font-size: 18px; @@ -133,9 +133,9 @@ /** 查询重置按钮 **/ QWidget#wdgtQueryBox QToolButton[class="btnResetQuery"] { border-radius: 12px; - border: 1px solid #504897; + border: 1px solid #2F6FC6; background-color: #FFFFFF; - color: #504897; + color: #2F6FC6; font-family: "Microsoft YaHei"; font-size: 18px; } @@ -148,7 +148,7 @@ } QTableWidget QHeaderView::section { - background-color: #504897; + background-color: #2F6FC6; border: 1px solid #FFFFFF; color: #FFFFFF; font-size: 18px; @@ -163,7 +163,7 @@ QTableWidget::item::selected { /*background: #FFFFFF; */ - color: #504897; + color: #2F6FC6; } QTableWidget QWidget[class="wdgtOper"] { @@ -201,7 +201,7 @@ /** 分页组件 **/ QWidget[class="wdgtPageBtn"] { - background: #504897; + background: #2F6FC6; border-radius: 6px; } QWidget[class="wdgtPageBtn"] QToolButton { @@ -215,7 +215,7 @@ /** 对话框弹窗顶端的标题栏 **/ QWidget[class="dlgTitle"]{ - background-color: #504897; + background-color: #2F6FC6; border: 0px; padding: 10px; } @@ -296,11 +296,11 @@ } QWidget[class="detailTable"] QComboBox QAbstractItemView::item:hover{ color: #FFFFFF; - background-color: #504897; + background-color: #2F6FC6; } QWidget[class="detailTable"] QComboBox QAbstractItemView::item:selected{ color: #FFFFFF; - background-color: #504897; + background-color: #2F6FC6; } QWidget[class="detailTable"] QComboBox QScrollBar::vertical { width: 5px; @@ -309,7 +309,7 @@ } QWidget[class="detailTable"] QComboBox QScrollBar::handle::vertical { width: 5px; - background: #504897; + background: #2F6FC6; border: none; } QWidget[class="detailTable"] QComboBox QScrollBar::add-line::vertical { @@ -329,14 +329,14 @@ width: 20px; height: 20px; border-radius: 5px; - border: 2px solid #504897; + border: 2px solid #2F6FC6; } QCheckBox[class="defaultSolid"]::indicator::unchecked { background: #FFFFFF; /*border: 2px solid #CCCCC;*/ } QCheckBox[class="defaultSolid"]::indicator::checked { - background: #504897; + background: #2F6FC6; } @@ -354,7 +354,7 @@ /** 自动校准界面步骤按钮 **/ QWidget#wdgtTestStep QPushButton { background: transparent; - border: 2px solid #504897; + border: 2px solid #2F6FC6; border-radius: 10px; font-family: "Microsoft YaHei"; font-size: 20px; @@ -362,11 +362,11 @@ padding: 16px; } QWidget#wdgtTestStep QPushButton:checked { - background: #504897; + background: #2F6FC6; color: #FFFFFF; } QWidget#wdgtTestStep QPushButton:checked:hover { - background: #504897; + background: #2F6FC6; color: #FFFFFF; } QWidget#wdgtTestStep QPushButton:hover { @@ -544,7 +544,7 @@ } /* 子标题样式 */ QWidget[class="subTitle"] QLabel { - color: #504897; + color: #2F6FC6; font-weight: bold; font-size: 20px; min-height: 40px; diff --git a/AutoCalibrationXC.pro b/AutoCalibrationXC.pro index 6bcb335..7790b37 100644 --- a/AutoCalibrationXC.pro +++ b/AutoCalibrationXC.pro @@ -24,11 +24,6 @@ include(QPagedTable/QPagedTable.pri) SOURCES += main.cpp -SOURCES += MainWindow.cpp - -HEADERS += MainWindow.h - -FORMS += MainWindow.ui RC_ICONS = res/autoCalibration.ico diff --git a/MainWindow.cpp b/MainWindow.cpp deleted file mode 100644 index ff126e8..0000000 --- a/MainWindow.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#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/MainWindow.h b/MainWindow.h deleted file mode 100644 index 4643e32..0000000 --- a/MainWindow.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#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; -}; -#endif // MAINWINDOW_H diff --git a/MainWindow.ui b/MainWindow.ui deleted file mode 100644 index b232854..0000000 --- a/MainWindow.ui +++ /dev/null @@ -1,22 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 800 - 600 - - - - MainWindow - - - - - - - - diff --git a/frame/CustomMessageBox.ui b/frame/CustomMessageBox.ui index 336be54..b545d74 100644 --- a/frame/CustomMessageBox.ui +++ b/frame/CustomMessageBox.ui @@ -84,8 +84,8 @@ - - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + + :/image/msgbox/icon_box_close.png:/image/msgbox/icon_box_close.png @@ -134,7 +134,7 @@ - :/image/msgbox/icon_box_success.png + :/image/msgbox/icon_box_success.png Qt::AlignCenter @@ -265,6 +265,8 @@ - + + + diff --git a/frame/MainWindowForm.cpp b/frame/MainWindowForm.cpp index 2ded44b..ec82cd7 100644 --- a/frame/MainWindowForm.cpp +++ b/frame/MainWindowForm.cpp @@ -1,6 +1,8 @@ #include "MainWindowForm.h" #include "ui_MainWindowForm.h" +#include + MainWindowForm::MainWindowForm(QWidget *parent) : FramelessWindow(parent), ui(new Ui::MainWindowForm) @@ -12,7 +14,7 @@ initMenuWidgets(); initFunctionButtons(); - // 每秒更新 界面上没有地方能摆 暂时先不启动定时器 + // 每秒更新 connect(TimeCounterUtil::getInstance().clockTimer, &QTimer::timeout, this, &MainWindowForm::onUpdateTimestampHandler); TimeCounterUtil::getInstance().clockTimer->start(1000); @@ -34,6 +36,7 @@ void MainWindowForm::initForm() { setWindowFlags(Qt::FramelessWindowHint); // 设置全屏 + setWindowState(Qt::WindowState::WindowMaximized); this->setTitleBar(ui->wdgtTop); // 设置窗口位置和大小 move(0, 0); @@ -120,6 +123,22 @@ setWindowState(Qt::WindowMinimized | windowState()); } +void MainWindowForm::on_btnMaxWin_clicked() +{ + QScreen *screen = QGuiApplication::primaryScreen(); + QRect screenSize = screen->availableGeometry(); // 可用区域(排除任务栏) + + if (this->isMaximized()) { + resize(screenSize.width() * 0.8, screenSize.height() * 0.8); + move(QRandomGenerator::global()->bounded(10, 100), QRandomGenerator::global()->bounded(10, 50)); + this->showNormal(); + } else { + resize(screenSize.width(), screenSize.height()); + move(0, 0); + this->showMaximized(); + } +} + void MainWindowForm::on_btnCloseWin_clicked() { // 创建一个消息框 @@ -146,18 +165,9 @@ ui->labelTime->setText(now.toString("yyyy-MM-dd HH:mm:ss")); } -void MainWindowForm::on_btnMenuMax_clicked() -{ - if (this->isMaximized()) { - this->showNormal(); - } else { - this->showMaximized(); - } -} - void MainWindowForm::titleDblClick() { - on_btnMenuMax_clicked(); + on_btnMaxWin_clicked(); } void MainWindowForm::onMenuButtonsEabled(bool enable) { diff --git a/frame/MainWindowForm.h b/frame/MainWindowForm.h index 4d206b1..9b4eae4 100644 --- a/frame/MainWindowForm.h +++ b/frame/MainWindowForm.h @@ -45,11 +45,11 @@ private slots: void on_btnMinWin_clicked(); + void on_btnMaxWin_clicked(); void on_btnCloseWin_clicked(); void onFunctionButtonsAction(); void onUpdateTimestampHandler(); - void on_btnMenuMax_clicked(); void titleDblClick(); void onMenuButtonsEabled(bool enable); diff --git a/frame/MainWindowForm.ui b/frame/MainWindowForm.ui index bd42122..f37d171 100644 --- a/frame/MainWindowForm.ui +++ b/frame/MainWindowForm.ui @@ -41,7 +41,7 @@ 0 - 120 + 100 @@ -58,7 +58,7 @@ 20 - 0 + 20 @@ -88,8 +88,8 @@ - 120 - 120 + 150 + 100 @@ -107,6 +107,22 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + @@ -158,7 +174,7 @@ 100 - 84 + 72 @@ -166,7 +182,8 @@ - :/image/main/calibration.png:/image/main/calibration.png + :/image/main/icon_menu_calibration.png + :/image/main/icon_menu_calibration_selected.png:/image/main/icon_menu_calibration.png @@ -184,7 +201,7 @@ 100 - 84 + 72 @@ -192,7 +209,8 @@ - :/image/main/rawDataRecord.png:/image/main/rawDataRecord.png + :/image/main/icon_menu_check.png + :/image/main/icon_menu_check_selected.png:/image/main/icon_menu_check.png @@ -210,7 +228,7 @@ 100 - 84 + 72 @@ -218,7 +236,8 @@ - :/image/main/fileRes.png:/image/main/fileRes.png + :/image/main/icon_menu_infomation.png + :/image/main/icon_menu_infomation_checked.png:/image/main/icon_menu_infomation.png @@ -235,10 +254,147 @@ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 50 + 20 + + + + + - 320 + 240 + 16777215 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 5 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + :/image/main/iconTemp.png + + + + + + + 34.5℃ + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + + + + :/image/main/iconHumi.png + + + + + + + 25%Rh + + + + + + + + + + + + + + 240 16777215 @@ -308,7 +464,7 @@ - :/image/main/icon_setting_p.png:/image/main/icon_setting_p.png + :/image/main/icon_setting.png:/image/main/icon_setting.png @@ -334,7 +490,33 @@ - :/image/main/icon_min_p.png:/image/main/icon_min_p.png + :/image/main/icon_min.png:/image/main/icon_min.png + + + + 32 + 32 + + + + + + + + + 40 + 40 + + + + 最小化 + + + + + + + :/image/main/icon_max.png:/image/main/icon_max.png @@ -360,7 +542,7 @@ - :/image/main/icon_close_p.png:/image/main/icon_close_p.png + :/image/main/icon_close.png:/image/main/icon_close.png @@ -426,87 +608,9 @@ - - - - - 0 - 30 - - - - - 20 - - - 0 - - - 0 - - - 40 - - - 0 - - - - - Qt::Horizontal - - - - 1289 - 20 - - - - - - - - - - - - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 20 - - - - - - - - - - - - - - wdgtContent wdgtTop - wdgtFoot diff --git a/infomation/InfoMainForm.cpp b/infomation/InfoMainForm.cpp index c001199..5d0ffc8 100644 --- a/infomation/InfoMainForm.cpp +++ b/infomation/InfoMainForm.cpp @@ -21,9 +21,13 @@ void InfoMainForm::initForm() { + // 加载样式表 + QString qssStyle = QssFileUtils::loadQssFileContent(QApplication::applicationDirPath() + "/qss/infoMain.css"); + if (qssStyle.isEmpty() == false) { + this->setStyleSheet(qssStyle); // 仅本窗口生效 + } - - + ui->scrollArea->setWindowFlags(Qt::FramelessWindowHint); // 设置无边框 } void InfoMainForm::initSubMenuForms() { diff --git a/infomation/InfoMainForm.ui b/infomation/InfoMainForm.ui index 958a6b2..d9066dd 100644 --- a/infomation/InfoMainForm.ui +++ b/infomation/InfoMainForm.ui @@ -90,7 +90,7 @@ - 280 + 295 48 @@ -103,7 +103,7 @@ - 280 + 295 48 @@ -116,7 +116,7 @@ - 280 + 295 48 @@ -129,7 +129,7 @@ - 280 + 295 48 @@ -142,7 +142,7 @@ - 280 + 295 48 @@ -155,7 +155,7 @@ - 280 + 295 48 @@ -168,7 +168,7 @@ - 280 + 295 48 @@ -181,7 +181,7 @@ - 280 + 295 48 @@ -194,7 +194,7 @@ - 280 + 295 48 @@ -207,7 +207,7 @@ - 280 + 295 48 @@ -220,7 +220,7 @@ - 280 + 295 48 @@ -233,7 +233,7 @@ - 280 + 295 48 @@ -246,7 +246,7 @@ - 280 + 295 48 diff --git a/infomation/task/DeptTaskForm.cpp b/infomation/task/DeptTaskForm.cpp index ea21a9f..cc6bf31 100644 --- a/infomation/task/DeptTaskForm.cpp +++ b/infomation/task/DeptTaskForm.cpp @@ -18,12 +18,17 @@ delete ui; } -void DeptTaskForm::showEvent(QShowEvent *event) +void DeptTaskForm::showEvent(QShowEvent * event) { ui->tableDeptTask->adjustTableWidth(); getDeptTaskList(0); } +void DeptTaskForm::resizeEvent(QResizeEvent * event) +{ + ui->tableDeptTask->adjustTableWidth(); +} + void DeptTaskForm::initFormTable() { // 初始化查询条件 diff --git a/infomation/task/DeptTaskForm.h b/infomation/task/DeptTaskForm.h index 1055c36..3c1ad5b 100644 --- a/infomation/task/DeptTaskForm.h +++ b/infomation/task/DeptTaskForm.h @@ -21,7 +21,8 @@ ~DeptTaskForm(); protected: - void showEvent(QShowEvent *event) override; + void showEvent(QShowEvent * event) override; + void resizeEvent(QResizeEvent * event) override; private: Ui::DeptTaskForm *ui; diff --git a/main.cpp b/main.cpp index 525387e..0b78c87 100644 --- a/main.cpp +++ b/main.cpp @@ -1,5 +1,3 @@ -#include "MainWindow.h" - #include #include diff --git a/res/image/Index/u1176.svg b/res/image/Index/u1176.svg deleted file mode 100644 index c81ce8a..0000000 --- a/res/image/Index/u1176.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1180.svg b/res/image/Index/u1180.svg deleted file mode 100644 index 2ef24ab..0000000 --- a/res/image/Index/u1180.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u1220.svg b/res/image/Index/u1220.svg deleted file mode 100644 index 43452aa..0000000 --- a/res/image/Index/u1220.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2158.svg b/res/image/Index/u2158.svg deleted file mode 100644 index fd249e0..0000000 --- a/res/image/Index/u2158.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u2188.svg b/res/image/Index/u2188.svg deleted file mode 100644 index 34f53c4..0000000 --- a/res/image/Index/u2188.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2189.svg b/res/image/Index/u2189.svg deleted file mode 100644 index 01a6bbb..0000000 --- a/res/image/Index/u2189.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2324.svg b/res/image/Index/u2324.svg deleted file mode 100644 index 797f1c5..0000000 --- a/res/image/Index/u2324.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u2325.svg b/res/image/Index/u2325.svg deleted file mode 100644 index fefe01b..0000000 --- a/res/image/Index/u2325.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u642.svg b/res/image/Index/u642.svg deleted file mode 100644 index 33c9e0a..0000000 --- a/res/image/Index/u642.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u7406.svg b/res/image/Index/u7406.svg deleted file mode 100644 index 8a7a6d9..0000000 --- a/res/image/Index/u7406.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7453.svg b/res/image/Index/u7453.svg deleted file mode 100644 index 603c496..0000000 --- a/res/image/Index/u7453.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7458.svg b/res/image/Index/u7458.svg deleted file mode 100644 index b31087b..0000000 --- a/res/image/Index/u7458.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7488.svg b/res/image/Index/u7488.svg deleted file mode 100644 index 8baf439..0000000 --- a/res/image/Index/u7488.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7491.svg b/res/image/Index/u7491.svg deleted file mode 100644 index 3e41c10..0000000 --- a/res/image/Index/u7491.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u7538.svg b/res/image/Index/u7538.svg deleted file mode 100644 index 417077d..0000000 --- a/res/image/Index/u7538.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u794.svg b/res/image/Index/u794.svg deleted file mode 100644 index e12cff7..0000000 --- a/res/image/Index/u794.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/Index/u8448.svg b/res/image/Index/u8448.svg deleted file mode 100644 index 7f6f4c0..0000000 --- a/res/image/Index/u8448.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/image/Index/u8458.svg b/res/image/Index/u8458.svg deleted file mode 100644 index 6d04a12..0000000 --- a/res/image/Index/u8458.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/image/main/bg_banner.png b/res/image/main/bg_banner.png new file mode 100644 index 0000000..26ddffd --- /dev/null +++ b/res/image/main/bg_banner.png Binary files differ diff --git a/res/image/main/iconHumi.png b/res/image/main/iconHumi.png index 4410d38..bd164e8 100644 --- a/res/image/main/iconHumi.png +++ b/res/image/main/iconHumi.png Binary files differ diff --git a/res/image/main/iconTemp.png b/res/image/main/iconTemp.png index 8fd059c..a2cfe4d 100644 --- a/res/image/main/iconTemp.png +++ b/res/image/main/iconTemp.png Binary files differ diff --git a/res/image/main/icon_close.png b/res/image/main/icon_close.png new file mode 100644 index 0000000..f3aa270 --- /dev/null +++ b/res/image/main/icon_close.png Binary files differ diff --git a/res/image/main/icon_close_p.png b/res/image/main/icon_close_p.png deleted file mode 100644 index b9ba30c..0000000 --- a/res/image/main/icon_close_p.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_main.png b/res/image/main/icon_main.png deleted file mode 100644 index 9d004d5..0000000 --- a/res/image/main/icon_main.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_max.png b/res/image/main/icon_max.png new file mode 100644 index 0000000..6cbf073 --- /dev/null +++ b/res/image/main/icon_max.png Binary files differ diff --git a/res/image/main/icon_menu_calibration.png b/res/image/main/icon_menu_calibration.png new file mode 100644 index 0000000..6fca8be --- /dev/null +++ b/res/image/main/icon_menu_calibration.png Binary files differ diff --git a/res/image/main/icon_menu_calibration_selected.png b/res/image/main/icon_menu_calibration_selected.png new file mode 100644 index 0000000..17f918f --- /dev/null +++ b/res/image/main/icon_menu_calibration_selected.png Binary files differ diff --git a/res/image/main/icon_menu_check.png b/res/image/main/icon_menu_check.png new file mode 100644 index 0000000..c3db5fa --- /dev/null +++ b/res/image/main/icon_menu_check.png Binary files differ diff --git a/res/image/main/icon_menu_check_selected.png b/res/image/main/icon_menu_check_selected.png new file mode 100644 index 0000000..9794c43 --- /dev/null +++ b/res/image/main/icon_menu_check_selected.png Binary files differ diff --git a/res/image/main/icon_menu_infomation.png b/res/image/main/icon_menu_infomation.png new file mode 100644 index 0000000..e272f4c --- /dev/null +++ b/res/image/main/icon_menu_infomation.png Binary files differ diff --git a/res/image/main/icon_menu_infomation_checked.png b/res/image/main/icon_menu_infomation_checked.png new file mode 100644 index 0000000..6122c7b --- /dev/null +++ b/res/image/main/icon_menu_infomation_checked.png Binary files differ diff --git a/res/image/main/icon_min.png b/res/image/main/icon_min.png new file mode 100644 index 0000000..2f524d9 --- /dev/null +++ b/res/image/main/icon_min.png Binary files differ diff --git a/res/image/main/icon_min_p.png b/res/image/main/icon_min_p.png deleted file mode 100644 index 93bd487..0000000 --- a/res/image/main/icon_min_p.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_quit_p.png b/res/image/main/icon_quit_p.png deleted file mode 100644 index 10d8bac..0000000 --- a/res/image/main/icon_quit_p.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_setting.png b/res/image/main/icon_setting.png new file mode 100644 index 0000000..8686833 --- /dev/null +++ b/res/image/main/icon_setting.png Binary files differ diff --git a/res/image/main/icon_setting_p.png b/res/image/main/icon_setting_p.png deleted file mode 100644 index f6645f1..0000000 --- a/res/image/main/icon_setting_p.png +++ /dev/null Binary files differ diff --git a/res/image/msgbox/icon_box_close.png b/res/image/msgbox/icon_box_close.png new file mode 100644 index 0000000..e9d00fb --- /dev/null +++ b/res/image/msgbox/icon_box_close.png Binary files differ diff --git a/res/images.qrc b/res/images.qrc index 68608e9..a6ba788 100644 --- a/res/images.qrc +++ b/res/images.qrc @@ -27,27 +27,9 @@ image/Index/u709.svg image/Index/u712.svg image/Index/u715.svg - image/Index/u1176.svg - image/Index/u1180.svg - image/Index/u1220.svg - image/Index/u7406.svg - image/Index/u7453.svg - image/Index/u7458.svg - image/Index/u7488.svg - image/Index/u7491.svg - image/Index/u7538.svg - image/Index/u2324.svg - image/Index/u2325.svg - image/Index/u2158.svg - image/Index/u8448.svg - image/Index/u8458.svg image/Index/u2327.svg image/Index/u5496.svg image/Index/u7313.svg - image/Index/u2188.svg - image/Index/u2189.svg - image/Index/u642.svg - image/Index/u794.svg image/Index/u5089.png image/Index/u138.png image/Index/btnPageFirst.png @@ -96,13 +78,6 @@ image/login/icon_min.png image/login/icon_setting.png image/login/icon_quit.png - image/main/icon_main.png - image/main/iconHumi.png - image/main/iconTemp.png - image/main/icon_close_p.png - image/main/icon_min_p.png - image/main/icon_quit_p.png - image/main/icon_setting_p.png image/main/arrow_down.png image/main/arrow_up.png image/main/icon_btn_pause.png @@ -115,5 +90,19 @@ image/msgbox/icon_box_warning.png image/msgbox/icon_box_fail.png image/login/logo.png + image/main/bg_banner.png + image/main/icon_close.png + image/main/icon_max.png + image/main/icon_min.png + image/main/icon_setting.png + image/main/iconHumi.png + image/main/iconTemp.png + image/main/icon_menu_calibration.png + image/main/icon_menu_calibration_selected.png + image/main/icon_menu_check.png + image/main/icon_menu_check_selected.png + image/main/icon_menu_infomation.png + image/main/icon_menu_infomation_checked.png + image/msgbox/icon_box_close.png diff --git a/res/qss.qrc b/res/qss.qrc index 56752bb..fbb36c0 100644 --- a/res/qss.qrc +++ b/res/qss.qrc @@ -1,14 +1,10 @@ - qss/Index.css qss/preCheck.css - qss/dialogcheckresul.css - qss/tf_testdevice.css - qss/generalStyle.css - qss/checkWin.css qss/loginForm.css qss/mainForm.css qss/baseInfomation.css qss/messageBox.css + qss/infoMain.css diff --git a/res/qss/Index.css b/res/qss/Index.css deleted file mode 100644 index 8842775..0000000 --- a/res/qss/Index.css +++ /dev/null @@ -1,190 +0,0 @@ -*{ -color:black; -} -QLabel { - font-family: "Microsoft YaHei"; -} -QWidget#centralwidget -{ -background-image: url(:/image/Index/u15.png); -background-color:white; -} -QToolButton#tb1:hover{ - background-image: url(:/image/Index/u26_mouseOver.svg); -} -QToolButton#tb2:hover{ - background-image: url(:/image/Index/u26_mouseOver.svg); -} -QToolButton#tb3:hover{ - background-image: url(:/image/Index/u26_mouseOver.svg); -}QToolButton#tb4:hover{ -background-image: url(:/image/Index/u26_mouseOver.svg); -}QToolButton#tb5:hover{ -background-image: url(:/image/Index/u26_mouseOver.svg); -} -QToolButton#tb6:hover{ - background-image: url(:/image/Index/u26_mouseOver.svg); -} -QToolButton#tb1{ -color: white; -background-image: url(:/image/Index/u26.svg); -font-weight: bold; -border-radius: 5px; -text-align: center; -margin:10; -margin-right: 180px; -font: 18pt 微软雅黑; -} -QToolButton#tb2{ -color: white; -background-image: url(:/image/Index/u26.svg); -font-weight: bold; -border-radius: 5px; -text-align: center; -margin:10; -margin-right: 180px; -font: 18pt 微软雅黑; -} -QToolButton#tb3{ -color: white; -background-image: url(:/image/Index/u26.svg); -font-weight: bold; -border-radius: 5px; -text-align: center; -margin:10; -margin-right: 180px; -font: 18pt 微软雅黑; -}QToolButton#tb4{ -color: white; -background-image: url(:/image/Index/u26.svg); -font-weight: bold; -border-radius: 5px; -text-align: center; -margin:10; -margin-right: 180px; -font: 18pt 微软雅黑; -}QToolButton#tb5{ -color: white; -background-image: url(:/image/Index/u26.svg); -font-weight: bold; -border-radius: 5px; -text-align: center; -margin:10; -margin-right: 180px; -font: 18pt 微软雅黑; -}QToolButton#tb6{ -color: white; -background-image: url(:/image/Index/u26.svg); -font-weight: bold; -border-radius: 5px; -text-align: center; -margin:10; -margin-right: 180px; -font: 18pt 微软雅黑; -} - -/******** NewCheckMethod页面 ********/ -QLabel#labelNcmInfo, QLabel#labelNcmGraph, QLabel#labelNcmConfig, QLabel#labelNcmComm { - font-size: 24px; - min-height: 40px; -} - -QLabel[class="ncmFormLabel"] { - font-size: 18px; - padding: 10px 20px; -} - -QLineEdit[class="ncmFormInput"] { - border-radius: 6px; - font-family: "Microsoft YaHei"; - color: #333333; - border: 1px solid #CCCCCC; - font-size: 18px; -} - -QDateEdit[class="ncmFormDate"] { - border-radius: 6px; - font-family: "Microsoft YaHei"; - border: 1px solid #CCCCCC; - font-size: 18px; -} - -QCheckBox { - color: #FFFFFF; - font-family: "Microsoft YaHei"; - font-size: 16px; - /*padding-left: 5px;*/ -} -QCheckBox::indicator { - width: 20px; - height: 20px; - border-radius: 5px; - border: 2px solid #2F6FC6; -} -QCheckBox::indicator::unchecked { - background: #FFFFFF; - /*border: 2px solid #CCCCC;*/ -} -QCheckBox::indicator::checked { - background: #2F6FC6; -} - -QComboBox { - border-radius: 6px; - font-family: "Microsoft YaHei"; - padding-left: 16px; - color: #333333; - border: 1px solid #CCCCCC; - font-size: 18px; -} - -QComboBox::down-arrow { - image: url(":/image/Index/arrowDown.png"); -} -QComboBox::down-arrow::on { - image: url(":/image/Index/arrowUp.png"); -} - -QComboBox::drop-down { - subcontrol-origin: padding; - subcontrol-position: top right; - width: 20px; - border: 0px; - padding-right: 15px; -} - -QComboBox QAbstractItemView { - color: #333333; - background-color: #E1E1ED; - selection-background-color: #2F6FC6; - selection-color: #FFFFFF; - font-family: "Microsoft YaHei"; - outline: 0px; -} - -QComboBox QAbstractItemView::item{ - min-height: 36px; - line-height: 36px; - color: #333333; - padding-left: 9px; - background-color: #FFFFFF; -} - -QComboBox QScrollBar::vertical { - width: 10px; - background: #FFFFFF; - border: none; -} - -QComboBox QScrollBar::handle::vertical { - width: 10px; - background: #2F6FC6; - border: none; -} - -QComboBox QScrollBar::add-line::vertical { - border: none; -} -QComboBox QScrollBar::sub-line::vertical { - border: none; -} diff --git a/res/qss/baseInfomation.css b/res/qss/baseInfomation.css index 636c382..1c6783c 100644 --- a/res/qss/baseInfomation.css +++ b/res/qss/baseInfomation.css @@ -1,5 +1,3 @@ -/*QPalette{background:#FFFFFF;}*/ - QWidget { background-color: #FFFFFF; } @@ -11,7 +9,7 @@ /** 普通按钮 **/ QToolButton[class="btnDefault"] { border-radius: 12px; - background-color: #504897; + background-color: #2F6FC6; color: #FFFFFF; font-family: "Microsoft YaHei"; font-size: 18px; @@ -19,16 +17,16 @@ /** 查询重置按钮 **/ QToolButton[class="btnOpposite"] { border-radius: 12px; - border: 1px solid #504897; + border: 1px solid #2F6FC6; background-color: #FFFFFF; - color: #504897; + color: #2F6FC6; font-family: "Microsoft YaHei"; font-size: 18px; } /** 表格顶端的标题栏 **/ QLabel[class="frameLabel"]{ - background-color: #504897; + background-color: #2F6FC6; border: 0px; border-radius: 0px; border-top-left-radius: 10px; @@ -87,11 +85,11 @@ } QComboBox[class="defaultSelect"] QAbstractItemView::item:hover{ color: #FFFFFF; - background-color: #504897; + background-color: #2F6FC6; } QComboBox[class="defaultSelect"] QAbstractItemView::item:selected{ color: #FFFFFF; - background-color: #504897; + background-color: #2F6FC6; } QComboBox[class="defaultSelect"] QScrollBar::vertical { width: 5px; @@ -100,7 +98,7 @@ } QComboBox[class="defaultSelect"] QScrollBar::handle::vertical { width: 5px; - background: #504897; + background: #2F6FC6; border: none; } QComboBox[class="defaultSelect"] QScrollBar::add-line::vertical { @@ -113,7 +111,7 @@ /** 查询普通按钮 **/ QWidget#wdgtQueryBox QToolButton { border-radius: 12px; - background-color: #504897; + background-color: #2F6FC6; color: #FFFFFF; font-family: "Microsoft YaHei"; font-size: 18px; @@ -121,9 +119,9 @@ /** 查询重置按钮 **/ QWidget#wdgtQueryBox QToolButton[class="btnResetQuery"] { border-radius: 12px; - border: 1px solid #504897; + border: 1px solid #2F6FC6; background-color: #FFFFFF; - color: #504897; + color: #2F6FC6; font-family: "Microsoft YaHei"; font-size: 18px; } @@ -136,7 +134,7 @@ } QTableWidget QHeaderView::section { - background-color: #504897; + background-color: #2F6FC6; border: 1px solid #FFFFFF; color: #FFFFFF; font-size: 18px; @@ -151,7 +149,7 @@ QTableWidget::item::selected { /*background: #FFFFFF; */ - color: #504897; + color: #2F6FC6; } QTableWidget QWidget[class="wdgtOper"] { @@ -189,7 +187,7 @@ /** 分页组件 **/ QWidget[class="wdgtPageBtn"] { - background: #504897; + background: #2F6FC6; border-radius: 6px; } QWidget[class="wdgtPageBtn"] QToolButton { @@ -203,7 +201,7 @@ /** 对话框弹窗顶端的标题栏 **/ QWidget[class="dlgTitle"]{ - background-color: #504897; + background-color: #2F6FC6; border: 0px; padding: 10px; } @@ -284,11 +282,11 @@ } QWidget[class="detailTable"] QComboBox QAbstractItemView::item:hover{ color: #FFFFFF; - background-color: #504897; + background-color: #2F6FC6; } QWidget[class="detailTable"] QComboBox QAbstractItemView::item:selected{ color: #FFFFFF; - background-color: #504897; + background-color: #2F6FC6; } QCheckBox[class="defaultSolid"] { @@ -301,14 +299,14 @@ width: 20px; height: 20px; border-radius: 5px; - border: 2px solid #504897; + border: 2px solid #2F6FC6; } QCheckBox[class="defaultSolid"]::indicator::unchecked { background: #FFFFFF; /*border: 2px solid #CCCCC;*/ } QCheckBox[class="defaultSolid"]::indicator::checked { - background: #504897; + background: #2F6FC6; } /* @@ -482,7 +480,7 @@ } /* 子标题样式 */ QWidget[class="subTitle"] QLabel { - color: #504897; + color: #2F6FC6; font-weight: bold; font-size: 20px; min-height: 40px; @@ -500,4 +498,4 @@ border: 1px solid #CCCCCC; font-size: 18px; } -*/ \ No newline at end of file +*/ diff --git a/res/qss/checkWin.css b/res/qss/checkWin.css deleted file mode 100644 index c5083da..0000000 --- a/res/qss/checkWin.css +++ /dev/null @@ -1,147 +0,0 @@ -QLabel { - font-family: Microsoft YaHei; - font-size: 18px; -} - -QPushButton[class="default"] { - font-family: Microsoft YaHei; - background-color:#504897; - font-size:16px; - font-weight: bold; - color:white; - border-radius: 5px; -} -QPushButton[class="default"]::hover { - color:white; - font-size: 17px; -} - -QPushButton[class="defEx"] { - font-family: Microsoft YaHei; - background-color:#169bd5; - font-size:16px; - font-weight: bold; - color:white; - border-radius: 5px; -} -QPushButton[class="defEx"]::hover { - color:white; - font-size: 17px; -} -QTableWidget[class="defTable"]{ - font-size: 22px; - color: #333333; - border: 1px solid #4b4b4b; - border-radius: 6px; - background-color: transparent; -} -QTableWidget[class="checkItemTable"]{ - font-size: 22px; - color: black; - border: 1px solid #4b4b4b; - border-radius: 6px; - background-color: white; -} -QTableWidget[class="checkItemTable"]::item::selected { - background: #504897; - color: #ffffff; -} -QTableWidget[class="defTable"]::item::selected { - background: #504897; - color: #ffffff; -} -QHeaderView[class="defTableHead"]::section{ - background-color: #504897; - border: 0px; - color: #ffffff; - font-size: 20px; -} -QLineEdit[class="Inputdef"]{ -background-color: white; /* 背景色:浅灰色 */ -border: 2px solid #cccccc; /* 边框:灰色 */ -border-radius: 8px; /* 圆角边框 */ -padding: 5px 10px; /* 内边距,增加输入区域的间距 */ -font-size: 20px; /* 字体大小 */ -font-family: "Segoe UI", sans-serif; /* 字体 */ -color: black; /* 字体颜色 */ -} -QLineEdit[class="Inputdef"]:focus { - border: 2px solid #f89a5c; - background-color: #ffffff; -} -QLineEdit[class="Inputdef"]:readonly { - background-color: #dddddd; - border: 1px solid #dddddd; - color: #636363; - -} -QWidget[class="defGBox"]{ - background-color:#f5ede0; - border: 1px solid #cccccc; - font-size: 18px; -} -QComboBox[class="Comboxdef"] { - background-color: white; - border: 1px solid #cccccc; - border-radius: 4px; - padding: 5px 10px; - font-size: 20px; - font-family: "Segoe UI", sans-serif; /* 字体 */ - color: black; /* 字体颜色 */ - min-width: 50px; /* 设置最小宽度 */ -} -QComboBox[class="Comboxdef"]:hover { - border: 1px solid #f89a5c; /* 鼠标悬浮时边框颜色变为绿色 */ -} - -QComboBox[class="Comboxdef"]:focus { - border: 1px solid #f89a5c; /* 聚焦时边框颜色变为 */ - background-color: #f9f9f9; /* 聚焦时背景色 */ -} - -QComboBox[class="Comboxdef"]::down-arrow { - - width: 12px; /* 设置箭头的宽度 */ - height: 12px; /* 设置箭头的高度 */ -} -QComboBox[class="Comboxdef"] QAbstractItemView { - border: 1px solid #cccccc; /* 下拉列表边框 */ - background-color: #ffffff; /* 下拉列表背景色 */ - selection-background-color: #f89a5c; /* 选中项背景色 */ - selection-color: white; /* 选中项文本颜色 */ - padding: 5px; /* 下拉项内边距 */ -} - -QComboBox[class="Comboxdef"]:disabled { - background-color: #dddddd; /* 禁用状态背景 */ - border: 1px solid #dddddd; /* 禁用状态下边框 */ - color: #636363; /* 禁用状态字体颜色 */ -} -QScrollArea[class="defscrollArea"]{ - background-color: transparent; -} - -QPushButton[class="defTest"] { - font-family: Microsoft YaHei; - background-color:#5481ba; - font-size:16px; - font-weight: bold; - color:white; - border-radius: 5px; -} -QPushButton[class="defTest"]::hover { - color:white; - font-size: 17px; -} -QPushButton[class="defTestStop"] { - font-family: Microsoft YaHei; - background-color:#e03d3e; - font-size:16px; - font-weight: bold; - color:white; - border-radius: 5px; -} -QPushButton[class="defTestStop"]::hover { - color:white; - font-size: 17px; -} diff --git a/res/qss/dialogcheckresul.css b/res/qss/dialogcheckresul.css deleted file mode 100644 index 0fd89db..0000000 --- a/res/qss/dialogcheckresul.css +++ /dev/null @@ -1,71 +0,0 @@ -QPushButton[class="ButtonSave"] { - -background-color: rgb(51, 69, 130); -color: rgb(255, 255, 255); -} -QPushButton[class="ButtonPrint"] { -background-color: rgb(100, 132, 68); -color: rgb(255, 255, 255); -} -QToolButton[class="ButtonSave"]::hover { -background-color: rgb(5, 69, 154); -} -QToolButton[class="ButtonSave"]:pressed { -background-color: rgb(3, 61, 139); -} -QComboBox[class="Comboxdef"] { - background-color: white; - border: 1px solid #cccccc; - border-radius: 4px; - padding: 5px 10px; - font-size: 20px; - font-family: "Segoe UI", sans-serif; /* 字体 */ - color: black; /* 字体颜色 */ - min-width: 50px; /* 设置最小宽度 */ -} -QComboBox[class="Comboxdef"]:hover { - border: 1px solid #f89a5c; /* 鼠标悬浮时边框颜色变为绿色 */ -} - -QComboBox[class="Comboxdef"]:focus { - border: 1px solid #f89a5c; /* 聚焦时边框颜色变为 */ - background-color: #f9f9f9; /* 聚焦时背景色 */ -} - -QComboBox[class="Comboxdef"]::down-arrow { - - width: 12px; /* 设置箭头的宽度 */ - height: 12px; /* 设置箭头的高度 */ -} -QComboBox[class="Comboxdef"] QAbstractItemView { - border: 1px solid #cccccc; /* 下拉列表边框 */ - background-color: #ffffff; /* 下拉列表背景色 */ - selection-background-color: #f89a5c; /* 选中项背景色 */ - selection-color: white; /* 选中项文本颜色 */ - padding: 5px; /* 下拉项内边距 */ -} - -QComboBox[class="Comboxdef"]:disabled { - background-color: #dddddd; /* 禁用状态背景 */ - border: 1px solid #dddddd; /* 禁用状态下边框 */ - color: #636363; /* 禁用状态字体颜色 */ -} -QLineEdit[class="Inputdef"]{ -background-color: white; /* 背景色:浅灰色 */ -border: 2px solid #cccccc; /* 边框:灰色 */ -border-radius: 8px; /* 圆角边框 */ -padding: 5px 10px; /* 内边距,增加输入区域的间距 */ -font-size: 20px; /* 字体大小 */ -font-family: "Segoe UI", sans-serif; /* 字体 */ -color: black; /* 字体颜色 */ -} -QLineEdit[class="Inputdef"]:focus { - border: 2px solid #f89a5c; - background-color: #ffffff; -} -QLineEdit[class="Inputdef"]:readonly { - background-color: #dddddd; - border: 1px solid #dddddd; - color: #636363; - -} diff --git a/res/qss/generalStyle.css b/res/qss/generalStyle.css deleted file mode 100644 index eceebd4..0000000 --- a/res/qss/generalStyle.css +++ /dev/null @@ -1,6 +0,0 @@ - - -QStackedWidget[class="BasestackedWidget"]{ - background: qlineargradient(y1: 0, y2: 1,stop: 0 rgba(255, 255, 255, 255),stop: 1 rgba(237, 221, 196, 255)); - background: qlineargradient(y1: 0, y2: 1,stop: 0 rgba(255, 255, 255, 255),stop: 1 rgba(237, 221, 196, 255)); -} diff --git a/res/qss/infoMain.css b/res/qss/infoMain.css new file mode 100644 index 0000000..2f178c7 --- /dev/null +++ b/res/qss/infoMain.css @@ -0,0 +1,26 @@ +QWidget { + background-color: #FFFFFF; +} +QLabel { + font-family: Microsoft YaHei; + font-size: 18px; +} +QScrollArea { + border: none; +} +QScrollBar::vertical { + width: 5px; + background: #FFFFFF; + border: none; +} +QScrollBar::handle::vertical { + width: 5px; + background: #2F6FC6; + border: none; +} +QScrollBar::add-line::vertical { + border: none; +} +QScrollBar::sub-line::vertical { + border: none; +} \ No newline at end of file diff --git a/res/qss/mainForm.css b/res/qss/mainForm.css index 666e8de..cf39f4e 100644 --- a/res/qss/mainForm.css +++ b/res/qss/mainForm.css @@ -1,43 +1,46 @@ -/*QPalette{background:#DFEBF2;}*/ - QWidget { - background-color: #DFEBF2; + background: transparent; } - QLable { font-size: 16px; color: #333333; + background: transparent; +} +QToolButton { + background: transparent; +} + +QWidget#wdgtTop { + background: qlineargradient(x1:0, y1:0, x2:1, y2:1, stop:0 #71b5ff, stop:1 #3d7eff); } /** 左上角LOGO和TITLE **/ QWidget#wdgtTitle QLabel#labelLogo{ margin: 10px; - font-family: "Microsoft YaHei"; } QWidget#wdgtTitle QLabel#labelTitle{ - color: #504897; + color: #FFFFFF; font-size: 30px; font-weight: bold; - /*font-style: italic;*/ - font-family: "Microsoft YaHei"; + font-family: "Microsoft YaHei"; } + /** 中间菜单按钮区域 **/ QWidget#wdgtFunc QToolButton { - background: transparent; border: 0px; border-radius: 10px; + font-size: 18px; font-family: "Microsoft YaHei"; - font-size: 20px; - color: #333333; - padding: 16px; + color: #FFFFFF; + padding: 10px; } QWidget#wdgtFunc QToolButton:checked { - background: #504897; + background: #69C2F7; color: #FFFFFF; } QWidget#wdgtFunc QToolButton:checked:hover { - background: #504897; + background: #69C2F7; color: #FFFFFF; } QWidget#wdgtFunc QToolButton:hover { @@ -46,6 +49,13 @@ } +/** 温湿度环境 **/ +QWidget#wdgtEnv QLabel{ + font-size: 20px; + color: #FFFFFF; + font-family: "Microsoft YaHei"; +} + /** 右上角关闭最小化按钮 **/ QWidget#wdgtBtnWin QToolButton{ @@ -56,22 +66,7 @@ QWidget#wdgtLoginUser QLabel{ font-size: 20px; - color: #504897; - font-family: "Microsoft YaHei"; - font-weight: bold; - /*font-style: italic;*/ -} - -QWidget#wdgtTemp QLabel{ - font-size: 20px; - color: #333333; + color: #FFFFFF; font-family: "Microsoft YaHei"; -} - - -/** 状态栏 **/ -QWidget#wdgtFoot QLabel{ - font-size: 18px; - color: #333333; - font-family: "Microsoft YaHei"; + /*font-weight: bold;*/ } diff --git a/res/qss/messageBox.css b/res/qss/messageBox.css index 9d2c76e..d038fd9 100644 --- a/res/qss/messageBox.css +++ b/res/qss/messageBox.css @@ -26,7 +26,7 @@ border-radius: 12px; border: 1px solid #2F6FC6; background-color: #FFFFFF; - color: #504897; + color: #2F6FC6; font-family: "Microsoft YaHei"; font-size: 18px; } @@ -112,7 +112,7 @@ } QComboBox[class="defaultSelect"] QScrollBar::handle::vertical { width: 5px; - background: #504897; + background: #2F6FC6; border: none; } QComboBox[class="defaultSelect"] QScrollBar::add-line::vertical { @@ -125,7 +125,7 @@ /** 查询普通按钮 **/ QWidget#wdgtQueryBox QToolButton { border-radius: 12px; - background-color: #504897; + background-color: #2F6FC6; color: #FFFFFF; font-family: "Microsoft YaHei"; font-size: 18px; @@ -133,9 +133,9 @@ /** 查询重置按钮 **/ QWidget#wdgtQueryBox QToolButton[class="btnResetQuery"] { border-radius: 12px; - border: 1px solid #504897; + border: 1px solid #2F6FC6; background-color: #FFFFFF; - color: #504897; + color: #2F6FC6; font-family: "Microsoft YaHei"; font-size: 18px; } @@ -148,7 +148,7 @@ } QTableWidget QHeaderView::section { - background-color: #504897; + background-color: #2F6FC6; border: 1px solid #FFFFFF; color: #FFFFFF; font-size: 18px; @@ -163,7 +163,7 @@ QTableWidget::item::selected { /*background: #FFFFFF; */ - color: #504897; + color: #2F6FC6; } QTableWidget QWidget[class="wdgtOper"] { @@ -201,7 +201,7 @@ /** 分页组件 **/ QWidget[class="wdgtPageBtn"] { - background: #504897; + background: #2F6FC6; border-radius: 6px; } QWidget[class="wdgtPageBtn"] QToolButton { @@ -215,7 +215,7 @@ /** 对话框弹窗顶端的标题栏 **/ QWidget[class="dlgTitle"]{ - background-color: #504897; + background-color: #2F6FC6; border: 0px; padding: 10px; } @@ -296,11 +296,11 @@ } QWidget[class="detailTable"] QComboBox QAbstractItemView::item:hover{ color: #FFFFFF; - background-color: #504897; + background-color: #2F6FC6; } QWidget[class="detailTable"] QComboBox QAbstractItemView::item:selected{ color: #FFFFFF; - background-color: #504897; + background-color: #2F6FC6; } QWidget[class="detailTable"] QComboBox QScrollBar::vertical { width: 5px; @@ -309,7 +309,7 @@ } QWidget[class="detailTable"] QComboBox QScrollBar::handle::vertical { width: 5px; - background: #504897; + background: #2F6FC6; border: none; } QWidget[class="detailTable"] QComboBox QScrollBar::add-line::vertical { @@ -329,14 +329,14 @@ width: 20px; height: 20px; border-radius: 5px; - border: 2px solid #504897; + border: 2px solid #2F6FC6; } QCheckBox[class="defaultSolid"]::indicator::unchecked { background: #FFFFFF; /*border: 2px solid #CCCCC;*/ } QCheckBox[class="defaultSolid"]::indicator::checked { - background: #504897; + background: #2F6FC6; } @@ -354,7 +354,7 @@ /** 自动校准界面步骤按钮 **/ QWidget#wdgtTestStep QPushButton { background: transparent; - border: 2px solid #504897; + border: 2px solid #2F6FC6; border-radius: 10px; font-family: "Microsoft YaHei"; font-size: 20px; @@ -362,11 +362,11 @@ padding: 16px; } QWidget#wdgtTestStep QPushButton:checked { - background: #504897; + background: #2F6FC6; color: #FFFFFF; } QWidget#wdgtTestStep QPushButton:checked:hover { - background: #504897; + background: #2F6FC6; color: #FFFFFF; } QWidget#wdgtTestStep QPushButton:hover { @@ -544,7 +544,7 @@ } /* 子标题样式 */ QWidget[class="subTitle"] QLabel { - color: #504897; + color: #2F6FC6; font-weight: bold; font-size: 20px; min-height: 40px; diff --git a/res/qss/tf_testdevice.css b/res/qss/tf_testdevice.css deleted file mode 100644 index f56e760..0000000 --- a/res/qss/tf_testdevice.css +++ /dev/null @@ -1,146 +0,0 @@ -QLabel { - font-family: Microsoft YaHei; - font-size: 18px; -} - -QPushButton[class="default"] { - font-family: Microsoft YaHei; - background-color:#504897; - font-size:16px; - font-weight: bold; - color:white; - border-radius: 5px; -} -QPushButton[class="default"]::hover { - color:white; - font-size: 17px; -} - -QPushButton[class="defEx"] { - font-family: Microsoft YaHei; - background-color:#169bd5; - font-size:16px; - font-weight: bold; - color:white; - border-radius: 5px; -} -QPushButton[class="defEx"]::hover { - color:white; - font-size: 17px; -} -QTableWidget[class="defTable"]{ - font-size: 22px; - color: #333333; - border: 1px solid #4b4b4b; - border-radius: 6px; - background-color: transparent; -} -QTableWidget[class="checkItemTable"]{ - font-size: 22px; - color: black; - border: 1px solid #4b4b4b; - border-radius: 6px; - background-color: white; -} -QTableWidget[class="checkItemTable"]::item::selected { - /*background: #504897;*/ - /*color: #ffffff;*/ - background: #FFFFFF; - color: #2F6FC6; -} -QTableWidget[class="defTable"]::item::selected { - background: #504897; - color: #ffffff; -} -QHeaderView[class="defTableHead"]::section{ - /*background-color: #E3E3E3;*/ - background-color: #504897; - border: 0px; - color: #ffffff; - font-size: 20px; -} -QLineEdit[class="Inputdef"]{ - border-radius: 10px; - font-family: "Microsoft YaHei"; - color: #333333; - border: 1px solid #CCCCCC; - font-size: 16px; - background-color: #DFEBF2; - padding-left: 10px; -} -QLineEdit[class="Inputdef"]:focus { - border: 2px solid #504897; - background-color: #ffffff; -} -QLineEdit[class="Inputdef"]:readonly { - background-color: #dddddd; - border: 1px solid #dddddd; - color: #636363; - -} -QLineEdit[class="SciInputdef"]{ -background-color: white; /* 背景色:浅灰色 */ -border: 2px solid #cccccc; /* 边框:灰色 */ -border-radius: 8px; /* 圆角边框 */ -padding: 5px 10px; /* 内边距,增加输入区域的间距 */ -font-size: 20px; /* 字体大小 */ -font-family: "Segoe UI", sans-serif; /* 字体 */ -color: black; /* 字体颜色 */ -} -QLineEdit[class="SciInputdef"]:focus { - border: 2px solid #504897; - background-color: #ffffff; -} -QLineEdit[class="SciInputdef"]:readonly { - background-color: #dddddd; - border: 1px solid #dddddd; - color: #636363; - -} -QWidget[class="defGBox"]{ - background-color:#f5ede0; - border: 1px solid #cccccc; - font-size: 18px; -} -QComboBox[class="Comboxdef"] { - background-color: white; - border: 1px solid #cccccc; - border-radius: 4px; - padding: 5px 10px; - font-size: 20px; - font-family: "Segoe UI", sans-serif; /* 字体 */ - color: black; /* 字体颜色 */ - min-width: 50px; /* 设置最小宽度 */ -} -QComboBox[class="Comboxdef"]:hover { - border: 1px solid #504897; /* 鼠标悬浮时边框颜色变为绿色 */ -} - -QComboBox[class="Comboxdef"]:focus { - border: 1px solid #504897; /* 聚焦时边框颜色变为 */ - background-color: #f9f9f9; /* 聚焦时背景色 */ -} - -QComboBox[class="Comboxdef"]::down-arrow { - - width: 12px; /* 设置箭头的宽度 */ - height: 12px; /* 设置箭头的高度 */ -} -QComboBox[class="Comboxdef"] QAbstractItemView { - border: 1px solid #cccccc; /* 下拉列表边框 */ - background-color: #ffffff; /* 下拉列表背景色 */ - selection-background-color: #504897; /* 选中项背景色 */ - selection-color: white; /* 选中项文本颜色 */ - padding: 5px; /* 下拉项内边距 */ -} - -QComboBox[class="Comboxdef"]:disabled { - background-color: #dddddd; /* 禁用状态背景 */ - border: 1px solid #dddddd; /* 禁用状态下边框 */ - color: #636363; /* 禁用状态字体颜色 */ -} -QScrollArea[class="defscrollArea"]{ - background-color: transparent; -} - -