diff --git a/calibration/CalibrationMainForm.cpp b/calibration/CalibrationMainForm.cpp new file mode 100644 index 0000000..9b778a5 --- /dev/null +++ b/calibration/CalibrationMainForm.cpp @@ -0,0 +1,14 @@ +#include "CalibrationMainForm.h" +#include "ui_CalibrationMainForm.h" + +CalibrationMainForm::CalibrationMainForm(QWidget *parent) : + QWidget(parent), + ui(new Ui::CalibrationMainForm) +{ + ui->setupUi(this); +} + +CalibrationMainForm::~CalibrationMainForm() +{ + delete ui; +} diff --git a/calibration/CalibrationMainForm.cpp b/calibration/CalibrationMainForm.cpp new file mode 100644 index 0000000..9b778a5 --- /dev/null +++ b/calibration/CalibrationMainForm.cpp @@ -0,0 +1,14 @@ +#include "CalibrationMainForm.h" +#include "ui_CalibrationMainForm.h" + +CalibrationMainForm::CalibrationMainForm(QWidget *parent) : + QWidget(parent), + ui(new Ui::CalibrationMainForm) +{ + ui->setupUi(this); +} + +CalibrationMainForm::~CalibrationMainForm() +{ + delete ui; +} diff --git a/calibration/CalibrationMainForm.h b/calibration/CalibrationMainForm.h new file mode 100644 index 0000000..7d75014 --- /dev/null +++ b/calibration/CalibrationMainForm.h @@ -0,0 +1,22 @@ +#ifndef CALIBRATIONMAINFORM_H +#define CALIBRATIONMAINFORM_H + +#include + +namespace Ui { +class CalibrationMainForm; +} + +class CalibrationMainForm : public QWidget +{ + Q_OBJECT + +public: + explicit CalibrationMainForm(QWidget *parent = nullptr); + ~CalibrationMainForm(); + +private: + Ui::CalibrationMainForm *ui; +}; + +#endif // CALIBRATIONMAINFORM_H diff --git a/calibration/CalibrationMainForm.cpp b/calibration/CalibrationMainForm.cpp new file mode 100644 index 0000000..9b778a5 --- /dev/null +++ b/calibration/CalibrationMainForm.cpp @@ -0,0 +1,14 @@ +#include "CalibrationMainForm.h" +#include "ui_CalibrationMainForm.h" + +CalibrationMainForm::CalibrationMainForm(QWidget *parent) : + QWidget(parent), + ui(new Ui::CalibrationMainForm) +{ + ui->setupUi(this); +} + +CalibrationMainForm::~CalibrationMainForm() +{ + delete ui; +} diff --git a/calibration/CalibrationMainForm.h b/calibration/CalibrationMainForm.h new file mode 100644 index 0000000..7d75014 --- /dev/null +++ b/calibration/CalibrationMainForm.h @@ -0,0 +1,22 @@ +#ifndef CALIBRATIONMAINFORM_H +#define CALIBRATIONMAINFORM_H + +#include + +namespace Ui { +class CalibrationMainForm; +} + +class CalibrationMainForm : public QWidget +{ + Q_OBJECT + +public: + explicit CalibrationMainForm(QWidget *parent = nullptr); + ~CalibrationMainForm(); + +private: + Ui::CalibrationMainForm *ui; +}; + +#endif // CALIBRATIONMAINFORM_H diff --git a/calibration/CalibrationMainForm.ui b/calibration/CalibrationMainForm.ui new file mode 100644 index 0000000..9b5a9c2 --- /dev/null +++ b/calibration/CalibrationMainForm.ui @@ -0,0 +1,21 @@ + + + + + CalibrationMainForm + + + + 0 + 0 + 400 + 300 + + + + Form + + + + + diff --git a/calibration/CalibrationMainForm.cpp b/calibration/CalibrationMainForm.cpp new file mode 100644 index 0000000..9b778a5 --- /dev/null +++ b/calibration/CalibrationMainForm.cpp @@ -0,0 +1,14 @@ +#include "CalibrationMainForm.h" +#include "ui_CalibrationMainForm.h" + +CalibrationMainForm::CalibrationMainForm(QWidget *parent) : + QWidget(parent), + ui(new Ui::CalibrationMainForm) +{ + ui->setupUi(this); +} + +CalibrationMainForm::~CalibrationMainForm() +{ + delete ui; +} diff --git a/calibration/CalibrationMainForm.h b/calibration/CalibrationMainForm.h new file mode 100644 index 0000000..7d75014 --- /dev/null +++ b/calibration/CalibrationMainForm.h @@ -0,0 +1,22 @@ +#ifndef CALIBRATIONMAINFORM_H +#define CALIBRATIONMAINFORM_H + +#include + +namespace Ui { +class CalibrationMainForm; +} + +class CalibrationMainForm : public QWidget +{ + Q_OBJECT + +public: + explicit CalibrationMainForm(QWidget *parent = nullptr); + ~CalibrationMainForm(); + +private: + Ui::CalibrationMainForm *ui; +}; + +#endif // CALIBRATIONMAINFORM_H diff --git a/calibration/CalibrationMainForm.ui b/calibration/CalibrationMainForm.ui new file mode 100644 index 0000000..9b5a9c2 --- /dev/null +++ b/calibration/CalibrationMainForm.ui @@ -0,0 +1,21 @@ + + + + + CalibrationMainForm + + + + 0 + 0 + 400 + 300 + + + + Form + + + + + diff --git a/calibration/calibration.pri b/calibration/calibration.pri index e69de29..f0e9dfb 100644 --- a/calibration/calibration.pri +++ b/calibration/calibration.pri @@ -0,0 +1,4 @@ +HEADERS += $$PWD/CalibrationMainForm.h +SOURCES += $$PWD/CalibrationMainForm.cpp + +FORMS += $$PWD/CalibrationMainForm.ui diff --git a/calibration/CalibrationMainForm.cpp b/calibration/CalibrationMainForm.cpp new file mode 100644 index 0000000..9b778a5 --- /dev/null +++ b/calibration/CalibrationMainForm.cpp @@ -0,0 +1,14 @@ +#include "CalibrationMainForm.h" +#include "ui_CalibrationMainForm.h" + +CalibrationMainForm::CalibrationMainForm(QWidget *parent) : + QWidget(parent), + ui(new Ui::CalibrationMainForm) +{ + ui->setupUi(this); +} + +CalibrationMainForm::~CalibrationMainForm() +{ + delete ui; +} diff --git a/calibration/CalibrationMainForm.h b/calibration/CalibrationMainForm.h new file mode 100644 index 0000000..7d75014 --- /dev/null +++ b/calibration/CalibrationMainForm.h @@ -0,0 +1,22 @@ +#ifndef CALIBRATIONMAINFORM_H +#define CALIBRATIONMAINFORM_H + +#include + +namespace Ui { +class CalibrationMainForm; +} + +class CalibrationMainForm : public QWidget +{ + Q_OBJECT + +public: + explicit CalibrationMainForm(QWidget *parent = nullptr); + ~CalibrationMainForm(); + +private: + Ui::CalibrationMainForm *ui; +}; + +#endif // CALIBRATIONMAINFORM_H diff --git a/calibration/CalibrationMainForm.ui b/calibration/CalibrationMainForm.ui new file mode 100644 index 0000000..9b5a9c2 --- /dev/null +++ b/calibration/CalibrationMainForm.ui @@ -0,0 +1,21 @@ + + + + + CalibrationMainForm + + + + 0 + 0 + 400 + 300 + + + + Form + + + + + diff --git a/calibration/calibration.pri b/calibration/calibration.pri index e69de29..f0e9dfb 100644 --- a/calibration/calibration.pri +++ b/calibration/calibration.pri @@ -0,0 +1,4 @@ +HEADERS += $$PWD/CalibrationMainForm.h +SOURCES += $$PWD/CalibrationMainForm.cpp + +FORMS += $$PWD/CalibrationMainForm.ui diff --git a/check/CheckMainForm.cpp b/check/CheckMainForm.cpp new file mode 100644 index 0000000..1725277 --- /dev/null +++ b/check/CheckMainForm.cpp @@ -0,0 +1,14 @@ +#include "CheckMainForm.h" +#include "ui_CheckMainForm.h" + +CheckMainForm::CheckMainForm(QWidget *parent) : + QWidget(parent), + ui(new Ui::CheckMainForm) +{ + ui->setupUi(this); +} + +CheckMainForm::~CheckMainForm() +{ + delete ui; +} diff --git a/calibration/CalibrationMainForm.cpp b/calibration/CalibrationMainForm.cpp new file mode 100644 index 0000000..9b778a5 --- /dev/null +++ b/calibration/CalibrationMainForm.cpp @@ -0,0 +1,14 @@ +#include "CalibrationMainForm.h" +#include "ui_CalibrationMainForm.h" + +CalibrationMainForm::CalibrationMainForm(QWidget *parent) : + QWidget(parent), + ui(new Ui::CalibrationMainForm) +{ + ui->setupUi(this); +} + +CalibrationMainForm::~CalibrationMainForm() +{ + delete ui; +} diff --git a/calibration/CalibrationMainForm.h b/calibration/CalibrationMainForm.h new file mode 100644 index 0000000..7d75014 --- /dev/null +++ b/calibration/CalibrationMainForm.h @@ -0,0 +1,22 @@ +#ifndef CALIBRATIONMAINFORM_H +#define CALIBRATIONMAINFORM_H + +#include + +namespace Ui { +class CalibrationMainForm; +} + +class CalibrationMainForm : public QWidget +{ + Q_OBJECT + +public: + explicit CalibrationMainForm(QWidget *parent = nullptr); + ~CalibrationMainForm(); + +private: + Ui::CalibrationMainForm *ui; +}; + +#endif // CALIBRATIONMAINFORM_H diff --git a/calibration/CalibrationMainForm.ui b/calibration/CalibrationMainForm.ui new file mode 100644 index 0000000..9b5a9c2 --- /dev/null +++ b/calibration/CalibrationMainForm.ui @@ -0,0 +1,21 @@ + + + + + CalibrationMainForm + + + + 0 + 0 + 400 + 300 + + + + Form + + + + + diff --git a/calibration/calibration.pri b/calibration/calibration.pri index e69de29..f0e9dfb 100644 --- a/calibration/calibration.pri +++ b/calibration/calibration.pri @@ -0,0 +1,4 @@ +HEADERS += $$PWD/CalibrationMainForm.h +SOURCES += $$PWD/CalibrationMainForm.cpp + +FORMS += $$PWD/CalibrationMainForm.ui diff --git a/check/CheckMainForm.cpp b/check/CheckMainForm.cpp new file mode 100644 index 0000000..1725277 --- /dev/null +++ b/check/CheckMainForm.cpp @@ -0,0 +1,14 @@ +#include "CheckMainForm.h" +#include "ui_CheckMainForm.h" + +CheckMainForm::CheckMainForm(QWidget *parent) : + QWidget(parent), + ui(new Ui::CheckMainForm) +{ + ui->setupUi(this); +} + +CheckMainForm::~CheckMainForm() +{ + delete ui; +} diff --git a/check/CheckMainForm.h b/check/CheckMainForm.h new file mode 100644 index 0000000..c71001e --- /dev/null +++ b/check/CheckMainForm.h @@ -0,0 +1,22 @@ +#ifndef CHECKMAINFORM_H +#define CHECKMAINFORM_H + +#include + +namespace Ui { +class CheckMainForm; +} + +class CheckMainForm : public QWidget +{ + Q_OBJECT + +public: + explicit CheckMainForm(QWidget *parent = nullptr); + ~CheckMainForm(); + +private: + Ui::CheckMainForm *ui; +}; + +#endif // CHECKMAINFORM_H diff --git a/calibration/CalibrationMainForm.cpp b/calibration/CalibrationMainForm.cpp new file mode 100644 index 0000000..9b778a5 --- /dev/null +++ b/calibration/CalibrationMainForm.cpp @@ -0,0 +1,14 @@ +#include "CalibrationMainForm.h" +#include "ui_CalibrationMainForm.h" + +CalibrationMainForm::CalibrationMainForm(QWidget *parent) : + QWidget(parent), + ui(new Ui::CalibrationMainForm) +{ + ui->setupUi(this); +} + +CalibrationMainForm::~CalibrationMainForm() +{ + delete ui; +} diff --git a/calibration/CalibrationMainForm.h b/calibration/CalibrationMainForm.h new file mode 100644 index 0000000..7d75014 --- /dev/null +++ b/calibration/CalibrationMainForm.h @@ -0,0 +1,22 @@ +#ifndef CALIBRATIONMAINFORM_H +#define CALIBRATIONMAINFORM_H + +#include + +namespace Ui { +class CalibrationMainForm; +} + +class CalibrationMainForm : public QWidget +{ + Q_OBJECT + +public: + explicit CalibrationMainForm(QWidget *parent = nullptr); + ~CalibrationMainForm(); + +private: + Ui::CalibrationMainForm *ui; +}; + +#endif // CALIBRATIONMAINFORM_H diff --git a/calibration/CalibrationMainForm.ui b/calibration/CalibrationMainForm.ui new file mode 100644 index 0000000..9b5a9c2 --- /dev/null +++ b/calibration/CalibrationMainForm.ui @@ -0,0 +1,21 @@ + + + + + CalibrationMainForm + + + + 0 + 0 + 400 + 300 + + + + Form + + + + + diff --git a/calibration/calibration.pri b/calibration/calibration.pri index e69de29..f0e9dfb 100644 --- a/calibration/calibration.pri +++ b/calibration/calibration.pri @@ -0,0 +1,4 @@ +HEADERS += $$PWD/CalibrationMainForm.h +SOURCES += $$PWD/CalibrationMainForm.cpp + +FORMS += $$PWD/CalibrationMainForm.ui diff --git a/check/CheckMainForm.cpp b/check/CheckMainForm.cpp new file mode 100644 index 0000000..1725277 --- /dev/null +++ b/check/CheckMainForm.cpp @@ -0,0 +1,14 @@ +#include "CheckMainForm.h" +#include "ui_CheckMainForm.h" + +CheckMainForm::CheckMainForm(QWidget *parent) : + QWidget(parent), + ui(new Ui::CheckMainForm) +{ + ui->setupUi(this); +} + +CheckMainForm::~CheckMainForm() +{ + delete ui; +} diff --git a/check/CheckMainForm.h b/check/CheckMainForm.h new file mode 100644 index 0000000..c71001e --- /dev/null +++ b/check/CheckMainForm.h @@ -0,0 +1,22 @@ +#ifndef CHECKMAINFORM_H +#define CHECKMAINFORM_H + +#include + +namespace Ui { +class CheckMainForm; +} + +class CheckMainForm : public QWidget +{ + Q_OBJECT + +public: + explicit CheckMainForm(QWidget *parent = nullptr); + ~CheckMainForm(); + +private: + Ui::CheckMainForm *ui; +}; + +#endif // CHECKMAINFORM_H diff --git a/check/CheckMainForm.ui b/check/CheckMainForm.ui new file mode 100644 index 0000000..76ca74d --- /dev/null +++ b/check/CheckMainForm.ui @@ -0,0 +1,21 @@ + + + + + CheckMainForm + + + + 0 + 0 + 400 + 300 + + + + Form + + + + + diff --git a/calibration/CalibrationMainForm.cpp b/calibration/CalibrationMainForm.cpp new file mode 100644 index 0000000..9b778a5 --- /dev/null +++ b/calibration/CalibrationMainForm.cpp @@ -0,0 +1,14 @@ +#include "CalibrationMainForm.h" +#include "ui_CalibrationMainForm.h" + +CalibrationMainForm::CalibrationMainForm(QWidget *parent) : + QWidget(parent), + ui(new Ui::CalibrationMainForm) +{ + ui->setupUi(this); +} + +CalibrationMainForm::~CalibrationMainForm() +{ + delete ui; +} diff --git a/calibration/CalibrationMainForm.h b/calibration/CalibrationMainForm.h new file mode 100644 index 0000000..7d75014 --- /dev/null +++ b/calibration/CalibrationMainForm.h @@ -0,0 +1,22 @@ +#ifndef CALIBRATIONMAINFORM_H +#define CALIBRATIONMAINFORM_H + +#include + +namespace Ui { +class CalibrationMainForm; +} + +class CalibrationMainForm : public QWidget +{ + Q_OBJECT + +public: + explicit CalibrationMainForm(QWidget *parent = nullptr); + ~CalibrationMainForm(); + +private: + Ui::CalibrationMainForm *ui; +}; + +#endif // CALIBRATIONMAINFORM_H diff --git a/calibration/CalibrationMainForm.ui b/calibration/CalibrationMainForm.ui new file mode 100644 index 0000000..9b5a9c2 --- /dev/null +++ b/calibration/CalibrationMainForm.ui @@ -0,0 +1,21 @@ + + + + + CalibrationMainForm + + + + 0 + 0 + 400 + 300 + + + + Form + + + + + diff --git a/calibration/calibration.pri b/calibration/calibration.pri index e69de29..f0e9dfb 100644 --- a/calibration/calibration.pri +++ b/calibration/calibration.pri @@ -0,0 +1,4 @@ +HEADERS += $$PWD/CalibrationMainForm.h +SOURCES += $$PWD/CalibrationMainForm.cpp + +FORMS += $$PWD/CalibrationMainForm.ui diff --git a/check/CheckMainForm.cpp b/check/CheckMainForm.cpp new file mode 100644 index 0000000..1725277 --- /dev/null +++ b/check/CheckMainForm.cpp @@ -0,0 +1,14 @@ +#include "CheckMainForm.h" +#include "ui_CheckMainForm.h" + +CheckMainForm::CheckMainForm(QWidget *parent) : + QWidget(parent), + ui(new Ui::CheckMainForm) +{ + ui->setupUi(this); +} + +CheckMainForm::~CheckMainForm() +{ + delete ui; +} diff --git a/check/CheckMainForm.h b/check/CheckMainForm.h new file mode 100644 index 0000000..c71001e --- /dev/null +++ b/check/CheckMainForm.h @@ -0,0 +1,22 @@ +#ifndef CHECKMAINFORM_H +#define CHECKMAINFORM_H + +#include + +namespace Ui { +class CheckMainForm; +} + +class CheckMainForm : public QWidget +{ + Q_OBJECT + +public: + explicit CheckMainForm(QWidget *parent = nullptr); + ~CheckMainForm(); + +private: + Ui::CheckMainForm *ui; +}; + +#endif // CHECKMAINFORM_H diff --git a/check/CheckMainForm.ui b/check/CheckMainForm.ui new file mode 100644 index 0000000..76ca74d --- /dev/null +++ b/check/CheckMainForm.ui @@ -0,0 +1,21 @@ + + + + + CheckMainForm + + + + 0 + 0 + 400 + 300 + + + + Form + + + + + diff --git a/check/check.pri b/check/check.pri index e69de29..624bd3f 100644 --- a/check/check.pri +++ b/check/check.pri @@ -0,0 +1,4 @@ +HEADERS += $$PWD/CheckMainForm.h +SOURCES += $$PWD/CheckMainForm.cpp + +FORMS += $$PWD/CheckMainForm.ui diff --git a/calibration/CalibrationMainForm.cpp b/calibration/CalibrationMainForm.cpp new file mode 100644 index 0000000..9b778a5 --- /dev/null +++ b/calibration/CalibrationMainForm.cpp @@ -0,0 +1,14 @@ +#include "CalibrationMainForm.h" +#include "ui_CalibrationMainForm.h" + +CalibrationMainForm::CalibrationMainForm(QWidget *parent) : + QWidget(parent), + ui(new Ui::CalibrationMainForm) +{ + ui->setupUi(this); +} + +CalibrationMainForm::~CalibrationMainForm() +{ + delete ui; +} diff --git a/calibration/CalibrationMainForm.h b/calibration/CalibrationMainForm.h new file mode 100644 index 0000000..7d75014 --- /dev/null +++ b/calibration/CalibrationMainForm.h @@ -0,0 +1,22 @@ +#ifndef CALIBRATIONMAINFORM_H +#define CALIBRATIONMAINFORM_H + +#include + +namespace Ui { +class CalibrationMainForm; +} + +class CalibrationMainForm : public QWidget +{ + Q_OBJECT + +public: + explicit CalibrationMainForm(QWidget *parent = nullptr); + ~CalibrationMainForm(); + +private: + Ui::CalibrationMainForm *ui; +}; + +#endif // CALIBRATIONMAINFORM_H diff --git a/calibration/CalibrationMainForm.ui b/calibration/CalibrationMainForm.ui new file mode 100644 index 0000000..9b5a9c2 --- /dev/null +++ b/calibration/CalibrationMainForm.ui @@ -0,0 +1,21 @@ + + + + + CalibrationMainForm + + + + 0 + 0 + 400 + 300 + + + + Form + + + + + diff --git a/calibration/calibration.pri b/calibration/calibration.pri index e69de29..f0e9dfb 100644 --- a/calibration/calibration.pri +++ b/calibration/calibration.pri @@ -0,0 +1,4 @@ +HEADERS += $$PWD/CalibrationMainForm.h +SOURCES += $$PWD/CalibrationMainForm.cpp + +FORMS += $$PWD/CalibrationMainForm.ui diff --git a/check/CheckMainForm.cpp b/check/CheckMainForm.cpp new file mode 100644 index 0000000..1725277 --- /dev/null +++ b/check/CheckMainForm.cpp @@ -0,0 +1,14 @@ +#include "CheckMainForm.h" +#include "ui_CheckMainForm.h" + +CheckMainForm::CheckMainForm(QWidget *parent) : + QWidget(parent), + ui(new Ui::CheckMainForm) +{ + ui->setupUi(this); +} + +CheckMainForm::~CheckMainForm() +{ + delete ui; +} diff --git a/check/CheckMainForm.h b/check/CheckMainForm.h new file mode 100644 index 0000000..c71001e --- /dev/null +++ b/check/CheckMainForm.h @@ -0,0 +1,22 @@ +#ifndef CHECKMAINFORM_H +#define CHECKMAINFORM_H + +#include + +namespace Ui { +class CheckMainForm; +} + +class CheckMainForm : public QWidget +{ + Q_OBJECT + +public: + explicit CheckMainForm(QWidget *parent = nullptr); + ~CheckMainForm(); + +private: + Ui::CheckMainForm *ui; +}; + +#endif // CHECKMAINFORM_H diff --git a/check/CheckMainForm.ui b/check/CheckMainForm.ui new file mode 100644 index 0000000..76ca74d --- /dev/null +++ b/check/CheckMainForm.ui @@ -0,0 +1,21 @@ + + + + + CheckMainForm + + + + 0 + 0 + 400 + 300 + + + + Form + + + + + diff --git a/check/check.pri b/check/check.pri index e69de29..624bd3f 100644 --- a/check/check.pri +++ b/check/check.pri @@ -0,0 +1,4 @@ +HEADERS += $$PWD/CheckMainForm.h +SOURCES += $$PWD/CheckMainForm.cpp + +FORMS += $$PWD/CheckMainForm.ui diff --git a/frame/FramelessWindow.cpp b/frame/FramelessWindow.cpp index d323ae5..5727866 100644 --- a/frame/FramelessWindow.cpp +++ b/frame/FramelessWindow.cpp @@ -1,4 +1,8 @@ -#include "FramelessWindow.h" +#include +#include +#include + +#include "FramelessWindow.h" #ifdef Q_OS_WIN #include "windows.h" @@ -63,6 +67,12 @@ resizeEnable = false; } + if (!isMaximized()) { + QRect screenRect = QApplication::screens().at(0)->availableGeometry(); + resize(screenRect.width() * 0.9, screenRect.height() * 0.9); + move(QRandomGenerator::global()->bounded(10, 100), QRandomGenerator::global()->bounded(10, 50)); + } + //发出最大化最小化等改变事件,以便界面上更改对应的信息比如右上角图标和文字 Q_EMIT windowStateChange(!moveEnable); diff --git a/calibration/CalibrationMainForm.cpp b/calibration/CalibrationMainForm.cpp new file mode 100644 index 0000000..9b778a5 --- /dev/null +++ b/calibration/CalibrationMainForm.cpp @@ -0,0 +1,14 @@ +#include "CalibrationMainForm.h" +#include "ui_CalibrationMainForm.h" + +CalibrationMainForm::CalibrationMainForm(QWidget *parent) : + QWidget(parent), + ui(new Ui::CalibrationMainForm) +{ + ui->setupUi(this); +} + +CalibrationMainForm::~CalibrationMainForm() +{ + delete ui; +} diff --git a/calibration/CalibrationMainForm.h b/calibration/CalibrationMainForm.h new file mode 100644 index 0000000..7d75014 --- /dev/null +++ b/calibration/CalibrationMainForm.h @@ -0,0 +1,22 @@ +#ifndef CALIBRATIONMAINFORM_H +#define CALIBRATIONMAINFORM_H + +#include + +namespace Ui { +class CalibrationMainForm; +} + +class CalibrationMainForm : public QWidget +{ + Q_OBJECT + +public: + explicit CalibrationMainForm(QWidget *parent = nullptr); + ~CalibrationMainForm(); + +private: + Ui::CalibrationMainForm *ui; +}; + +#endif // CALIBRATIONMAINFORM_H diff --git a/calibration/CalibrationMainForm.ui b/calibration/CalibrationMainForm.ui new file mode 100644 index 0000000..9b5a9c2 --- /dev/null +++ b/calibration/CalibrationMainForm.ui @@ -0,0 +1,21 @@ + + + + + CalibrationMainForm + + + + 0 + 0 + 400 + 300 + + + + Form + + + + + diff --git a/calibration/calibration.pri b/calibration/calibration.pri index e69de29..f0e9dfb 100644 --- a/calibration/calibration.pri +++ b/calibration/calibration.pri @@ -0,0 +1,4 @@ +HEADERS += $$PWD/CalibrationMainForm.h +SOURCES += $$PWD/CalibrationMainForm.cpp + +FORMS += $$PWD/CalibrationMainForm.ui diff --git a/check/CheckMainForm.cpp b/check/CheckMainForm.cpp new file mode 100644 index 0000000..1725277 --- /dev/null +++ b/check/CheckMainForm.cpp @@ -0,0 +1,14 @@ +#include "CheckMainForm.h" +#include "ui_CheckMainForm.h" + +CheckMainForm::CheckMainForm(QWidget *parent) : + QWidget(parent), + ui(new Ui::CheckMainForm) +{ + ui->setupUi(this); +} + +CheckMainForm::~CheckMainForm() +{ + delete ui; +} diff --git a/check/CheckMainForm.h b/check/CheckMainForm.h new file mode 100644 index 0000000..c71001e --- /dev/null +++ b/check/CheckMainForm.h @@ -0,0 +1,22 @@ +#ifndef CHECKMAINFORM_H +#define CHECKMAINFORM_H + +#include + +namespace Ui { +class CheckMainForm; +} + +class CheckMainForm : public QWidget +{ + Q_OBJECT + +public: + explicit CheckMainForm(QWidget *parent = nullptr); + ~CheckMainForm(); + +private: + Ui::CheckMainForm *ui; +}; + +#endif // CHECKMAINFORM_H diff --git a/check/CheckMainForm.ui b/check/CheckMainForm.ui new file mode 100644 index 0000000..76ca74d --- /dev/null +++ b/check/CheckMainForm.ui @@ -0,0 +1,21 @@ + + + + + CheckMainForm + + + + 0 + 0 + 400 + 300 + + + + Form + + + + + diff --git a/check/check.pri b/check/check.pri index e69de29..624bd3f 100644 --- a/check/check.pri +++ b/check/check.pri @@ -0,0 +1,4 @@ +HEADERS += $$PWD/CheckMainForm.h +SOURCES += $$PWD/CheckMainForm.cpp + +FORMS += $$PWD/CheckMainForm.ui diff --git a/frame/FramelessWindow.cpp b/frame/FramelessWindow.cpp index d323ae5..5727866 100644 --- a/frame/FramelessWindow.cpp +++ b/frame/FramelessWindow.cpp @@ -1,4 +1,8 @@ -#include "FramelessWindow.h" +#include +#include +#include + +#include "FramelessWindow.h" #ifdef Q_OS_WIN #include "windows.h" @@ -63,6 +67,12 @@ resizeEnable = false; } + if (!isMaximized()) { + QRect screenRect = QApplication::screens().at(0)->availableGeometry(); + resize(screenRect.width() * 0.9, screenRect.height() * 0.9); + move(QRandomGenerator::global()->bounded(10, 100), QRandomGenerator::global()->bounded(10, 50)); + } + //发出最大化最小化等改变事件,以便界面上更改对应的信息比如右上角图标和文字 Q_EMIT windowStateChange(!moveEnable); diff --git a/frame/MainWindowForm.cpp b/frame/MainWindowForm.cpp index cb98f69..0791c77 100644 --- a/frame/MainWindowForm.cpp +++ b/frame/MainWindowForm.cpp @@ -1,8 +1,6 @@ #include "MainWindowForm.h" #include "ui_MainWindowForm.h" -#include - MainWindowForm::MainWindowForm(QWidget *parent) : FramelessWindow(parent), ui(new Ui::MainWindowForm) @@ -18,8 +16,8 @@ connect(TimeCounterUtil::getInstance().clockTimer, &QTimer::timeout, this, &MainWindowForm::onUpdateTimestampHandler); TimeCounterUtil::getInstance().clockTimer->start(1000); - /** 临时调试代码 **/ - emit ui->btnInfomation->clicked(); + // 自动加载第一个页面 + emit ui->btnCalibration->clicked(); } MainWindowForm::~MainWindowForm() @@ -37,7 +35,7 @@ { setWindowFlags(Qt::FramelessWindowHint); // 设置全屏 setWindowState(Qt::WindowState::WindowMaximized); - this->setTitleBar(ui->wdgtTop); + // 设置窗口位置和大小 move(0, 0); @@ -46,42 +44,31 @@ qint16 screenHeight = screenRect.height(); resize(screenWidth, screenHeight); + // 设置标题栏 以绑定和触发鼠标双击事件 + this->setTitleBar(ui->wdgtTop); + connect(this, &MainWindowForm::titleDblClick, this, &MainWindowForm::titleDblClickHandler); + // 加载样式表 QString qssStyle = QssFileUtils::loadQssFileContent(":/qss/mainForm.css"); if (qssStyle.isEmpty() == false) { ui->wdgtTop->setStyleSheet(qssStyle); // 仅本窗口生效 + ui->wdgtContent->setStyleSheet("QWidget{background: #FFFFFF;}"); } - // 设置标题 + // 设置标题文字 ui->labelTitle->setText(SettingConfig::getInstance().CLIENT_TITLE); setWindowTitle(SettingConfig::getInstance().CLIENT_TITLE); - // 设置最小尺寸(宽度, 高度) lxc - QScreen *screen = QGuiApplication::primaryScreen(); - QRect screenSize = screen->availableGeometry(); // 可用区域(排除任务栏) - // 设置最小尺寸为屏幕宽度的 80%,高度 600 - int minWidth = screenSize.width() * 0.8; + int minWidth = screenWidth * 0.8; this->setMinimumSize(minWidth, 600); } void MainWindowForm::initMenuWidgets() { + wdgtCaliMain = new CalibrationMainForm(this); + wdgtCheckMain = new CheckMainForm(this); wdgtInfoMain = new InfoMainForm(this); -// wdgtInfo = new TF_InfoManag(this); -// wdgtCheckMethod = new CheckMethodManage(this); -// wdgtCheck = new CheckWindow(this); -// wdgtData = new TF_TextDataManag(this); -// wdgtCert = new TF_CertificateApproval(this); -// wdgtUserMan = new TF_UserManag(this); -// wdgtTestDev = new TF_TextDevice(this); -// wdgtStandDev = new tf_StandardDevice(this); - -// wdgtStdDevForm = new StandardDeviceForm(this); -// wdgtEqptDevForm = new TestDeviceForm(this); -// wdgtFileResForm = new FileResourcesForm(this); - -// wdgtCalibrationForm = new CalibrationForm(this); // 绑定事件 // connect(wdgtCalibrationForm, &CalibrationForm::enableMenuButtons, this, &MainWindowForm::onMenuButtonsEabled); @@ -89,18 +76,9 @@ // connect(wdgtCheck, &CheckWindow::BarsetEnabled, this, &MainWindowForm::onMenuButtonsEabled); // 添加到stackWidget中 + ui->wdgtContent->insertWidget(0, wdgtCaliMain); + ui->wdgtContent->insertWidget(1, wdgtCheckMain); ui->wdgtContent->insertWidget(2, wdgtInfoMain); -// ui->wdgtContent->insertWidget(0, wdgtCalibrationForm); -// ui->wdgtContent->insertWidget(1, wdgtStdDevForm); -// ui->wdgtContent->insertWidget(1, wdgtStandDev); -// ui->wdgtContent->insertWidget(2, wdgtTestDev); -// ui->wdgtContent->insertWidget(2, wdgtEqptDevForm); -// ui->wdgtContent->insertWidget(3, wdgtCheckMethod); -// ui->wdgtContent->insertWidget(4, wdgtCheck); -// ui->wdgtContent->insertWidget(5, wdgtData); -// ui->wdgtContent->insertWidget(6, wdgtCert); -// ui->wdgtContent->insertWidget(7, wdgtFileResForm); -// ui->wdgtContent->insertWidget(8, wdgtUserMan); } void MainWindowForm::initFunctionButtons() @@ -115,7 +93,6 @@ funcButtGroup->addButton(funcButt); connect(funcButt, &QToolButton::clicked, this, &MainWindowForm::onFunctionButtonsAction); } - connect(this, SIGNAL(titleDblClick()), this, SLOT(titleDblClick())); } void MainWindowForm::on_btnMinWin_clicked() @@ -125,17 +102,12 @@ 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(); + ui->btnMaxWin->setToolTip("最大化"); } else { - resize(screenSize.width(), screenSize.height()); - move(0, 0); this->showMaximized(); + ui->btnMaxWin->setToolTip("还原"); } } @@ -165,7 +137,7 @@ ui->labelTime->setText(now.toString("yyyy-MM-dd HH:mm:ss")); } -void MainWindowForm::titleDblClick() +void MainWindowForm::titleDblClickHandler() { on_btnMaxWin_clicked(); } diff --git a/calibration/CalibrationMainForm.cpp b/calibration/CalibrationMainForm.cpp new file mode 100644 index 0000000..9b778a5 --- /dev/null +++ b/calibration/CalibrationMainForm.cpp @@ -0,0 +1,14 @@ +#include "CalibrationMainForm.h" +#include "ui_CalibrationMainForm.h" + +CalibrationMainForm::CalibrationMainForm(QWidget *parent) : + QWidget(parent), + ui(new Ui::CalibrationMainForm) +{ + ui->setupUi(this); +} + +CalibrationMainForm::~CalibrationMainForm() +{ + delete ui; +} diff --git a/calibration/CalibrationMainForm.h b/calibration/CalibrationMainForm.h new file mode 100644 index 0000000..7d75014 --- /dev/null +++ b/calibration/CalibrationMainForm.h @@ -0,0 +1,22 @@ +#ifndef CALIBRATIONMAINFORM_H +#define CALIBRATIONMAINFORM_H + +#include + +namespace Ui { +class CalibrationMainForm; +} + +class CalibrationMainForm : public QWidget +{ + Q_OBJECT + +public: + explicit CalibrationMainForm(QWidget *parent = nullptr); + ~CalibrationMainForm(); + +private: + Ui::CalibrationMainForm *ui; +}; + +#endif // CALIBRATIONMAINFORM_H diff --git a/calibration/CalibrationMainForm.ui b/calibration/CalibrationMainForm.ui new file mode 100644 index 0000000..9b5a9c2 --- /dev/null +++ b/calibration/CalibrationMainForm.ui @@ -0,0 +1,21 @@ + + + + + CalibrationMainForm + + + + 0 + 0 + 400 + 300 + + + + Form + + + + + diff --git a/calibration/calibration.pri b/calibration/calibration.pri index e69de29..f0e9dfb 100644 --- a/calibration/calibration.pri +++ b/calibration/calibration.pri @@ -0,0 +1,4 @@ +HEADERS += $$PWD/CalibrationMainForm.h +SOURCES += $$PWD/CalibrationMainForm.cpp + +FORMS += $$PWD/CalibrationMainForm.ui diff --git a/check/CheckMainForm.cpp b/check/CheckMainForm.cpp new file mode 100644 index 0000000..1725277 --- /dev/null +++ b/check/CheckMainForm.cpp @@ -0,0 +1,14 @@ +#include "CheckMainForm.h" +#include "ui_CheckMainForm.h" + +CheckMainForm::CheckMainForm(QWidget *parent) : + QWidget(parent), + ui(new Ui::CheckMainForm) +{ + ui->setupUi(this); +} + +CheckMainForm::~CheckMainForm() +{ + delete ui; +} diff --git a/check/CheckMainForm.h b/check/CheckMainForm.h new file mode 100644 index 0000000..c71001e --- /dev/null +++ b/check/CheckMainForm.h @@ -0,0 +1,22 @@ +#ifndef CHECKMAINFORM_H +#define CHECKMAINFORM_H + +#include + +namespace Ui { +class CheckMainForm; +} + +class CheckMainForm : public QWidget +{ + Q_OBJECT + +public: + explicit CheckMainForm(QWidget *parent = nullptr); + ~CheckMainForm(); + +private: + Ui::CheckMainForm *ui; +}; + +#endif // CHECKMAINFORM_H diff --git a/check/CheckMainForm.ui b/check/CheckMainForm.ui new file mode 100644 index 0000000..76ca74d --- /dev/null +++ b/check/CheckMainForm.ui @@ -0,0 +1,21 @@ + + + + + CheckMainForm + + + + 0 + 0 + 400 + 300 + + + + Form + + + + + diff --git a/check/check.pri b/check/check.pri index e69de29..624bd3f 100644 --- a/check/check.pri +++ b/check/check.pri @@ -0,0 +1,4 @@ +HEADERS += $$PWD/CheckMainForm.h +SOURCES += $$PWD/CheckMainForm.cpp + +FORMS += $$PWD/CheckMainForm.ui diff --git a/frame/FramelessWindow.cpp b/frame/FramelessWindow.cpp index d323ae5..5727866 100644 --- a/frame/FramelessWindow.cpp +++ b/frame/FramelessWindow.cpp @@ -1,4 +1,8 @@ -#include "FramelessWindow.h" +#include +#include +#include + +#include "FramelessWindow.h" #ifdef Q_OS_WIN #include "windows.h" @@ -63,6 +67,12 @@ resizeEnable = false; } + if (!isMaximized()) { + QRect screenRect = QApplication::screens().at(0)->availableGeometry(); + resize(screenRect.width() * 0.9, screenRect.height() * 0.9); + move(QRandomGenerator::global()->bounded(10, 100), QRandomGenerator::global()->bounded(10, 50)); + } + //发出最大化最小化等改变事件,以便界面上更改对应的信息比如右上角图标和文字 Q_EMIT windowStateChange(!moveEnable); diff --git a/frame/MainWindowForm.cpp b/frame/MainWindowForm.cpp index cb98f69..0791c77 100644 --- a/frame/MainWindowForm.cpp +++ b/frame/MainWindowForm.cpp @@ -1,8 +1,6 @@ #include "MainWindowForm.h" #include "ui_MainWindowForm.h" -#include - MainWindowForm::MainWindowForm(QWidget *parent) : FramelessWindow(parent), ui(new Ui::MainWindowForm) @@ -18,8 +16,8 @@ connect(TimeCounterUtil::getInstance().clockTimer, &QTimer::timeout, this, &MainWindowForm::onUpdateTimestampHandler); TimeCounterUtil::getInstance().clockTimer->start(1000); - /** 临时调试代码 **/ - emit ui->btnInfomation->clicked(); + // 自动加载第一个页面 + emit ui->btnCalibration->clicked(); } MainWindowForm::~MainWindowForm() @@ -37,7 +35,7 @@ { setWindowFlags(Qt::FramelessWindowHint); // 设置全屏 setWindowState(Qt::WindowState::WindowMaximized); - this->setTitleBar(ui->wdgtTop); + // 设置窗口位置和大小 move(0, 0); @@ -46,42 +44,31 @@ qint16 screenHeight = screenRect.height(); resize(screenWidth, screenHeight); + // 设置标题栏 以绑定和触发鼠标双击事件 + this->setTitleBar(ui->wdgtTop); + connect(this, &MainWindowForm::titleDblClick, this, &MainWindowForm::titleDblClickHandler); + // 加载样式表 QString qssStyle = QssFileUtils::loadQssFileContent(":/qss/mainForm.css"); if (qssStyle.isEmpty() == false) { ui->wdgtTop->setStyleSheet(qssStyle); // 仅本窗口生效 + ui->wdgtContent->setStyleSheet("QWidget{background: #FFFFFF;}"); } - // 设置标题 + // 设置标题文字 ui->labelTitle->setText(SettingConfig::getInstance().CLIENT_TITLE); setWindowTitle(SettingConfig::getInstance().CLIENT_TITLE); - // 设置最小尺寸(宽度, 高度) lxc - QScreen *screen = QGuiApplication::primaryScreen(); - QRect screenSize = screen->availableGeometry(); // 可用区域(排除任务栏) - // 设置最小尺寸为屏幕宽度的 80%,高度 600 - int minWidth = screenSize.width() * 0.8; + int minWidth = screenWidth * 0.8; this->setMinimumSize(minWidth, 600); } void MainWindowForm::initMenuWidgets() { + wdgtCaliMain = new CalibrationMainForm(this); + wdgtCheckMain = new CheckMainForm(this); wdgtInfoMain = new InfoMainForm(this); -// wdgtInfo = new TF_InfoManag(this); -// wdgtCheckMethod = new CheckMethodManage(this); -// wdgtCheck = new CheckWindow(this); -// wdgtData = new TF_TextDataManag(this); -// wdgtCert = new TF_CertificateApproval(this); -// wdgtUserMan = new TF_UserManag(this); -// wdgtTestDev = new TF_TextDevice(this); -// wdgtStandDev = new tf_StandardDevice(this); - -// wdgtStdDevForm = new StandardDeviceForm(this); -// wdgtEqptDevForm = new TestDeviceForm(this); -// wdgtFileResForm = new FileResourcesForm(this); - -// wdgtCalibrationForm = new CalibrationForm(this); // 绑定事件 // connect(wdgtCalibrationForm, &CalibrationForm::enableMenuButtons, this, &MainWindowForm::onMenuButtonsEabled); @@ -89,18 +76,9 @@ // connect(wdgtCheck, &CheckWindow::BarsetEnabled, this, &MainWindowForm::onMenuButtonsEabled); // 添加到stackWidget中 + ui->wdgtContent->insertWidget(0, wdgtCaliMain); + ui->wdgtContent->insertWidget(1, wdgtCheckMain); ui->wdgtContent->insertWidget(2, wdgtInfoMain); -// ui->wdgtContent->insertWidget(0, wdgtCalibrationForm); -// ui->wdgtContent->insertWidget(1, wdgtStdDevForm); -// ui->wdgtContent->insertWidget(1, wdgtStandDev); -// ui->wdgtContent->insertWidget(2, wdgtTestDev); -// ui->wdgtContent->insertWidget(2, wdgtEqptDevForm); -// ui->wdgtContent->insertWidget(3, wdgtCheckMethod); -// ui->wdgtContent->insertWidget(4, wdgtCheck); -// ui->wdgtContent->insertWidget(5, wdgtData); -// ui->wdgtContent->insertWidget(6, wdgtCert); -// ui->wdgtContent->insertWidget(7, wdgtFileResForm); -// ui->wdgtContent->insertWidget(8, wdgtUserMan); } void MainWindowForm::initFunctionButtons() @@ -115,7 +93,6 @@ funcButtGroup->addButton(funcButt); connect(funcButt, &QToolButton::clicked, this, &MainWindowForm::onFunctionButtonsAction); } - connect(this, SIGNAL(titleDblClick()), this, SLOT(titleDblClick())); } void MainWindowForm::on_btnMinWin_clicked() @@ -125,17 +102,12 @@ 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(); + ui->btnMaxWin->setToolTip("最大化"); } else { - resize(screenSize.width(), screenSize.height()); - move(0, 0); this->showMaximized(); + ui->btnMaxWin->setToolTip("还原"); } } @@ -165,7 +137,7 @@ ui->labelTime->setText(now.toString("yyyy-MM-dd HH:mm:ss")); } -void MainWindowForm::titleDblClick() +void MainWindowForm::titleDblClickHandler() { on_btnMaxWin_clicked(); } diff --git a/frame/MainWindowForm.h b/frame/MainWindowForm.h index 9b4eae4..aa5330c 100644 --- a/frame/MainWindowForm.h +++ b/frame/MainWindowForm.h @@ -13,21 +13,8 @@ #include "frame/FramelessWindow.h" #include "infomation/InfoMainForm.h" - -//#include "infomation/standDev/StandardDeviceForm.h" -//#include "infomation/testDev/TestDeviceForm.h" -//#include "infomation/fileRes/FileResourcesForm.h" - -//#include "calibration/CalibrationForm.h" - -//#include "TimeFreq/tf_standarddevice.h" -//#include "TimeFreq/tf_certificateapproval.h" -//#include "TimeFreq/tf_infomanag.h" -//#include "TimeFreq/tf_textdatamanag.h" -//#include "TimeFreq/tf_textdevice.h" -//#include "TimeFreq/tf_usermanag.h" -//#include "checkmethodmanage.h" -//#include "checkwindow.h" +#include "calibration/CalibrationMainForm.h" +#include "check/CheckMainForm.h" namespace Ui { class MainWindowForm; @@ -50,29 +37,16 @@ void onFunctionButtonsAction(); void onUpdateTimestampHandler(); - void titleDblClick(); + void titleDblClickHandler(); void onMenuButtonsEabled(bool enable); private: Ui::MainWindowForm *ui; + CalibrationMainForm * wdgtCaliMain; + CheckMainForm * wdgtCheckMain; InfoMainForm * wdgtInfoMain; -// TF_InfoManag * wdgtInfo; -// CheckMethodManage * wdgtCheckMethod; -// CheckWindow * wdgtCheck; -// TF_TextDataManag * wdgtData; -// TF_CertificateApproval * wdgtCert; -// TF_UserManag * wdgtUserMan; -// tf_StandardDevice * wdgtStandDev; -// TF_TextDevice * wdgtTestDev; - -// StandardDeviceForm * wdgtStdDevForm; -// TestDeviceForm * wdgtEqptDevForm; -// FileResourcesForm * wdgtFileResForm; - -// CalibrationForm * wdgtCalibrationForm; - void initForm(); void initMenuWidgets(); void initFunctionButtons(); diff --git a/calibration/CalibrationMainForm.cpp b/calibration/CalibrationMainForm.cpp new file mode 100644 index 0000000..9b778a5 --- /dev/null +++ b/calibration/CalibrationMainForm.cpp @@ -0,0 +1,14 @@ +#include "CalibrationMainForm.h" +#include "ui_CalibrationMainForm.h" + +CalibrationMainForm::CalibrationMainForm(QWidget *parent) : + QWidget(parent), + ui(new Ui::CalibrationMainForm) +{ + ui->setupUi(this); +} + +CalibrationMainForm::~CalibrationMainForm() +{ + delete ui; +} diff --git a/calibration/CalibrationMainForm.h b/calibration/CalibrationMainForm.h new file mode 100644 index 0000000..7d75014 --- /dev/null +++ b/calibration/CalibrationMainForm.h @@ -0,0 +1,22 @@ +#ifndef CALIBRATIONMAINFORM_H +#define CALIBRATIONMAINFORM_H + +#include + +namespace Ui { +class CalibrationMainForm; +} + +class CalibrationMainForm : public QWidget +{ + Q_OBJECT + +public: + explicit CalibrationMainForm(QWidget *parent = nullptr); + ~CalibrationMainForm(); + +private: + Ui::CalibrationMainForm *ui; +}; + +#endif // CALIBRATIONMAINFORM_H diff --git a/calibration/CalibrationMainForm.ui b/calibration/CalibrationMainForm.ui new file mode 100644 index 0000000..9b5a9c2 --- /dev/null +++ b/calibration/CalibrationMainForm.ui @@ -0,0 +1,21 @@ + + + + + CalibrationMainForm + + + + 0 + 0 + 400 + 300 + + + + Form + + + + + diff --git a/calibration/calibration.pri b/calibration/calibration.pri index e69de29..f0e9dfb 100644 --- a/calibration/calibration.pri +++ b/calibration/calibration.pri @@ -0,0 +1,4 @@ +HEADERS += $$PWD/CalibrationMainForm.h +SOURCES += $$PWD/CalibrationMainForm.cpp + +FORMS += $$PWD/CalibrationMainForm.ui diff --git a/check/CheckMainForm.cpp b/check/CheckMainForm.cpp new file mode 100644 index 0000000..1725277 --- /dev/null +++ b/check/CheckMainForm.cpp @@ -0,0 +1,14 @@ +#include "CheckMainForm.h" +#include "ui_CheckMainForm.h" + +CheckMainForm::CheckMainForm(QWidget *parent) : + QWidget(parent), + ui(new Ui::CheckMainForm) +{ + ui->setupUi(this); +} + +CheckMainForm::~CheckMainForm() +{ + delete ui; +} diff --git a/check/CheckMainForm.h b/check/CheckMainForm.h new file mode 100644 index 0000000..c71001e --- /dev/null +++ b/check/CheckMainForm.h @@ -0,0 +1,22 @@ +#ifndef CHECKMAINFORM_H +#define CHECKMAINFORM_H + +#include + +namespace Ui { +class CheckMainForm; +} + +class CheckMainForm : public QWidget +{ + Q_OBJECT + +public: + explicit CheckMainForm(QWidget *parent = nullptr); + ~CheckMainForm(); + +private: + Ui::CheckMainForm *ui; +}; + +#endif // CHECKMAINFORM_H diff --git a/check/CheckMainForm.ui b/check/CheckMainForm.ui new file mode 100644 index 0000000..76ca74d --- /dev/null +++ b/check/CheckMainForm.ui @@ -0,0 +1,21 @@ + + + + + CheckMainForm + + + + 0 + 0 + 400 + 300 + + + + Form + + + + + diff --git a/check/check.pri b/check/check.pri index e69de29..624bd3f 100644 --- a/check/check.pri +++ b/check/check.pri @@ -0,0 +1,4 @@ +HEADERS += $$PWD/CheckMainForm.h +SOURCES += $$PWD/CheckMainForm.cpp + +FORMS += $$PWD/CheckMainForm.ui diff --git a/frame/FramelessWindow.cpp b/frame/FramelessWindow.cpp index d323ae5..5727866 100644 --- a/frame/FramelessWindow.cpp +++ b/frame/FramelessWindow.cpp @@ -1,4 +1,8 @@ -#include "FramelessWindow.h" +#include +#include +#include + +#include "FramelessWindow.h" #ifdef Q_OS_WIN #include "windows.h" @@ -63,6 +67,12 @@ resizeEnable = false; } + if (!isMaximized()) { + QRect screenRect = QApplication::screens().at(0)->availableGeometry(); + resize(screenRect.width() * 0.9, screenRect.height() * 0.9); + move(QRandomGenerator::global()->bounded(10, 100), QRandomGenerator::global()->bounded(10, 50)); + } + //发出最大化最小化等改变事件,以便界面上更改对应的信息比如右上角图标和文字 Q_EMIT windowStateChange(!moveEnable); diff --git a/frame/MainWindowForm.cpp b/frame/MainWindowForm.cpp index cb98f69..0791c77 100644 --- a/frame/MainWindowForm.cpp +++ b/frame/MainWindowForm.cpp @@ -1,8 +1,6 @@ #include "MainWindowForm.h" #include "ui_MainWindowForm.h" -#include - MainWindowForm::MainWindowForm(QWidget *parent) : FramelessWindow(parent), ui(new Ui::MainWindowForm) @@ -18,8 +16,8 @@ connect(TimeCounterUtil::getInstance().clockTimer, &QTimer::timeout, this, &MainWindowForm::onUpdateTimestampHandler); TimeCounterUtil::getInstance().clockTimer->start(1000); - /** 临时调试代码 **/ - emit ui->btnInfomation->clicked(); + // 自动加载第一个页面 + emit ui->btnCalibration->clicked(); } MainWindowForm::~MainWindowForm() @@ -37,7 +35,7 @@ { setWindowFlags(Qt::FramelessWindowHint); // 设置全屏 setWindowState(Qt::WindowState::WindowMaximized); - this->setTitleBar(ui->wdgtTop); + // 设置窗口位置和大小 move(0, 0); @@ -46,42 +44,31 @@ qint16 screenHeight = screenRect.height(); resize(screenWidth, screenHeight); + // 设置标题栏 以绑定和触发鼠标双击事件 + this->setTitleBar(ui->wdgtTop); + connect(this, &MainWindowForm::titleDblClick, this, &MainWindowForm::titleDblClickHandler); + // 加载样式表 QString qssStyle = QssFileUtils::loadQssFileContent(":/qss/mainForm.css"); if (qssStyle.isEmpty() == false) { ui->wdgtTop->setStyleSheet(qssStyle); // 仅本窗口生效 + ui->wdgtContent->setStyleSheet("QWidget{background: #FFFFFF;}"); } - // 设置标题 + // 设置标题文字 ui->labelTitle->setText(SettingConfig::getInstance().CLIENT_TITLE); setWindowTitle(SettingConfig::getInstance().CLIENT_TITLE); - // 设置最小尺寸(宽度, 高度) lxc - QScreen *screen = QGuiApplication::primaryScreen(); - QRect screenSize = screen->availableGeometry(); // 可用区域(排除任务栏) - // 设置最小尺寸为屏幕宽度的 80%,高度 600 - int minWidth = screenSize.width() * 0.8; + int minWidth = screenWidth * 0.8; this->setMinimumSize(minWidth, 600); } void MainWindowForm::initMenuWidgets() { + wdgtCaliMain = new CalibrationMainForm(this); + wdgtCheckMain = new CheckMainForm(this); wdgtInfoMain = new InfoMainForm(this); -// wdgtInfo = new TF_InfoManag(this); -// wdgtCheckMethod = new CheckMethodManage(this); -// wdgtCheck = new CheckWindow(this); -// wdgtData = new TF_TextDataManag(this); -// wdgtCert = new TF_CertificateApproval(this); -// wdgtUserMan = new TF_UserManag(this); -// wdgtTestDev = new TF_TextDevice(this); -// wdgtStandDev = new tf_StandardDevice(this); - -// wdgtStdDevForm = new StandardDeviceForm(this); -// wdgtEqptDevForm = new TestDeviceForm(this); -// wdgtFileResForm = new FileResourcesForm(this); - -// wdgtCalibrationForm = new CalibrationForm(this); // 绑定事件 // connect(wdgtCalibrationForm, &CalibrationForm::enableMenuButtons, this, &MainWindowForm::onMenuButtonsEabled); @@ -89,18 +76,9 @@ // connect(wdgtCheck, &CheckWindow::BarsetEnabled, this, &MainWindowForm::onMenuButtonsEabled); // 添加到stackWidget中 + ui->wdgtContent->insertWidget(0, wdgtCaliMain); + ui->wdgtContent->insertWidget(1, wdgtCheckMain); ui->wdgtContent->insertWidget(2, wdgtInfoMain); -// ui->wdgtContent->insertWidget(0, wdgtCalibrationForm); -// ui->wdgtContent->insertWidget(1, wdgtStdDevForm); -// ui->wdgtContent->insertWidget(1, wdgtStandDev); -// ui->wdgtContent->insertWidget(2, wdgtTestDev); -// ui->wdgtContent->insertWidget(2, wdgtEqptDevForm); -// ui->wdgtContent->insertWidget(3, wdgtCheckMethod); -// ui->wdgtContent->insertWidget(4, wdgtCheck); -// ui->wdgtContent->insertWidget(5, wdgtData); -// ui->wdgtContent->insertWidget(6, wdgtCert); -// ui->wdgtContent->insertWidget(7, wdgtFileResForm); -// ui->wdgtContent->insertWidget(8, wdgtUserMan); } void MainWindowForm::initFunctionButtons() @@ -115,7 +93,6 @@ funcButtGroup->addButton(funcButt); connect(funcButt, &QToolButton::clicked, this, &MainWindowForm::onFunctionButtonsAction); } - connect(this, SIGNAL(titleDblClick()), this, SLOT(titleDblClick())); } void MainWindowForm::on_btnMinWin_clicked() @@ -125,17 +102,12 @@ 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(); + ui->btnMaxWin->setToolTip("最大化"); } else { - resize(screenSize.width(), screenSize.height()); - move(0, 0); this->showMaximized(); + ui->btnMaxWin->setToolTip("还原"); } } @@ -165,7 +137,7 @@ ui->labelTime->setText(now.toString("yyyy-MM-dd HH:mm:ss")); } -void MainWindowForm::titleDblClick() +void MainWindowForm::titleDblClickHandler() { on_btnMaxWin_clicked(); } diff --git a/frame/MainWindowForm.h b/frame/MainWindowForm.h index 9b4eae4..aa5330c 100644 --- a/frame/MainWindowForm.h +++ b/frame/MainWindowForm.h @@ -13,21 +13,8 @@ #include "frame/FramelessWindow.h" #include "infomation/InfoMainForm.h" - -//#include "infomation/standDev/StandardDeviceForm.h" -//#include "infomation/testDev/TestDeviceForm.h" -//#include "infomation/fileRes/FileResourcesForm.h" - -//#include "calibration/CalibrationForm.h" - -//#include "TimeFreq/tf_standarddevice.h" -//#include "TimeFreq/tf_certificateapproval.h" -//#include "TimeFreq/tf_infomanag.h" -//#include "TimeFreq/tf_textdatamanag.h" -//#include "TimeFreq/tf_textdevice.h" -//#include "TimeFreq/tf_usermanag.h" -//#include "checkmethodmanage.h" -//#include "checkwindow.h" +#include "calibration/CalibrationMainForm.h" +#include "check/CheckMainForm.h" namespace Ui { class MainWindowForm; @@ -50,29 +37,16 @@ void onFunctionButtonsAction(); void onUpdateTimestampHandler(); - void titleDblClick(); + void titleDblClickHandler(); void onMenuButtonsEabled(bool enable); private: Ui::MainWindowForm *ui; + CalibrationMainForm * wdgtCaliMain; + CheckMainForm * wdgtCheckMain; InfoMainForm * wdgtInfoMain; -// TF_InfoManag * wdgtInfo; -// CheckMethodManage * wdgtCheckMethod; -// CheckWindow * wdgtCheck; -// TF_TextDataManag * wdgtData; -// TF_CertificateApproval * wdgtCert; -// TF_UserManag * wdgtUserMan; -// tf_StandardDevice * wdgtStandDev; -// TF_TextDevice * wdgtTestDev; - -// StandardDeviceForm * wdgtStdDevForm; -// TestDeviceForm * wdgtEqptDevForm; -// FileResourcesForm * wdgtFileResForm; - -// CalibrationForm * wdgtCalibrationForm; - void initForm(); void initMenuWidgets(); void initFunctionButtons(); diff --git a/frame/MainWindowForm.ui b/frame/MainWindowForm.ui index d3fd4fe..e0638e1 100644 --- a/frame/MainWindowForm.ui +++ b/frame/MainWindowForm.ui @@ -271,6 +271,18 @@ + + + 0 + 0 + + + + + 240 + 0 + + 240 @@ -295,6 +307,18 @@ + + + 0 + 0 + + + + + 0 + 40 + + @@ -392,6 +416,18 @@ + + + 0 + 0 + + + + + 240 + 0 + + 240 @@ -422,6 +458,12 @@ 0 + + + 0 + 40 + + 5 @@ -459,6 +501,9 @@ 24 + + 设置 + @@ -509,7 +554,7 @@ - 最小化 + 还原 diff --git a/calibration/CalibrationMainForm.cpp b/calibration/CalibrationMainForm.cpp new file mode 100644 index 0000000..9b778a5 --- /dev/null +++ b/calibration/CalibrationMainForm.cpp @@ -0,0 +1,14 @@ +#include "CalibrationMainForm.h" +#include "ui_CalibrationMainForm.h" + +CalibrationMainForm::CalibrationMainForm(QWidget *parent) : + QWidget(parent), + ui(new Ui::CalibrationMainForm) +{ + ui->setupUi(this); +} + +CalibrationMainForm::~CalibrationMainForm() +{ + delete ui; +} diff --git a/calibration/CalibrationMainForm.h b/calibration/CalibrationMainForm.h new file mode 100644 index 0000000..7d75014 --- /dev/null +++ b/calibration/CalibrationMainForm.h @@ -0,0 +1,22 @@ +#ifndef CALIBRATIONMAINFORM_H +#define CALIBRATIONMAINFORM_H + +#include + +namespace Ui { +class CalibrationMainForm; +} + +class CalibrationMainForm : public QWidget +{ + Q_OBJECT + +public: + explicit CalibrationMainForm(QWidget *parent = nullptr); + ~CalibrationMainForm(); + +private: + Ui::CalibrationMainForm *ui; +}; + +#endif // CALIBRATIONMAINFORM_H diff --git a/calibration/CalibrationMainForm.ui b/calibration/CalibrationMainForm.ui new file mode 100644 index 0000000..9b5a9c2 --- /dev/null +++ b/calibration/CalibrationMainForm.ui @@ -0,0 +1,21 @@ + + + + + CalibrationMainForm + + + + 0 + 0 + 400 + 300 + + + + Form + + + + + diff --git a/calibration/calibration.pri b/calibration/calibration.pri index e69de29..f0e9dfb 100644 --- a/calibration/calibration.pri +++ b/calibration/calibration.pri @@ -0,0 +1,4 @@ +HEADERS += $$PWD/CalibrationMainForm.h +SOURCES += $$PWD/CalibrationMainForm.cpp + +FORMS += $$PWD/CalibrationMainForm.ui diff --git a/check/CheckMainForm.cpp b/check/CheckMainForm.cpp new file mode 100644 index 0000000..1725277 --- /dev/null +++ b/check/CheckMainForm.cpp @@ -0,0 +1,14 @@ +#include "CheckMainForm.h" +#include "ui_CheckMainForm.h" + +CheckMainForm::CheckMainForm(QWidget *parent) : + QWidget(parent), + ui(new Ui::CheckMainForm) +{ + ui->setupUi(this); +} + +CheckMainForm::~CheckMainForm() +{ + delete ui; +} diff --git a/check/CheckMainForm.h b/check/CheckMainForm.h new file mode 100644 index 0000000..c71001e --- /dev/null +++ b/check/CheckMainForm.h @@ -0,0 +1,22 @@ +#ifndef CHECKMAINFORM_H +#define CHECKMAINFORM_H + +#include + +namespace Ui { +class CheckMainForm; +} + +class CheckMainForm : public QWidget +{ + Q_OBJECT + +public: + explicit CheckMainForm(QWidget *parent = nullptr); + ~CheckMainForm(); + +private: + Ui::CheckMainForm *ui; +}; + +#endif // CHECKMAINFORM_H diff --git a/check/CheckMainForm.ui b/check/CheckMainForm.ui new file mode 100644 index 0000000..76ca74d --- /dev/null +++ b/check/CheckMainForm.ui @@ -0,0 +1,21 @@ + + + + + CheckMainForm + + + + 0 + 0 + 400 + 300 + + + + Form + + + + + diff --git a/check/check.pri b/check/check.pri index e69de29..624bd3f 100644 --- a/check/check.pri +++ b/check/check.pri @@ -0,0 +1,4 @@ +HEADERS += $$PWD/CheckMainForm.h +SOURCES += $$PWD/CheckMainForm.cpp + +FORMS += $$PWD/CheckMainForm.ui diff --git a/frame/FramelessWindow.cpp b/frame/FramelessWindow.cpp index d323ae5..5727866 100644 --- a/frame/FramelessWindow.cpp +++ b/frame/FramelessWindow.cpp @@ -1,4 +1,8 @@ -#include "FramelessWindow.h" +#include +#include +#include + +#include "FramelessWindow.h" #ifdef Q_OS_WIN #include "windows.h" @@ -63,6 +67,12 @@ resizeEnable = false; } + if (!isMaximized()) { + QRect screenRect = QApplication::screens().at(0)->availableGeometry(); + resize(screenRect.width() * 0.9, screenRect.height() * 0.9); + move(QRandomGenerator::global()->bounded(10, 100), QRandomGenerator::global()->bounded(10, 50)); + } + //发出最大化最小化等改变事件,以便界面上更改对应的信息比如右上角图标和文字 Q_EMIT windowStateChange(!moveEnable); diff --git a/frame/MainWindowForm.cpp b/frame/MainWindowForm.cpp index cb98f69..0791c77 100644 --- a/frame/MainWindowForm.cpp +++ b/frame/MainWindowForm.cpp @@ -1,8 +1,6 @@ #include "MainWindowForm.h" #include "ui_MainWindowForm.h" -#include - MainWindowForm::MainWindowForm(QWidget *parent) : FramelessWindow(parent), ui(new Ui::MainWindowForm) @@ -18,8 +16,8 @@ connect(TimeCounterUtil::getInstance().clockTimer, &QTimer::timeout, this, &MainWindowForm::onUpdateTimestampHandler); TimeCounterUtil::getInstance().clockTimer->start(1000); - /** 临时调试代码 **/ - emit ui->btnInfomation->clicked(); + // 自动加载第一个页面 + emit ui->btnCalibration->clicked(); } MainWindowForm::~MainWindowForm() @@ -37,7 +35,7 @@ { setWindowFlags(Qt::FramelessWindowHint); // 设置全屏 setWindowState(Qt::WindowState::WindowMaximized); - this->setTitleBar(ui->wdgtTop); + // 设置窗口位置和大小 move(0, 0); @@ -46,42 +44,31 @@ qint16 screenHeight = screenRect.height(); resize(screenWidth, screenHeight); + // 设置标题栏 以绑定和触发鼠标双击事件 + this->setTitleBar(ui->wdgtTop); + connect(this, &MainWindowForm::titleDblClick, this, &MainWindowForm::titleDblClickHandler); + // 加载样式表 QString qssStyle = QssFileUtils::loadQssFileContent(":/qss/mainForm.css"); if (qssStyle.isEmpty() == false) { ui->wdgtTop->setStyleSheet(qssStyle); // 仅本窗口生效 + ui->wdgtContent->setStyleSheet("QWidget{background: #FFFFFF;}"); } - // 设置标题 + // 设置标题文字 ui->labelTitle->setText(SettingConfig::getInstance().CLIENT_TITLE); setWindowTitle(SettingConfig::getInstance().CLIENT_TITLE); - // 设置最小尺寸(宽度, 高度) lxc - QScreen *screen = QGuiApplication::primaryScreen(); - QRect screenSize = screen->availableGeometry(); // 可用区域(排除任务栏) - // 设置最小尺寸为屏幕宽度的 80%,高度 600 - int minWidth = screenSize.width() * 0.8; + int minWidth = screenWidth * 0.8; this->setMinimumSize(minWidth, 600); } void MainWindowForm::initMenuWidgets() { + wdgtCaliMain = new CalibrationMainForm(this); + wdgtCheckMain = new CheckMainForm(this); wdgtInfoMain = new InfoMainForm(this); -// wdgtInfo = new TF_InfoManag(this); -// wdgtCheckMethod = new CheckMethodManage(this); -// wdgtCheck = new CheckWindow(this); -// wdgtData = new TF_TextDataManag(this); -// wdgtCert = new TF_CertificateApproval(this); -// wdgtUserMan = new TF_UserManag(this); -// wdgtTestDev = new TF_TextDevice(this); -// wdgtStandDev = new tf_StandardDevice(this); - -// wdgtStdDevForm = new StandardDeviceForm(this); -// wdgtEqptDevForm = new TestDeviceForm(this); -// wdgtFileResForm = new FileResourcesForm(this); - -// wdgtCalibrationForm = new CalibrationForm(this); // 绑定事件 // connect(wdgtCalibrationForm, &CalibrationForm::enableMenuButtons, this, &MainWindowForm::onMenuButtonsEabled); @@ -89,18 +76,9 @@ // connect(wdgtCheck, &CheckWindow::BarsetEnabled, this, &MainWindowForm::onMenuButtonsEabled); // 添加到stackWidget中 + ui->wdgtContent->insertWidget(0, wdgtCaliMain); + ui->wdgtContent->insertWidget(1, wdgtCheckMain); ui->wdgtContent->insertWidget(2, wdgtInfoMain); -// ui->wdgtContent->insertWidget(0, wdgtCalibrationForm); -// ui->wdgtContent->insertWidget(1, wdgtStdDevForm); -// ui->wdgtContent->insertWidget(1, wdgtStandDev); -// ui->wdgtContent->insertWidget(2, wdgtTestDev); -// ui->wdgtContent->insertWidget(2, wdgtEqptDevForm); -// ui->wdgtContent->insertWidget(3, wdgtCheckMethod); -// ui->wdgtContent->insertWidget(4, wdgtCheck); -// ui->wdgtContent->insertWidget(5, wdgtData); -// ui->wdgtContent->insertWidget(6, wdgtCert); -// ui->wdgtContent->insertWidget(7, wdgtFileResForm); -// ui->wdgtContent->insertWidget(8, wdgtUserMan); } void MainWindowForm::initFunctionButtons() @@ -115,7 +93,6 @@ funcButtGroup->addButton(funcButt); connect(funcButt, &QToolButton::clicked, this, &MainWindowForm::onFunctionButtonsAction); } - connect(this, SIGNAL(titleDblClick()), this, SLOT(titleDblClick())); } void MainWindowForm::on_btnMinWin_clicked() @@ -125,17 +102,12 @@ 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(); + ui->btnMaxWin->setToolTip("最大化"); } else { - resize(screenSize.width(), screenSize.height()); - move(0, 0); this->showMaximized(); + ui->btnMaxWin->setToolTip("还原"); } } @@ -165,7 +137,7 @@ ui->labelTime->setText(now.toString("yyyy-MM-dd HH:mm:ss")); } -void MainWindowForm::titleDblClick() +void MainWindowForm::titleDblClickHandler() { on_btnMaxWin_clicked(); } diff --git a/frame/MainWindowForm.h b/frame/MainWindowForm.h index 9b4eae4..aa5330c 100644 --- a/frame/MainWindowForm.h +++ b/frame/MainWindowForm.h @@ -13,21 +13,8 @@ #include "frame/FramelessWindow.h" #include "infomation/InfoMainForm.h" - -//#include "infomation/standDev/StandardDeviceForm.h" -//#include "infomation/testDev/TestDeviceForm.h" -//#include "infomation/fileRes/FileResourcesForm.h" - -//#include "calibration/CalibrationForm.h" - -//#include "TimeFreq/tf_standarddevice.h" -//#include "TimeFreq/tf_certificateapproval.h" -//#include "TimeFreq/tf_infomanag.h" -//#include "TimeFreq/tf_textdatamanag.h" -//#include "TimeFreq/tf_textdevice.h" -//#include "TimeFreq/tf_usermanag.h" -//#include "checkmethodmanage.h" -//#include "checkwindow.h" +#include "calibration/CalibrationMainForm.h" +#include "check/CheckMainForm.h" namespace Ui { class MainWindowForm; @@ -50,29 +37,16 @@ void onFunctionButtonsAction(); void onUpdateTimestampHandler(); - void titleDblClick(); + void titleDblClickHandler(); void onMenuButtonsEabled(bool enable); private: Ui::MainWindowForm *ui; + CalibrationMainForm * wdgtCaliMain; + CheckMainForm * wdgtCheckMain; InfoMainForm * wdgtInfoMain; -// TF_InfoManag * wdgtInfo; -// CheckMethodManage * wdgtCheckMethod; -// CheckWindow * wdgtCheck; -// TF_TextDataManag * wdgtData; -// TF_CertificateApproval * wdgtCert; -// TF_UserManag * wdgtUserMan; -// tf_StandardDevice * wdgtStandDev; -// TF_TextDevice * wdgtTestDev; - -// StandardDeviceForm * wdgtStdDevForm; -// TestDeviceForm * wdgtEqptDevForm; -// FileResourcesForm * wdgtFileResForm; - -// CalibrationForm * wdgtCalibrationForm; - void initForm(); void initMenuWidgets(); void initFunctionButtons(); diff --git a/frame/MainWindowForm.ui b/frame/MainWindowForm.ui index d3fd4fe..e0638e1 100644 --- a/frame/MainWindowForm.ui +++ b/frame/MainWindowForm.ui @@ -271,6 +271,18 @@ + + + 0 + 0 + + + + + 240 + 0 + + 240 @@ -295,6 +307,18 @@ + + + 0 + 0 + + + + + 0 + 40 + + @@ -392,6 +416,18 @@ + + + 0 + 0 + + + + + 240 + 0 + + 240 @@ -422,6 +458,12 @@ 0 + + + 0 + 40 + + 5 @@ -459,6 +501,9 @@ 24 + + 设置 + @@ -509,7 +554,7 @@ - 最小化 + 还原 diff --git a/infomation/task/DeptTaskForm.cpp b/infomation/task/DeptTaskForm.cpp index 208973c..b7d771b 100644 --- a/infomation/task/DeptTaskForm.cpp +++ b/infomation/task/DeptTaskForm.cpp @@ -33,7 +33,7 @@ void DeptTaskForm::initForm() { // 加载样式表 - QString qssStyle = QssFileUtils::loadQssFileContent(QApplication::applicationDirPath() + "/qss/infoTable.css"); + QString qssStyle = QssFileUtils::loadQssFileContent(":/qss/infoTable.css"); if (qssStyle.isEmpty() == false) { this->setStyleSheet(qssStyle); // 仅本窗口生效 } diff --git a/calibration/CalibrationMainForm.cpp b/calibration/CalibrationMainForm.cpp new file mode 100644 index 0000000..9b778a5 --- /dev/null +++ b/calibration/CalibrationMainForm.cpp @@ -0,0 +1,14 @@ +#include "CalibrationMainForm.h" +#include "ui_CalibrationMainForm.h" + +CalibrationMainForm::CalibrationMainForm(QWidget *parent) : + QWidget(parent), + ui(new Ui::CalibrationMainForm) +{ + ui->setupUi(this); +} + +CalibrationMainForm::~CalibrationMainForm() +{ + delete ui; +} diff --git a/calibration/CalibrationMainForm.h b/calibration/CalibrationMainForm.h new file mode 100644 index 0000000..7d75014 --- /dev/null +++ b/calibration/CalibrationMainForm.h @@ -0,0 +1,22 @@ +#ifndef CALIBRATIONMAINFORM_H +#define CALIBRATIONMAINFORM_H + +#include + +namespace Ui { +class CalibrationMainForm; +} + +class CalibrationMainForm : public QWidget +{ + Q_OBJECT + +public: + explicit CalibrationMainForm(QWidget *parent = nullptr); + ~CalibrationMainForm(); + +private: + Ui::CalibrationMainForm *ui; +}; + +#endif // CALIBRATIONMAINFORM_H diff --git a/calibration/CalibrationMainForm.ui b/calibration/CalibrationMainForm.ui new file mode 100644 index 0000000..9b5a9c2 --- /dev/null +++ b/calibration/CalibrationMainForm.ui @@ -0,0 +1,21 @@ + + + + + CalibrationMainForm + + + + 0 + 0 + 400 + 300 + + + + Form + + + + + diff --git a/calibration/calibration.pri b/calibration/calibration.pri index e69de29..f0e9dfb 100644 --- a/calibration/calibration.pri +++ b/calibration/calibration.pri @@ -0,0 +1,4 @@ +HEADERS += $$PWD/CalibrationMainForm.h +SOURCES += $$PWD/CalibrationMainForm.cpp + +FORMS += $$PWD/CalibrationMainForm.ui diff --git a/check/CheckMainForm.cpp b/check/CheckMainForm.cpp new file mode 100644 index 0000000..1725277 --- /dev/null +++ b/check/CheckMainForm.cpp @@ -0,0 +1,14 @@ +#include "CheckMainForm.h" +#include "ui_CheckMainForm.h" + +CheckMainForm::CheckMainForm(QWidget *parent) : + QWidget(parent), + ui(new Ui::CheckMainForm) +{ + ui->setupUi(this); +} + +CheckMainForm::~CheckMainForm() +{ + delete ui; +} diff --git a/check/CheckMainForm.h b/check/CheckMainForm.h new file mode 100644 index 0000000..c71001e --- /dev/null +++ b/check/CheckMainForm.h @@ -0,0 +1,22 @@ +#ifndef CHECKMAINFORM_H +#define CHECKMAINFORM_H + +#include + +namespace Ui { +class CheckMainForm; +} + +class CheckMainForm : public QWidget +{ + Q_OBJECT + +public: + explicit CheckMainForm(QWidget *parent = nullptr); + ~CheckMainForm(); + +private: + Ui::CheckMainForm *ui; +}; + +#endif // CHECKMAINFORM_H diff --git a/check/CheckMainForm.ui b/check/CheckMainForm.ui new file mode 100644 index 0000000..76ca74d --- /dev/null +++ b/check/CheckMainForm.ui @@ -0,0 +1,21 @@ + + + + + CheckMainForm + + + + 0 + 0 + 400 + 300 + + + + Form + + + + + diff --git a/check/check.pri b/check/check.pri index e69de29..624bd3f 100644 --- a/check/check.pri +++ b/check/check.pri @@ -0,0 +1,4 @@ +HEADERS += $$PWD/CheckMainForm.h +SOURCES += $$PWD/CheckMainForm.cpp + +FORMS += $$PWD/CheckMainForm.ui diff --git a/frame/FramelessWindow.cpp b/frame/FramelessWindow.cpp index d323ae5..5727866 100644 --- a/frame/FramelessWindow.cpp +++ b/frame/FramelessWindow.cpp @@ -1,4 +1,8 @@ -#include "FramelessWindow.h" +#include +#include +#include + +#include "FramelessWindow.h" #ifdef Q_OS_WIN #include "windows.h" @@ -63,6 +67,12 @@ resizeEnable = false; } + if (!isMaximized()) { + QRect screenRect = QApplication::screens().at(0)->availableGeometry(); + resize(screenRect.width() * 0.9, screenRect.height() * 0.9); + move(QRandomGenerator::global()->bounded(10, 100), QRandomGenerator::global()->bounded(10, 50)); + } + //发出最大化最小化等改变事件,以便界面上更改对应的信息比如右上角图标和文字 Q_EMIT windowStateChange(!moveEnable); diff --git a/frame/MainWindowForm.cpp b/frame/MainWindowForm.cpp index cb98f69..0791c77 100644 --- a/frame/MainWindowForm.cpp +++ b/frame/MainWindowForm.cpp @@ -1,8 +1,6 @@ #include "MainWindowForm.h" #include "ui_MainWindowForm.h" -#include - MainWindowForm::MainWindowForm(QWidget *parent) : FramelessWindow(parent), ui(new Ui::MainWindowForm) @@ -18,8 +16,8 @@ connect(TimeCounterUtil::getInstance().clockTimer, &QTimer::timeout, this, &MainWindowForm::onUpdateTimestampHandler); TimeCounterUtil::getInstance().clockTimer->start(1000); - /** 临时调试代码 **/ - emit ui->btnInfomation->clicked(); + // 自动加载第一个页面 + emit ui->btnCalibration->clicked(); } MainWindowForm::~MainWindowForm() @@ -37,7 +35,7 @@ { setWindowFlags(Qt::FramelessWindowHint); // 设置全屏 setWindowState(Qt::WindowState::WindowMaximized); - this->setTitleBar(ui->wdgtTop); + // 设置窗口位置和大小 move(0, 0); @@ -46,42 +44,31 @@ qint16 screenHeight = screenRect.height(); resize(screenWidth, screenHeight); + // 设置标题栏 以绑定和触发鼠标双击事件 + this->setTitleBar(ui->wdgtTop); + connect(this, &MainWindowForm::titleDblClick, this, &MainWindowForm::titleDblClickHandler); + // 加载样式表 QString qssStyle = QssFileUtils::loadQssFileContent(":/qss/mainForm.css"); if (qssStyle.isEmpty() == false) { ui->wdgtTop->setStyleSheet(qssStyle); // 仅本窗口生效 + ui->wdgtContent->setStyleSheet("QWidget{background: #FFFFFF;}"); } - // 设置标题 + // 设置标题文字 ui->labelTitle->setText(SettingConfig::getInstance().CLIENT_TITLE); setWindowTitle(SettingConfig::getInstance().CLIENT_TITLE); - // 设置最小尺寸(宽度, 高度) lxc - QScreen *screen = QGuiApplication::primaryScreen(); - QRect screenSize = screen->availableGeometry(); // 可用区域(排除任务栏) - // 设置最小尺寸为屏幕宽度的 80%,高度 600 - int minWidth = screenSize.width() * 0.8; + int minWidth = screenWidth * 0.8; this->setMinimumSize(minWidth, 600); } void MainWindowForm::initMenuWidgets() { + wdgtCaliMain = new CalibrationMainForm(this); + wdgtCheckMain = new CheckMainForm(this); wdgtInfoMain = new InfoMainForm(this); -// wdgtInfo = new TF_InfoManag(this); -// wdgtCheckMethod = new CheckMethodManage(this); -// wdgtCheck = new CheckWindow(this); -// wdgtData = new TF_TextDataManag(this); -// wdgtCert = new TF_CertificateApproval(this); -// wdgtUserMan = new TF_UserManag(this); -// wdgtTestDev = new TF_TextDevice(this); -// wdgtStandDev = new tf_StandardDevice(this); - -// wdgtStdDevForm = new StandardDeviceForm(this); -// wdgtEqptDevForm = new TestDeviceForm(this); -// wdgtFileResForm = new FileResourcesForm(this); - -// wdgtCalibrationForm = new CalibrationForm(this); // 绑定事件 // connect(wdgtCalibrationForm, &CalibrationForm::enableMenuButtons, this, &MainWindowForm::onMenuButtonsEabled); @@ -89,18 +76,9 @@ // connect(wdgtCheck, &CheckWindow::BarsetEnabled, this, &MainWindowForm::onMenuButtonsEabled); // 添加到stackWidget中 + ui->wdgtContent->insertWidget(0, wdgtCaliMain); + ui->wdgtContent->insertWidget(1, wdgtCheckMain); ui->wdgtContent->insertWidget(2, wdgtInfoMain); -// ui->wdgtContent->insertWidget(0, wdgtCalibrationForm); -// ui->wdgtContent->insertWidget(1, wdgtStdDevForm); -// ui->wdgtContent->insertWidget(1, wdgtStandDev); -// ui->wdgtContent->insertWidget(2, wdgtTestDev); -// ui->wdgtContent->insertWidget(2, wdgtEqptDevForm); -// ui->wdgtContent->insertWidget(3, wdgtCheckMethod); -// ui->wdgtContent->insertWidget(4, wdgtCheck); -// ui->wdgtContent->insertWidget(5, wdgtData); -// ui->wdgtContent->insertWidget(6, wdgtCert); -// ui->wdgtContent->insertWidget(7, wdgtFileResForm); -// ui->wdgtContent->insertWidget(8, wdgtUserMan); } void MainWindowForm::initFunctionButtons() @@ -115,7 +93,6 @@ funcButtGroup->addButton(funcButt); connect(funcButt, &QToolButton::clicked, this, &MainWindowForm::onFunctionButtonsAction); } - connect(this, SIGNAL(titleDblClick()), this, SLOT(titleDblClick())); } void MainWindowForm::on_btnMinWin_clicked() @@ -125,17 +102,12 @@ 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(); + ui->btnMaxWin->setToolTip("最大化"); } else { - resize(screenSize.width(), screenSize.height()); - move(0, 0); this->showMaximized(); + ui->btnMaxWin->setToolTip("还原"); } } @@ -165,7 +137,7 @@ ui->labelTime->setText(now.toString("yyyy-MM-dd HH:mm:ss")); } -void MainWindowForm::titleDblClick() +void MainWindowForm::titleDblClickHandler() { on_btnMaxWin_clicked(); } diff --git a/frame/MainWindowForm.h b/frame/MainWindowForm.h index 9b4eae4..aa5330c 100644 --- a/frame/MainWindowForm.h +++ b/frame/MainWindowForm.h @@ -13,21 +13,8 @@ #include "frame/FramelessWindow.h" #include "infomation/InfoMainForm.h" - -//#include "infomation/standDev/StandardDeviceForm.h" -//#include "infomation/testDev/TestDeviceForm.h" -//#include "infomation/fileRes/FileResourcesForm.h" - -//#include "calibration/CalibrationForm.h" - -//#include "TimeFreq/tf_standarddevice.h" -//#include "TimeFreq/tf_certificateapproval.h" -//#include "TimeFreq/tf_infomanag.h" -//#include "TimeFreq/tf_textdatamanag.h" -//#include "TimeFreq/tf_textdevice.h" -//#include "TimeFreq/tf_usermanag.h" -//#include "checkmethodmanage.h" -//#include "checkwindow.h" +#include "calibration/CalibrationMainForm.h" +#include "check/CheckMainForm.h" namespace Ui { class MainWindowForm; @@ -50,29 +37,16 @@ void onFunctionButtonsAction(); void onUpdateTimestampHandler(); - void titleDblClick(); + void titleDblClickHandler(); void onMenuButtonsEabled(bool enable); private: Ui::MainWindowForm *ui; + CalibrationMainForm * wdgtCaliMain; + CheckMainForm * wdgtCheckMain; InfoMainForm * wdgtInfoMain; -// TF_InfoManag * wdgtInfo; -// CheckMethodManage * wdgtCheckMethod; -// CheckWindow * wdgtCheck; -// TF_TextDataManag * wdgtData; -// TF_CertificateApproval * wdgtCert; -// TF_UserManag * wdgtUserMan; -// tf_StandardDevice * wdgtStandDev; -// TF_TextDevice * wdgtTestDev; - -// StandardDeviceForm * wdgtStdDevForm; -// TestDeviceForm * wdgtEqptDevForm; -// FileResourcesForm * wdgtFileResForm; - -// CalibrationForm * wdgtCalibrationForm; - void initForm(); void initMenuWidgets(); void initFunctionButtons(); diff --git a/frame/MainWindowForm.ui b/frame/MainWindowForm.ui index d3fd4fe..e0638e1 100644 --- a/frame/MainWindowForm.ui +++ b/frame/MainWindowForm.ui @@ -271,6 +271,18 @@ + + + 0 + 0 + + + + + 240 + 0 + + 240 @@ -295,6 +307,18 @@ + + + 0 + 0 + + + + + 0 + 40 + + @@ -392,6 +416,18 @@ + + + 0 + 0 + + + + + 240 + 0 + + 240 @@ -422,6 +458,12 @@ 0 + + + 0 + 40 + + 5 @@ -459,6 +501,9 @@ 24 + + 设置 + @@ -509,7 +554,7 @@ - 最小化 + 还原 diff --git a/infomation/task/DeptTaskForm.cpp b/infomation/task/DeptTaskForm.cpp index 208973c..b7d771b 100644 --- a/infomation/task/DeptTaskForm.cpp +++ b/infomation/task/DeptTaskForm.cpp @@ -33,7 +33,7 @@ void DeptTaskForm::initForm() { // 加载样式表 - QString qssStyle = QssFileUtils::loadQssFileContent(QApplication::applicationDirPath() + "/qss/infoTable.css"); + QString qssStyle = QssFileUtils::loadQssFileContent(":/qss/infoTable.css"); if (qssStyle.isEmpty() == false) { this->setStyleSheet(qssStyle); // 仅本窗口生效 } diff --git a/res/image/main/calibration.png b/res/image/main/calibration.png deleted file mode 100644 index 9d6de19..0000000 --- a/res/image/main/calibration.png +++ /dev/null Binary files differ diff --git a/calibration/CalibrationMainForm.cpp b/calibration/CalibrationMainForm.cpp new file mode 100644 index 0000000..9b778a5 --- /dev/null +++ b/calibration/CalibrationMainForm.cpp @@ -0,0 +1,14 @@ +#include "CalibrationMainForm.h" +#include "ui_CalibrationMainForm.h" + +CalibrationMainForm::CalibrationMainForm(QWidget *parent) : + QWidget(parent), + ui(new Ui::CalibrationMainForm) +{ + ui->setupUi(this); +} + +CalibrationMainForm::~CalibrationMainForm() +{ + delete ui; +} diff --git a/calibration/CalibrationMainForm.h b/calibration/CalibrationMainForm.h new file mode 100644 index 0000000..7d75014 --- /dev/null +++ b/calibration/CalibrationMainForm.h @@ -0,0 +1,22 @@ +#ifndef CALIBRATIONMAINFORM_H +#define CALIBRATIONMAINFORM_H + +#include + +namespace Ui { +class CalibrationMainForm; +} + +class CalibrationMainForm : public QWidget +{ + Q_OBJECT + +public: + explicit CalibrationMainForm(QWidget *parent = nullptr); + ~CalibrationMainForm(); + +private: + Ui::CalibrationMainForm *ui; +}; + +#endif // CALIBRATIONMAINFORM_H diff --git a/calibration/CalibrationMainForm.ui b/calibration/CalibrationMainForm.ui new file mode 100644 index 0000000..9b5a9c2 --- /dev/null +++ b/calibration/CalibrationMainForm.ui @@ -0,0 +1,21 @@ + + + + + CalibrationMainForm + + + + 0 + 0 + 400 + 300 + + + + Form + + + + + diff --git a/calibration/calibration.pri b/calibration/calibration.pri index e69de29..f0e9dfb 100644 --- a/calibration/calibration.pri +++ b/calibration/calibration.pri @@ -0,0 +1,4 @@ +HEADERS += $$PWD/CalibrationMainForm.h +SOURCES += $$PWD/CalibrationMainForm.cpp + +FORMS += $$PWD/CalibrationMainForm.ui diff --git a/check/CheckMainForm.cpp b/check/CheckMainForm.cpp new file mode 100644 index 0000000..1725277 --- /dev/null +++ b/check/CheckMainForm.cpp @@ -0,0 +1,14 @@ +#include "CheckMainForm.h" +#include "ui_CheckMainForm.h" + +CheckMainForm::CheckMainForm(QWidget *parent) : + QWidget(parent), + ui(new Ui::CheckMainForm) +{ + ui->setupUi(this); +} + +CheckMainForm::~CheckMainForm() +{ + delete ui; +} diff --git a/check/CheckMainForm.h b/check/CheckMainForm.h new file mode 100644 index 0000000..c71001e --- /dev/null +++ b/check/CheckMainForm.h @@ -0,0 +1,22 @@ +#ifndef CHECKMAINFORM_H +#define CHECKMAINFORM_H + +#include + +namespace Ui { +class CheckMainForm; +} + +class CheckMainForm : public QWidget +{ + Q_OBJECT + +public: + explicit CheckMainForm(QWidget *parent = nullptr); + ~CheckMainForm(); + +private: + Ui::CheckMainForm *ui; +}; + +#endif // CHECKMAINFORM_H diff --git a/check/CheckMainForm.ui b/check/CheckMainForm.ui new file mode 100644 index 0000000..76ca74d --- /dev/null +++ b/check/CheckMainForm.ui @@ -0,0 +1,21 @@ + + + + + CheckMainForm + + + + 0 + 0 + 400 + 300 + + + + Form + + + + + diff --git a/check/check.pri b/check/check.pri index e69de29..624bd3f 100644 --- a/check/check.pri +++ b/check/check.pri @@ -0,0 +1,4 @@ +HEADERS += $$PWD/CheckMainForm.h +SOURCES += $$PWD/CheckMainForm.cpp + +FORMS += $$PWD/CheckMainForm.ui diff --git a/frame/FramelessWindow.cpp b/frame/FramelessWindow.cpp index d323ae5..5727866 100644 --- a/frame/FramelessWindow.cpp +++ b/frame/FramelessWindow.cpp @@ -1,4 +1,8 @@ -#include "FramelessWindow.h" +#include +#include +#include + +#include "FramelessWindow.h" #ifdef Q_OS_WIN #include "windows.h" @@ -63,6 +67,12 @@ resizeEnable = false; } + if (!isMaximized()) { + QRect screenRect = QApplication::screens().at(0)->availableGeometry(); + resize(screenRect.width() * 0.9, screenRect.height() * 0.9); + move(QRandomGenerator::global()->bounded(10, 100), QRandomGenerator::global()->bounded(10, 50)); + } + //发出最大化最小化等改变事件,以便界面上更改对应的信息比如右上角图标和文字 Q_EMIT windowStateChange(!moveEnable); diff --git a/frame/MainWindowForm.cpp b/frame/MainWindowForm.cpp index cb98f69..0791c77 100644 --- a/frame/MainWindowForm.cpp +++ b/frame/MainWindowForm.cpp @@ -1,8 +1,6 @@ #include "MainWindowForm.h" #include "ui_MainWindowForm.h" -#include - MainWindowForm::MainWindowForm(QWidget *parent) : FramelessWindow(parent), ui(new Ui::MainWindowForm) @@ -18,8 +16,8 @@ connect(TimeCounterUtil::getInstance().clockTimer, &QTimer::timeout, this, &MainWindowForm::onUpdateTimestampHandler); TimeCounterUtil::getInstance().clockTimer->start(1000); - /** 临时调试代码 **/ - emit ui->btnInfomation->clicked(); + // 自动加载第一个页面 + emit ui->btnCalibration->clicked(); } MainWindowForm::~MainWindowForm() @@ -37,7 +35,7 @@ { setWindowFlags(Qt::FramelessWindowHint); // 设置全屏 setWindowState(Qt::WindowState::WindowMaximized); - this->setTitleBar(ui->wdgtTop); + // 设置窗口位置和大小 move(0, 0); @@ -46,42 +44,31 @@ qint16 screenHeight = screenRect.height(); resize(screenWidth, screenHeight); + // 设置标题栏 以绑定和触发鼠标双击事件 + this->setTitleBar(ui->wdgtTop); + connect(this, &MainWindowForm::titleDblClick, this, &MainWindowForm::titleDblClickHandler); + // 加载样式表 QString qssStyle = QssFileUtils::loadQssFileContent(":/qss/mainForm.css"); if (qssStyle.isEmpty() == false) { ui->wdgtTop->setStyleSheet(qssStyle); // 仅本窗口生效 + ui->wdgtContent->setStyleSheet("QWidget{background: #FFFFFF;}"); } - // 设置标题 + // 设置标题文字 ui->labelTitle->setText(SettingConfig::getInstance().CLIENT_TITLE); setWindowTitle(SettingConfig::getInstance().CLIENT_TITLE); - // 设置最小尺寸(宽度, 高度) lxc - QScreen *screen = QGuiApplication::primaryScreen(); - QRect screenSize = screen->availableGeometry(); // 可用区域(排除任务栏) - // 设置最小尺寸为屏幕宽度的 80%,高度 600 - int minWidth = screenSize.width() * 0.8; + int minWidth = screenWidth * 0.8; this->setMinimumSize(minWidth, 600); } void MainWindowForm::initMenuWidgets() { + wdgtCaliMain = new CalibrationMainForm(this); + wdgtCheckMain = new CheckMainForm(this); wdgtInfoMain = new InfoMainForm(this); -// wdgtInfo = new TF_InfoManag(this); -// wdgtCheckMethod = new CheckMethodManage(this); -// wdgtCheck = new CheckWindow(this); -// wdgtData = new TF_TextDataManag(this); -// wdgtCert = new TF_CertificateApproval(this); -// wdgtUserMan = new TF_UserManag(this); -// wdgtTestDev = new TF_TextDevice(this); -// wdgtStandDev = new tf_StandardDevice(this); - -// wdgtStdDevForm = new StandardDeviceForm(this); -// wdgtEqptDevForm = new TestDeviceForm(this); -// wdgtFileResForm = new FileResourcesForm(this); - -// wdgtCalibrationForm = new CalibrationForm(this); // 绑定事件 // connect(wdgtCalibrationForm, &CalibrationForm::enableMenuButtons, this, &MainWindowForm::onMenuButtonsEabled); @@ -89,18 +76,9 @@ // connect(wdgtCheck, &CheckWindow::BarsetEnabled, this, &MainWindowForm::onMenuButtonsEabled); // 添加到stackWidget中 + ui->wdgtContent->insertWidget(0, wdgtCaliMain); + ui->wdgtContent->insertWidget(1, wdgtCheckMain); ui->wdgtContent->insertWidget(2, wdgtInfoMain); -// ui->wdgtContent->insertWidget(0, wdgtCalibrationForm); -// ui->wdgtContent->insertWidget(1, wdgtStdDevForm); -// ui->wdgtContent->insertWidget(1, wdgtStandDev); -// ui->wdgtContent->insertWidget(2, wdgtTestDev); -// ui->wdgtContent->insertWidget(2, wdgtEqptDevForm); -// ui->wdgtContent->insertWidget(3, wdgtCheckMethod); -// ui->wdgtContent->insertWidget(4, wdgtCheck); -// ui->wdgtContent->insertWidget(5, wdgtData); -// ui->wdgtContent->insertWidget(6, wdgtCert); -// ui->wdgtContent->insertWidget(7, wdgtFileResForm); -// ui->wdgtContent->insertWidget(8, wdgtUserMan); } void MainWindowForm::initFunctionButtons() @@ -115,7 +93,6 @@ funcButtGroup->addButton(funcButt); connect(funcButt, &QToolButton::clicked, this, &MainWindowForm::onFunctionButtonsAction); } - connect(this, SIGNAL(titleDblClick()), this, SLOT(titleDblClick())); } void MainWindowForm::on_btnMinWin_clicked() @@ -125,17 +102,12 @@ 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(); + ui->btnMaxWin->setToolTip("最大化"); } else { - resize(screenSize.width(), screenSize.height()); - move(0, 0); this->showMaximized(); + ui->btnMaxWin->setToolTip("还原"); } } @@ -165,7 +137,7 @@ ui->labelTime->setText(now.toString("yyyy-MM-dd HH:mm:ss")); } -void MainWindowForm::titleDblClick() +void MainWindowForm::titleDblClickHandler() { on_btnMaxWin_clicked(); } diff --git a/frame/MainWindowForm.h b/frame/MainWindowForm.h index 9b4eae4..aa5330c 100644 --- a/frame/MainWindowForm.h +++ b/frame/MainWindowForm.h @@ -13,21 +13,8 @@ #include "frame/FramelessWindow.h" #include "infomation/InfoMainForm.h" - -//#include "infomation/standDev/StandardDeviceForm.h" -//#include "infomation/testDev/TestDeviceForm.h" -//#include "infomation/fileRes/FileResourcesForm.h" - -//#include "calibration/CalibrationForm.h" - -//#include "TimeFreq/tf_standarddevice.h" -//#include "TimeFreq/tf_certificateapproval.h" -//#include "TimeFreq/tf_infomanag.h" -//#include "TimeFreq/tf_textdatamanag.h" -//#include "TimeFreq/tf_textdevice.h" -//#include "TimeFreq/tf_usermanag.h" -//#include "checkmethodmanage.h" -//#include "checkwindow.h" +#include "calibration/CalibrationMainForm.h" +#include "check/CheckMainForm.h" namespace Ui { class MainWindowForm; @@ -50,29 +37,16 @@ void onFunctionButtonsAction(); void onUpdateTimestampHandler(); - void titleDblClick(); + void titleDblClickHandler(); void onMenuButtonsEabled(bool enable); private: Ui::MainWindowForm *ui; + CalibrationMainForm * wdgtCaliMain; + CheckMainForm * wdgtCheckMain; InfoMainForm * wdgtInfoMain; -// TF_InfoManag * wdgtInfo; -// CheckMethodManage * wdgtCheckMethod; -// CheckWindow * wdgtCheck; -// TF_TextDataManag * wdgtData; -// TF_CertificateApproval * wdgtCert; -// TF_UserManag * wdgtUserMan; -// tf_StandardDevice * wdgtStandDev; -// TF_TextDevice * wdgtTestDev; - -// StandardDeviceForm * wdgtStdDevForm; -// TestDeviceForm * wdgtEqptDevForm; -// FileResourcesForm * wdgtFileResForm; - -// CalibrationForm * wdgtCalibrationForm; - void initForm(); void initMenuWidgets(); void initFunctionButtons(); diff --git a/frame/MainWindowForm.ui b/frame/MainWindowForm.ui index d3fd4fe..e0638e1 100644 --- a/frame/MainWindowForm.ui +++ b/frame/MainWindowForm.ui @@ -271,6 +271,18 @@ + + + 0 + 0 + + + + + 240 + 0 + + 240 @@ -295,6 +307,18 @@ + + + 0 + 0 + + + + + 0 + 40 + + @@ -392,6 +416,18 @@ + + + 0 + 0 + + + + + 240 + 0 + + 240 @@ -422,6 +458,12 @@ 0 + + + 0 + 40 + + 5 @@ -459,6 +501,9 @@ 24 + + 设置 + @@ -509,7 +554,7 @@ - 最小化 + 还原 diff --git a/infomation/task/DeptTaskForm.cpp b/infomation/task/DeptTaskForm.cpp index 208973c..b7d771b 100644 --- a/infomation/task/DeptTaskForm.cpp +++ b/infomation/task/DeptTaskForm.cpp @@ -33,7 +33,7 @@ void DeptTaskForm::initForm() { // 加载样式表 - QString qssStyle = QssFileUtils::loadQssFileContent(QApplication::applicationDirPath() + "/qss/infoTable.css"); + QString qssStyle = QssFileUtils::loadQssFileContent(":/qss/infoTable.css"); if (qssStyle.isEmpty() == false) { this->setStyleSheet(qssStyle); // 仅本窗口生效 } diff --git a/res/image/main/calibration.png b/res/image/main/calibration.png deleted file mode 100644 index 9d6de19..0000000 --- a/res/image/main/calibration.png +++ /dev/null Binary files differ diff --git a/res/image/main/certApproval.png b/res/image/main/certApproval.png deleted file mode 100644 index 45147a6..0000000 --- a/res/image/main/certApproval.png +++ /dev/null Binary files differ diff --git a/calibration/CalibrationMainForm.cpp b/calibration/CalibrationMainForm.cpp new file mode 100644 index 0000000..9b778a5 --- /dev/null +++ b/calibration/CalibrationMainForm.cpp @@ -0,0 +1,14 @@ +#include "CalibrationMainForm.h" +#include "ui_CalibrationMainForm.h" + +CalibrationMainForm::CalibrationMainForm(QWidget *parent) : + QWidget(parent), + ui(new Ui::CalibrationMainForm) +{ + ui->setupUi(this); +} + +CalibrationMainForm::~CalibrationMainForm() +{ + delete ui; +} diff --git a/calibration/CalibrationMainForm.h b/calibration/CalibrationMainForm.h new file mode 100644 index 0000000..7d75014 --- /dev/null +++ b/calibration/CalibrationMainForm.h @@ -0,0 +1,22 @@ +#ifndef CALIBRATIONMAINFORM_H +#define CALIBRATIONMAINFORM_H + +#include + +namespace Ui { +class CalibrationMainForm; +} + +class CalibrationMainForm : public QWidget +{ + Q_OBJECT + +public: + explicit CalibrationMainForm(QWidget *parent = nullptr); + ~CalibrationMainForm(); + +private: + Ui::CalibrationMainForm *ui; +}; + +#endif // CALIBRATIONMAINFORM_H diff --git a/calibration/CalibrationMainForm.ui b/calibration/CalibrationMainForm.ui new file mode 100644 index 0000000..9b5a9c2 --- /dev/null +++ b/calibration/CalibrationMainForm.ui @@ -0,0 +1,21 @@ + + + + + CalibrationMainForm + + + + 0 + 0 + 400 + 300 + + + + Form + + + + + diff --git a/calibration/calibration.pri b/calibration/calibration.pri index e69de29..f0e9dfb 100644 --- a/calibration/calibration.pri +++ b/calibration/calibration.pri @@ -0,0 +1,4 @@ +HEADERS += $$PWD/CalibrationMainForm.h +SOURCES += $$PWD/CalibrationMainForm.cpp + +FORMS += $$PWD/CalibrationMainForm.ui diff --git a/check/CheckMainForm.cpp b/check/CheckMainForm.cpp new file mode 100644 index 0000000..1725277 --- /dev/null +++ b/check/CheckMainForm.cpp @@ -0,0 +1,14 @@ +#include "CheckMainForm.h" +#include "ui_CheckMainForm.h" + +CheckMainForm::CheckMainForm(QWidget *parent) : + QWidget(parent), + ui(new Ui::CheckMainForm) +{ + ui->setupUi(this); +} + +CheckMainForm::~CheckMainForm() +{ + delete ui; +} diff --git a/check/CheckMainForm.h b/check/CheckMainForm.h new file mode 100644 index 0000000..c71001e --- /dev/null +++ b/check/CheckMainForm.h @@ -0,0 +1,22 @@ +#ifndef CHECKMAINFORM_H +#define CHECKMAINFORM_H + +#include + +namespace Ui { +class CheckMainForm; +} + +class CheckMainForm : public QWidget +{ + Q_OBJECT + +public: + explicit CheckMainForm(QWidget *parent = nullptr); + ~CheckMainForm(); + +private: + Ui::CheckMainForm *ui; +}; + +#endif // CHECKMAINFORM_H diff --git a/check/CheckMainForm.ui b/check/CheckMainForm.ui new file mode 100644 index 0000000..76ca74d --- /dev/null +++ b/check/CheckMainForm.ui @@ -0,0 +1,21 @@ + + + + + CheckMainForm + + + + 0 + 0 + 400 + 300 + + + + Form + + + + + diff --git a/check/check.pri b/check/check.pri index e69de29..624bd3f 100644 --- a/check/check.pri +++ b/check/check.pri @@ -0,0 +1,4 @@ +HEADERS += $$PWD/CheckMainForm.h +SOURCES += $$PWD/CheckMainForm.cpp + +FORMS += $$PWD/CheckMainForm.ui diff --git a/frame/FramelessWindow.cpp b/frame/FramelessWindow.cpp index d323ae5..5727866 100644 --- a/frame/FramelessWindow.cpp +++ b/frame/FramelessWindow.cpp @@ -1,4 +1,8 @@ -#include "FramelessWindow.h" +#include +#include +#include + +#include "FramelessWindow.h" #ifdef Q_OS_WIN #include "windows.h" @@ -63,6 +67,12 @@ resizeEnable = false; } + if (!isMaximized()) { + QRect screenRect = QApplication::screens().at(0)->availableGeometry(); + resize(screenRect.width() * 0.9, screenRect.height() * 0.9); + move(QRandomGenerator::global()->bounded(10, 100), QRandomGenerator::global()->bounded(10, 50)); + } + //发出最大化最小化等改变事件,以便界面上更改对应的信息比如右上角图标和文字 Q_EMIT windowStateChange(!moveEnable); diff --git a/frame/MainWindowForm.cpp b/frame/MainWindowForm.cpp index cb98f69..0791c77 100644 --- a/frame/MainWindowForm.cpp +++ b/frame/MainWindowForm.cpp @@ -1,8 +1,6 @@ #include "MainWindowForm.h" #include "ui_MainWindowForm.h" -#include - MainWindowForm::MainWindowForm(QWidget *parent) : FramelessWindow(parent), ui(new Ui::MainWindowForm) @@ -18,8 +16,8 @@ connect(TimeCounterUtil::getInstance().clockTimer, &QTimer::timeout, this, &MainWindowForm::onUpdateTimestampHandler); TimeCounterUtil::getInstance().clockTimer->start(1000); - /** 临时调试代码 **/ - emit ui->btnInfomation->clicked(); + // 自动加载第一个页面 + emit ui->btnCalibration->clicked(); } MainWindowForm::~MainWindowForm() @@ -37,7 +35,7 @@ { setWindowFlags(Qt::FramelessWindowHint); // 设置全屏 setWindowState(Qt::WindowState::WindowMaximized); - this->setTitleBar(ui->wdgtTop); + // 设置窗口位置和大小 move(0, 0); @@ -46,42 +44,31 @@ qint16 screenHeight = screenRect.height(); resize(screenWidth, screenHeight); + // 设置标题栏 以绑定和触发鼠标双击事件 + this->setTitleBar(ui->wdgtTop); + connect(this, &MainWindowForm::titleDblClick, this, &MainWindowForm::titleDblClickHandler); + // 加载样式表 QString qssStyle = QssFileUtils::loadQssFileContent(":/qss/mainForm.css"); if (qssStyle.isEmpty() == false) { ui->wdgtTop->setStyleSheet(qssStyle); // 仅本窗口生效 + ui->wdgtContent->setStyleSheet("QWidget{background: #FFFFFF;}"); } - // 设置标题 + // 设置标题文字 ui->labelTitle->setText(SettingConfig::getInstance().CLIENT_TITLE); setWindowTitle(SettingConfig::getInstance().CLIENT_TITLE); - // 设置最小尺寸(宽度, 高度) lxc - QScreen *screen = QGuiApplication::primaryScreen(); - QRect screenSize = screen->availableGeometry(); // 可用区域(排除任务栏) - // 设置最小尺寸为屏幕宽度的 80%,高度 600 - int minWidth = screenSize.width() * 0.8; + int minWidth = screenWidth * 0.8; this->setMinimumSize(minWidth, 600); } void MainWindowForm::initMenuWidgets() { + wdgtCaliMain = new CalibrationMainForm(this); + wdgtCheckMain = new CheckMainForm(this); wdgtInfoMain = new InfoMainForm(this); -// wdgtInfo = new TF_InfoManag(this); -// wdgtCheckMethod = new CheckMethodManage(this); -// wdgtCheck = new CheckWindow(this); -// wdgtData = new TF_TextDataManag(this); -// wdgtCert = new TF_CertificateApproval(this); -// wdgtUserMan = new TF_UserManag(this); -// wdgtTestDev = new TF_TextDevice(this); -// wdgtStandDev = new tf_StandardDevice(this); - -// wdgtStdDevForm = new StandardDeviceForm(this); -// wdgtEqptDevForm = new TestDeviceForm(this); -// wdgtFileResForm = new FileResourcesForm(this); - -// wdgtCalibrationForm = new CalibrationForm(this); // 绑定事件 // connect(wdgtCalibrationForm, &CalibrationForm::enableMenuButtons, this, &MainWindowForm::onMenuButtonsEabled); @@ -89,18 +76,9 @@ // connect(wdgtCheck, &CheckWindow::BarsetEnabled, this, &MainWindowForm::onMenuButtonsEabled); // 添加到stackWidget中 + ui->wdgtContent->insertWidget(0, wdgtCaliMain); + ui->wdgtContent->insertWidget(1, wdgtCheckMain); ui->wdgtContent->insertWidget(2, wdgtInfoMain); -// ui->wdgtContent->insertWidget(0, wdgtCalibrationForm); -// ui->wdgtContent->insertWidget(1, wdgtStdDevForm); -// ui->wdgtContent->insertWidget(1, wdgtStandDev); -// ui->wdgtContent->insertWidget(2, wdgtTestDev); -// ui->wdgtContent->insertWidget(2, wdgtEqptDevForm); -// ui->wdgtContent->insertWidget(3, wdgtCheckMethod); -// ui->wdgtContent->insertWidget(4, wdgtCheck); -// ui->wdgtContent->insertWidget(5, wdgtData); -// ui->wdgtContent->insertWidget(6, wdgtCert); -// ui->wdgtContent->insertWidget(7, wdgtFileResForm); -// ui->wdgtContent->insertWidget(8, wdgtUserMan); } void MainWindowForm::initFunctionButtons() @@ -115,7 +93,6 @@ funcButtGroup->addButton(funcButt); connect(funcButt, &QToolButton::clicked, this, &MainWindowForm::onFunctionButtonsAction); } - connect(this, SIGNAL(titleDblClick()), this, SLOT(titleDblClick())); } void MainWindowForm::on_btnMinWin_clicked() @@ -125,17 +102,12 @@ 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(); + ui->btnMaxWin->setToolTip("最大化"); } else { - resize(screenSize.width(), screenSize.height()); - move(0, 0); this->showMaximized(); + ui->btnMaxWin->setToolTip("还原"); } } @@ -165,7 +137,7 @@ ui->labelTime->setText(now.toString("yyyy-MM-dd HH:mm:ss")); } -void MainWindowForm::titleDblClick() +void MainWindowForm::titleDblClickHandler() { on_btnMaxWin_clicked(); } diff --git a/frame/MainWindowForm.h b/frame/MainWindowForm.h index 9b4eae4..aa5330c 100644 --- a/frame/MainWindowForm.h +++ b/frame/MainWindowForm.h @@ -13,21 +13,8 @@ #include "frame/FramelessWindow.h" #include "infomation/InfoMainForm.h" - -//#include "infomation/standDev/StandardDeviceForm.h" -//#include "infomation/testDev/TestDeviceForm.h" -//#include "infomation/fileRes/FileResourcesForm.h" - -//#include "calibration/CalibrationForm.h" - -//#include "TimeFreq/tf_standarddevice.h" -//#include "TimeFreq/tf_certificateapproval.h" -//#include "TimeFreq/tf_infomanag.h" -//#include "TimeFreq/tf_textdatamanag.h" -//#include "TimeFreq/tf_textdevice.h" -//#include "TimeFreq/tf_usermanag.h" -//#include "checkmethodmanage.h" -//#include "checkwindow.h" +#include "calibration/CalibrationMainForm.h" +#include "check/CheckMainForm.h" namespace Ui { class MainWindowForm; @@ -50,29 +37,16 @@ void onFunctionButtonsAction(); void onUpdateTimestampHandler(); - void titleDblClick(); + void titleDblClickHandler(); void onMenuButtonsEabled(bool enable); private: Ui::MainWindowForm *ui; + CalibrationMainForm * wdgtCaliMain; + CheckMainForm * wdgtCheckMain; InfoMainForm * wdgtInfoMain; -// TF_InfoManag * wdgtInfo; -// CheckMethodManage * wdgtCheckMethod; -// CheckWindow * wdgtCheck; -// TF_TextDataManag * wdgtData; -// TF_CertificateApproval * wdgtCert; -// TF_UserManag * wdgtUserMan; -// tf_StandardDevice * wdgtStandDev; -// TF_TextDevice * wdgtTestDev; - -// StandardDeviceForm * wdgtStdDevForm; -// TestDeviceForm * wdgtEqptDevForm; -// FileResourcesForm * wdgtFileResForm; - -// CalibrationForm * wdgtCalibrationForm; - void initForm(); void initMenuWidgets(); void initFunctionButtons(); diff --git a/frame/MainWindowForm.ui b/frame/MainWindowForm.ui index d3fd4fe..e0638e1 100644 --- a/frame/MainWindowForm.ui +++ b/frame/MainWindowForm.ui @@ -271,6 +271,18 @@ + + + 0 + 0 + + + + + 240 + 0 + + 240 @@ -295,6 +307,18 @@ + + + 0 + 0 + + + + + 0 + 40 + + @@ -392,6 +416,18 @@ + + + 0 + 0 + + + + + 240 + 0 + + 240 @@ -422,6 +458,12 @@ 0 + + + 0 + 40 + + 5 @@ -459,6 +501,9 @@ 24 + + 设置 + @@ -509,7 +554,7 @@ - 最小化 + 还原 diff --git a/infomation/task/DeptTaskForm.cpp b/infomation/task/DeptTaskForm.cpp index 208973c..b7d771b 100644 --- a/infomation/task/DeptTaskForm.cpp +++ b/infomation/task/DeptTaskForm.cpp @@ -33,7 +33,7 @@ void DeptTaskForm::initForm() { // 加载样式表 - QString qssStyle = QssFileUtils::loadQssFileContent(QApplication::applicationDirPath() + "/qss/infoTable.css"); + QString qssStyle = QssFileUtils::loadQssFileContent(":/qss/infoTable.css"); if (qssStyle.isEmpty() == false) { this->setStyleSheet(qssStyle); // 仅本窗口生效 } diff --git a/res/image/main/calibration.png b/res/image/main/calibration.png deleted file mode 100644 index 9d6de19..0000000 --- a/res/image/main/calibration.png +++ /dev/null Binary files differ diff --git a/res/image/main/certApproval.png b/res/image/main/certApproval.png deleted file mode 100644 index 45147a6..0000000 --- a/res/image/main/certApproval.png +++ /dev/null Binary files differ diff --git a/res/image/main/checkDevice.png b/res/image/main/checkDevice.png deleted file mode 100644 index 3e9307a..0000000 --- a/res/image/main/checkDevice.png +++ /dev/null Binary files differ diff --git a/calibration/CalibrationMainForm.cpp b/calibration/CalibrationMainForm.cpp new file mode 100644 index 0000000..9b778a5 --- /dev/null +++ b/calibration/CalibrationMainForm.cpp @@ -0,0 +1,14 @@ +#include "CalibrationMainForm.h" +#include "ui_CalibrationMainForm.h" + +CalibrationMainForm::CalibrationMainForm(QWidget *parent) : + QWidget(parent), + ui(new Ui::CalibrationMainForm) +{ + ui->setupUi(this); +} + +CalibrationMainForm::~CalibrationMainForm() +{ + delete ui; +} diff --git a/calibration/CalibrationMainForm.h b/calibration/CalibrationMainForm.h new file mode 100644 index 0000000..7d75014 --- /dev/null +++ b/calibration/CalibrationMainForm.h @@ -0,0 +1,22 @@ +#ifndef CALIBRATIONMAINFORM_H +#define CALIBRATIONMAINFORM_H + +#include + +namespace Ui { +class CalibrationMainForm; +} + +class CalibrationMainForm : public QWidget +{ + Q_OBJECT + +public: + explicit CalibrationMainForm(QWidget *parent = nullptr); + ~CalibrationMainForm(); + +private: + Ui::CalibrationMainForm *ui; +}; + +#endif // CALIBRATIONMAINFORM_H diff --git a/calibration/CalibrationMainForm.ui b/calibration/CalibrationMainForm.ui new file mode 100644 index 0000000..9b5a9c2 --- /dev/null +++ b/calibration/CalibrationMainForm.ui @@ -0,0 +1,21 @@ + + + + + CalibrationMainForm + + + + 0 + 0 + 400 + 300 + + + + Form + + + + + diff --git a/calibration/calibration.pri b/calibration/calibration.pri index e69de29..f0e9dfb 100644 --- a/calibration/calibration.pri +++ b/calibration/calibration.pri @@ -0,0 +1,4 @@ +HEADERS += $$PWD/CalibrationMainForm.h +SOURCES += $$PWD/CalibrationMainForm.cpp + +FORMS += $$PWD/CalibrationMainForm.ui diff --git a/check/CheckMainForm.cpp b/check/CheckMainForm.cpp new file mode 100644 index 0000000..1725277 --- /dev/null +++ b/check/CheckMainForm.cpp @@ -0,0 +1,14 @@ +#include "CheckMainForm.h" +#include "ui_CheckMainForm.h" + +CheckMainForm::CheckMainForm(QWidget *parent) : + QWidget(parent), + ui(new Ui::CheckMainForm) +{ + ui->setupUi(this); +} + +CheckMainForm::~CheckMainForm() +{ + delete ui; +} diff --git a/check/CheckMainForm.h b/check/CheckMainForm.h new file mode 100644 index 0000000..c71001e --- /dev/null +++ b/check/CheckMainForm.h @@ -0,0 +1,22 @@ +#ifndef CHECKMAINFORM_H +#define CHECKMAINFORM_H + +#include + +namespace Ui { +class CheckMainForm; +} + +class CheckMainForm : public QWidget +{ + Q_OBJECT + +public: + explicit CheckMainForm(QWidget *parent = nullptr); + ~CheckMainForm(); + +private: + Ui::CheckMainForm *ui; +}; + +#endif // CHECKMAINFORM_H diff --git a/check/CheckMainForm.ui b/check/CheckMainForm.ui new file mode 100644 index 0000000..76ca74d --- /dev/null +++ b/check/CheckMainForm.ui @@ -0,0 +1,21 @@ + + + + + CheckMainForm + + + + 0 + 0 + 400 + 300 + + + + Form + + + + + diff --git a/check/check.pri b/check/check.pri index e69de29..624bd3f 100644 --- a/check/check.pri +++ b/check/check.pri @@ -0,0 +1,4 @@ +HEADERS += $$PWD/CheckMainForm.h +SOURCES += $$PWD/CheckMainForm.cpp + +FORMS += $$PWD/CheckMainForm.ui diff --git a/frame/FramelessWindow.cpp b/frame/FramelessWindow.cpp index d323ae5..5727866 100644 --- a/frame/FramelessWindow.cpp +++ b/frame/FramelessWindow.cpp @@ -1,4 +1,8 @@ -#include "FramelessWindow.h" +#include +#include +#include + +#include "FramelessWindow.h" #ifdef Q_OS_WIN #include "windows.h" @@ -63,6 +67,12 @@ resizeEnable = false; } + if (!isMaximized()) { + QRect screenRect = QApplication::screens().at(0)->availableGeometry(); + resize(screenRect.width() * 0.9, screenRect.height() * 0.9); + move(QRandomGenerator::global()->bounded(10, 100), QRandomGenerator::global()->bounded(10, 50)); + } + //发出最大化最小化等改变事件,以便界面上更改对应的信息比如右上角图标和文字 Q_EMIT windowStateChange(!moveEnable); diff --git a/frame/MainWindowForm.cpp b/frame/MainWindowForm.cpp index cb98f69..0791c77 100644 --- a/frame/MainWindowForm.cpp +++ b/frame/MainWindowForm.cpp @@ -1,8 +1,6 @@ #include "MainWindowForm.h" #include "ui_MainWindowForm.h" -#include - MainWindowForm::MainWindowForm(QWidget *parent) : FramelessWindow(parent), ui(new Ui::MainWindowForm) @@ -18,8 +16,8 @@ connect(TimeCounterUtil::getInstance().clockTimer, &QTimer::timeout, this, &MainWindowForm::onUpdateTimestampHandler); TimeCounterUtil::getInstance().clockTimer->start(1000); - /** 临时调试代码 **/ - emit ui->btnInfomation->clicked(); + // 自动加载第一个页面 + emit ui->btnCalibration->clicked(); } MainWindowForm::~MainWindowForm() @@ -37,7 +35,7 @@ { setWindowFlags(Qt::FramelessWindowHint); // 设置全屏 setWindowState(Qt::WindowState::WindowMaximized); - this->setTitleBar(ui->wdgtTop); + // 设置窗口位置和大小 move(0, 0); @@ -46,42 +44,31 @@ qint16 screenHeight = screenRect.height(); resize(screenWidth, screenHeight); + // 设置标题栏 以绑定和触发鼠标双击事件 + this->setTitleBar(ui->wdgtTop); + connect(this, &MainWindowForm::titleDblClick, this, &MainWindowForm::titleDblClickHandler); + // 加载样式表 QString qssStyle = QssFileUtils::loadQssFileContent(":/qss/mainForm.css"); if (qssStyle.isEmpty() == false) { ui->wdgtTop->setStyleSheet(qssStyle); // 仅本窗口生效 + ui->wdgtContent->setStyleSheet("QWidget{background: #FFFFFF;}"); } - // 设置标题 + // 设置标题文字 ui->labelTitle->setText(SettingConfig::getInstance().CLIENT_TITLE); setWindowTitle(SettingConfig::getInstance().CLIENT_TITLE); - // 设置最小尺寸(宽度, 高度) lxc - QScreen *screen = QGuiApplication::primaryScreen(); - QRect screenSize = screen->availableGeometry(); // 可用区域(排除任务栏) - // 设置最小尺寸为屏幕宽度的 80%,高度 600 - int minWidth = screenSize.width() * 0.8; + int minWidth = screenWidth * 0.8; this->setMinimumSize(minWidth, 600); } void MainWindowForm::initMenuWidgets() { + wdgtCaliMain = new CalibrationMainForm(this); + wdgtCheckMain = new CheckMainForm(this); wdgtInfoMain = new InfoMainForm(this); -// wdgtInfo = new TF_InfoManag(this); -// wdgtCheckMethod = new CheckMethodManage(this); -// wdgtCheck = new CheckWindow(this); -// wdgtData = new TF_TextDataManag(this); -// wdgtCert = new TF_CertificateApproval(this); -// wdgtUserMan = new TF_UserManag(this); -// wdgtTestDev = new TF_TextDevice(this); -// wdgtStandDev = new tf_StandardDevice(this); - -// wdgtStdDevForm = new StandardDeviceForm(this); -// wdgtEqptDevForm = new TestDeviceForm(this); -// wdgtFileResForm = new FileResourcesForm(this); - -// wdgtCalibrationForm = new CalibrationForm(this); // 绑定事件 // connect(wdgtCalibrationForm, &CalibrationForm::enableMenuButtons, this, &MainWindowForm::onMenuButtonsEabled); @@ -89,18 +76,9 @@ // connect(wdgtCheck, &CheckWindow::BarsetEnabled, this, &MainWindowForm::onMenuButtonsEabled); // 添加到stackWidget中 + ui->wdgtContent->insertWidget(0, wdgtCaliMain); + ui->wdgtContent->insertWidget(1, wdgtCheckMain); ui->wdgtContent->insertWidget(2, wdgtInfoMain); -// ui->wdgtContent->insertWidget(0, wdgtCalibrationForm); -// ui->wdgtContent->insertWidget(1, wdgtStdDevForm); -// ui->wdgtContent->insertWidget(1, wdgtStandDev); -// ui->wdgtContent->insertWidget(2, wdgtTestDev); -// ui->wdgtContent->insertWidget(2, wdgtEqptDevForm); -// ui->wdgtContent->insertWidget(3, wdgtCheckMethod); -// ui->wdgtContent->insertWidget(4, wdgtCheck); -// ui->wdgtContent->insertWidget(5, wdgtData); -// ui->wdgtContent->insertWidget(6, wdgtCert); -// ui->wdgtContent->insertWidget(7, wdgtFileResForm); -// ui->wdgtContent->insertWidget(8, wdgtUserMan); } void MainWindowForm::initFunctionButtons() @@ -115,7 +93,6 @@ funcButtGroup->addButton(funcButt); connect(funcButt, &QToolButton::clicked, this, &MainWindowForm::onFunctionButtonsAction); } - connect(this, SIGNAL(titleDblClick()), this, SLOT(titleDblClick())); } void MainWindowForm::on_btnMinWin_clicked() @@ -125,17 +102,12 @@ 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(); + ui->btnMaxWin->setToolTip("最大化"); } else { - resize(screenSize.width(), screenSize.height()); - move(0, 0); this->showMaximized(); + ui->btnMaxWin->setToolTip("还原"); } } @@ -165,7 +137,7 @@ ui->labelTime->setText(now.toString("yyyy-MM-dd HH:mm:ss")); } -void MainWindowForm::titleDblClick() +void MainWindowForm::titleDblClickHandler() { on_btnMaxWin_clicked(); } diff --git a/frame/MainWindowForm.h b/frame/MainWindowForm.h index 9b4eae4..aa5330c 100644 --- a/frame/MainWindowForm.h +++ b/frame/MainWindowForm.h @@ -13,21 +13,8 @@ #include "frame/FramelessWindow.h" #include "infomation/InfoMainForm.h" - -//#include "infomation/standDev/StandardDeviceForm.h" -//#include "infomation/testDev/TestDeviceForm.h" -//#include "infomation/fileRes/FileResourcesForm.h" - -//#include "calibration/CalibrationForm.h" - -//#include "TimeFreq/tf_standarddevice.h" -//#include "TimeFreq/tf_certificateapproval.h" -//#include "TimeFreq/tf_infomanag.h" -//#include "TimeFreq/tf_textdatamanag.h" -//#include "TimeFreq/tf_textdevice.h" -//#include "TimeFreq/tf_usermanag.h" -//#include "checkmethodmanage.h" -//#include "checkwindow.h" +#include "calibration/CalibrationMainForm.h" +#include "check/CheckMainForm.h" namespace Ui { class MainWindowForm; @@ -50,29 +37,16 @@ void onFunctionButtonsAction(); void onUpdateTimestampHandler(); - void titleDblClick(); + void titleDblClickHandler(); void onMenuButtonsEabled(bool enable); private: Ui::MainWindowForm *ui; + CalibrationMainForm * wdgtCaliMain; + CheckMainForm * wdgtCheckMain; InfoMainForm * wdgtInfoMain; -// TF_InfoManag * wdgtInfo; -// CheckMethodManage * wdgtCheckMethod; -// CheckWindow * wdgtCheck; -// TF_TextDataManag * wdgtData; -// TF_CertificateApproval * wdgtCert; -// TF_UserManag * wdgtUserMan; -// tf_StandardDevice * wdgtStandDev; -// TF_TextDevice * wdgtTestDev; - -// StandardDeviceForm * wdgtStdDevForm; -// TestDeviceForm * wdgtEqptDevForm; -// FileResourcesForm * wdgtFileResForm; - -// CalibrationForm * wdgtCalibrationForm; - void initForm(); void initMenuWidgets(); void initFunctionButtons(); diff --git a/frame/MainWindowForm.ui b/frame/MainWindowForm.ui index d3fd4fe..e0638e1 100644 --- a/frame/MainWindowForm.ui +++ b/frame/MainWindowForm.ui @@ -271,6 +271,18 @@ + + + 0 + 0 + + + + + 240 + 0 + + 240 @@ -295,6 +307,18 @@ + + + 0 + 0 + + + + + 0 + 40 + + @@ -392,6 +416,18 @@ + + + 0 + 0 + + + + + 240 + 0 + + 240 @@ -422,6 +458,12 @@ 0 + + + 0 + 40 + + 5 @@ -459,6 +501,9 @@ 24 + + 设置 + @@ -509,7 +554,7 @@ - 最小化 + 还原 diff --git a/infomation/task/DeptTaskForm.cpp b/infomation/task/DeptTaskForm.cpp index 208973c..b7d771b 100644 --- a/infomation/task/DeptTaskForm.cpp +++ b/infomation/task/DeptTaskForm.cpp @@ -33,7 +33,7 @@ void DeptTaskForm::initForm() { // 加载样式表 - QString qssStyle = QssFileUtils::loadQssFileContent(QApplication::applicationDirPath() + "/qss/infoTable.css"); + QString qssStyle = QssFileUtils::loadQssFileContent(":/qss/infoTable.css"); if (qssStyle.isEmpty() == false) { this->setStyleSheet(qssStyle); // 仅本窗口生效 } diff --git a/res/image/main/calibration.png b/res/image/main/calibration.png deleted file mode 100644 index 9d6de19..0000000 --- a/res/image/main/calibration.png +++ /dev/null Binary files differ diff --git a/res/image/main/certApproval.png b/res/image/main/certApproval.png deleted file mode 100644 index 45147a6..0000000 --- a/res/image/main/certApproval.png +++ /dev/null Binary files differ diff --git a/res/image/main/checkDevice.png b/res/image/main/checkDevice.png deleted file mode 100644 index 3e9307a..0000000 --- a/res/image/main/checkDevice.png +++ /dev/null Binary files differ diff --git a/res/image/main/checkProgram.png b/res/image/main/checkProgram.png deleted file mode 100644 index e75ef50..0000000 --- a/res/image/main/checkProgram.png +++ /dev/null Binary files differ diff --git a/calibration/CalibrationMainForm.cpp b/calibration/CalibrationMainForm.cpp new file mode 100644 index 0000000..9b778a5 --- /dev/null +++ b/calibration/CalibrationMainForm.cpp @@ -0,0 +1,14 @@ +#include "CalibrationMainForm.h" +#include "ui_CalibrationMainForm.h" + +CalibrationMainForm::CalibrationMainForm(QWidget *parent) : + QWidget(parent), + ui(new Ui::CalibrationMainForm) +{ + ui->setupUi(this); +} + +CalibrationMainForm::~CalibrationMainForm() +{ + delete ui; +} diff --git a/calibration/CalibrationMainForm.h b/calibration/CalibrationMainForm.h new file mode 100644 index 0000000..7d75014 --- /dev/null +++ b/calibration/CalibrationMainForm.h @@ -0,0 +1,22 @@ +#ifndef CALIBRATIONMAINFORM_H +#define CALIBRATIONMAINFORM_H + +#include + +namespace Ui { +class CalibrationMainForm; +} + +class CalibrationMainForm : public QWidget +{ + Q_OBJECT + +public: + explicit CalibrationMainForm(QWidget *parent = nullptr); + ~CalibrationMainForm(); + +private: + Ui::CalibrationMainForm *ui; +}; + +#endif // CALIBRATIONMAINFORM_H diff --git a/calibration/CalibrationMainForm.ui b/calibration/CalibrationMainForm.ui new file mode 100644 index 0000000..9b5a9c2 --- /dev/null +++ b/calibration/CalibrationMainForm.ui @@ -0,0 +1,21 @@ + + + + + CalibrationMainForm + + + + 0 + 0 + 400 + 300 + + + + Form + + + + + diff --git a/calibration/calibration.pri b/calibration/calibration.pri index e69de29..f0e9dfb 100644 --- a/calibration/calibration.pri +++ b/calibration/calibration.pri @@ -0,0 +1,4 @@ +HEADERS += $$PWD/CalibrationMainForm.h +SOURCES += $$PWD/CalibrationMainForm.cpp + +FORMS += $$PWD/CalibrationMainForm.ui diff --git a/check/CheckMainForm.cpp b/check/CheckMainForm.cpp new file mode 100644 index 0000000..1725277 --- /dev/null +++ b/check/CheckMainForm.cpp @@ -0,0 +1,14 @@ +#include "CheckMainForm.h" +#include "ui_CheckMainForm.h" + +CheckMainForm::CheckMainForm(QWidget *parent) : + QWidget(parent), + ui(new Ui::CheckMainForm) +{ + ui->setupUi(this); +} + +CheckMainForm::~CheckMainForm() +{ + delete ui; +} diff --git a/check/CheckMainForm.h b/check/CheckMainForm.h new file mode 100644 index 0000000..c71001e --- /dev/null +++ b/check/CheckMainForm.h @@ -0,0 +1,22 @@ +#ifndef CHECKMAINFORM_H +#define CHECKMAINFORM_H + +#include + +namespace Ui { +class CheckMainForm; +} + +class CheckMainForm : public QWidget +{ + Q_OBJECT + +public: + explicit CheckMainForm(QWidget *parent = nullptr); + ~CheckMainForm(); + +private: + Ui::CheckMainForm *ui; +}; + +#endif // CHECKMAINFORM_H diff --git a/check/CheckMainForm.ui b/check/CheckMainForm.ui new file mode 100644 index 0000000..76ca74d --- /dev/null +++ b/check/CheckMainForm.ui @@ -0,0 +1,21 @@ + + + + + CheckMainForm + + + + 0 + 0 + 400 + 300 + + + + Form + + + + + diff --git a/check/check.pri b/check/check.pri index e69de29..624bd3f 100644 --- a/check/check.pri +++ b/check/check.pri @@ -0,0 +1,4 @@ +HEADERS += $$PWD/CheckMainForm.h +SOURCES += $$PWD/CheckMainForm.cpp + +FORMS += $$PWD/CheckMainForm.ui diff --git a/frame/FramelessWindow.cpp b/frame/FramelessWindow.cpp index d323ae5..5727866 100644 --- a/frame/FramelessWindow.cpp +++ b/frame/FramelessWindow.cpp @@ -1,4 +1,8 @@ -#include "FramelessWindow.h" +#include +#include +#include + +#include "FramelessWindow.h" #ifdef Q_OS_WIN #include "windows.h" @@ -63,6 +67,12 @@ resizeEnable = false; } + if (!isMaximized()) { + QRect screenRect = QApplication::screens().at(0)->availableGeometry(); + resize(screenRect.width() * 0.9, screenRect.height() * 0.9); + move(QRandomGenerator::global()->bounded(10, 100), QRandomGenerator::global()->bounded(10, 50)); + } + //发出最大化最小化等改变事件,以便界面上更改对应的信息比如右上角图标和文字 Q_EMIT windowStateChange(!moveEnable); diff --git a/frame/MainWindowForm.cpp b/frame/MainWindowForm.cpp index cb98f69..0791c77 100644 --- a/frame/MainWindowForm.cpp +++ b/frame/MainWindowForm.cpp @@ -1,8 +1,6 @@ #include "MainWindowForm.h" #include "ui_MainWindowForm.h" -#include - MainWindowForm::MainWindowForm(QWidget *parent) : FramelessWindow(parent), ui(new Ui::MainWindowForm) @@ -18,8 +16,8 @@ connect(TimeCounterUtil::getInstance().clockTimer, &QTimer::timeout, this, &MainWindowForm::onUpdateTimestampHandler); TimeCounterUtil::getInstance().clockTimer->start(1000); - /** 临时调试代码 **/ - emit ui->btnInfomation->clicked(); + // 自动加载第一个页面 + emit ui->btnCalibration->clicked(); } MainWindowForm::~MainWindowForm() @@ -37,7 +35,7 @@ { setWindowFlags(Qt::FramelessWindowHint); // 设置全屏 setWindowState(Qt::WindowState::WindowMaximized); - this->setTitleBar(ui->wdgtTop); + // 设置窗口位置和大小 move(0, 0); @@ -46,42 +44,31 @@ qint16 screenHeight = screenRect.height(); resize(screenWidth, screenHeight); + // 设置标题栏 以绑定和触发鼠标双击事件 + this->setTitleBar(ui->wdgtTop); + connect(this, &MainWindowForm::titleDblClick, this, &MainWindowForm::titleDblClickHandler); + // 加载样式表 QString qssStyle = QssFileUtils::loadQssFileContent(":/qss/mainForm.css"); if (qssStyle.isEmpty() == false) { ui->wdgtTop->setStyleSheet(qssStyle); // 仅本窗口生效 + ui->wdgtContent->setStyleSheet("QWidget{background: #FFFFFF;}"); } - // 设置标题 + // 设置标题文字 ui->labelTitle->setText(SettingConfig::getInstance().CLIENT_TITLE); setWindowTitle(SettingConfig::getInstance().CLIENT_TITLE); - // 设置最小尺寸(宽度, 高度) lxc - QScreen *screen = QGuiApplication::primaryScreen(); - QRect screenSize = screen->availableGeometry(); // 可用区域(排除任务栏) - // 设置最小尺寸为屏幕宽度的 80%,高度 600 - int minWidth = screenSize.width() * 0.8; + int minWidth = screenWidth * 0.8; this->setMinimumSize(minWidth, 600); } void MainWindowForm::initMenuWidgets() { + wdgtCaliMain = new CalibrationMainForm(this); + wdgtCheckMain = new CheckMainForm(this); wdgtInfoMain = new InfoMainForm(this); -// wdgtInfo = new TF_InfoManag(this); -// wdgtCheckMethod = new CheckMethodManage(this); -// wdgtCheck = new CheckWindow(this); -// wdgtData = new TF_TextDataManag(this); -// wdgtCert = new TF_CertificateApproval(this); -// wdgtUserMan = new TF_UserManag(this); -// wdgtTestDev = new TF_TextDevice(this); -// wdgtStandDev = new tf_StandardDevice(this); - -// wdgtStdDevForm = new StandardDeviceForm(this); -// wdgtEqptDevForm = new TestDeviceForm(this); -// wdgtFileResForm = new FileResourcesForm(this); - -// wdgtCalibrationForm = new CalibrationForm(this); // 绑定事件 // connect(wdgtCalibrationForm, &CalibrationForm::enableMenuButtons, this, &MainWindowForm::onMenuButtonsEabled); @@ -89,18 +76,9 @@ // connect(wdgtCheck, &CheckWindow::BarsetEnabled, this, &MainWindowForm::onMenuButtonsEabled); // 添加到stackWidget中 + ui->wdgtContent->insertWidget(0, wdgtCaliMain); + ui->wdgtContent->insertWidget(1, wdgtCheckMain); ui->wdgtContent->insertWidget(2, wdgtInfoMain); -// ui->wdgtContent->insertWidget(0, wdgtCalibrationForm); -// ui->wdgtContent->insertWidget(1, wdgtStdDevForm); -// ui->wdgtContent->insertWidget(1, wdgtStandDev); -// ui->wdgtContent->insertWidget(2, wdgtTestDev); -// ui->wdgtContent->insertWidget(2, wdgtEqptDevForm); -// ui->wdgtContent->insertWidget(3, wdgtCheckMethod); -// ui->wdgtContent->insertWidget(4, wdgtCheck); -// ui->wdgtContent->insertWidget(5, wdgtData); -// ui->wdgtContent->insertWidget(6, wdgtCert); -// ui->wdgtContent->insertWidget(7, wdgtFileResForm); -// ui->wdgtContent->insertWidget(8, wdgtUserMan); } void MainWindowForm::initFunctionButtons() @@ -115,7 +93,6 @@ funcButtGroup->addButton(funcButt); connect(funcButt, &QToolButton::clicked, this, &MainWindowForm::onFunctionButtonsAction); } - connect(this, SIGNAL(titleDblClick()), this, SLOT(titleDblClick())); } void MainWindowForm::on_btnMinWin_clicked() @@ -125,17 +102,12 @@ 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(); + ui->btnMaxWin->setToolTip("最大化"); } else { - resize(screenSize.width(), screenSize.height()); - move(0, 0); this->showMaximized(); + ui->btnMaxWin->setToolTip("还原"); } } @@ -165,7 +137,7 @@ ui->labelTime->setText(now.toString("yyyy-MM-dd HH:mm:ss")); } -void MainWindowForm::titleDblClick() +void MainWindowForm::titleDblClickHandler() { on_btnMaxWin_clicked(); } diff --git a/frame/MainWindowForm.h b/frame/MainWindowForm.h index 9b4eae4..aa5330c 100644 --- a/frame/MainWindowForm.h +++ b/frame/MainWindowForm.h @@ -13,21 +13,8 @@ #include "frame/FramelessWindow.h" #include "infomation/InfoMainForm.h" - -//#include "infomation/standDev/StandardDeviceForm.h" -//#include "infomation/testDev/TestDeviceForm.h" -//#include "infomation/fileRes/FileResourcesForm.h" - -//#include "calibration/CalibrationForm.h" - -//#include "TimeFreq/tf_standarddevice.h" -//#include "TimeFreq/tf_certificateapproval.h" -//#include "TimeFreq/tf_infomanag.h" -//#include "TimeFreq/tf_textdatamanag.h" -//#include "TimeFreq/tf_textdevice.h" -//#include "TimeFreq/tf_usermanag.h" -//#include "checkmethodmanage.h" -//#include "checkwindow.h" +#include "calibration/CalibrationMainForm.h" +#include "check/CheckMainForm.h" namespace Ui { class MainWindowForm; @@ -50,29 +37,16 @@ void onFunctionButtonsAction(); void onUpdateTimestampHandler(); - void titleDblClick(); + void titleDblClickHandler(); void onMenuButtonsEabled(bool enable); private: Ui::MainWindowForm *ui; + CalibrationMainForm * wdgtCaliMain; + CheckMainForm * wdgtCheckMain; InfoMainForm * wdgtInfoMain; -// TF_InfoManag * wdgtInfo; -// CheckMethodManage * wdgtCheckMethod; -// CheckWindow * wdgtCheck; -// TF_TextDataManag * wdgtData; -// TF_CertificateApproval * wdgtCert; -// TF_UserManag * wdgtUserMan; -// tf_StandardDevice * wdgtStandDev; -// TF_TextDevice * wdgtTestDev; - -// StandardDeviceForm * wdgtStdDevForm; -// TestDeviceForm * wdgtEqptDevForm; -// FileResourcesForm * wdgtFileResForm; - -// CalibrationForm * wdgtCalibrationForm; - void initForm(); void initMenuWidgets(); void initFunctionButtons(); diff --git a/frame/MainWindowForm.ui b/frame/MainWindowForm.ui index d3fd4fe..e0638e1 100644 --- a/frame/MainWindowForm.ui +++ b/frame/MainWindowForm.ui @@ -271,6 +271,18 @@ + + + 0 + 0 + + + + + 240 + 0 + + 240 @@ -295,6 +307,18 @@ + + + 0 + 0 + + + + + 0 + 40 + + @@ -392,6 +416,18 @@ + + + 0 + 0 + + + + + 240 + 0 + + 240 @@ -422,6 +458,12 @@ 0 + + + 0 + 40 + + 5 @@ -459,6 +501,9 @@ 24 + + 设置 + @@ -509,7 +554,7 @@ - 最小化 + 还原 diff --git a/infomation/task/DeptTaskForm.cpp b/infomation/task/DeptTaskForm.cpp index 208973c..b7d771b 100644 --- a/infomation/task/DeptTaskForm.cpp +++ b/infomation/task/DeptTaskForm.cpp @@ -33,7 +33,7 @@ void DeptTaskForm::initForm() { // 加载样式表 - QString qssStyle = QssFileUtils::loadQssFileContent(QApplication::applicationDirPath() + "/qss/infoTable.css"); + QString qssStyle = QssFileUtils::loadQssFileContent(":/qss/infoTable.css"); if (qssStyle.isEmpty() == false) { this->setStyleSheet(qssStyle); // 仅本窗口生效 } diff --git a/res/image/main/calibration.png b/res/image/main/calibration.png deleted file mode 100644 index 9d6de19..0000000 --- a/res/image/main/calibration.png +++ /dev/null Binary files differ diff --git a/res/image/main/certApproval.png b/res/image/main/certApproval.png deleted file mode 100644 index 45147a6..0000000 --- a/res/image/main/certApproval.png +++ /dev/null Binary files differ diff --git a/res/image/main/checkDevice.png b/res/image/main/checkDevice.png deleted file mode 100644 index 3e9307a..0000000 --- a/res/image/main/checkDevice.png +++ /dev/null Binary files differ diff --git a/res/image/main/checkProgram.png b/res/image/main/checkProgram.png deleted file mode 100644 index e75ef50..0000000 --- a/res/image/main/checkProgram.png +++ /dev/null Binary files differ diff --git a/res/image/main/fileRes.png b/res/image/main/fileRes.png deleted file mode 100644 index 99b9b45..0000000 --- a/res/image/main/fileRes.png +++ /dev/null Binary files differ diff --git a/calibration/CalibrationMainForm.cpp b/calibration/CalibrationMainForm.cpp new file mode 100644 index 0000000..9b778a5 --- /dev/null +++ b/calibration/CalibrationMainForm.cpp @@ -0,0 +1,14 @@ +#include "CalibrationMainForm.h" +#include "ui_CalibrationMainForm.h" + +CalibrationMainForm::CalibrationMainForm(QWidget *parent) : + QWidget(parent), + ui(new Ui::CalibrationMainForm) +{ + ui->setupUi(this); +} + +CalibrationMainForm::~CalibrationMainForm() +{ + delete ui; +} diff --git a/calibration/CalibrationMainForm.h b/calibration/CalibrationMainForm.h new file mode 100644 index 0000000..7d75014 --- /dev/null +++ b/calibration/CalibrationMainForm.h @@ -0,0 +1,22 @@ +#ifndef CALIBRATIONMAINFORM_H +#define CALIBRATIONMAINFORM_H + +#include + +namespace Ui { +class CalibrationMainForm; +} + +class CalibrationMainForm : public QWidget +{ + Q_OBJECT + +public: + explicit CalibrationMainForm(QWidget *parent = nullptr); + ~CalibrationMainForm(); + +private: + Ui::CalibrationMainForm *ui; +}; + +#endif // CALIBRATIONMAINFORM_H diff --git a/calibration/CalibrationMainForm.ui b/calibration/CalibrationMainForm.ui new file mode 100644 index 0000000..9b5a9c2 --- /dev/null +++ b/calibration/CalibrationMainForm.ui @@ -0,0 +1,21 @@ + + + + + CalibrationMainForm + + + + 0 + 0 + 400 + 300 + + + + Form + + + + + diff --git a/calibration/calibration.pri b/calibration/calibration.pri index e69de29..f0e9dfb 100644 --- a/calibration/calibration.pri +++ b/calibration/calibration.pri @@ -0,0 +1,4 @@ +HEADERS += $$PWD/CalibrationMainForm.h +SOURCES += $$PWD/CalibrationMainForm.cpp + +FORMS += $$PWD/CalibrationMainForm.ui diff --git a/check/CheckMainForm.cpp b/check/CheckMainForm.cpp new file mode 100644 index 0000000..1725277 --- /dev/null +++ b/check/CheckMainForm.cpp @@ -0,0 +1,14 @@ +#include "CheckMainForm.h" +#include "ui_CheckMainForm.h" + +CheckMainForm::CheckMainForm(QWidget *parent) : + QWidget(parent), + ui(new Ui::CheckMainForm) +{ + ui->setupUi(this); +} + +CheckMainForm::~CheckMainForm() +{ + delete ui; +} diff --git a/check/CheckMainForm.h b/check/CheckMainForm.h new file mode 100644 index 0000000..c71001e --- /dev/null +++ b/check/CheckMainForm.h @@ -0,0 +1,22 @@ +#ifndef CHECKMAINFORM_H +#define CHECKMAINFORM_H + +#include + +namespace Ui { +class CheckMainForm; +} + +class CheckMainForm : public QWidget +{ + Q_OBJECT + +public: + explicit CheckMainForm(QWidget *parent = nullptr); + ~CheckMainForm(); + +private: + Ui::CheckMainForm *ui; +}; + +#endif // CHECKMAINFORM_H diff --git a/check/CheckMainForm.ui b/check/CheckMainForm.ui new file mode 100644 index 0000000..76ca74d --- /dev/null +++ b/check/CheckMainForm.ui @@ -0,0 +1,21 @@ + + + + + CheckMainForm + + + + 0 + 0 + 400 + 300 + + + + Form + + + + + diff --git a/check/check.pri b/check/check.pri index e69de29..624bd3f 100644 --- a/check/check.pri +++ b/check/check.pri @@ -0,0 +1,4 @@ +HEADERS += $$PWD/CheckMainForm.h +SOURCES += $$PWD/CheckMainForm.cpp + +FORMS += $$PWD/CheckMainForm.ui diff --git a/frame/FramelessWindow.cpp b/frame/FramelessWindow.cpp index d323ae5..5727866 100644 --- a/frame/FramelessWindow.cpp +++ b/frame/FramelessWindow.cpp @@ -1,4 +1,8 @@ -#include "FramelessWindow.h" +#include +#include +#include + +#include "FramelessWindow.h" #ifdef Q_OS_WIN #include "windows.h" @@ -63,6 +67,12 @@ resizeEnable = false; } + if (!isMaximized()) { + QRect screenRect = QApplication::screens().at(0)->availableGeometry(); + resize(screenRect.width() * 0.9, screenRect.height() * 0.9); + move(QRandomGenerator::global()->bounded(10, 100), QRandomGenerator::global()->bounded(10, 50)); + } + //发出最大化最小化等改变事件,以便界面上更改对应的信息比如右上角图标和文字 Q_EMIT windowStateChange(!moveEnable); diff --git a/frame/MainWindowForm.cpp b/frame/MainWindowForm.cpp index cb98f69..0791c77 100644 --- a/frame/MainWindowForm.cpp +++ b/frame/MainWindowForm.cpp @@ -1,8 +1,6 @@ #include "MainWindowForm.h" #include "ui_MainWindowForm.h" -#include - MainWindowForm::MainWindowForm(QWidget *parent) : FramelessWindow(parent), ui(new Ui::MainWindowForm) @@ -18,8 +16,8 @@ connect(TimeCounterUtil::getInstance().clockTimer, &QTimer::timeout, this, &MainWindowForm::onUpdateTimestampHandler); TimeCounterUtil::getInstance().clockTimer->start(1000); - /** 临时调试代码 **/ - emit ui->btnInfomation->clicked(); + // 自动加载第一个页面 + emit ui->btnCalibration->clicked(); } MainWindowForm::~MainWindowForm() @@ -37,7 +35,7 @@ { setWindowFlags(Qt::FramelessWindowHint); // 设置全屏 setWindowState(Qt::WindowState::WindowMaximized); - this->setTitleBar(ui->wdgtTop); + // 设置窗口位置和大小 move(0, 0); @@ -46,42 +44,31 @@ qint16 screenHeight = screenRect.height(); resize(screenWidth, screenHeight); + // 设置标题栏 以绑定和触发鼠标双击事件 + this->setTitleBar(ui->wdgtTop); + connect(this, &MainWindowForm::titleDblClick, this, &MainWindowForm::titleDblClickHandler); + // 加载样式表 QString qssStyle = QssFileUtils::loadQssFileContent(":/qss/mainForm.css"); if (qssStyle.isEmpty() == false) { ui->wdgtTop->setStyleSheet(qssStyle); // 仅本窗口生效 + ui->wdgtContent->setStyleSheet("QWidget{background: #FFFFFF;}"); } - // 设置标题 + // 设置标题文字 ui->labelTitle->setText(SettingConfig::getInstance().CLIENT_TITLE); setWindowTitle(SettingConfig::getInstance().CLIENT_TITLE); - // 设置最小尺寸(宽度, 高度) lxc - QScreen *screen = QGuiApplication::primaryScreen(); - QRect screenSize = screen->availableGeometry(); // 可用区域(排除任务栏) - // 设置最小尺寸为屏幕宽度的 80%,高度 600 - int minWidth = screenSize.width() * 0.8; + int minWidth = screenWidth * 0.8; this->setMinimumSize(minWidth, 600); } void MainWindowForm::initMenuWidgets() { + wdgtCaliMain = new CalibrationMainForm(this); + wdgtCheckMain = new CheckMainForm(this); wdgtInfoMain = new InfoMainForm(this); -// wdgtInfo = new TF_InfoManag(this); -// wdgtCheckMethod = new CheckMethodManage(this); -// wdgtCheck = new CheckWindow(this); -// wdgtData = new TF_TextDataManag(this); -// wdgtCert = new TF_CertificateApproval(this); -// wdgtUserMan = new TF_UserManag(this); -// wdgtTestDev = new TF_TextDevice(this); -// wdgtStandDev = new tf_StandardDevice(this); - -// wdgtStdDevForm = new StandardDeviceForm(this); -// wdgtEqptDevForm = new TestDeviceForm(this); -// wdgtFileResForm = new FileResourcesForm(this); - -// wdgtCalibrationForm = new CalibrationForm(this); // 绑定事件 // connect(wdgtCalibrationForm, &CalibrationForm::enableMenuButtons, this, &MainWindowForm::onMenuButtonsEabled); @@ -89,18 +76,9 @@ // connect(wdgtCheck, &CheckWindow::BarsetEnabled, this, &MainWindowForm::onMenuButtonsEabled); // 添加到stackWidget中 + ui->wdgtContent->insertWidget(0, wdgtCaliMain); + ui->wdgtContent->insertWidget(1, wdgtCheckMain); ui->wdgtContent->insertWidget(2, wdgtInfoMain); -// ui->wdgtContent->insertWidget(0, wdgtCalibrationForm); -// ui->wdgtContent->insertWidget(1, wdgtStdDevForm); -// ui->wdgtContent->insertWidget(1, wdgtStandDev); -// ui->wdgtContent->insertWidget(2, wdgtTestDev); -// ui->wdgtContent->insertWidget(2, wdgtEqptDevForm); -// ui->wdgtContent->insertWidget(3, wdgtCheckMethod); -// ui->wdgtContent->insertWidget(4, wdgtCheck); -// ui->wdgtContent->insertWidget(5, wdgtData); -// ui->wdgtContent->insertWidget(6, wdgtCert); -// ui->wdgtContent->insertWidget(7, wdgtFileResForm); -// ui->wdgtContent->insertWidget(8, wdgtUserMan); } void MainWindowForm::initFunctionButtons() @@ -115,7 +93,6 @@ funcButtGroup->addButton(funcButt); connect(funcButt, &QToolButton::clicked, this, &MainWindowForm::onFunctionButtonsAction); } - connect(this, SIGNAL(titleDblClick()), this, SLOT(titleDblClick())); } void MainWindowForm::on_btnMinWin_clicked() @@ -125,17 +102,12 @@ 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(); + ui->btnMaxWin->setToolTip("最大化"); } else { - resize(screenSize.width(), screenSize.height()); - move(0, 0); this->showMaximized(); + ui->btnMaxWin->setToolTip("还原"); } } @@ -165,7 +137,7 @@ ui->labelTime->setText(now.toString("yyyy-MM-dd HH:mm:ss")); } -void MainWindowForm::titleDblClick() +void MainWindowForm::titleDblClickHandler() { on_btnMaxWin_clicked(); } diff --git a/frame/MainWindowForm.h b/frame/MainWindowForm.h index 9b4eae4..aa5330c 100644 --- a/frame/MainWindowForm.h +++ b/frame/MainWindowForm.h @@ -13,21 +13,8 @@ #include "frame/FramelessWindow.h" #include "infomation/InfoMainForm.h" - -//#include "infomation/standDev/StandardDeviceForm.h" -//#include "infomation/testDev/TestDeviceForm.h" -//#include "infomation/fileRes/FileResourcesForm.h" - -//#include "calibration/CalibrationForm.h" - -//#include "TimeFreq/tf_standarddevice.h" -//#include "TimeFreq/tf_certificateapproval.h" -//#include "TimeFreq/tf_infomanag.h" -//#include "TimeFreq/tf_textdatamanag.h" -//#include "TimeFreq/tf_textdevice.h" -//#include "TimeFreq/tf_usermanag.h" -//#include "checkmethodmanage.h" -//#include "checkwindow.h" +#include "calibration/CalibrationMainForm.h" +#include "check/CheckMainForm.h" namespace Ui { class MainWindowForm; @@ -50,29 +37,16 @@ void onFunctionButtonsAction(); void onUpdateTimestampHandler(); - void titleDblClick(); + void titleDblClickHandler(); void onMenuButtonsEabled(bool enable); private: Ui::MainWindowForm *ui; + CalibrationMainForm * wdgtCaliMain; + CheckMainForm * wdgtCheckMain; InfoMainForm * wdgtInfoMain; -// TF_InfoManag * wdgtInfo; -// CheckMethodManage * wdgtCheckMethod; -// CheckWindow * wdgtCheck; -// TF_TextDataManag * wdgtData; -// TF_CertificateApproval * wdgtCert; -// TF_UserManag * wdgtUserMan; -// tf_StandardDevice * wdgtStandDev; -// TF_TextDevice * wdgtTestDev; - -// StandardDeviceForm * wdgtStdDevForm; -// TestDeviceForm * wdgtEqptDevForm; -// FileResourcesForm * wdgtFileResForm; - -// CalibrationForm * wdgtCalibrationForm; - void initForm(); void initMenuWidgets(); void initFunctionButtons(); diff --git a/frame/MainWindowForm.ui b/frame/MainWindowForm.ui index d3fd4fe..e0638e1 100644 --- a/frame/MainWindowForm.ui +++ b/frame/MainWindowForm.ui @@ -271,6 +271,18 @@ + + + 0 + 0 + + + + + 240 + 0 + + 240 @@ -295,6 +307,18 @@ + + + 0 + 0 + + + + + 0 + 40 + + @@ -392,6 +416,18 @@ + + + 0 + 0 + + + + + 240 + 0 + + 240 @@ -422,6 +458,12 @@ 0 + + + 0 + 40 + + 5 @@ -459,6 +501,9 @@ 24 + + 设置 + @@ -509,7 +554,7 @@ - 最小化 + 还原 diff --git a/infomation/task/DeptTaskForm.cpp b/infomation/task/DeptTaskForm.cpp index 208973c..b7d771b 100644 --- a/infomation/task/DeptTaskForm.cpp +++ b/infomation/task/DeptTaskForm.cpp @@ -33,7 +33,7 @@ void DeptTaskForm::initForm() { // 加载样式表 - QString qssStyle = QssFileUtils::loadQssFileContent(QApplication::applicationDirPath() + "/qss/infoTable.css"); + QString qssStyle = QssFileUtils::loadQssFileContent(":/qss/infoTable.css"); if (qssStyle.isEmpty() == false) { this->setStyleSheet(qssStyle); // 仅本窗口生效 } diff --git a/res/image/main/calibration.png b/res/image/main/calibration.png deleted file mode 100644 index 9d6de19..0000000 --- a/res/image/main/calibration.png +++ /dev/null Binary files differ diff --git a/res/image/main/certApproval.png b/res/image/main/certApproval.png deleted file mode 100644 index 45147a6..0000000 --- a/res/image/main/certApproval.png +++ /dev/null Binary files differ diff --git a/res/image/main/checkDevice.png b/res/image/main/checkDevice.png deleted file mode 100644 index 3e9307a..0000000 --- a/res/image/main/checkDevice.png +++ /dev/null Binary files differ diff --git a/res/image/main/checkProgram.png b/res/image/main/checkProgram.png deleted file mode 100644 index e75ef50..0000000 --- a/res/image/main/checkProgram.png +++ /dev/null Binary files differ diff --git a/res/image/main/fileRes.png b/res/image/main/fileRes.png deleted file mode 100644 index 99b9b45..0000000 --- a/res/image/main/fileRes.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_menu_calibration.png b/res/image/main/icon_menu_calibration.png index 6fca8be..cbc7bfc 100644 --- a/res/image/main/icon_menu_calibration.png +++ b/res/image/main/icon_menu_calibration.png Binary files differ diff --git a/calibration/CalibrationMainForm.cpp b/calibration/CalibrationMainForm.cpp new file mode 100644 index 0000000..9b778a5 --- /dev/null +++ b/calibration/CalibrationMainForm.cpp @@ -0,0 +1,14 @@ +#include "CalibrationMainForm.h" +#include "ui_CalibrationMainForm.h" + +CalibrationMainForm::CalibrationMainForm(QWidget *parent) : + QWidget(parent), + ui(new Ui::CalibrationMainForm) +{ + ui->setupUi(this); +} + +CalibrationMainForm::~CalibrationMainForm() +{ + delete ui; +} diff --git a/calibration/CalibrationMainForm.h b/calibration/CalibrationMainForm.h new file mode 100644 index 0000000..7d75014 --- /dev/null +++ b/calibration/CalibrationMainForm.h @@ -0,0 +1,22 @@ +#ifndef CALIBRATIONMAINFORM_H +#define CALIBRATIONMAINFORM_H + +#include + +namespace Ui { +class CalibrationMainForm; +} + +class CalibrationMainForm : public QWidget +{ + Q_OBJECT + +public: + explicit CalibrationMainForm(QWidget *parent = nullptr); + ~CalibrationMainForm(); + +private: + Ui::CalibrationMainForm *ui; +}; + +#endif // CALIBRATIONMAINFORM_H diff --git a/calibration/CalibrationMainForm.ui b/calibration/CalibrationMainForm.ui new file mode 100644 index 0000000..9b5a9c2 --- /dev/null +++ b/calibration/CalibrationMainForm.ui @@ -0,0 +1,21 @@ + + + + + CalibrationMainForm + + + + 0 + 0 + 400 + 300 + + + + Form + + + + + diff --git a/calibration/calibration.pri b/calibration/calibration.pri index e69de29..f0e9dfb 100644 --- a/calibration/calibration.pri +++ b/calibration/calibration.pri @@ -0,0 +1,4 @@ +HEADERS += $$PWD/CalibrationMainForm.h +SOURCES += $$PWD/CalibrationMainForm.cpp + +FORMS += $$PWD/CalibrationMainForm.ui diff --git a/check/CheckMainForm.cpp b/check/CheckMainForm.cpp new file mode 100644 index 0000000..1725277 --- /dev/null +++ b/check/CheckMainForm.cpp @@ -0,0 +1,14 @@ +#include "CheckMainForm.h" +#include "ui_CheckMainForm.h" + +CheckMainForm::CheckMainForm(QWidget *parent) : + QWidget(parent), + ui(new Ui::CheckMainForm) +{ + ui->setupUi(this); +} + +CheckMainForm::~CheckMainForm() +{ + delete ui; +} diff --git a/check/CheckMainForm.h b/check/CheckMainForm.h new file mode 100644 index 0000000..c71001e --- /dev/null +++ b/check/CheckMainForm.h @@ -0,0 +1,22 @@ +#ifndef CHECKMAINFORM_H +#define CHECKMAINFORM_H + +#include + +namespace Ui { +class CheckMainForm; +} + +class CheckMainForm : public QWidget +{ + Q_OBJECT + +public: + explicit CheckMainForm(QWidget *parent = nullptr); + ~CheckMainForm(); + +private: + Ui::CheckMainForm *ui; +}; + +#endif // CHECKMAINFORM_H diff --git a/check/CheckMainForm.ui b/check/CheckMainForm.ui new file mode 100644 index 0000000..76ca74d --- /dev/null +++ b/check/CheckMainForm.ui @@ -0,0 +1,21 @@ + + + + + CheckMainForm + + + + 0 + 0 + 400 + 300 + + + + Form + + + + + diff --git a/check/check.pri b/check/check.pri index e69de29..624bd3f 100644 --- a/check/check.pri +++ b/check/check.pri @@ -0,0 +1,4 @@ +HEADERS += $$PWD/CheckMainForm.h +SOURCES += $$PWD/CheckMainForm.cpp + +FORMS += $$PWD/CheckMainForm.ui diff --git a/frame/FramelessWindow.cpp b/frame/FramelessWindow.cpp index d323ae5..5727866 100644 --- a/frame/FramelessWindow.cpp +++ b/frame/FramelessWindow.cpp @@ -1,4 +1,8 @@ -#include "FramelessWindow.h" +#include +#include +#include + +#include "FramelessWindow.h" #ifdef Q_OS_WIN #include "windows.h" @@ -63,6 +67,12 @@ resizeEnable = false; } + if (!isMaximized()) { + QRect screenRect = QApplication::screens().at(0)->availableGeometry(); + resize(screenRect.width() * 0.9, screenRect.height() * 0.9); + move(QRandomGenerator::global()->bounded(10, 100), QRandomGenerator::global()->bounded(10, 50)); + } + //发出最大化最小化等改变事件,以便界面上更改对应的信息比如右上角图标和文字 Q_EMIT windowStateChange(!moveEnable); diff --git a/frame/MainWindowForm.cpp b/frame/MainWindowForm.cpp index cb98f69..0791c77 100644 --- a/frame/MainWindowForm.cpp +++ b/frame/MainWindowForm.cpp @@ -1,8 +1,6 @@ #include "MainWindowForm.h" #include "ui_MainWindowForm.h" -#include - MainWindowForm::MainWindowForm(QWidget *parent) : FramelessWindow(parent), ui(new Ui::MainWindowForm) @@ -18,8 +16,8 @@ connect(TimeCounterUtil::getInstance().clockTimer, &QTimer::timeout, this, &MainWindowForm::onUpdateTimestampHandler); TimeCounterUtil::getInstance().clockTimer->start(1000); - /** 临时调试代码 **/ - emit ui->btnInfomation->clicked(); + // 自动加载第一个页面 + emit ui->btnCalibration->clicked(); } MainWindowForm::~MainWindowForm() @@ -37,7 +35,7 @@ { setWindowFlags(Qt::FramelessWindowHint); // 设置全屏 setWindowState(Qt::WindowState::WindowMaximized); - this->setTitleBar(ui->wdgtTop); + // 设置窗口位置和大小 move(0, 0); @@ -46,42 +44,31 @@ qint16 screenHeight = screenRect.height(); resize(screenWidth, screenHeight); + // 设置标题栏 以绑定和触发鼠标双击事件 + this->setTitleBar(ui->wdgtTop); + connect(this, &MainWindowForm::titleDblClick, this, &MainWindowForm::titleDblClickHandler); + // 加载样式表 QString qssStyle = QssFileUtils::loadQssFileContent(":/qss/mainForm.css"); if (qssStyle.isEmpty() == false) { ui->wdgtTop->setStyleSheet(qssStyle); // 仅本窗口生效 + ui->wdgtContent->setStyleSheet("QWidget{background: #FFFFFF;}"); } - // 设置标题 + // 设置标题文字 ui->labelTitle->setText(SettingConfig::getInstance().CLIENT_TITLE); setWindowTitle(SettingConfig::getInstance().CLIENT_TITLE); - // 设置最小尺寸(宽度, 高度) lxc - QScreen *screen = QGuiApplication::primaryScreen(); - QRect screenSize = screen->availableGeometry(); // 可用区域(排除任务栏) - // 设置最小尺寸为屏幕宽度的 80%,高度 600 - int minWidth = screenSize.width() * 0.8; + int minWidth = screenWidth * 0.8; this->setMinimumSize(minWidth, 600); } void MainWindowForm::initMenuWidgets() { + wdgtCaliMain = new CalibrationMainForm(this); + wdgtCheckMain = new CheckMainForm(this); wdgtInfoMain = new InfoMainForm(this); -// wdgtInfo = new TF_InfoManag(this); -// wdgtCheckMethod = new CheckMethodManage(this); -// wdgtCheck = new CheckWindow(this); -// wdgtData = new TF_TextDataManag(this); -// wdgtCert = new TF_CertificateApproval(this); -// wdgtUserMan = new TF_UserManag(this); -// wdgtTestDev = new TF_TextDevice(this); -// wdgtStandDev = new tf_StandardDevice(this); - -// wdgtStdDevForm = new StandardDeviceForm(this); -// wdgtEqptDevForm = new TestDeviceForm(this); -// wdgtFileResForm = new FileResourcesForm(this); - -// wdgtCalibrationForm = new CalibrationForm(this); // 绑定事件 // connect(wdgtCalibrationForm, &CalibrationForm::enableMenuButtons, this, &MainWindowForm::onMenuButtonsEabled); @@ -89,18 +76,9 @@ // connect(wdgtCheck, &CheckWindow::BarsetEnabled, this, &MainWindowForm::onMenuButtonsEabled); // 添加到stackWidget中 + ui->wdgtContent->insertWidget(0, wdgtCaliMain); + ui->wdgtContent->insertWidget(1, wdgtCheckMain); ui->wdgtContent->insertWidget(2, wdgtInfoMain); -// ui->wdgtContent->insertWidget(0, wdgtCalibrationForm); -// ui->wdgtContent->insertWidget(1, wdgtStdDevForm); -// ui->wdgtContent->insertWidget(1, wdgtStandDev); -// ui->wdgtContent->insertWidget(2, wdgtTestDev); -// ui->wdgtContent->insertWidget(2, wdgtEqptDevForm); -// ui->wdgtContent->insertWidget(3, wdgtCheckMethod); -// ui->wdgtContent->insertWidget(4, wdgtCheck); -// ui->wdgtContent->insertWidget(5, wdgtData); -// ui->wdgtContent->insertWidget(6, wdgtCert); -// ui->wdgtContent->insertWidget(7, wdgtFileResForm); -// ui->wdgtContent->insertWidget(8, wdgtUserMan); } void MainWindowForm::initFunctionButtons() @@ -115,7 +93,6 @@ funcButtGroup->addButton(funcButt); connect(funcButt, &QToolButton::clicked, this, &MainWindowForm::onFunctionButtonsAction); } - connect(this, SIGNAL(titleDblClick()), this, SLOT(titleDblClick())); } void MainWindowForm::on_btnMinWin_clicked() @@ -125,17 +102,12 @@ 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(); + ui->btnMaxWin->setToolTip("最大化"); } else { - resize(screenSize.width(), screenSize.height()); - move(0, 0); this->showMaximized(); + ui->btnMaxWin->setToolTip("还原"); } } @@ -165,7 +137,7 @@ ui->labelTime->setText(now.toString("yyyy-MM-dd HH:mm:ss")); } -void MainWindowForm::titleDblClick() +void MainWindowForm::titleDblClickHandler() { on_btnMaxWin_clicked(); } diff --git a/frame/MainWindowForm.h b/frame/MainWindowForm.h index 9b4eae4..aa5330c 100644 --- a/frame/MainWindowForm.h +++ b/frame/MainWindowForm.h @@ -13,21 +13,8 @@ #include "frame/FramelessWindow.h" #include "infomation/InfoMainForm.h" - -//#include "infomation/standDev/StandardDeviceForm.h" -//#include "infomation/testDev/TestDeviceForm.h" -//#include "infomation/fileRes/FileResourcesForm.h" - -//#include "calibration/CalibrationForm.h" - -//#include "TimeFreq/tf_standarddevice.h" -//#include "TimeFreq/tf_certificateapproval.h" -//#include "TimeFreq/tf_infomanag.h" -//#include "TimeFreq/tf_textdatamanag.h" -//#include "TimeFreq/tf_textdevice.h" -//#include "TimeFreq/tf_usermanag.h" -//#include "checkmethodmanage.h" -//#include "checkwindow.h" +#include "calibration/CalibrationMainForm.h" +#include "check/CheckMainForm.h" namespace Ui { class MainWindowForm; @@ -50,29 +37,16 @@ void onFunctionButtonsAction(); void onUpdateTimestampHandler(); - void titleDblClick(); + void titleDblClickHandler(); void onMenuButtonsEabled(bool enable); private: Ui::MainWindowForm *ui; + CalibrationMainForm * wdgtCaliMain; + CheckMainForm * wdgtCheckMain; InfoMainForm * wdgtInfoMain; -// TF_InfoManag * wdgtInfo; -// CheckMethodManage * wdgtCheckMethod; -// CheckWindow * wdgtCheck; -// TF_TextDataManag * wdgtData; -// TF_CertificateApproval * wdgtCert; -// TF_UserManag * wdgtUserMan; -// tf_StandardDevice * wdgtStandDev; -// TF_TextDevice * wdgtTestDev; - -// StandardDeviceForm * wdgtStdDevForm; -// TestDeviceForm * wdgtEqptDevForm; -// FileResourcesForm * wdgtFileResForm; - -// CalibrationForm * wdgtCalibrationForm; - void initForm(); void initMenuWidgets(); void initFunctionButtons(); diff --git a/frame/MainWindowForm.ui b/frame/MainWindowForm.ui index d3fd4fe..e0638e1 100644 --- a/frame/MainWindowForm.ui +++ b/frame/MainWindowForm.ui @@ -271,6 +271,18 @@ + + + 0 + 0 + + + + + 240 + 0 + + 240 @@ -295,6 +307,18 @@ + + + 0 + 0 + + + + + 0 + 40 + + @@ -392,6 +416,18 @@ + + + 0 + 0 + + + + + 240 + 0 + + 240 @@ -422,6 +458,12 @@ 0 + + + 0 + 40 + + 5 @@ -459,6 +501,9 @@ 24 + + 设置 + @@ -509,7 +554,7 @@ - 最小化 + 还原 diff --git a/infomation/task/DeptTaskForm.cpp b/infomation/task/DeptTaskForm.cpp index 208973c..b7d771b 100644 --- a/infomation/task/DeptTaskForm.cpp +++ b/infomation/task/DeptTaskForm.cpp @@ -33,7 +33,7 @@ void DeptTaskForm::initForm() { // 加载样式表 - QString qssStyle = QssFileUtils::loadQssFileContent(QApplication::applicationDirPath() + "/qss/infoTable.css"); + QString qssStyle = QssFileUtils::loadQssFileContent(":/qss/infoTable.css"); if (qssStyle.isEmpty() == false) { this->setStyleSheet(qssStyle); // 仅本窗口生效 } diff --git a/res/image/main/calibration.png b/res/image/main/calibration.png deleted file mode 100644 index 9d6de19..0000000 --- a/res/image/main/calibration.png +++ /dev/null Binary files differ diff --git a/res/image/main/certApproval.png b/res/image/main/certApproval.png deleted file mode 100644 index 45147a6..0000000 --- a/res/image/main/certApproval.png +++ /dev/null Binary files differ diff --git a/res/image/main/checkDevice.png b/res/image/main/checkDevice.png deleted file mode 100644 index 3e9307a..0000000 --- a/res/image/main/checkDevice.png +++ /dev/null Binary files differ diff --git a/res/image/main/checkProgram.png b/res/image/main/checkProgram.png deleted file mode 100644 index e75ef50..0000000 --- a/res/image/main/checkProgram.png +++ /dev/null Binary files differ diff --git a/res/image/main/fileRes.png b/res/image/main/fileRes.png deleted file mode 100644 index 99b9b45..0000000 --- a/res/image/main/fileRes.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_menu_calibration.png b/res/image/main/icon_menu_calibration.png index 6fca8be..cbc7bfc 100644 --- a/res/image/main/icon_menu_calibration.png +++ 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 index 17f918f..3f140c6 100644 --- a/res/image/main/icon_menu_calibration_selected.png +++ b/res/image/main/icon_menu_calibration_selected.png Binary files differ diff --git a/calibration/CalibrationMainForm.cpp b/calibration/CalibrationMainForm.cpp new file mode 100644 index 0000000..9b778a5 --- /dev/null +++ b/calibration/CalibrationMainForm.cpp @@ -0,0 +1,14 @@ +#include "CalibrationMainForm.h" +#include "ui_CalibrationMainForm.h" + +CalibrationMainForm::CalibrationMainForm(QWidget *parent) : + QWidget(parent), + ui(new Ui::CalibrationMainForm) +{ + ui->setupUi(this); +} + +CalibrationMainForm::~CalibrationMainForm() +{ + delete ui; +} diff --git a/calibration/CalibrationMainForm.h b/calibration/CalibrationMainForm.h new file mode 100644 index 0000000..7d75014 --- /dev/null +++ b/calibration/CalibrationMainForm.h @@ -0,0 +1,22 @@ +#ifndef CALIBRATIONMAINFORM_H +#define CALIBRATIONMAINFORM_H + +#include + +namespace Ui { +class CalibrationMainForm; +} + +class CalibrationMainForm : public QWidget +{ + Q_OBJECT + +public: + explicit CalibrationMainForm(QWidget *parent = nullptr); + ~CalibrationMainForm(); + +private: + Ui::CalibrationMainForm *ui; +}; + +#endif // CALIBRATIONMAINFORM_H diff --git a/calibration/CalibrationMainForm.ui b/calibration/CalibrationMainForm.ui new file mode 100644 index 0000000..9b5a9c2 --- /dev/null +++ b/calibration/CalibrationMainForm.ui @@ -0,0 +1,21 @@ + + + + + CalibrationMainForm + + + + 0 + 0 + 400 + 300 + + + + Form + + + + + diff --git a/calibration/calibration.pri b/calibration/calibration.pri index e69de29..f0e9dfb 100644 --- a/calibration/calibration.pri +++ b/calibration/calibration.pri @@ -0,0 +1,4 @@ +HEADERS += $$PWD/CalibrationMainForm.h +SOURCES += $$PWD/CalibrationMainForm.cpp + +FORMS += $$PWD/CalibrationMainForm.ui diff --git a/check/CheckMainForm.cpp b/check/CheckMainForm.cpp new file mode 100644 index 0000000..1725277 --- /dev/null +++ b/check/CheckMainForm.cpp @@ -0,0 +1,14 @@ +#include "CheckMainForm.h" +#include "ui_CheckMainForm.h" + +CheckMainForm::CheckMainForm(QWidget *parent) : + QWidget(parent), + ui(new Ui::CheckMainForm) +{ + ui->setupUi(this); +} + +CheckMainForm::~CheckMainForm() +{ + delete ui; +} diff --git a/check/CheckMainForm.h b/check/CheckMainForm.h new file mode 100644 index 0000000..c71001e --- /dev/null +++ b/check/CheckMainForm.h @@ -0,0 +1,22 @@ +#ifndef CHECKMAINFORM_H +#define CHECKMAINFORM_H + +#include + +namespace Ui { +class CheckMainForm; +} + +class CheckMainForm : public QWidget +{ + Q_OBJECT + +public: + explicit CheckMainForm(QWidget *parent = nullptr); + ~CheckMainForm(); + +private: + Ui::CheckMainForm *ui; +}; + +#endif // CHECKMAINFORM_H diff --git a/check/CheckMainForm.ui b/check/CheckMainForm.ui new file mode 100644 index 0000000..76ca74d --- /dev/null +++ b/check/CheckMainForm.ui @@ -0,0 +1,21 @@ + + + + + CheckMainForm + + + + 0 + 0 + 400 + 300 + + + + Form + + + + + diff --git a/check/check.pri b/check/check.pri index e69de29..624bd3f 100644 --- a/check/check.pri +++ b/check/check.pri @@ -0,0 +1,4 @@ +HEADERS += $$PWD/CheckMainForm.h +SOURCES += $$PWD/CheckMainForm.cpp + +FORMS += $$PWD/CheckMainForm.ui diff --git a/frame/FramelessWindow.cpp b/frame/FramelessWindow.cpp index d323ae5..5727866 100644 --- a/frame/FramelessWindow.cpp +++ b/frame/FramelessWindow.cpp @@ -1,4 +1,8 @@ -#include "FramelessWindow.h" +#include +#include +#include + +#include "FramelessWindow.h" #ifdef Q_OS_WIN #include "windows.h" @@ -63,6 +67,12 @@ resizeEnable = false; } + if (!isMaximized()) { + QRect screenRect = QApplication::screens().at(0)->availableGeometry(); + resize(screenRect.width() * 0.9, screenRect.height() * 0.9); + move(QRandomGenerator::global()->bounded(10, 100), QRandomGenerator::global()->bounded(10, 50)); + } + //发出最大化最小化等改变事件,以便界面上更改对应的信息比如右上角图标和文字 Q_EMIT windowStateChange(!moveEnable); diff --git a/frame/MainWindowForm.cpp b/frame/MainWindowForm.cpp index cb98f69..0791c77 100644 --- a/frame/MainWindowForm.cpp +++ b/frame/MainWindowForm.cpp @@ -1,8 +1,6 @@ #include "MainWindowForm.h" #include "ui_MainWindowForm.h" -#include - MainWindowForm::MainWindowForm(QWidget *parent) : FramelessWindow(parent), ui(new Ui::MainWindowForm) @@ -18,8 +16,8 @@ connect(TimeCounterUtil::getInstance().clockTimer, &QTimer::timeout, this, &MainWindowForm::onUpdateTimestampHandler); TimeCounterUtil::getInstance().clockTimer->start(1000); - /** 临时调试代码 **/ - emit ui->btnInfomation->clicked(); + // 自动加载第一个页面 + emit ui->btnCalibration->clicked(); } MainWindowForm::~MainWindowForm() @@ -37,7 +35,7 @@ { setWindowFlags(Qt::FramelessWindowHint); // 设置全屏 setWindowState(Qt::WindowState::WindowMaximized); - this->setTitleBar(ui->wdgtTop); + // 设置窗口位置和大小 move(0, 0); @@ -46,42 +44,31 @@ qint16 screenHeight = screenRect.height(); resize(screenWidth, screenHeight); + // 设置标题栏 以绑定和触发鼠标双击事件 + this->setTitleBar(ui->wdgtTop); + connect(this, &MainWindowForm::titleDblClick, this, &MainWindowForm::titleDblClickHandler); + // 加载样式表 QString qssStyle = QssFileUtils::loadQssFileContent(":/qss/mainForm.css"); if (qssStyle.isEmpty() == false) { ui->wdgtTop->setStyleSheet(qssStyle); // 仅本窗口生效 + ui->wdgtContent->setStyleSheet("QWidget{background: #FFFFFF;}"); } - // 设置标题 + // 设置标题文字 ui->labelTitle->setText(SettingConfig::getInstance().CLIENT_TITLE); setWindowTitle(SettingConfig::getInstance().CLIENT_TITLE); - // 设置最小尺寸(宽度, 高度) lxc - QScreen *screen = QGuiApplication::primaryScreen(); - QRect screenSize = screen->availableGeometry(); // 可用区域(排除任务栏) - // 设置最小尺寸为屏幕宽度的 80%,高度 600 - int minWidth = screenSize.width() * 0.8; + int minWidth = screenWidth * 0.8; this->setMinimumSize(minWidth, 600); } void MainWindowForm::initMenuWidgets() { + wdgtCaliMain = new CalibrationMainForm(this); + wdgtCheckMain = new CheckMainForm(this); wdgtInfoMain = new InfoMainForm(this); -// wdgtInfo = new TF_InfoManag(this); -// wdgtCheckMethod = new CheckMethodManage(this); -// wdgtCheck = new CheckWindow(this); -// wdgtData = new TF_TextDataManag(this); -// wdgtCert = new TF_CertificateApproval(this); -// wdgtUserMan = new TF_UserManag(this); -// wdgtTestDev = new TF_TextDevice(this); -// wdgtStandDev = new tf_StandardDevice(this); - -// wdgtStdDevForm = new StandardDeviceForm(this); -// wdgtEqptDevForm = new TestDeviceForm(this); -// wdgtFileResForm = new FileResourcesForm(this); - -// wdgtCalibrationForm = new CalibrationForm(this); // 绑定事件 // connect(wdgtCalibrationForm, &CalibrationForm::enableMenuButtons, this, &MainWindowForm::onMenuButtonsEabled); @@ -89,18 +76,9 @@ // connect(wdgtCheck, &CheckWindow::BarsetEnabled, this, &MainWindowForm::onMenuButtonsEabled); // 添加到stackWidget中 + ui->wdgtContent->insertWidget(0, wdgtCaliMain); + ui->wdgtContent->insertWidget(1, wdgtCheckMain); ui->wdgtContent->insertWidget(2, wdgtInfoMain); -// ui->wdgtContent->insertWidget(0, wdgtCalibrationForm); -// ui->wdgtContent->insertWidget(1, wdgtStdDevForm); -// ui->wdgtContent->insertWidget(1, wdgtStandDev); -// ui->wdgtContent->insertWidget(2, wdgtTestDev); -// ui->wdgtContent->insertWidget(2, wdgtEqptDevForm); -// ui->wdgtContent->insertWidget(3, wdgtCheckMethod); -// ui->wdgtContent->insertWidget(4, wdgtCheck); -// ui->wdgtContent->insertWidget(5, wdgtData); -// ui->wdgtContent->insertWidget(6, wdgtCert); -// ui->wdgtContent->insertWidget(7, wdgtFileResForm); -// ui->wdgtContent->insertWidget(8, wdgtUserMan); } void MainWindowForm::initFunctionButtons() @@ -115,7 +93,6 @@ funcButtGroup->addButton(funcButt); connect(funcButt, &QToolButton::clicked, this, &MainWindowForm::onFunctionButtonsAction); } - connect(this, SIGNAL(titleDblClick()), this, SLOT(titleDblClick())); } void MainWindowForm::on_btnMinWin_clicked() @@ -125,17 +102,12 @@ 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(); + ui->btnMaxWin->setToolTip("最大化"); } else { - resize(screenSize.width(), screenSize.height()); - move(0, 0); this->showMaximized(); + ui->btnMaxWin->setToolTip("还原"); } } @@ -165,7 +137,7 @@ ui->labelTime->setText(now.toString("yyyy-MM-dd HH:mm:ss")); } -void MainWindowForm::titleDblClick() +void MainWindowForm::titleDblClickHandler() { on_btnMaxWin_clicked(); } diff --git a/frame/MainWindowForm.h b/frame/MainWindowForm.h index 9b4eae4..aa5330c 100644 --- a/frame/MainWindowForm.h +++ b/frame/MainWindowForm.h @@ -13,21 +13,8 @@ #include "frame/FramelessWindow.h" #include "infomation/InfoMainForm.h" - -//#include "infomation/standDev/StandardDeviceForm.h" -//#include "infomation/testDev/TestDeviceForm.h" -//#include "infomation/fileRes/FileResourcesForm.h" - -//#include "calibration/CalibrationForm.h" - -//#include "TimeFreq/tf_standarddevice.h" -//#include "TimeFreq/tf_certificateapproval.h" -//#include "TimeFreq/tf_infomanag.h" -//#include "TimeFreq/tf_textdatamanag.h" -//#include "TimeFreq/tf_textdevice.h" -//#include "TimeFreq/tf_usermanag.h" -//#include "checkmethodmanage.h" -//#include "checkwindow.h" +#include "calibration/CalibrationMainForm.h" +#include "check/CheckMainForm.h" namespace Ui { class MainWindowForm; @@ -50,29 +37,16 @@ void onFunctionButtonsAction(); void onUpdateTimestampHandler(); - void titleDblClick(); + void titleDblClickHandler(); void onMenuButtonsEabled(bool enable); private: Ui::MainWindowForm *ui; + CalibrationMainForm * wdgtCaliMain; + CheckMainForm * wdgtCheckMain; InfoMainForm * wdgtInfoMain; -// TF_InfoManag * wdgtInfo; -// CheckMethodManage * wdgtCheckMethod; -// CheckWindow * wdgtCheck; -// TF_TextDataManag * wdgtData; -// TF_CertificateApproval * wdgtCert; -// TF_UserManag * wdgtUserMan; -// tf_StandardDevice * wdgtStandDev; -// TF_TextDevice * wdgtTestDev; - -// StandardDeviceForm * wdgtStdDevForm; -// TestDeviceForm * wdgtEqptDevForm; -// FileResourcesForm * wdgtFileResForm; - -// CalibrationForm * wdgtCalibrationForm; - void initForm(); void initMenuWidgets(); void initFunctionButtons(); diff --git a/frame/MainWindowForm.ui b/frame/MainWindowForm.ui index d3fd4fe..e0638e1 100644 --- a/frame/MainWindowForm.ui +++ b/frame/MainWindowForm.ui @@ -271,6 +271,18 @@ + + + 0 + 0 + + + + + 240 + 0 + + 240 @@ -295,6 +307,18 @@ + + + 0 + 0 + + + + + 0 + 40 + + @@ -392,6 +416,18 @@ + + + 0 + 0 + + + + + 240 + 0 + + 240 @@ -422,6 +458,12 @@ 0 + + + 0 + 40 + + 5 @@ -459,6 +501,9 @@ 24 + + 设置 + @@ -509,7 +554,7 @@ - 最小化 + 还原 diff --git a/infomation/task/DeptTaskForm.cpp b/infomation/task/DeptTaskForm.cpp index 208973c..b7d771b 100644 --- a/infomation/task/DeptTaskForm.cpp +++ b/infomation/task/DeptTaskForm.cpp @@ -33,7 +33,7 @@ void DeptTaskForm::initForm() { // 加载样式表 - QString qssStyle = QssFileUtils::loadQssFileContent(QApplication::applicationDirPath() + "/qss/infoTable.css"); + QString qssStyle = QssFileUtils::loadQssFileContent(":/qss/infoTable.css"); if (qssStyle.isEmpty() == false) { this->setStyleSheet(qssStyle); // 仅本窗口生效 } diff --git a/res/image/main/calibration.png b/res/image/main/calibration.png deleted file mode 100644 index 9d6de19..0000000 --- a/res/image/main/calibration.png +++ /dev/null Binary files differ diff --git a/res/image/main/certApproval.png b/res/image/main/certApproval.png deleted file mode 100644 index 45147a6..0000000 --- a/res/image/main/certApproval.png +++ /dev/null Binary files differ diff --git a/res/image/main/checkDevice.png b/res/image/main/checkDevice.png deleted file mode 100644 index 3e9307a..0000000 --- a/res/image/main/checkDevice.png +++ /dev/null Binary files differ diff --git a/res/image/main/checkProgram.png b/res/image/main/checkProgram.png deleted file mode 100644 index e75ef50..0000000 --- a/res/image/main/checkProgram.png +++ /dev/null Binary files differ diff --git a/res/image/main/fileRes.png b/res/image/main/fileRes.png deleted file mode 100644 index 99b9b45..0000000 --- a/res/image/main/fileRes.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_menu_calibration.png b/res/image/main/icon_menu_calibration.png index 6fca8be..cbc7bfc 100644 --- a/res/image/main/icon_menu_calibration.png +++ 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 index 17f918f..3f140c6 100644 --- a/res/image/main/icon_menu_calibration_selected.png +++ 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 index c3db5fa..0a714a4 100644 --- a/res/image/main/icon_menu_check.png +++ b/res/image/main/icon_menu_check.png Binary files differ diff --git a/calibration/CalibrationMainForm.cpp b/calibration/CalibrationMainForm.cpp new file mode 100644 index 0000000..9b778a5 --- /dev/null +++ b/calibration/CalibrationMainForm.cpp @@ -0,0 +1,14 @@ +#include "CalibrationMainForm.h" +#include "ui_CalibrationMainForm.h" + +CalibrationMainForm::CalibrationMainForm(QWidget *parent) : + QWidget(parent), + ui(new Ui::CalibrationMainForm) +{ + ui->setupUi(this); +} + +CalibrationMainForm::~CalibrationMainForm() +{ + delete ui; +} diff --git a/calibration/CalibrationMainForm.h b/calibration/CalibrationMainForm.h new file mode 100644 index 0000000..7d75014 --- /dev/null +++ b/calibration/CalibrationMainForm.h @@ -0,0 +1,22 @@ +#ifndef CALIBRATIONMAINFORM_H +#define CALIBRATIONMAINFORM_H + +#include + +namespace Ui { +class CalibrationMainForm; +} + +class CalibrationMainForm : public QWidget +{ + Q_OBJECT + +public: + explicit CalibrationMainForm(QWidget *parent = nullptr); + ~CalibrationMainForm(); + +private: + Ui::CalibrationMainForm *ui; +}; + +#endif // CALIBRATIONMAINFORM_H diff --git a/calibration/CalibrationMainForm.ui b/calibration/CalibrationMainForm.ui new file mode 100644 index 0000000..9b5a9c2 --- /dev/null +++ b/calibration/CalibrationMainForm.ui @@ -0,0 +1,21 @@ + + + + + CalibrationMainForm + + + + 0 + 0 + 400 + 300 + + + + Form + + + + + diff --git a/calibration/calibration.pri b/calibration/calibration.pri index e69de29..f0e9dfb 100644 --- a/calibration/calibration.pri +++ b/calibration/calibration.pri @@ -0,0 +1,4 @@ +HEADERS += $$PWD/CalibrationMainForm.h +SOURCES += $$PWD/CalibrationMainForm.cpp + +FORMS += $$PWD/CalibrationMainForm.ui diff --git a/check/CheckMainForm.cpp b/check/CheckMainForm.cpp new file mode 100644 index 0000000..1725277 --- /dev/null +++ b/check/CheckMainForm.cpp @@ -0,0 +1,14 @@ +#include "CheckMainForm.h" +#include "ui_CheckMainForm.h" + +CheckMainForm::CheckMainForm(QWidget *parent) : + QWidget(parent), + ui(new Ui::CheckMainForm) +{ + ui->setupUi(this); +} + +CheckMainForm::~CheckMainForm() +{ + delete ui; +} diff --git a/check/CheckMainForm.h b/check/CheckMainForm.h new file mode 100644 index 0000000..c71001e --- /dev/null +++ b/check/CheckMainForm.h @@ -0,0 +1,22 @@ +#ifndef CHECKMAINFORM_H +#define CHECKMAINFORM_H + +#include + +namespace Ui { +class CheckMainForm; +} + +class CheckMainForm : public QWidget +{ + Q_OBJECT + +public: + explicit CheckMainForm(QWidget *parent = nullptr); + ~CheckMainForm(); + +private: + Ui::CheckMainForm *ui; +}; + +#endif // CHECKMAINFORM_H diff --git a/check/CheckMainForm.ui b/check/CheckMainForm.ui new file mode 100644 index 0000000..76ca74d --- /dev/null +++ b/check/CheckMainForm.ui @@ -0,0 +1,21 @@ + + + + + CheckMainForm + + + + 0 + 0 + 400 + 300 + + + + Form + + + + + diff --git a/check/check.pri b/check/check.pri index e69de29..624bd3f 100644 --- a/check/check.pri +++ b/check/check.pri @@ -0,0 +1,4 @@ +HEADERS += $$PWD/CheckMainForm.h +SOURCES += $$PWD/CheckMainForm.cpp + +FORMS += $$PWD/CheckMainForm.ui diff --git a/frame/FramelessWindow.cpp b/frame/FramelessWindow.cpp index d323ae5..5727866 100644 --- a/frame/FramelessWindow.cpp +++ b/frame/FramelessWindow.cpp @@ -1,4 +1,8 @@ -#include "FramelessWindow.h" +#include +#include +#include + +#include "FramelessWindow.h" #ifdef Q_OS_WIN #include "windows.h" @@ -63,6 +67,12 @@ resizeEnable = false; } + if (!isMaximized()) { + QRect screenRect = QApplication::screens().at(0)->availableGeometry(); + resize(screenRect.width() * 0.9, screenRect.height() * 0.9); + move(QRandomGenerator::global()->bounded(10, 100), QRandomGenerator::global()->bounded(10, 50)); + } + //发出最大化最小化等改变事件,以便界面上更改对应的信息比如右上角图标和文字 Q_EMIT windowStateChange(!moveEnable); diff --git a/frame/MainWindowForm.cpp b/frame/MainWindowForm.cpp index cb98f69..0791c77 100644 --- a/frame/MainWindowForm.cpp +++ b/frame/MainWindowForm.cpp @@ -1,8 +1,6 @@ #include "MainWindowForm.h" #include "ui_MainWindowForm.h" -#include - MainWindowForm::MainWindowForm(QWidget *parent) : FramelessWindow(parent), ui(new Ui::MainWindowForm) @@ -18,8 +16,8 @@ connect(TimeCounterUtil::getInstance().clockTimer, &QTimer::timeout, this, &MainWindowForm::onUpdateTimestampHandler); TimeCounterUtil::getInstance().clockTimer->start(1000); - /** 临时调试代码 **/ - emit ui->btnInfomation->clicked(); + // 自动加载第一个页面 + emit ui->btnCalibration->clicked(); } MainWindowForm::~MainWindowForm() @@ -37,7 +35,7 @@ { setWindowFlags(Qt::FramelessWindowHint); // 设置全屏 setWindowState(Qt::WindowState::WindowMaximized); - this->setTitleBar(ui->wdgtTop); + // 设置窗口位置和大小 move(0, 0); @@ -46,42 +44,31 @@ qint16 screenHeight = screenRect.height(); resize(screenWidth, screenHeight); + // 设置标题栏 以绑定和触发鼠标双击事件 + this->setTitleBar(ui->wdgtTop); + connect(this, &MainWindowForm::titleDblClick, this, &MainWindowForm::titleDblClickHandler); + // 加载样式表 QString qssStyle = QssFileUtils::loadQssFileContent(":/qss/mainForm.css"); if (qssStyle.isEmpty() == false) { ui->wdgtTop->setStyleSheet(qssStyle); // 仅本窗口生效 + ui->wdgtContent->setStyleSheet("QWidget{background: #FFFFFF;}"); } - // 设置标题 + // 设置标题文字 ui->labelTitle->setText(SettingConfig::getInstance().CLIENT_TITLE); setWindowTitle(SettingConfig::getInstance().CLIENT_TITLE); - // 设置最小尺寸(宽度, 高度) lxc - QScreen *screen = QGuiApplication::primaryScreen(); - QRect screenSize = screen->availableGeometry(); // 可用区域(排除任务栏) - // 设置最小尺寸为屏幕宽度的 80%,高度 600 - int minWidth = screenSize.width() * 0.8; + int minWidth = screenWidth * 0.8; this->setMinimumSize(minWidth, 600); } void MainWindowForm::initMenuWidgets() { + wdgtCaliMain = new CalibrationMainForm(this); + wdgtCheckMain = new CheckMainForm(this); wdgtInfoMain = new InfoMainForm(this); -// wdgtInfo = new TF_InfoManag(this); -// wdgtCheckMethod = new CheckMethodManage(this); -// wdgtCheck = new CheckWindow(this); -// wdgtData = new TF_TextDataManag(this); -// wdgtCert = new TF_CertificateApproval(this); -// wdgtUserMan = new TF_UserManag(this); -// wdgtTestDev = new TF_TextDevice(this); -// wdgtStandDev = new tf_StandardDevice(this); - -// wdgtStdDevForm = new StandardDeviceForm(this); -// wdgtEqptDevForm = new TestDeviceForm(this); -// wdgtFileResForm = new FileResourcesForm(this); - -// wdgtCalibrationForm = new CalibrationForm(this); // 绑定事件 // connect(wdgtCalibrationForm, &CalibrationForm::enableMenuButtons, this, &MainWindowForm::onMenuButtonsEabled); @@ -89,18 +76,9 @@ // connect(wdgtCheck, &CheckWindow::BarsetEnabled, this, &MainWindowForm::onMenuButtonsEabled); // 添加到stackWidget中 + ui->wdgtContent->insertWidget(0, wdgtCaliMain); + ui->wdgtContent->insertWidget(1, wdgtCheckMain); ui->wdgtContent->insertWidget(2, wdgtInfoMain); -// ui->wdgtContent->insertWidget(0, wdgtCalibrationForm); -// ui->wdgtContent->insertWidget(1, wdgtStdDevForm); -// ui->wdgtContent->insertWidget(1, wdgtStandDev); -// ui->wdgtContent->insertWidget(2, wdgtTestDev); -// ui->wdgtContent->insertWidget(2, wdgtEqptDevForm); -// ui->wdgtContent->insertWidget(3, wdgtCheckMethod); -// ui->wdgtContent->insertWidget(4, wdgtCheck); -// ui->wdgtContent->insertWidget(5, wdgtData); -// ui->wdgtContent->insertWidget(6, wdgtCert); -// ui->wdgtContent->insertWidget(7, wdgtFileResForm); -// ui->wdgtContent->insertWidget(8, wdgtUserMan); } void MainWindowForm::initFunctionButtons() @@ -115,7 +93,6 @@ funcButtGroup->addButton(funcButt); connect(funcButt, &QToolButton::clicked, this, &MainWindowForm::onFunctionButtonsAction); } - connect(this, SIGNAL(titleDblClick()), this, SLOT(titleDblClick())); } void MainWindowForm::on_btnMinWin_clicked() @@ -125,17 +102,12 @@ 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(); + ui->btnMaxWin->setToolTip("最大化"); } else { - resize(screenSize.width(), screenSize.height()); - move(0, 0); this->showMaximized(); + ui->btnMaxWin->setToolTip("还原"); } } @@ -165,7 +137,7 @@ ui->labelTime->setText(now.toString("yyyy-MM-dd HH:mm:ss")); } -void MainWindowForm::titleDblClick() +void MainWindowForm::titleDblClickHandler() { on_btnMaxWin_clicked(); } diff --git a/frame/MainWindowForm.h b/frame/MainWindowForm.h index 9b4eae4..aa5330c 100644 --- a/frame/MainWindowForm.h +++ b/frame/MainWindowForm.h @@ -13,21 +13,8 @@ #include "frame/FramelessWindow.h" #include "infomation/InfoMainForm.h" - -//#include "infomation/standDev/StandardDeviceForm.h" -//#include "infomation/testDev/TestDeviceForm.h" -//#include "infomation/fileRes/FileResourcesForm.h" - -//#include "calibration/CalibrationForm.h" - -//#include "TimeFreq/tf_standarddevice.h" -//#include "TimeFreq/tf_certificateapproval.h" -//#include "TimeFreq/tf_infomanag.h" -//#include "TimeFreq/tf_textdatamanag.h" -//#include "TimeFreq/tf_textdevice.h" -//#include "TimeFreq/tf_usermanag.h" -//#include "checkmethodmanage.h" -//#include "checkwindow.h" +#include "calibration/CalibrationMainForm.h" +#include "check/CheckMainForm.h" namespace Ui { class MainWindowForm; @@ -50,29 +37,16 @@ void onFunctionButtonsAction(); void onUpdateTimestampHandler(); - void titleDblClick(); + void titleDblClickHandler(); void onMenuButtonsEabled(bool enable); private: Ui::MainWindowForm *ui; + CalibrationMainForm * wdgtCaliMain; + CheckMainForm * wdgtCheckMain; InfoMainForm * wdgtInfoMain; -// TF_InfoManag * wdgtInfo; -// CheckMethodManage * wdgtCheckMethod; -// CheckWindow * wdgtCheck; -// TF_TextDataManag * wdgtData; -// TF_CertificateApproval * wdgtCert; -// TF_UserManag * wdgtUserMan; -// tf_StandardDevice * wdgtStandDev; -// TF_TextDevice * wdgtTestDev; - -// StandardDeviceForm * wdgtStdDevForm; -// TestDeviceForm * wdgtEqptDevForm; -// FileResourcesForm * wdgtFileResForm; - -// CalibrationForm * wdgtCalibrationForm; - void initForm(); void initMenuWidgets(); void initFunctionButtons(); diff --git a/frame/MainWindowForm.ui b/frame/MainWindowForm.ui index d3fd4fe..e0638e1 100644 --- a/frame/MainWindowForm.ui +++ b/frame/MainWindowForm.ui @@ -271,6 +271,18 @@ + + + 0 + 0 + + + + + 240 + 0 + + 240 @@ -295,6 +307,18 @@ + + + 0 + 0 + + + + + 0 + 40 + + @@ -392,6 +416,18 @@ + + + 0 + 0 + + + + + 240 + 0 + + 240 @@ -422,6 +458,12 @@ 0 + + + 0 + 40 + + 5 @@ -459,6 +501,9 @@ 24 + + 设置 + @@ -509,7 +554,7 @@ - 最小化 + 还原 diff --git a/infomation/task/DeptTaskForm.cpp b/infomation/task/DeptTaskForm.cpp index 208973c..b7d771b 100644 --- a/infomation/task/DeptTaskForm.cpp +++ b/infomation/task/DeptTaskForm.cpp @@ -33,7 +33,7 @@ void DeptTaskForm::initForm() { // 加载样式表 - QString qssStyle = QssFileUtils::loadQssFileContent(QApplication::applicationDirPath() + "/qss/infoTable.css"); + QString qssStyle = QssFileUtils::loadQssFileContent(":/qss/infoTable.css"); if (qssStyle.isEmpty() == false) { this->setStyleSheet(qssStyle); // 仅本窗口生效 } diff --git a/res/image/main/calibration.png b/res/image/main/calibration.png deleted file mode 100644 index 9d6de19..0000000 --- a/res/image/main/calibration.png +++ /dev/null Binary files differ diff --git a/res/image/main/certApproval.png b/res/image/main/certApproval.png deleted file mode 100644 index 45147a6..0000000 --- a/res/image/main/certApproval.png +++ /dev/null Binary files differ diff --git a/res/image/main/checkDevice.png b/res/image/main/checkDevice.png deleted file mode 100644 index 3e9307a..0000000 --- a/res/image/main/checkDevice.png +++ /dev/null Binary files differ diff --git a/res/image/main/checkProgram.png b/res/image/main/checkProgram.png deleted file mode 100644 index e75ef50..0000000 --- a/res/image/main/checkProgram.png +++ /dev/null Binary files differ diff --git a/res/image/main/fileRes.png b/res/image/main/fileRes.png deleted file mode 100644 index 99b9b45..0000000 --- a/res/image/main/fileRes.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_menu_calibration.png b/res/image/main/icon_menu_calibration.png index 6fca8be..cbc7bfc 100644 --- a/res/image/main/icon_menu_calibration.png +++ 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 index 17f918f..3f140c6 100644 --- a/res/image/main/icon_menu_calibration_selected.png +++ 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 index c3db5fa..0a714a4 100644 --- a/res/image/main/icon_menu_check.png +++ 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 index 9794c43..9546177 100644 --- a/res/image/main/icon_menu_check_selected.png +++ b/res/image/main/icon_menu_check_selected.png Binary files differ diff --git a/calibration/CalibrationMainForm.cpp b/calibration/CalibrationMainForm.cpp new file mode 100644 index 0000000..9b778a5 --- /dev/null +++ b/calibration/CalibrationMainForm.cpp @@ -0,0 +1,14 @@ +#include "CalibrationMainForm.h" +#include "ui_CalibrationMainForm.h" + +CalibrationMainForm::CalibrationMainForm(QWidget *parent) : + QWidget(parent), + ui(new Ui::CalibrationMainForm) +{ + ui->setupUi(this); +} + +CalibrationMainForm::~CalibrationMainForm() +{ + delete ui; +} diff --git a/calibration/CalibrationMainForm.h b/calibration/CalibrationMainForm.h new file mode 100644 index 0000000..7d75014 --- /dev/null +++ b/calibration/CalibrationMainForm.h @@ -0,0 +1,22 @@ +#ifndef CALIBRATIONMAINFORM_H +#define CALIBRATIONMAINFORM_H + +#include + +namespace Ui { +class CalibrationMainForm; +} + +class CalibrationMainForm : public QWidget +{ + Q_OBJECT + +public: + explicit CalibrationMainForm(QWidget *parent = nullptr); + ~CalibrationMainForm(); + +private: + Ui::CalibrationMainForm *ui; +}; + +#endif // CALIBRATIONMAINFORM_H diff --git a/calibration/CalibrationMainForm.ui b/calibration/CalibrationMainForm.ui new file mode 100644 index 0000000..9b5a9c2 --- /dev/null +++ b/calibration/CalibrationMainForm.ui @@ -0,0 +1,21 @@ + + + + + CalibrationMainForm + + + + 0 + 0 + 400 + 300 + + + + Form + + + + + diff --git a/calibration/calibration.pri b/calibration/calibration.pri index e69de29..f0e9dfb 100644 --- a/calibration/calibration.pri +++ b/calibration/calibration.pri @@ -0,0 +1,4 @@ +HEADERS += $$PWD/CalibrationMainForm.h +SOURCES += $$PWD/CalibrationMainForm.cpp + +FORMS += $$PWD/CalibrationMainForm.ui diff --git a/check/CheckMainForm.cpp b/check/CheckMainForm.cpp new file mode 100644 index 0000000..1725277 --- /dev/null +++ b/check/CheckMainForm.cpp @@ -0,0 +1,14 @@ +#include "CheckMainForm.h" +#include "ui_CheckMainForm.h" + +CheckMainForm::CheckMainForm(QWidget *parent) : + QWidget(parent), + ui(new Ui::CheckMainForm) +{ + ui->setupUi(this); +} + +CheckMainForm::~CheckMainForm() +{ + delete ui; +} diff --git a/check/CheckMainForm.h b/check/CheckMainForm.h new file mode 100644 index 0000000..c71001e --- /dev/null +++ b/check/CheckMainForm.h @@ -0,0 +1,22 @@ +#ifndef CHECKMAINFORM_H +#define CHECKMAINFORM_H + +#include + +namespace Ui { +class CheckMainForm; +} + +class CheckMainForm : public QWidget +{ + Q_OBJECT + +public: + explicit CheckMainForm(QWidget *parent = nullptr); + ~CheckMainForm(); + +private: + Ui::CheckMainForm *ui; +}; + +#endif // CHECKMAINFORM_H diff --git a/check/CheckMainForm.ui b/check/CheckMainForm.ui new file mode 100644 index 0000000..76ca74d --- /dev/null +++ b/check/CheckMainForm.ui @@ -0,0 +1,21 @@ + + + + + CheckMainForm + + + + 0 + 0 + 400 + 300 + + + + Form + + + + + diff --git a/check/check.pri b/check/check.pri index e69de29..624bd3f 100644 --- a/check/check.pri +++ b/check/check.pri @@ -0,0 +1,4 @@ +HEADERS += $$PWD/CheckMainForm.h +SOURCES += $$PWD/CheckMainForm.cpp + +FORMS += $$PWD/CheckMainForm.ui diff --git a/frame/FramelessWindow.cpp b/frame/FramelessWindow.cpp index d323ae5..5727866 100644 --- a/frame/FramelessWindow.cpp +++ b/frame/FramelessWindow.cpp @@ -1,4 +1,8 @@ -#include "FramelessWindow.h" +#include +#include +#include + +#include "FramelessWindow.h" #ifdef Q_OS_WIN #include "windows.h" @@ -63,6 +67,12 @@ resizeEnable = false; } + if (!isMaximized()) { + QRect screenRect = QApplication::screens().at(0)->availableGeometry(); + resize(screenRect.width() * 0.9, screenRect.height() * 0.9); + move(QRandomGenerator::global()->bounded(10, 100), QRandomGenerator::global()->bounded(10, 50)); + } + //发出最大化最小化等改变事件,以便界面上更改对应的信息比如右上角图标和文字 Q_EMIT windowStateChange(!moveEnable); diff --git a/frame/MainWindowForm.cpp b/frame/MainWindowForm.cpp index cb98f69..0791c77 100644 --- a/frame/MainWindowForm.cpp +++ b/frame/MainWindowForm.cpp @@ -1,8 +1,6 @@ #include "MainWindowForm.h" #include "ui_MainWindowForm.h" -#include - MainWindowForm::MainWindowForm(QWidget *parent) : FramelessWindow(parent), ui(new Ui::MainWindowForm) @@ -18,8 +16,8 @@ connect(TimeCounterUtil::getInstance().clockTimer, &QTimer::timeout, this, &MainWindowForm::onUpdateTimestampHandler); TimeCounterUtil::getInstance().clockTimer->start(1000); - /** 临时调试代码 **/ - emit ui->btnInfomation->clicked(); + // 自动加载第一个页面 + emit ui->btnCalibration->clicked(); } MainWindowForm::~MainWindowForm() @@ -37,7 +35,7 @@ { setWindowFlags(Qt::FramelessWindowHint); // 设置全屏 setWindowState(Qt::WindowState::WindowMaximized); - this->setTitleBar(ui->wdgtTop); + // 设置窗口位置和大小 move(0, 0); @@ -46,42 +44,31 @@ qint16 screenHeight = screenRect.height(); resize(screenWidth, screenHeight); + // 设置标题栏 以绑定和触发鼠标双击事件 + this->setTitleBar(ui->wdgtTop); + connect(this, &MainWindowForm::titleDblClick, this, &MainWindowForm::titleDblClickHandler); + // 加载样式表 QString qssStyle = QssFileUtils::loadQssFileContent(":/qss/mainForm.css"); if (qssStyle.isEmpty() == false) { ui->wdgtTop->setStyleSheet(qssStyle); // 仅本窗口生效 + ui->wdgtContent->setStyleSheet("QWidget{background: #FFFFFF;}"); } - // 设置标题 + // 设置标题文字 ui->labelTitle->setText(SettingConfig::getInstance().CLIENT_TITLE); setWindowTitle(SettingConfig::getInstance().CLIENT_TITLE); - // 设置最小尺寸(宽度, 高度) lxc - QScreen *screen = QGuiApplication::primaryScreen(); - QRect screenSize = screen->availableGeometry(); // 可用区域(排除任务栏) - // 设置最小尺寸为屏幕宽度的 80%,高度 600 - int minWidth = screenSize.width() * 0.8; + int minWidth = screenWidth * 0.8; this->setMinimumSize(minWidth, 600); } void MainWindowForm::initMenuWidgets() { + wdgtCaliMain = new CalibrationMainForm(this); + wdgtCheckMain = new CheckMainForm(this); wdgtInfoMain = new InfoMainForm(this); -// wdgtInfo = new TF_InfoManag(this); -// wdgtCheckMethod = new CheckMethodManage(this); -// wdgtCheck = new CheckWindow(this); -// wdgtData = new TF_TextDataManag(this); -// wdgtCert = new TF_CertificateApproval(this); -// wdgtUserMan = new TF_UserManag(this); -// wdgtTestDev = new TF_TextDevice(this); -// wdgtStandDev = new tf_StandardDevice(this); - -// wdgtStdDevForm = new StandardDeviceForm(this); -// wdgtEqptDevForm = new TestDeviceForm(this); -// wdgtFileResForm = new FileResourcesForm(this); - -// wdgtCalibrationForm = new CalibrationForm(this); // 绑定事件 // connect(wdgtCalibrationForm, &CalibrationForm::enableMenuButtons, this, &MainWindowForm::onMenuButtonsEabled); @@ -89,18 +76,9 @@ // connect(wdgtCheck, &CheckWindow::BarsetEnabled, this, &MainWindowForm::onMenuButtonsEabled); // 添加到stackWidget中 + ui->wdgtContent->insertWidget(0, wdgtCaliMain); + ui->wdgtContent->insertWidget(1, wdgtCheckMain); ui->wdgtContent->insertWidget(2, wdgtInfoMain); -// ui->wdgtContent->insertWidget(0, wdgtCalibrationForm); -// ui->wdgtContent->insertWidget(1, wdgtStdDevForm); -// ui->wdgtContent->insertWidget(1, wdgtStandDev); -// ui->wdgtContent->insertWidget(2, wdgtTestDev); -// ui->wdgtContent->insertWidget(2, wdgtEqptDevForm); -// ui->wdgtContent->insertWidget(3, wdgtCheckMethod); -// ui->wdgtContent->insertWidget(4, wdgtCheck); -// ui->wdgtContent->insertWidget(5, wdgtData); -// ui->wdgtContent->insertWidget(6, wdgtCert); -// ui->wdgtContent->insertWidget(7, wdgtFileResForm); -// ui->wdgtContent->insertWidget(8, wdgtUserMan); } void MainWindowForm::initFunctionButtons() @@ -115,7 +93,6 @@ funcButtGroup->addButton(funcButt); connect(funcButt, &QToolButton::clicked, this, &MainWindowForm::onFunctionButtonsAction); } - connect(this, SIGNAL(titleDblClick()), this, SLOT(titleDblClick())); } void MainWindowForm::on_btnMinWin_clicked() @@ -125,17 +102,12 @@ 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(); + ui->btnMaxWin->setToolTip("最大化"); } else { - resize(screenSize.width(), screenSize.height()); - move(0, 0); this->showMaximized(); + ui->btnMaxWin->setToolTip("还原"); } } @@ -165,7 +137,7 @@ ui->labelTime->setText(now.toString("yyyy-MM-dd HH:mm:ss")); } -void MainWindowForm::titleDblClick() +void MainWindowForm::titleDblClickHandler() { on_btnMaxWin_clicked(); } diff --git a/frame/MainWindowForm.h b/frame/MainWindowForm.h index 9b4eae4..aa5330c 100644 --- a/frame/MainWindowForm.h +++ b/frame/MainWindowForm.h @@ -13,21 +13,8 @@ #include "frame/FramelessWindow.h" #include "infomation/InfoMainForm.h" - -//#include "infomation/standDev/StandardDeviceForm.h" -//#include "infomation/testDev/TestDeviceForm.h" -//#include "infomation/fileRes/FileResourcesForm.h" - -//#include "calibration/CalibrationForm.h" - -//#include "TimeFreq/tf_standarddevice.h" -//#include "TimeFreq/tf_certificateapproval.h" -//#include "TimeFreq/tf_infomanag.h" -//#include "TimeFreq/tf_textdatamanag.h" -//#include "TimeFreq/tf_textdevice.h" -//#include "TimeFreq/tf_usermanag.h" -//#include "checkmethodmanage.h" -//#include "checkwindow.h" +#include "calibration/CalibrationMainForm.h" +#include "check/CheckMainForm.h" namespace Ui { class MainWindowForm; @@ -50,29 +37,16 @@ void onFunctionButtonsAction(); void onUpdateTimestampHandler(); - void titleDblClick(); + void titleDblClickHandler(); void onMenuButtonsEabled(bool enable); private: Ui::MainWindowForm *ui; + CalibrationMainForm * wdgtCaliMain; + CheckMainForm * wdgtCheckMain; InfoMainForm * wdgtInfoMain; -// TF_InfoManag * wdgtInfo; -// CheckMethodManage * wdgtCheckMethod; -// CheckWindow * wdgtCheck; -// TF_TextDataManag * wdgtData; -// TF_CertificateApproval * wdgtCert; -// TF_UserManag * wdgtUserMan; -// tf_StandardDevice * wdgtStandDev; -// TF_TextDevice * wdgtTestDev; - -// StandardDeviceForm * wdgtStdDevForm; -// TestDeviceForm * wdgtEqptDevForm; -// FileResourcesForm * wdgtFileResForm; - -// CalibrationForm * wdgtCalibrationForm; - void initForm(); void initMenuWidgets(); void initFunctionButtons(); diff --git a/frame/MainWindowForm.ui b/frame/MainWindowForm.ui index d3fd4fe..e0638e1 100644 --- a/frame/MainWindowForm.ui +++ b/frame/MainWindowForm.ui @@ -271,6 +271,18 @@ + + + 0 + 0 + + + + + 240 + 0 + + 240 @@ -295,6 +307,18 @@ + + + 0 + 0 + + + + + 0 + 40 + + @@ -392,6 +416,18 @@ + + + 0 + 0 + + + + + 240 + 0 + + 240 @@ -422,6 +458,12 @@ 0 + + + 0 + 40 + + 5 @@ -459,6 +501,9 @@ 24 + + 设置 + @@ -509,7 +554,7 @@ - 最小化 + 还原 diff --git a/infomation/task/DeptTaskForm.cpp b/infomation/task/DeptTaskForm.cpp index 208973c..b7d771b 100644 --- a/infomation/task/DeptTaskForm.cpp +++ b/infomation/task/DeptTaskForm.cpp @@ -33,7 +33,7 @@ void DeptTaskForm::initForm() { // 加载样式表 - QString qssStyle = QssFileUtils::loadQssFileContent(QApplication::applicationDirPath() + "/qss/infoTable.css"); + QString qssStyle = QssFileUtils::loadQssFileContent(":/qss/infoTable.css"); if (qssStyle.isEmpty() == false) { this->setStyleSheet(qssStyle); // 仅本窗口生效 } diff --git a/res/image/main/calibration.png b/res/image/main/calibration.png deleted file mode 100644 index 9d6de19..0000000 --- a/res/image/main/calibration.png +++ /dev/null Binary files differ diff --git a/res/image/main/certApproval.png b/res/image/main/certApproval.png deleted file mode 100644 index 45147a6..0000000 --- a/res/image/main/certApproval.png +++ /dev/null Binary files differ diff --git a/res/image/main/checkDevice.png b/res/image/main/checkDevice.png deleted file mode 100644 index 3e9307a..0000000 --- a/res/image/main/checkDevice.png +++ /dev/null Binary files differ diff --git a/res/image/main/checkProgram.png b/res/image/main/checkProgram.png deleted file mode 100644 index e75ef50..0000000 --- a/res/image/main/checkProgram.png +++ /dev/null Binary files differ diff --git a/res/image/main/fileRes.png b/res/image/main/fileRes.png deleted file mode 100644 index 99b9b45..0000000 --- a/res/image/main/fileRes.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_menu_calibration.png b/res/image/main/icon_menu_calibration.png index 6fca8be..cbc7bfc 100644 --- a/res/image/main/icon_menu_calibration.png +++ 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 index 17f918f..3f140c6 100644 --- a/res/image/main/icon_menu_calibration_selected.png +++ 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 index c3db5fa..0a714a4 100644 --- a/res/image/main/icon_menu_check.png +++ 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 index 9794c43..9546177 100644 --- a/res/image/main/icon_menu_check_selected.png +++ 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 index e272f4c..73f2a24 100644 --- a/res/image/main/icon_menu_infomation.png +++ b/res/image/main/icon_menu_infomation.png Binary files differ diff --git a/calibration/CalibrationMainForm.cpp b/calibration/CalibrationMainForm.cpp new file mode 100644 index 0000000..9b778a5 --- /dev/null +++ b/calibration/CalibrationMainForm.cpp @@ -0,0 +1,14 @@ +#include "CalibrationMainForm.h" +#include "ui_CalibrationMainForm.h" + +CalibrationMainForm::CalibrationMainForm(QWidget *parent) : + QWidget(parent), + ui(new Ui::CalibrationMainForm) +{ + ui->setupUi(this); +} + +CalibrationMainForm::~CalibrationMainForm() +{ + delete ui; +} diff --git a/calibration/CalibrationMainForm.h b/calibration/CalibrationMainForm.h new file mode 100644 index 0000000..7d75014 --- /dev/null +++ b/calibration/CalibrationMainForm.h @@ -0,0 +1,22 @@ +#ifndef CALIBRATIONMAINFORM_H +#define CALIBRATIONMAINFORM_H + +#include + +namespace Ui { +class CalibrationMainForm; +} + +class CalibrationMainForm : public QWidget +{ + Q_OBJECT + +public: + explicit CalibrationMainForm(QWidget *parent = nullptr); + ~CalibrationMainForm(); + +private: + Ui::CalibrationMainForm *ui; +}; + +#endif // CALIBRATIONMAINFORM_H diff --git a/calibration/CalibrationMainForm.ui b/calibration/CalibrationMainForm.ui new file mode 100644 index 0000000..9b5a9c2 --- /dev/null +++ b/calibration/CalibrationMainForm.ui @@ -0,0 +1,21 @@ + + + + + CalibrationMainForm + + + + 0 + 0 + 400 + 300 + + + + Form + + + + + diff --git a/calibration/calibration.pri b/calibration/calibration.pri index e69de29..f0e9dfb 100644 --- a/calibration/calibration.pri +++ b/calibration/calibration.pri @@ -0,0 +1,4 @@ +HEADERS += $$PWD/CalibrationMainForm.h +SOURCES += $$PWD/CalibrationMainForm.cpp + +FORMS += $$PWD/CalibrationMainForm.ui diff --git a/check/CheckMainForm.cpp b/check/CheckMainForm.cpp new file mode 100644 index 0000000..1725277 --- /dev/null +++ b/check/CheckMainForm.cpp @@ -0,0 +1,14 @@ +#include "CheckMainForm.h" +#include "ui_CheckMainForm.h" + +CheckMainForm::CheckMainForm(QWidget *parent) : + QWidget(parent), + ui(new Ui::CheckMainForm) +{ + ui->setupUi(this); +} + +CheckMainForm::~CheckMainForm() +{ + delete ui; +} diff --git a/check/CheckMainForm.h b/check/CheckMainForm.h new file mode 100644 index 0000000..c71001e --- /dev/null +++ b/check/CheckMainForm.h @@ -0,0 +1,22 @@ +#ifndef CHECKMAINFORM_H +#define CHECKMAINFORM_H + +#include + +namespace Ui { +class CheckMainForm; +} + +class CheckMainForm : public QWidget +{ + Q_OBJECT + +public: + explicit CheckMainForm(QWidget *parent = nullptr); + ~CheckMainForm(); + +private: + Ui::CheckMainForm *ui; +}; + +#endif // CHECKMAINFORM_H diff --git a/check/CheckMainForm.ui b/check/CheckMainForm.ui new file mode 100644 index 0000000..76ca74d --- /dev/null +++ b/check/CheckMainForm.ui @@ -0,0 +1,21 @@ + + + + + CheckMainForm + + + + 0 + 0 + 400 + 300 + + + + Form + + + + + diff --git a/check/check.pri b/check/check.pri index e69de29..624bd3f 100644 --- a/check/check.pri +++ b/check/check.pri @@ -0,0 +1,4 @@ +HEADERS += $$PWD/CheckMainForm.h +SOURCES += $$PWD/CheckMainForm.cpp + +FORMS += $$PWD/CheckMainForm.ui diff --git a/frame/FramelessWindow.cpp b/frame/FramelessWindow.cpp index d323ae5..5727866 100644 --- a/frame/FramelessWindow.cpp +++ b/frame/FramelessWindow.cpp @@ -1,4 +1,8 @@ -#include "FramelessWindow.h" +#include +#include +#include + +#include "FramelessWindow.h" #ifdef Q_OS_WIN #include "windows.h" @@ -63,6 +67,12 @@ resizeEnable = false; } + if (!isMaximized()) { + QRect screenRect = QApplication::screens().at(0)->availableGeometry(); + resize(screenRect.width() * 0.9, screenRect.height() * 0.9); + move(QRandomGenerator::global()->bounded(10, 100), QRandomGenerator::global()->bounded(10, 50)); + } + //发出最大化最小化等改变事件,以便界面上更改对应的信息比如右上角图标和文字 Q_EMIT windowStateChange(!moveEnable); diff --git a/frame/MainWindowForm.cpp b/frame/MainWindowForm.cpp index cb98f69..0791c77 100644 --- a/frame/MainWindowForm.cpp +++ b/frame/MainWindowForm.cpp @@ -1,8 +1,6 @@ #include "MainWindowForm.h" #include "ui_MainWindowForm.h" -#include - MainWindowForm::MainWindowForm(QWidget *parent) : FramelessWindow(parent), ui(new Ui::MainWindowForm) @@ -18,8 +16,8 @@ connect(TimeCounterUtil::getInstance().clockTimer, &QTimer::timeout, this, &MainWindowForm::onUpdateTimestampHandler); TimeCounterUtil::getInstance().clockTimer->start(1000); - /** 临时调试代码 **/ - emit ui->btnInfomation->clicked(); + // 自动加载第一个页面 + emit ui->btnCalibration->clicked(); } MainWindowForm::~MainWindowForm() @@ -37,7 +35,7 @@ { setWindowFlags(Qt::FramelessWindowHint); // 设置全屏 setWindowState(Qt::WindowState::WindowMaximized); - this->setTitleBar(ui->wdgtTop); + // 设置窗口位置和大小 move(0, 0); @@ -46,42 +44,31 @@ qint16 screenHeight = screenRect.height(); resize(screenWidth, screenHeight); + // 设置标题栏 以绑定和触发鼠标双击事件 + this->setTitleBar(ui->wdgtTop); + connect(this, &MainWindowForm::titleDblClick, this, &MainWindowForm::titleDblClickHandler); + // 加载样式表 QString qssStyle = QssFileUtils::loadQssFileContent(":/qss/mainForm.css"); if (qssStyle.isEmpty() == false) { ui->wdgtTop->setStyleSheet(qssStyle); // 仅本窗口生效 + ui->wdgtContent->setStyleSheet("QWidget{background: #FFFFFF;}"); } - // 设置标题 + // 设置标题文字 ui->labelTitle->setText(SettingConfig::getInstance().CLIENT_TITLE); setWindowTitle(SettingConfig::getInstance().CLIENT_TITLE); - // 设置最小尺寸(宽度, 高度) lxc - QScreen *screen = QGuiApplication::primaryScreen(); - QRect screenSize = screen->availableGeometry(); // 可用区域(排除任务栏) - // 设置最小尺寸为屏幕宽度的 80%,高度 600 - int minWidth = screenSize.width() * 0.8; + int minWidth = screenWidth * 0.8; this->setMinimumSize(minWidth, 600); } void MainWindowForm::initMenuWidgets() { + wdgtCaliMain = new CalibrationMainForm(this); + wdgtCheckMain = new CheckMainForm(this); wdgtInfoMain = new InfoMainForm(this); -// wdgtInfo = new TF_InfoManag(this); -// wdgtCheckMethod = new CheckMethodManage(this); -// wdgtCheck = new CheckWindow(this); -// wdgtData = new TF_TextDataManag(this); -// wdgtCert = new TF_CertificateApproval(this); -// wdgtUserMan = new TF_UserManag(this); -// wdgtTestDev = new TF_TextDevice(this); -// wdgtStandDev = new tf_StandardDevice(this); - -// wdgtStdDevForm = new StandardDeviceForm(this); -// wdgtEqptDevForm = new TestDeviceForm(this); -// wdgtFileResForm = new FileResourcesForm(this); - -// wdgtCalibrationForm = new CalibrationForm(this); // 绑定事件 // connect(wdgtCalibrationForm, &CalibrationForm::enableMenuButtons, this, &MainWindowForm::onMenuButtonsEabled); @@ -89,18 +76,9 @@ // connect(wdgtCheck, &CheckWindow::BarsetEnabled, this, &MainWindowForm::onMenuButtonsEabled); // 添加到stackWidget中 + ui->wdgtContent->insertWidget(0, wdgtCaliMain); + ui->wdgtContent->insertWidget(1, wdgtCheckMain); ui->wdgtContent->insertWidget(2, wdgtInfoMain); -// ui->wdgtContent->insertWidget(0, wdgtCalibrationForm); -// ui->wdgtContent->insertWidget(1, wdgtStdDevForm); -// ui->wdgtContent->insertWidget(1, wdgtStandDev); -// ui->wdgtContent->insertWidget(2, wdgtTestDev); -// ui->wdgtContent->insertWidget(2, wdgtEqptDevForm); -// ui->wdgtContent->insertWidget(3, wdgtCheckMethod); -// ui->wdgtContent->insertWidget(4, wdgtCheck); -// ui->wdgtContent->insertWidget(5, wdgtData); -// ui->wdgtContent->insertWidget(6, wdgtCert); -// ui->wdgtContent->insertWidget(7, wdgtFileResForm); -// ui->wdgtContent->insertWidget(8, wdgtUserMan); } void MainWindowForm::initFunctionButtons() @@ -115,7 +93,6 @@ funcButtGroup->addButton(funcButt); connect(funcButt, &QToolButton::clicked, this, &MainWindowForm::onFunctionButtonsAction); } - connect(this, SIGNAL(titleDblClick()), this, SLOT(titleDblClick())); } void MainWindowForm::on_btnMinWin_clicked() @@ -125,17 +102,12 @@ 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(); + ui->btnMaxWin->setToolTip("最大化"); } else { - resize(screenSize.width(), screenSize.height()); - move(0, 0); this->showMaximized(); + ui->btnMaxWin->setToolTip("还原"); } } @@ -165,7 +137,7 @@ ui->labelTime->setText(now.toString("yyyy-MM-dd HH:mm:ss")); } -void MainWindowForm::titleDblClick() +void MainWindowForm::titleDblClickHandler() { on_btnMaxWin_clicked(); } diff --git a/frame/MainWindowForm.h b/frame/MainWindowForm.h index 9b4eae4..aa5330c 100644 --- a/frame/MainWindowForm.h +++ b/frame/MainWindowForm.h @@ -13,21 +13,8 @@ #include "frame/FramelessWindow.h" #include "infomation/InfoMainForm.h" - -//#include "infomation/standDev/StandardDeviceForm.h" -//#include "infomation/testDev/TestDeviceForm.h" -//#include "infomation/fileRes/FileResourcesForm.h" - -//#include "calibration/CalibrationForm.h" - -//#include "TimeFreq/tf_standarddevice.h" -//#include "TimeFreq/tf_certificateapproval.h" -//#include "TimeFreq/tf_infomanag.h" -//#include "TimeFreq/tf_textdatamanag.h" -//#include "TimeFreq/tf_textdevice.h" -//#include "TimeFreq/tf_usermanag.h" -//#include "checkmethodmanage.h" -//#include "checkwindow.h" +#include "calibration/CalibrationMainForm.h" +#include "check/CheckMainForm.h" namespace Ui { class MainWindowForm; @@ -50,29 +37,16 @@ void onFunctionButtonsAction(); void onUpdateTimestampHandler(); - void titleDblClick(); + void titleDblClickHandler(); void onMenuButtonsEabled(bool enable); private: Ui::MainWindowForm *ui; + CalibrationMainForm * wdgtCaliMain; + CheckMainForm * wdgtCheckMain; InfoMainForm * wdgtInfoMain; -// TF_InfoManag * wdgtInfo; -// CheckMethodManage * wdgtCheckMethod; -// CheckWindow * wdgtCheck; -// TF_TextDataManag * wdgtData; -// TF_CertificateApproval * wdgtCert; -// TF_UserManag * wdgtUserMan; -// tf_StandardDevice * wdgtStandDev; -// TF_TextDevice * wdgtTestDev; - -// StandardDeviceForm * wdgtStdDevForm; -// TestDeviceForm * wdgtEqptDevForm; -// FileResourcesForm * wdgtFileResForm; - -// CalibrationForm * wdgtCalibrationForm; - void initForm(); void initMenuWidgets(); void initFunctionButtons(); diff --git a/frame/MainWindowForm.ui b/frame/MainWindowForm.ui index d3fd4fe..e0638e1 100644 --- a/frame/MainWindowForm.ui +++ b/frame/MainWindowForm.ui @@ -271,6 +271,18 @@ + + + 0 + 0 + + + + + 240 + 0 + + 240 @@ -295,6 +307,18 @@ + + + 0 + 0 + + + + + 0 + 40 + + @@ -392,6 +416,18 @@ + + + 0 + 0 + + + + + 240 + 0 + + 240 @@ -422,6 +458,12 @@ 0 + + + 0 + 40 + + 5 @@ -459,6 +501,9 @@ 24 + + 设置 + @@ -509,7 +554,7 @@ - 最小化 + 还原 diff --git a/infomation/task/DeptTaskForm.cpp b/infomation/task/DeptTaskForm.cpp index 208973c..b7d771b 100644 --- a/infomation/task/DeptTaskForm.cpp +++ b/infomation/task/DeptTaskForm.cpp @@ -33,7 +33,7 @@ void DeptTaskForm::initForm() { // 加载样式表 - QString qssStyle = QssFileUtils::loadQssFileContent(QApplication::applicationDirPath() + "/qss/infoTable.css"); + QString qssStyle = QssFileUtils::loadQssFileContent(":/qss/infoTable.css"); if (qssStyle.isEmpty() == false) { this->setStyleSheet(qssStyle); // 仅本窗口生效 } diff --git a/res/image/main/calibration.png b/res/image/main/calibration.png deleted file mode 100644 index 9d6de19..0000000 --- a/res/image/main/calibration.png +++ /dev/null Binary files differ diff --git a/res/image/main/certApproval.png b/res/image/main/certApproval.png deleted file mode 100644 index 45147a6..0000000 --- a/res/image/main/certApproval.png +++ /dev/null Binary files differ diff --git a/res/image/main/checkDevice.png b/res/image/main/checkDevice.png deleted file mode 100644 index 3e9307a..0000000 --- a/res/image/main/checkDevice.png +++ /dev/null Binary files differ diff --git a/res/image/main/checkProgram.png b/res/image/main/checkProgram.png deleted file mode 100644 index e75ef50..0000000 --- a/res/image/main/checkProgram.png +++ /dev/null Binary files differ diff --git a/res/image/main/fileRes.png b/res/image/main/fileRes.png deleted file mode 100644 index 99b9b45..0000000 --- a/res/image/main/fileRes.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_menu_calibration.png b/res/image/main/icon_menu_calibration.png index 6fca8be..cbc7bfc 100644 --- a/res/image/main/icon_menu_calibration.png +++ 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 index 17f918f..3f140c6 100644 --- a/res/image/main/icon_menu_calibration_selected.png +++ 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 index c3db5fa..0a714a4 100644 --- a/res/image/main/icon_menu_check.png +++ 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 index 9794c43..9546177 100644 --- a/res/image/main/icon_menu_check_selected.png +++ 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 index e272f4c..73f2a24 100644 --- a/res/image/main/icon_menu_infomation.png +++ 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 index 6122c7b..bcb8e30 100644 --- a/res/image/main/icon_menu_infomation_checked.png +++ b/res/image/main/icon_menu_infomation_checked.png Binary files differ diff --git a/calibration/CalibrationMainForm.cpp b/calibration/CalibrationMainForm.cpp new file mode 100644 index 0000000..9b778a5 --- /dev/null +++ b/calibration/CalibrationMainForm.cpp @@ -0,0 +1,14 @@ +#include "CalibrationMainForm.h" +#include "ui_CalibrationMainForm.h" + +CalibrationMainForm::CalibrationMainForm(QWidget *parent) : + QWidget(parent), + ui(new Ui::CalibrationMainForm) +{ + ui->setupUi(this); +} + +CalibrationMainForm::~CalibrationMainForm() +{ + delete ui; +} diff --git a/calibration/CalibrationMainForm.h b/calibration/CalibrationMainForm.h new file mode 100644 index 0000000..7d75014 --- /dev/null +++ b/calibration/CalibrationMainForm.h @@ -0,0 +1,22 @@ +#ifndef CALIBRATIONMAINFORM_H +#define CALIBRATIONMAINFORM_H + +#include + +namespace Ui { +class CalibrationMainForm; +} + +class CalibrationMainForm : public QWidget +{ + Q_OBJECT + +public: + explicit CalibrationMainForm(QWidget *parent = nullptr); + ~CalibrationMainForm(); + +private: + Ui::CalibrationMainForm *ui; +}; + +#endif // CALIBRATIONMAINFORM_H diff --git a/calibration/CalibrationMainForm.ui b/calibration/CalibrationMainForm.ui new file mode 100644 index 0000000..9b5a9c2 --- /dev/null +++ b/calibration/CalibrationMainForm.ui @@ -0,0 +1,21 @@ + + + + + CalibrationMainForm + + + + 0 + 0 + 400 + 300 + + + + Form + + + + + diff --git a/calibration/calibration.pri b/calibration/calibration.pri index e69de29..f0e9dfb 100644 --- a/calibration/calibration.pri +++ b/calibration/calibration.pri @@ -0,0 +1,4 @@ +HEADERS += $$PWD/CalibrationMainForm.h +SOURCES += $$PWD/CalibrationMainForm.cpp + +FORMS += $$PWD/CalibrationMainForm.ui diff --git a/check/CheckMainForm.cpp b/check/CheckMainForm.cpp new file mode 100644 index 0000000..1725277 --- /dev/null +++ b/check/CheckMainForm.cpp @@ -0,0 +1,14 @@ +#include "CheckMainForm.h" +#include "ui_CheckMainForm.h" + +CheckMainForm::CheckMainForm(QWidget *parent) : + QWidget(parent), + ui(new Ui::CheckMainForm) +{ + ui->setupUi(this); +} + +CheckMainForm::~CheckMainForm() +{ + delete ui; +} diff --git a/check/CheckMainForm.h b/check/CheckMainForm.h new file mode 100644 index 0000000..c71001e --- /dev/null +++ b/check/CheckMainForm.h @@ -0,0 +1,22 @@ +#ifndef CHECKMAINFORM_H +#define CHECKMAINFORM_H + +#include + +namespace Ui { +class CheckMainForm; +} + +class CheckMainForm : public QWidget +{ + Q_OBJECT + +public: + explicit CheckMainForm(QWidget *parent = nullptr); + ~CheckMainForm(); + +private: + Ui::CheckMainForm *ui; +}; + +#endif // CHECKMAINFORM_H diff --git a/check/CheckMainForm.ui b/check/CheckMainForm.ui new file mode 100644 index 0000000..76ca74d --- /dev/null +++ b/check/CheckMainForm.ui @@ -0,0 +1,21 @@ + + + + + CheckMainForm + + + + 0 + 0 + 400 + 300 + + + + Form + + + + + diff --git a/check/check.pri b/check/check.pri index e69de29..624bd3f 100644 --- a/check/check.pri +++ b/check/check.pri @@ -0,0 +1,4 @@ +HEADERS += $$PWD/CheckMainForm.h +SOURCES += $$PWD/CheckMainForm.cpp + +FORMS += $$PWD/CheckMainForm.ui diff --git a/frame/FramelessWindow.cpp b/frame/FramelessWindow.cpp index d323ae5..5727866 100644 --- a/frame/FramelessWindow.cpp +++ b/frame/FramelessWindow.cpp @@ -1,4 +1,8 @@ -#include "FramelessWindow.h" +#include +#include +#include + +#include "FramelessWindow.h" #ifdef Q_OS_WIN #include "windows.h" @@ -63,6 +67,12 @@ resizeEnable = false; } + if (!isMaximized()) { + QRect screenRect = QApplication::screens().at(0)->availableGeometry(); + resize(screenRect.width() * 0.9, screenRect.height() * 0.9); + move(QRandomGenerator::global()->bounded(10, 100), QRandomGenerator::global()->bounded(10, 50)); + } + //发出最大化最小化等改变事件,以便界面上更改对应的信息比如右上角图标和文字 Q_EMIT windowStateChange(!moveEnable); diff --git a/frame/MainWindowForm.cpp b/frame/MainWindowForm.cpp index cb98f69..0791c77 100644 --- a/frame/MainWindowForm.cpp +++ b/frame/MainWindowForm.cpp @@ -1,8 +1,6 @@ #include "MainWindowForm.h" #include "ui_MainWindowForm.h" -#include - MainWindowForm::MainWindowForm(QWidget *parent) : FramelessWindow(parent), ui(new Ui::MainWindowForm) @@ -18,8 +16,8 @@ connect(TimeCounterUtil::getInstance().clockTimer, &QTimer::timeout, this, &MainWindowForm::onUpdateTimestampHandler); TimeCounterUtil::getInstance().clockTimer->start(1000); - /** 临时调试代码 **/ - emit ui->btnInfomation->clicked(); + // 自动加载第一个页面 + emit ui->btnCalibration->clicked(); } MainWindowForm::~MainWindowForm() @@ -37,7 +35,7 @@ { setWindowFlags(Qt::FramelessWindowHint); // 设置全屏 setWindowState(Qt::WindowState::WindowMaximized); - this->setTitleBar(ui->wdgtTop); + // 设置窗口位置和大小 move(0, 0); @@ -46,42 +44,31 @@ qint16 screenHeight = screenRect.height(); resize(screenWidth, screenHeight); + // 设置标题栏 以绑定和触发鼠标双击事件 + this->setTitleBar(ui->wdgtTop); + connect(this, &MainWindowForm::titleDblClick, this, &MainWindowForm::titleDblClickHandler); + // 加载样式表 QString qssStyle = QssFileUtils::loadQssFileContent(":/qss/mainForm.css"); if (qssStyle.isEmpty() == false) { ui->wdgtTop->setStyleSheet(qssStyle); // 仅本窗口生效 + ui->wdgtContent->setStyleSheet("QWidget{background: #FFFFFF;}"); } - // 设置标题 + // 设置标题文字 ui->labelTitle->setText(SettingConfig::getInstance().CLIENT_TITLE); setWindowTitle(SettingConfig::getInstance().CLIENT_TITLE); - // 设置最小尺寸(宽度, 高度) lxc - QScreen *screen = QGuiApplication::primaryScreen(); - QRect screenSize = screen->availableGeometry(); // 可用区域(排除任务栏) - // 设置最小尺寸为屏幕宽度的 80%,高度 600 - int minWidth = screenSize.width() * 0.8; + int minWidth = screenWidth * 0.8; this->setMinimumSize(minWidth, 600); } void MainWindowForm::initMenuWidgets() { + wdgtCaliMain = new CalibrationMainForm(this); + wdgtCheckMain = new CheckMainForm(this); wdgtInfoMain = new InfoMainForm(this); -// wdgtInfo = new TF_InfoManag(this); -// wdgtCheckMethod = new CheckMethodManage(this); -// wdgtCheck = new CheckWindow(this); -// wdgtData = new TF_TextDataManag(this); -// wdgtCert = new TF_CertificateApproval(this); -// wdgtUserMan = new TF_UserManag(this); -// wdgtTestDev = new TF_TextDevice(this); -// wdgtStandDev = new tf_StandardDevice(this); - -// wdgtStdDevForm = new StandardDeviceForm(this); -// wdgtEqptDevForm = new TestDeviceForm(this); -// wdgtFileResForm = new FileResourcesForm(this); - -// wdgtCalibrationForm = new CalibrationForm(this); // 绑定事件 // connect(wdgtCalibrationForm, &CalibrationForm::enableMenuButtons, this, &MainWindowForm::onMenuButtonsEabled); @@ -89,18 +76,9 @@ // connect(wdgtCheck, &CheckWindow::BarsetEnabled, this, &MainWindowForm::onMenuButtonsEabled); // 添加到stackWidget中 + ui->wdgtContent->insertWidget(0, wdgtCaliMain); + ui->wdgtContent->insertWidget(1, wdgtCheckMain); ui->wdgtContent->insertWidget(2, wdgtInfoMain); -// ui->wdgtContent->insertWidget(0, wdgtCalibrationForm); -// ui->wdgtContent->insertWidget(1, wdgtStdDevForm); -// ui->wdgtContent->insertWidget(1, wdgtStandDev); -// ui->wdgtContent->insertWidget(2, wdgtTestDev); -// ui->wdgtContent->insertWidget(2, wdgtEqptDevForm); -// ui->wdgtContent->insertWidget(3, wdgtCheckMethod); -// ui->wdgtContent->insertWidget(4, wdgtCheck); -// ui->wdgtContent->insertWidget(5, wdgtData); -// ui->wdgtContent->insertWidget(6, wdgtCert); -// ui->wdgtContent->insertWidget(7, wdgtFileResForm); -// ui->wdgtContent->insertWidget(8, wdgtUserMan); } void MainWindowForm::initFunctionButtons() @@ -115,7 +93,6 @@ funcButtGroup->addButton(funcButt); connect(funcButt, &QToolButton::clicked, this, &MainWindowForm::onFunctionButtonsAction); } - connect(this, SIGNAL(titleDblClick()), this, SLOT(titleDblClick())); } void MainWindowForm::on_btnMinWin_clicked() @@ -125,17 +102,12 @@ 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(); + ui->btnMaxWin->setToolTip("最大化"); } else { - resize(screenSize.width(), screenSize.height()); - move(0, 0); this->showMaximized(); + ui->btnMaxWin->setToolTip("还原"); } } @@ -165,7 +137,7 @@ ui->labelTime->setText(now.toString("yyyy-MM-dd HH:mm:ss")); } -void MainWindowForm::titleDblClick() +void MainWindowForm::titleDblClickHandler() { on_btnMaxWin_clicked(); } diff --git a/frame/MainWindowForm.h b/frame/MainWindowForm.h index 9b4eae4..aa5330c 100644 --- a/frame/MainWindowForm.h +++ b/frame/MainWindowForm.h @@ -13,21 +13,8 @@ #include "frame/FramelessWindow.h" #include "infomation/InfoMainForm.h" - -//#include "infomation/standDev/StandardDeviceForm.h" -//#include "infomation/testDev/TestDeviceForm.h" -//#include "infomation/fileRes/FileResourcesForm.h" - -//#include "calibration/CalibrationForm.h" - -//#include "TimeFreq/tf_standarddevice.h" -//#include "TimeFreq/tf_certificateapproval.h" -//#include "TimeFreq/tf_infomanag.h" -//#include "TimeFreq/tf_textdatamanag.h" -//#include "TimeFreq/tf_textdevice.h" -//#include "TimeFreq/tf_usermanag.h" -//#include "checkmethodmanage.h" -//#include "checkwindow.h" +#include "calibration/CalibrationMainForm.h" +#include "check/CheckMainForm.h" namespace Ui { class MainWindowForm; @@ -50,29 +37,16 @@ void onFunctionButtonsAction(); void onUpdateTimestampHandler(); - void titleDblClick(); + void titleDblClickHandler(); void onMenuButtonsEabled(bool enable); private: Ui::MainWindowForm *ui; + CalibrationMainForm * wdgtCaliMain; + CheckMainForm * wdgtCheckMain; InfoMainForm * wdgtInfoMain; -// TF_InfoManag * wdgtInfo; -// CheckMethodManage * wdgtCheckMethod; -// CheckWindow * wdgtCheck; -// TF_TextDataManag * wdgtData; -// TF_CertificateApproval * wdgtCert; -// TF_UserManag * wdgtUserMan; -// tf_StandardDevice * wdgtStandDev; -// TF_TextDevice * wdgtTestDev; - -// StandardDeviceForm * wdgtStdDevForm; -// TestDeviceForm * wdgtEqptDevForm; -// FileResourcesForm * wdgtFileResForm; - -// CalibrationForm * wdgtCalibrationForm; - void initForm(); void initMenuWidgets(); void initFunctionButtons(); diff --git a/frame/MainWindowForm.ui b/frame/MainWindowForm.ui index d3fd4fe..e0638e1 100644 --- a/frame/MainWindowForm.ui +++ b/frame/MainWindowForm.ui @@ -271,6 +271,18 @@ + + + 0 + 0 + + + + + 240 + 0 + + 240 @@ -295,6 +307,18 @@ + + + 0 + 0 + + + + + 0 + 40 + + @@ -392,6 +416,18 @@ + + + 0 + 0 + + + + + 240 + 0 + + 240 @@ -422,6 +458,12 @@ 0 + + + 0 + 40 + + 5 @@ -459,6 +501,9 @@ 24 + + 设置 + @@ -509,7 +554,7 @@ - 最小化 + 还原 diff --git a/infomation/task/DeptTaskForm.cpp b/infomation/task/DeptTaskForm.cpp index 208973c..b7d771b 100644 --- a/infomation/task/DeptTaskForm.cpp +++ b/infomation/task/DeptTaskForm.cpp @@ -33,7 +33,7 @@ void DeptTaskForm::initForm() { // 加载样式表 - QString qssStyle = QssFileUtils::loadQssFileContent(QApplication::applicationDirPath() + "/qss/infoTable.css"); + QString qssStyle = QssFileUtils::loadQssFileContent(":/qss/infoTable.css"); if (qssStyle.isEmpty() == false) { this->setStyleSheet(qssStyle); // 仅本窗口生效 } diff --git a/res/image/main/calibration.png b/res/image/main/calibration.png deleted file mode 100644 index 9d6de19..0000000 --- a/res/image/main/calibration.png +++ /dev/null Binary files differ diff --git a/res/image/main/certApproval.png b/res/image/main/certApproval.png deleted file mode 100644 index 45147a6..0000000 --- a/res/image/main/certApproval.png +++ /dev/null Binary files differ diff --git a/res/image/main/checkDevice.png b/res/image/main/checkDevice.png deleted file mode 100644 index 3e9307a..0000000 --- a/res/image/main/checkDevice.png +++ /dev/null Binary files differ diff --git a/res/image/main/checkProgram.png b/res/image/main/checkProgram.png deleted file mode 100644 index e75ef50..0000000 --- a/res/image/main/checkProgram.png +++ /dev/null Binary files differ diff --git a/res/image/main/fileRes.png b/res/image/main/fileRes.png deleted file mode 100644 index 99b9b45..0000000 --- a/res/image/main/fileRes.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_menu_calibration.png b/res/image/main/icon_menu_calibration.png index 6fca8be..cbc7bfc 100644 --- a/res/image/main/icon_menu_calibration.png +++ 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 index 17f918f..3f140c6 100644 --- a/res/image/main/icon_menu_calibration_selected.png +++ 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 index c3db5fa..0a714a4 100644 --- a/res/image/main/icon_menu_check.png +++ 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 index 9794c43..9546177 100644 --- a/res/image/main/icon_menu_check_selected.png +++ 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 index e272f4c..73f2a24 100644 --- a/res/image/main/icon_menu_infomation.png +++ 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 index 6122c7b..bcb8e30 100644 --- a/res/image/main/icon_menu_infomation_checked.png +++ b/res/image/main/icon_menu_infomation_checked.png Binary files differ diff --git a/res/image/main/info.png b/res/image/main/info.png deleted file mode 100644 index a762db4..0000000 --- a/res/image/main/info.png +++ /dev/null Binary files differ diff --git a/calibration/CalibrationMainForm.cpp b/calibration/CalibrationMainForm.cpp new file mode 100644 index 0000000..9b778a5 --- /dev/null +++ b/calibration/CalibrationMainForm.cpp @@ -0,0 +1,14 @@ +#include "CalibrationMainForm.h" +#include "ui_CalibrationMainForm.h" + +CalibrationMainForm::CalibrationMainForm(QWidget *parent) : + QWidget(parent), + ui(new Ui::CalibrationMainForm) +{ + ui->setupUi(this); +} + +CalibrationMainForm::~CalibrationMainForm() +{ + delete ui; +} diff --git a/calibration/CalibrationMainForm.h b/calibration/CalibrationMainForm.h new file mode 100644 index 0000000..7d75014 --- /dev/null +++ b/calibration/CalibrationMainForm.h @@ -0,0 +1,22 @@ +#ifndef CALIBRATIONMAINFORM_H +#define CALIBRATIONMAINFORM_H + +#include + +namespace Ui { +class CalibrationMainForm; +} + +class CalibrationMainForm : public QWidget +{ + Q_OBJECT + +public: + explicit CalibrationMainForm(QWidget *parent = nullptr); + ~CalibrationMainForm(); + +private: + Ui::CalibrationMainForm *ui; +}; + +#endif // CALIBRATIONMAINFORM_H diff --git a/calibration/CalibrationMainForm.ui b/calibration/CalibrationMainForm.ui new file mode 100644 index 0000000..9b5a9c2 --- /dev/null +++ b/calibration/CalibrationMainForm.ui @@ -0,0 +1,21 @@ + + + + + CalibrationMainForm + + + + 0 + 0 + 400 + 300 + + + + Form + + + + + diff --git a/calibration/calibration.pri b/calibration/calibration.pri index e69de29..f0e9dfb 100644 --- a/calibration/calibration.pri +++ b/calibration/calibration.pri @@ -0,0 +1,4 @@ +HEADERS += $$PWD/CalibrationMainForm.h +SOURCES += $$PWD/CalibrationMainForm.cpp + +FORMS += $$PWD/CalibrationMainForm.ui diff --git a/check/CheckMainForm.cpp b/check/CheckMainForm.cpp new file mode 100644 index 0000000..1725277 --- /dev/null +++ b/check/CheckMainForm.cpp @@ -0,0 +1,14 @@ +#include "CheckMainForm.h" +#include "ui_CheckMainForm.h" + +CheckMainForm::CheckMainForm(QWidget *parent) : + QWidget(parent), + ui(new Ui::CheckMainForm) +{ + ui->setupUi(this); +} + +CheckMainForm::~CheckMainForm() +{ + delete ui; +} diff --git a/check/CheckMainForm.h b/check/CheckMainForm.h new file mode 100644 index 0000000..c71001e --- /dev/null +++ b/check/CheckMainForm.h @@ -0,0 +1,22 @@ +#ifndef CHECKMAINFORM_H +#define CHECKMAINFORM_H + +#include + +namespace Ui { +class CheckMainForm; +} + +class CheckMainForm : public QWidget +{ + Q_OBJECT + +public: + explicit CheckMainForm(QWidget *parent = nullptr); + ~CheckMainForm(); + +private: + Ui::CheckMainForm *ui; +}; + +#endif // CHECKMAINFORM_H diff --git a/check/CheckMainForm.ui b/check/CheckMainForm.ui new file mode 100644 index 0000000..76ca74d --- /dev/null +++ b/check/CheckMainForm.ui @@ -0,0 +1,21 @@ + + + + + CheckMainForm + + + + 0 + 0 + 400 + 300 + + + + Form + + + + + diff --git a/check/check.pri b/check/check.pri index e69de29..624bd3f 100644 --- a/check/check.pri +++ b/check/check.pri @@ -0,0 +1,4 @@ +HEADERS += $$PWD/CheckMainForm.h +SOURCES += $$PWD/CheckMainForm.cpp + +FORMS += $$PWD/CheckMainForm.ui diff --git a/frame/FramelessWindow.cpp b/frame/FramelessWindow.cpp index d323ae5..5727866 100644 --- a/frame/FramelessWindow.cpp +++ b/frame/FramelessWindow.cpp @@ -1,4 +1,8 @@ -#include "FramelessWindow.h" +#include +#include +#include + +#include "FramelessWindow.h" #ifdef Q_OS_WIN #include "windows.h" @@ -63,6 +67,12 @@ resizeEnable = false; } + if (!isMaximized()) { + QRect screenRect = QApplication::screens().at(0)->availableGeometry(); + resize(screenRect.width() * 0.9, screenRect.height() * 0.9); + move(QRandomGenerator::global()->bounded(10, 100), QRandomGenerator::global()->bounded(10, 50)); + } + //发出最大化最小化等改变事件,以便界面上更改对应的信息比如右上角图标和文字 Q_EMIT windowStateChange(!moveEnable); diff --git a/frame/MainWindowForm.cpp b/frame/MainWindowForm.cpp index cb98f69..0791c77 100644 --- a/frame/MainWindowForm.cpp +++ b/frame/MainWindowForm.cpp @@ -1,8 +1,6 @@ #include "MainWindowForm.h" #include "ui_MainWindowForm.h" -#include - MainWindowForm::MainWindowForm(QWidget *parent) : FramelessWindow(parent), ui(new Ui::MainWindowForm) @@ -18,8 +16,8 @@ connect(TimeCounterUtil::getInstance().clockTimer, &QTimer::timeout, this, &MainWindowForm::onUpdateTimestampHandler); TimeCounterUtil::getInstance().clockTimer->start(1000); - /** 临时调试代码 **/ - emit ui->btnInfomation->clicked(); + // 自动加载第一个页面 + emit ui->btnCalibration->clicked(); } MainWindowForm::~MainWindowForm() @@ -37,7 +35,7 @@ { setWindowFlags(Qt::FramelessWindowHint); // 设置全屏 setWindowState(Qt::WindowState::WindowMaximized); - this->setTitleBar(ui->wdgtTop); + // 设置窗口位置和大小 move(0, 0); @@ -46,42 +44,31 @@ qint16 screenHeight = screenRect.height(); resize(screenWidth, screenHeight); + // 设置标题栏 以绑定和触发鼠标双击事件 + this->setTitleBar(ui->wdgtTop); + connect(this, &MainWindowForm::titleDblClick, this, &MainWindowForm::titleDblClickHandler); + // 加载样式表 QString qssStyle = QssFileUtils::loadQssFileContent(":/qss/mainForm.css"); if (qssStyle.isEmpty() == false) { ui->wdgtTop->setStyleSheet(qssStyle); // 仅本窗口生效 + ui->wdgtContent->setStyleSheet("QWidget{background: #FFFFFF;}"); } - // 设置标题 + // 设置标题文字 ui->labelTitle->setText(SettingConfig::getInstance().CLIENT_TITLE); setWindowTitle(SettingConfig::getInstance().CLIENT_TITLE); - // 设置最小尺寸(宽度, 高度) lxc - QScreen *screen = QGuiApplication::primaryScreen(); - QRect screenSize = screen->availableGeometry(); // 可用区域(排除任务栏) - // 设置最小尺寸为屏幕宽度的 80%,高度 600 - int minWidth = screenSize.width() * 0.8; + int minWidth = screenWidth * 0.8; this->setMinimumSize(minWidth, 600); } void MainWindowForm::initMenuWidgets() { + wdgtCaliMain = new CalibrationMainForm(this); + wdgtCheckMain = new CheckMainForm(this); wdgtInfoMain = new InfoMainForm(this); -// wdgtInfo = new TF_InfoManag(this); -// wdgtCheckMethod = new CheckMethodManage(this); -// wdgtCheck = new CheckWindow(this); -// wdgtData = new TF_TextDataManag(this); -// wdgtCert = new TF_CertificateApproval(this); -// wdgtUserMan = new TF_UserManag(this); -// wdgtTestDev = new TF_TextDevice(this); -// wdgtStandDev = new tf_StandardDevice(this); - -// wdgtStdDevForm = new StandardDeviceForm(this); -// wdgtEqptDevForm = new TestDeviceForm(this); -// wdgtFileResForm = new FileResourcesForm(this); - -// wdgtCalibrationForm = new CalibrationForm(this); // 绑定事件 // connect(wdgtCalibrationForm, &CalibrationForm::enableMenuButtons, this, &MainWindowForm::onMenuButtonsEabled); @@ -89,18 +76,9 @@ // connect(wdgtCheck, &CheckWindow::BarsetEnabled, this, &MainWindowForm::onMenuButtonsEabled); // 添加到stackWidget中 + ui->wdgtContent->insertWidget(0, wdgtCaliMain); + ui->wdgtContent->insertWidget(1, wdgtCheckMain); ui->wdgtContent->insertWidget(2, wdgtInfoMain); -// ui->wdgtContent->insertWidget(0, wdgtCalibrationForm); -// ui->wdgtContent->insertWidget(1, wdgtStdDevForm); -// ui->wdgtContent->insertWidget(1, wdgtStandDev); -// ui->wdgtContent->insertWidget(2, wdgtTestDev); -// ui->wdgtContent->insertWidget(2, wdgtEqptDevForm); -// ui->wdgtContent->insertWidget(3, wdgtCheckMethod); -// ui->wdgtContent->insertWidget(4, wdgtCheck); -// ui->wdgtContent->insertWidget(5, wdgtData); -// ui->wdgtContent->insertWidget(6, wdgtCert); -// ui->wdgtContent->insertWidget(7, wdgtFileResForm); -// ui->wdgtContent->insertWidget(8, wdgtUserMan); } void MainWindowForm::initFunctionButtons() @@ -115,7 +93,6 @@ funcButtGroup->addButton(funcButt); connect(funcButt, &QToolButton::clicked, this, &MainWindowForm::onFunctionButtonsAction); } - connect(this, SIGNAL(titleDblClick()), this, SLOT(titleDblClick())); } void MainWindowForm::on_btnMinWin_clicked() @@ -125,17 +102,12 @@ 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(); + ui->btnMaxWin->setToolTip("最大化"); } else { - resize(screenSize.width(), screenSize.height()); - move(0, 0); this->showMaximized(); + ui->btnMaxWin->setToolTip("还原"); } } @@ -165,7 +137,7 @@ ui->labelTime->setText(now.toString("yyyy-MM-dd HH:mm:ss")); } -void MainWindowForm::titleDblClick() +void MainWindowForm::titleDblClickHandler() { on_btnMaxWin_clicked(); } diff --git a/frame/MainWindowForm.h b/frame/MainWindowForm.h index 9b4eae4..aa5330c 100644 --- a/frame/MainWindowForm.h +++ b/frame/MainWindowForm.h @@ -13,21 +13,8 @@ #include "frame/FramelessWindow.h" #include "infomation/InfoMainForm.h" - -//#include "infomation/standDev/StandardDeviceForm.h" -//#include "infomation/testDev/TestDeviceForm.h" -//#include "infomation/fileRes/FileResourcesForm.h" - -//#include "calibration/CalibrationForm.h" - -//#include "TimeFreq/tf_standarddevice.h" -//#include "TimeFreq/tf_certificateapproval.h" -//#include "TimeFreq/tf_infomanag.h" -//#include "TimeFreq/tf_textdatamanag.h" -//#include "TimeFreq/tf_textdevice.h" -//#include "TimeFreq/tf_usermanag.h" -//#include "checkmethodmanage.h" -//#include "checkwindow.h" +#include "calibration/CalibrationMainForm.h" +#include "check/CheckMainForm.h" namespace Ui { class MainWindowForm; @@ -50,29 +37,16 @@ void onFunctionButtonsAction(); void onUpdateTimestampHandler(); - void titleDblClick(); + void titleDblClickHandler(); void onMenuButtonsEabled(bool enable); private: Ui::MainWindowForm *ui; + CalibrationMainForm * wdgtCaliMain; + CheckMainForm * wdgtCheckMain; InfoMainForm * wdgtInfoMain; -// TF_InfoManag * wdgtInfo; -// CheckMethodManage * wdgtCheckMethod; -// CheckWindow * wdgtCheck; -// TF_TextDataManag * wdgtData; -// TF_CertificateApproval * wdgtCert; -// TF_UserManag * wdgtUserMan; -// tf_StandardDevice * wdgtStandDev; -// TF_TextDevice * wdgtTestDev; - -// StandardDeviceForm * wdgtStdDevForm; -// TestDeviceForm * wdgtEqptDevForm; -// FileResourcesForm * wdgtFileResForm; - -// CalibrationForm * wdgtCalibrationForm; - void initForm(); void initMenuWidgets(); void initFunctionButtons(); diff --git a/frame/MainWindowForm.ui b/frame/MainWindowForm.ui index d3fd4fe..e0638e1 100644 --- a/frame/MainWindowForm.ui +++ b/frame/MainWindowForm.ui @@ -271,6 +271,18 @@ + + + 0 + 0 + + + + + 240 + 0 + + 240 @@ -295,6 +307,18 @@ + + + 0 + 0 + + + + + 0 + 40 + + @@ -392,6 +416,18 @@ + + + 0 + 0 + + + + + 240 + 0 + + 240 @@ -422,6 +458,12 @@ 0 + + + 0 + 40 + + 5 @@ -459,6 +501,9 @@ 24 + + 设置 + @@ -509,7 +554,7 @@ - 最小化 + 还原 diff --git a/infomation/task/DeptTaskForm.cpp b/infomation/task/DeptTaskForm.cpp index 208973c..b7d771b 100644 --- a/infomation/task/DeptTaskForm.cpp +++ b/infomation/task/DeptTaskForm.cpp @@ -33,7 +33,7 @@ void DeptTaskForm::initForm() { // 加载样式表 - QString qssStyle = QssFileUtils::loadQssFileContent(QApplication::applicationDirPath() + "/qss/infoTable.css"); + QString qssStyle = QssFileUtils::loadQssFileContent(":/qss/infoTable.css"); if (qssStyle.isEmpty() == false) { this->setStyleSheet(qssStyle); // 仅本窗口生效 } diff --git a/res/image/main/calibration.png b/res/image/main/calibration.png deleted file mode 100644 index 9d6de19..0000000 --- a/res/image/main/calibration.png +++ /dev/null Binary files differ diff --git a/res/image/main/certApproval.png b/res/image/main/certApproval.png deleted file mode 100644 index 45147a6..0000000 --- a/res/image/main/certApproval.png +++ /dev/null Binary files differ diff --git a/res/image/main/checkDevice.png b/res/image/main/checkDevice.png deleted file mode 100644 index 3e9307a..0000000 --- a/res/image/main/checkDevice.png +++ /dev/null Binary files differ diff --git a/res/image/main/checkProgram.png b/res/image/main/checkProgram.png deleted file mode 100644 index e75ef50..0000000 --- a/res/image/main/checkProgram.png +++ /dev/null Binary files differ diff --git a/res/image/main/fileRes.png b/res/image/main/fileRes.png deleted file mode 100644 index 99b9b45..0000000 --- a/res/image/main/fileRes.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_menu_calibration.png b/res/image/main/icon_menu_calibration.png index 6fca8be..cbc7bfc 100644 --- a/res/image/main/icon_menu_calibration.png +++ 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 index 17f918f..3f140c6 100644 --- a/res/image/main/icon_menu_calibration_selected.png +++ 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 index c3db5fa..0a714a4 100644 --- a/res/image/main/icon_menu_check.png +++ 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 index 9794c43..9546177 100644 --- a/res/image/main/icon_menu_check_selected.png +++ 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 index e272f4c..73f2a24 100644 --- a/res/image/main/icon_menu_infomation.png +++ 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 index 6122c7b..bcb8e30 100644 --- a/res/image/main/icon_menu_infomation_checked.png +++ b/res/image/main/icon_menu_infomation_checked.png Binary files differ diff --git a/res/image/main/info.png b/res/image/main/info.png deleted file mode 100644 index a762db4..0000000 --- a/res/image/main/info.png +++ /dev/null Binary files differ diff --git a/res/image/main/rawDataRecord.png b/res/image/main/rawDataRecord.png deleted file mode 100644 index dd25617..0000000 --- a/res/image/main/rawDataRecord.png +++ /dev/null Binary files differ diff --git a/calibration/CalibrationMainForm.cpp b/calibration/CalibrationMainForm.cpp new file mode 100644 index 0000000..9b778a5 --- /dev/null +++ b/calibration/CalibrationMainForm.cpp @@ -0,0 +1,14 @@ +#include "CalibrationMainForm.h" +#include "ui_CalibrationMainForm.h" + +CalibrationMainForm::CalibrationMainForm(QWidget *parent) : + QWidget(parent), + ui(new Ui::CalibrationMainForm) +{ + ui->setupUi(this); +} + +CalibrationMainForm::~CalibrationMainForm() +{ + delete ui; +} diff --git a/calibration/CalibrationMainForm.h b/calibration/CalibrationMainForm.h new file mode 100644 index 0000000..7d75014 --- /dev/null +++ b/calibration/CalibrationMainForm.h @@ -0,0 +1,22 @@ +#ifndef CALIBRATIONMAINFORM_H +#define CALIBRATIONMAINFORM_H + +#include + +namespace Ui { +class CalibrationMainForm; +} + +class CalibrationMainForm : public QWidget +{ + Q_OBJECT + +public: + explicit CalibrationMainForm(QWidget *parent = nullptr); + ~CalibrationMainForm(); + +private: + Ui::CalibrationMainForm *ui; +}; + +#endif // CALIBRATIONMAINFORM_H diff --git a/calibration/CalibrationMainForm.ui b/calibration/CalibrationMainForm.ui new file mode 100644 index 0000000..9b5a9c2 --- /dev/null +++ b/calibration/CalibrationMainForm.ui @@ -0,0 +1,21 @@ + + + + + CalibrationMainForm + + + + 0 + 0 + 400 + 300 + + + + Form + + + + + diff --git a/calibration/calibration.pri b/calibration/calibration.pri index e69de29..f0e9dfb 100644 --- a/calibration/calibration.pri +++ b/calibration/calibration.pri @@ -0,0 +1,4 @@ +HEADERS += $$PWD/CalibrationMainForm.h +SOURCES += $$PWD/CalibrationMainForm.cpp + +FORMS += $$PWD/CalibrationMainForm.ui diff --git a/check/CheckMainForm.cpp b/check/CheckMainForm.cpp new file mode 100644 index 0000000..1725277 --- /dev/null +++ b/check/CheckMainForm.cpp @@ -0,0 +1,14 @@ +#include "CheckMainForm.h" +#include "ui_CheckMainForm.h" + +CheckMainForm::CheckMainForm(QWidget *parent) : + QWidget(parent), + ui(new Ui::CheckMainForm) +{ + ui->setupUi(this); +} + +CheckMainForm::~CheckMainForm() +{ + delete ui; +} diff --git a/check/CheckMainForm.h b/check/CheckMainForm.h new file mode 100644 index 0000000..c71001e --- /dev/null +++ b/check/CheckMainForm.h @@ -0,0 +1,22 @@ +#ifndef CHECKMAINFORM_H +#define CHECKMAINFORM_H + +#include + +namespace Ui { +class CheckMainForm; +} + +class CheckMainForm : public QWidget +{ + Q_OBJECT + +public: + explicit CheckMainForm(QWidget *parent = nullptr); + ~CheckMainForm(); + +private: + Ui::CheckMainForm *ui; +}; + +#endif // CHECKMAINFORM_H diff --git a/check/CheckMainForm.ui b/check/CheckMainForm.ui new file mode 100644 index 0000000..76ca74d --- /dev/null +++ b/check/CheckMainForm.ui @@ -0,0 +1,21 @@ + + + + + CheckMainForm + + + + 0 + 0 + 400 + 300 + + + + Form + + + + + diff --git a/check/check.pri b/check/check.pri index e69de29..624bd3f 100644 --- a/check/check.pri +++ b/check/check.pri @@ -0,0 +1,4 @@ +HEADERS += $$PWD/CheckMainForm.h +SOURCES += $$PWD/CheckMainForm.cpp + +FORMS += $$PWD/CheckMainForm.ui diff --git a/frame/FramelessWindow.cpp b/frame/FramelessWindow.cpp index d323ae5..5727866 100644 --- a/frame/FramelessWindow.cpp +++ b/frame/FramelessWindow.cpp @@ -1,4 +1,8 @@ -#include "FramelessWindow.h" +#include +#include +#include + +#include "FramelessWindow.h" #ifdef Q_OS_WIN #include "windows.h" @@ -63,6 +67,12 @@ resizeEnable = false; } + if (!isMaximized()) { + QRect screenRect = QApplication::screens().at(0)->availableGeometry(); + resize(screenRect.width() * 0.9, screenRect.height() * 0.9); + move(QRandomGenerator::global()->bounded(10, 100), QRandomGenerator::global()->bounded(10, 50)); + } + //发出最大化最小化等改变事件,以便界面上更改对应的信息比如右上角图标和文字 Q_EMIT windowStateChange(!moveEnable); diff --git a/frame/MainWindowForm.cpp b/frame/MainWindowForm.cpp index cb98f69..0791c77 100644 --- a/frame/MainWindowForm.cpp +++ b/frame/MainWindowForm.cpp @@ -1,8 +1,6 @@ #include "MainWindowForm.h" #include "ui_MainWindowForm.h" -#include - MainWindowForm::MainWindowForm(QWidget *parent) : FramelessWindow(parent), ui(new Ui::MainWindowForm) @@ -18,8 +16,8 @@ connect(TimeCounterUtil::getInstance().clockTimer, &QTimer::timeout, this, &MainWindowForm::onUpdateTimestampHandler); TimeCounterUtil::getInstance().clockTimer->start(1000); - /** 临时调试代码 **/ - emit ui->btnInfomation->clicked(); + // 自动加载第一个页面 + emit ui->btnCalibration->clicked(); } MainWindowForm::~MainWindowForm() @@ -37,7 +35,7 @@ { setWindowFlags(Qt::FramelessWindowHint); // 设置全屏 setWindowState(Qt::WindowState::WindowMaximized); - this->setTitleBar(ui->wdgtTop); + // 设置窗口位置和大小 move(0, 0); @@ -46,42 +44,31 @@ qint16 screenHeight = screenRect.height(); resize(screenWidth, screenHeight); + // 设置标题栏 以绑定和触发鼠标双击事件 + this->setTitleBar(ui->wdgtTop); + connect(this, &MainWindowForm::titleDblClick, this, &MainWindowForm::titleDblClickHandler); + // 加载样式表 QString qssStyle = QssFileUtils::loadQssFileContent(":/qss/mainForm.css"); if (qssStyle.isEmpty() == false) { ui->wdgtTop->setStyleSheet(qssStyle); // 仅本窗口生效 + ui->wdgtContent->setStyleSheet("QWidget{background: #FFFFFF;}"); } - // 设置标题 + // 设置标题文字 ui->labelTitle->setText(SettingConfig::getInstance().CLIENT_TITLE); setWindowTitle(SettingConfig::getInstance().CLIENT_TITLE); - // 设置最小尺寸(宽度, 高度) lxc - QScreen *screen = QGuiApplication::primaryScreen(); - QRect screenSize = screen->availableGeometry(); // 可用区域(排除任务栏) - // 设置最小尺寸为屏幕宽度的 80%,高度 600 - int minWidth = screenSize.width() * 0.8; + int minWidth = screenWidth * 0.8; this->setMinimumSize(minWidth, 600); } void MainWindowForm::initMenuWidgets() { + wdgtCaliMain = new CalibrationMainForm(this); + wdgtCheckMain = new CheckMainForm(this); wdgtInfoMain = new InfoMainForm(this); -// wdgtInfo = new TF_InfoManag(this); -// wdgtCheckMethod = new CheckMethodManage(this); -// wdgtCheck = new CheckWindow(this); -// wdgtData = new TF_TextDataManag(this); -// wdgtCert = new TF_CertificateApproval(this); -// wdgtUserMan = new TF_UserManag(this); -// wdgtTestDev = new TF_TextDevice(this); -// wdgtStandDev = new tf_StandardDevice(this); - -// wdgtStdDevForm = new StandardDeviceForm(this); -// wdgtEqptDevForm = new TestDeviceForm(this); -// wdgtFileResForm = new FileResourcesForm(this); - -// wdgtCalibrationForm = new CalibrationForm(this); // 绑定事件 // connect(wdgtCalibrationForm, &CalibrationForm::enableMenuButtons, this, &MainWindowForm::onMenuButtonsEabled); @@ -89,18 +76,9 @@ // connect(wdgtCheck, &CheckWindow::BarsetEnabled, this, &MainWindowForm::onMenuButtonsEabled); // 添加到stackWidget中 + ui->wdgtContent->insertWidget(0, wdgtCaliMain); + ui->wdgtContent->insertWidget(1, wdgtCheckMain); ui->wdgtContent->insertWidget(2, wdgtInfoMain); -// ui->wdgtContent->insertWidget(0, wdgtCalibrationForm); -// ui->wdgtContent->insertWidget(1, wdgtStdDevForm); -// ui->wdgtContent->insertWidget(1, wdgtStandDev); -// ui->wdgtContent->insertWidget(2, wdgtTestDev); -// ui->wdgtContent->insertWidget(2, wdgtEqptDevForm); -// ui->wdgtContent->insertWidget(3, wdgtCheckMethod); -// ui->wdgtContent->insertWidget(4, wdgtCheck); -// ui->wdgtContent->insertWidget(5, wdgtData); -// ui->wdgtContent->insertWidget(6, wdgtCert); -// ui->wdgtContent->insertWidget(7, wdgtFileResForm); -// ui->wdgtContent->insertWidget(8, wdgtUserMan); } void MainWindowForm::initFunctionButtons() @@ -115,7 +93,6 @@ funcButtGroup->addButton(funcButt); connect(funcButt, &QToolButton::clicked, this, &MainWindowForm::onFunctionButtonsAction); } - connect(this, SIGNAL(titleDblClick()), this, SLOT(titleDblClick())); } void MainWindowForm::on_btnMinWin_clicked() @@ -125,17 +102,12 @@ 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(); + ui->btnMaxWin->setToolTip("最大化"); } else { - resize(screenSize.width(), screenSize.height()); - move(0, 0); this->showMaximized(); + ui->btnMaxWin->setToolTip("还原"); } } @@ -165,7 +137,7 @@ ui->labelTime->setText(now.toString("yyyy-MM-dd HH:mm:ss")); } -void MainWindowForm::titleDblClick() +void MainWindowForm::titleDblClickHandler() { on_btnMaxWin_clicked(); } diff --git a/frame/MainWindowForm.h b/frame/MainWindowForm.h index 9b4eae4..aa5330c 100644 --- a/frame/MainWindowForm.h +++ b/frame/MainWindowForm.h @@ -13,21 +13,8 @@ #include "frame/FramelessWindow.h" #include "infomation/InfoMainForm.h" - -//#include "infomation/standDev/StandardDeviceForm.h" -//#include "infomation/testDev/TestDeviceForm.h" -//#include "infomation/fileRes/FileResourcesForm.h" - -//#include "calibration/CalibrationForm.h" - -//#include "TimeFreq/tf_standarddevice.h" -//#include "TimeFreq/tf_certificateapproval.h" -//#include "TimeFreq/tf_infomanag.h" -//#include "TimeFreq/tf_textdatamanag.h" -//#include "TimeFreq/tf_textdevice.h" -//#include "TimeFreq/tf_usermanag.h" -//#include "checkmethodmanage.h" -//#include "checkwindow.h" +#include "calibration/CalibrationMainForm.h" +#include "check/CheckMainForm.h" namespace Ui { class MainWindowForm; @@ -50,29 +37,16 @@ void onFunctionButtonsAction(); void onUpdateTimestampHandler(); - void titleDblClick(); + void titleDblClickHandler(); void onMenuButtonsEabled(bool enable); private: Ui::MainWindowForm *ui; + CalibrationMainForm * wdgtCaliMain; + CheckMainForm * wdgtCheckMain; InfoMainForm * wdgtInfoMain; -// TF_InfoManag * wdgtInfo; -// CheckMethodManage * wdgtCheckMethod; -// CheckWindow * wdgtCheck; -// TF_TextDataManag * wdgtData; -// TF_CertificateApproval * wdgtCert; -// TF_UserManag * wdgtUserMan; -// tf_StandardDevice * wdgtStandDev; -// TF_TextDevice * wdgtTestDev; - -// StandardDeviceForm * wdgtStdDevForm; -// TestDeviceForm * wdgtEqptDevForm; -// FileResourcesForm * wdgtFileResForm; - -// CalibrationForm * wdgtCalibrationForm; - void initForm(); void initMenuWidgets(); void initFunctionButtons(); diff --git a/frame/MainWindowForm.ui b/frame/MainWindowForm.ui index d3fd4fe..e0638e1 100644 --- a/frame/MainWindowForm.ui +++ b/frame/MainWindowForm.ui @@ -271,6 +271,18 @@ + + + 0 + 0 + + + + + 240 + 0 + + 240 @@ -295,6 +307,18 @@ + + + 0 + 0 + + + + + 0 + 40 + + @@ -392,6 +416,18 @@ + + + 0 + 0 + + + + + 240 + 0 + + 240 @@ -422,6 +458,12 @@ 0 + + + 0 + 40 + + 5 @@ -459,6 +501,9 @@ 24 + + 设置 + @@ -509,7 +554,7 @@ - 最小化 + 还原 diff --git a/infomation/task/DeptTaskForm.cpp b/infomation/task/DeptTaskForm.cpp index 208973c..b7d771b 100644 --- a/infomation/task/DeptTaskForm.cpp +++ b/infomation/task/DeptTaskForm.cpp @@ -33,7 +33,7 @@ void DeptTaskForm::initForm() { // 加载样式表 - QString qssStyle = QssFileUtils::loadQssFileContent(QApplication::applicationDirPath() + "/qss/infoTable.css"); + QString qssStyle = QssFileUtils::loadQssFileContent(":/qss/infoTable.css"); if (qssStyle.isEmpty() == false) { this->setStyleSheet(qssStyle); // 仅本窗口生效 } diff --git a/res/image/main/calibration.png b/res/image/main/calibration.png deleted file mode 100644 index 9d6de19..0000000 --- a/res/image/main/calibration.png +++ /dev/null Binary files differ diff --git a/res/image/main/certApproval.png b/res/image/main/certApproval.png deleted file mode 100644 index 45147a6..0000000 --- a/res/image/main/certApproval.png +++ /dev/null Binary files differ diff --git a/res/image/main/checkDevice.png b/res/image/main/checkDevice.png deleted file mode 100644 index 3e9307a..0000000 --- a/res/image/main/checkDevice.png +++ /dev/null Binary files differ diff --git a/res/image/main/checkProgram.png b/res/image/main/checkProgram.png deleted file mode 100644 index e75ef50..0000000 --- a/res/image/main/checkProgram.png +++ /dev/null Binary files differ diff --git a/res/image/main/fileRes.png b/res/image/main/fileRes.png deleted file mode 100644 index 99b9b45..0000000 --- a/res/image/main/fileRes.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_menu_calibration.png b/res/image/main/icon_menu_calibration.png index 6fca8be..cbc7bfc 100644 --- a/res/image/main/icon_menu_calibration.png +++ 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 index 17f918f..3f140c6 100644 --- a/res/image/main/icon_menu_calibration_selected.png +++ 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 index c3db5fa..0a714a4 100644 --- a/res/image/main/icon_menu_check.png +++ 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 index 9794c43..9546177 100644 --- a/res/image/main/icon_menu_check_selected.png +++ 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 index e272f4c..73f2a24 100644 --- a/res/image/main/icon_menu_infomation.png +++ 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 index 6122c7b..bcb8e30 100644 --- a/res/image/main/icon_menu_infomation_checked.png +++ b/res/image/main/icon_menu_infomation_checked.png Binary files differ diff --git a/res/image/main/info.png b/res/image/main/info.png deleted file mode 100644 index a762db4..0000000 --- a/res/image/main/info.png +++ /dev/null Binary files differ diff --git a/res/image/main/rawDataRecord.png b/res/image/main/rawDataRecord.png deleted file mode 100644 index dd25617..0000000 --- a/res/image/main/rawDataRecord.png +++ /dev/null Binary files differ diff --git a/res/image/main/staff.png b/res/image/main/staff.png deleted file mode 100644 index a581e5f..0000000 --- a/res/image/main/staff.png +++ /dev/null Binary files differ diff --git a/calibration/CalibrationMainForm.cpp b/calibration/CalibrationMainForm.cpp new file mode 100644 index 0000000..9b778a5 --- /dev/null +++ b/calibration/CalibrationMainForm.cpp @@ -0,0 +1,14 @@ +#include "CalibrationMainForm.h" +#include "ui_CalibrationMainForm.h" + +CalibrationMainForm::CalibrationMainForm(QWidget *parent) : + QWidget(parent), + ui(new Ui::CalibrationMainForm) +{ + ui->setupUi(this); +} + +CalibrationMainForm::~CalibrationMainForm() +{ + delete ui; +} diff --git a/calibration/CalibrationMainForm.h b/calibration/CalibrationMainForm.h new file mode 100644 index 0000000..7d75014 --- /dev/null +++ b/calibration/CalibrationMainForm.h @@ -0,0 +1,22 @@ +#ifndef CALIBRATIONMAINFORM_H +#define CALIBRATIONMAINFORM_H + +#include + +namespace Ui { +class CalibrationMainForm; +} + +class CalibrationMainForm : public QWidget +{ + Q_OBJECT + +public: + explicit CalibrationMainForm(QWidget *parent = nullptr); + ~CalibrationMainForm(); + +private: + Ui::CalibrationMainForm *ui; +}; + +#endif // CALIBRATIONMAINFORM_H diff --git a/calibration/CalibrationMainForm.ui b/calibration/CalibrationMainForm.ui new file mode 100644 index 0000000..9b5a9c2 --- /dev/null +++ b/calibration/CalibrationMainForm.ui @@ -0,0 +1,21 @@ + + + + + CalibrationMainForm + + + + 0 + 0 + 400 + 300 + + + + Form + + + + + diff --git a/calibration/calibration.pri b/calibration/calibration.pri index e69de29..f0e9dfb 100644 --- a/calibration/calibration.pri +++ b/calibration/calibration.pri @@ -0,0 +1,4 @@ +HEADERS += $$PWD/CalibrationMainForm.h +SOURCES += $$PWD/CalibrationMainForm.cpp + +FORMS += $$PWD/CalibrationMainForm.ui diff --git a/check/CheckMainForm.cpp b/check/CheckMainForm.cpp new file mode 100644 index 0000000..1725277 --- /dev/null +++ b/check/CheckMainForm.cpp @@ -0,0 +1,14 @@ +#include "CheckMainForm.h" +#include "ui_CheckMainForm.h" + +CheckMainForm::CheckMainForm(QWidget *parent) : + QWidget(parent), + ui(new Ui::CheckMainForm) +{ + ui->setupUi(this); +} + +CheckMainForm::~CheckMainForm() +{ + delete ui; +} diff --git a/check/CheckMainForm.h b/check/CheckMainForm.h new file mode 100644 index 0000000..c71001e --- /dev/null +++ b/check/CheckMainForm.h @@ -0,0 +1,22 @@ +#ifndef CHECKMAINFORM_H +#define CHECKMAINFORM_H + +#include + +namespace Ui { +class CheckMainForm; +} + +class CheckMainForm : public QWidget +{ + Q_OBJECT + +public: + explicit CheckMainForm(QWidget *parent = nullptr); + ~CheckMainForm(); + +private: + Ui::CheckMainForm *ui; +}; + +#endif // CHECKMAINFORM_H diff --git a/check/CheckMainForm.ui b/check/CheckMainForm.ui new file mode 100644 index 0000000..76ca74d --- /dev/null +++ b/check/CheckMainForm.ui @@ -0,0 +1,21 @@ + + + + + CheckMainForm + + + + 0 + 0 + 400 + 300 + + + + Form + + + + + diff --git a/check/check.pri b/check/check.pri index e69de29..624bd3f 100644 --- a/check/check.pri +++ b/check/check.pri @@ -0,0 +1,4 @@ +HEADERS += $$PWD/CheckMainForm.h +SOURCES += $$PWD/CheckMainForm.cpp + +FORMS += $$PWD/CheckMainForm.ui diff --git a/frame/FramelessWindow.cpp b/frame/FramelessWindow.cpp index d323ae5..5727866 100644 --- a/frame/FramelessWindow.cpp +++ b/frame/FramelessWindow.cpp @@ -1,4 +1,8 @@ -#include "FramelessWindow.h" +#include +#include +#include + +#include "FramelessWindow.h" #ifdef Q_OS_WIN #include "windows.h" @@ -63,6 +67,12 @@ resizeEnable = false; } + if (!isMaximized()) { + QRect screenRect = QApplication::screens().at(0)->availableGeometry(); + resize(screenRect.width() * 0.9, screenRect.height() * 0.9); + move(QRandomGenerator::global()->bounded(10, 100), QRandomGenerator::global()->bounded(10, 50)); + } + //发出最大化最小化等改变事件,以便界面上更改对应的信息比如右上角图标和文字 Q_EMIT windowStateChange(!moveEnable); diff --git a/frame/MainWindowForm.cpp b/frame/MainWindowForm.cpp index cb98f69..0791c77 100644 --- a/frame/MainWindowForm.cpp +++ b/frame/MainWindowForm.cpp @@ -1,8 +1,6 @@ #include "MainWindowForm.h" #include "ui_MainWindowForm.h" -#include - MainWindowForm::MainWindowForm(QWidget *parent) : FramelessWindow(parent), ui(new Ui::MainWindowForm) @@ -18,8 +16,8 @@ connect(TimeCounterUtil::getInstance().clockTimer, &QTimer::timeout, this, &MainWindowForm::onUpdateTimestampHandler); TimeCounterUtil::getInstance().clockTimer->start(1000); - /** 临时调试代码 **/ - emit ui->btnInfomation->clicked(); + // 自动加载第一个页面 + emit ui->btnCalibration->clicked(); } MainWindowForm::~MainWindowForm() @@ -37,7 +35,7 @@ { setWindowFlags(Qt::FramelessWindowHint); // 设置全屏 setWindowState(Qt::WindowState::WindowMaximized); - this->setTitleBar(ui->wdgtTop); + // 设置窗口位置和大小 move(0, 0); @@ -46,42 +44,31 @@ qint16 screenHeight = screenRect.height(); resize(screenWidth, screenHeight); + // 设置标题栏 以绑定和触发鼠标双击事件 + this->setTitleBar(ui->wdgtTop); + connect(this, &MainWindowForm::titleDblClick, this, &MainWindowForm::titleDblClickHandler); + // 加载样式表 QString qssStyle = QssFileUtils::loadQssFileContent(":/qss/mainForm.css"); if (qssStyle.isEmpty() == false) { ui->wdgtTop->setStyleSheet(qssStyle); // 仅本窗口生效 + ui->wdgtContent->setStyleSheet("QWidget{background: #FFFFFF;}"); } - // 设置标题 + // 设置标题文字 ui->labelTitle->setText(SettingConfig::getInstance().CLIENT_TITLE); setWindowTitle(SettingConfig::getInstance().CLIENT_TITLE); - // 设置最小尺寸(宽度, 高度) lxc - QScreen *screen = QGuiApplication::primaryScreen(); - QRect screenSize = screen->availableGeometry(); // 可用区域(排除任务栏) - // 设置最小尺寸为屏幕宽度的 80%,高度 600 - int minWidth = screenSize.width() * 0.8; + int minWidth = screenWidth * 0.8; this->setMinimumSize(minWidth, 600); } void MainWindowForm::initMenuWidgets() { + wdgtCaliMain = new CalibrationMainForm(this); + wdgtCheckMain = new CheckMainForm(this); wdgtInfoMain = new InfoMainForm(this); -// wdgtInfo = new TF_InfoManag(this); -// wdgtCheckMethod = new CheckMethodManage(this); -// wdgtCheck = new CheckWindow(this); -// wdgtData = new TF_TextDataManag(this); -// wdgtCert = new TF_CertificateApproval(this); -// wdgtUserMan = new TF_UserManag(this); -// wdgtTestDev = new TF_TextDevice(this); -// wdgtStandDev = new tf_StandardDevice(this); - -// wdgtStdDevForm = new StandardDeviceForm(this); -// wdgtEqptDevForm = new TestDeviceForm(this); -// wdgtFileResForm = new FileResourcesForm(this); - -// wdgtCalibrationForm = new CalibrationForm(this); // 绑定事件 // connect(wdgtCalibrationForm, &CalibrationForm::enableMenuButtons, this, &MainWindowForm::onMenuButtonsEabled); @@ -89,18 +76,9 @@ // connect(wdgtCheck, &CheckWindow::BarsetEnabled, this, &MainWindowForm::onMenuButtonsEabled); // 添加到stackWidget中 + ui->wdgtContent->insertWidget(0, wdgtCaliMain); + ui->wdgtContent->insertWidget(1, wdgtCheckMain); ui->wdgtContent->insertWidget(2, wdgtInfoMain); -// ui->wdgtContent->insertWidget(0, wdgtCalibrationForm); -// ui->wdgtContent->insertWidget(1, wdgtStdDevForm); -// ui->wdgtContent->insertWidget(1, wdgtStandDev); -// ui->wdgtContent->insertWidget(2, wdgtTestDev); -// ui->wdgtContent->insertWidget(2, wdgtEqptDevForm); -// ui->wdgtContent->insertWidget(3, wdgtCheckMethod); -// ui->wdgtContent->insertWidget(4, wdgtCheck); -// ui->wdgtContent->insertWidget(5, wdgtData); -// ui->wdgtContent->insertWidget(6, wdgtCert); -// ui->wdgtContent->insertWidget(7, wdgtFileResForm); -// ui->wdgtContent->insertWidget(8, wdgtUserMan); } void MainWindowForm::initFunctionButtons() @@ -115,7 +93,6 @@ funcButtGroup->addButton(funcButt); connect(funcButt, &QToolButton::clicked, this, &MainWindowForm::onFunctionButtonsAction); } - connect(this, SIGNAL(titleDblClick()), this, SLOT(titleDblClick())); } void MainWindowForm::on_btnMinWin_clicked() @@ -125,17 +102,12 @@ 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(); + ui->btnMaxWin->setToolTip("最大化"); } else { - resize(screenSize.width(), screenSize.height()); - move(0, 0); this->showMaximized(); + ui->btnMaxWin->setToolTip("还原"); } } @@ -165,7 +137,7 @@ ui->labelTime->setText(now.toString("yyyy-MM-dd HH:mm:ss")); } -void MainWindowForm::titleDblClick() +void MainWindowForm::titleDblClickHandler() { on_btnMaxWin_clicked(); } diff --git a/frame/MainWindowForm.h b/frame/MainWindowForm.h index 9b4eae4..aa5330c 100644 --- a/frame/MainWindowForm.h +++ b/frame/MainWindowForm.h @@ -13,21 +13,8 @@ #include "frame/FramelessWindow.h" #include "infomation/InfoMainForm.h" - -//#include "infomation/standDev/StandardDeviceForm.h" -//#include "infomation/testDev/TestDeviceForm.h" -//#include "infomation/fileRes/FileResourcesForm.h" - -//#include "calibration/CalibrationForm.h" - -//#include "TimeFreq/tf_standarddevice.h" -//#include "TimeFreq/tf_certificateapproval.h" -//#include "TimeFreq/tf_infomanag.h" -//#include "TimeFreq/tf_textdatamanag.h" -//#include "TimeFreq/tf_textdevice.h" -//#include "TimeFreq/tf_usermanag.h" -//#include "checkmethodmanage.h" -//#include "checkwindow.h" +#include "calibration/CalibrationMainForm.h" +#include "check/CheckMainForm.h" namespace Ui { class MainWindowForm; @@ -50,29 +37,16 @@ void onFunctionButtonsAction(); void onUpdateTimestampHandler(); - void titleDblClick(); + void titleDblClickHandler(); void onMenuButtonsEabled(bool enable); private: Ui::MainWindowForm *ui; + CalibrationMainForm * wdgtCaliMain; + CheckMainForm * wdgtCheckMain; InfoMainForm * wdgtInfoMain; -// TF_InfoManag * wdgtInfo; -// CheckMethodManage * wdgtCheckMethod; -// CheckWindow * wdgtCheck; -// TF_TextDataManag * wdgtData; -// TF_CertificateApproval * wdgtCert; -// TF_UserManag * wdgtUserMan; -// tf_StandardDevice * wdgtStandDev; -// TF_TextDevice * wdgtTestDev; - -// StandardDeviceForm * wdgtStdDevForm; -// TestDeviceForm * wdgtEqptDevForm; -// FileResourcesForm * wdgtFileResForm; - -// CalibrationForm * wdgtCalibrationForm; - void initForm(); void initMenuWidgets(); void initFunctionButtons(); diff --git a/frame/MainWindowForm.ui b/frame/MainWindowForm.ui index d3fd4fe..e0638e1 100644 --- a/frame/MainWindowForm.ui +++ b/frame/MainWindowForm.ui @@ -271,6 +271,18 @@ + + + 0 + 0 + + + + + 240 + 0 + + 240 @@ -295,6 +307,18 @@ + + + 0 + 0 + + + + + 0 + 40 + + @@ -392,6 +416,18 @@ + + + 0 + 0 + + + + + 240 + 0 + + 240 @@ -422,6 +458,12 @@ 0 + + + 0 + 40 + + 5 @@ -459,6 +501,9 @@ 24 + + 设置 + @@ -509,7 +554,7 @@ - 最小化 + 还原 diff --git a/infomation/task/DeptTaskForm.cpp b/infomation/task/DeptTaskForm.cpp index 208973c..b7d771b 100644 --- a/infomation/task/DeptTaskForm.cpp +++ b/infomation/task/DeptTaskForm.cpp @@ -33,7 +33,7 @@ void DeptTaskForm::initForm() { // 加载样式表 - QString qssStyle = QssFileUtils::loadQssFileContent(QApplication::applicationDirPath() + "/qss/infoTable.css"); + QString qssStyle = QssFileUtils::loadQssFileContent(":/qss/infoTable.css"); if (qssStyle.isEmpty() == false) { this->setStyleSheet(qssStyle); // 仅本窗口生效 } diff --git a/res/image/main/calibration.png b/res/image/main/calibration.png deleted file mode 100644 index 9d6de19..0000000 --- a/res/image/main/calibration.png +++ /dev/null Binary files differ diff --git a/res/image/main/certApproval.png b/res/image/main/certApproval.png deleted file mode 100644 index 45147a6..0000000 --- a/res/image/main/certApproval.png +++ /dev/null Binary files differ diff --git a/res/image/main/checkDevice.png b/res/image/main/checkDevice.png deleted file mode 100644 index 3e9307a..0000000 --- a/res/image/main/checkDevice.png +++ /dev/null Binary files differ diff --git a/res/image/main/checkProgram.png b/res/image/main/checkProgram.png deleted file mode 100644 index e75ef50..0000000 --- a/res/image/main/checkProgram.png +++ /dev/null Binary files differ diff --git a/res/image/main/fileRes.png b/res/image/main/fileRes.png deleted file mode 100644 index 99b9b45..0000000 --- a/res/image/main/fileRes.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_menu_calibration.png b/res/image/main/icon_menu_calibration.png index 6fca8be..cbc7bfc 100644 --- a/res/image/main/icon_menu_calibration.png +++ 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 index 17f918f..3f140c6 100644 --- a/res/image/main/icon_menu_calibration_selected.png +++ 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 index c3db5fa..0a714a4 100644 --- a/res/image/main/icon_menu_check.png +++ 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 index 9794c43..9546177 100644 --- a/res/image/main/icon_menu_check_selected.png +++ 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 index e272f4c..73f2a24 100644 --- a/res/image/main/icon_menu_infomation.png +++ 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 index 6122c7b..bcb8e30 100644 --- a/res/image/main/icon_menu_infomation_checked.png +++ b/res/image/main/icon_menu_infomation_checked.png Binary files differ diff --git a/res/image/main/info.png b/res/image/main/info.png deleted file mode 100644 index a762db4..0000000 --- a/res/image/main/info.png +++ /dev/null Binary files differ diff --git a/res/image/main/rawDataRecord.png b/res/image/main/rawDataRecord.png deleted file mode 100644 index dd25617..0000000 --- a/res/image/main/rawDataRecord.png +++ /dev/null Binary files differ diff --git a/res/image/main/staff.png b/res/image/main/staff.png deleted file mode 100644 index a581e5f..0000000 --- a/res/image/main/staff.png +++ /dev/null Binary files differ diff --git a/res/image/main/standDevice.png b/res/image/main/standDevice.png deleted file mode 100644 index 48cbce1..0000000 --- a/res/image/main/standDevice.png +++ /dev/null Binary files differ diff --git a/calibration/CalibrationMainForm.cpp b/calibration/CalibrationMainForm.cpp new file mode 100644 index 0000000..9b778a5 --- /dev/null +++ b/calibration/CalibrationMainForm.cpp @@ -0,0 +1,14 @@ +#include "CalibrationMainForm.h" +#include "ui_CalibrationMainForm.h" + +CalibrationMainForm::CalibrationMainForm(QWidget *parent) : + QWidget(parent), + ui(new Ui::CalibrationMainForm) +{ + ui->setupUi(this); +} + +CalibrationMainForm::~CalibrationMainForm() +{ + delete ui; +} diff --git a/calibration/CalibrationMainForm.h b/calibration/CalibrationMainForm.h new file mode 100644 index 0000000..7d75014 --- /dev/null +++ b/calibration/CalibrationMainForm.h @@ -0,0 +1,22 @@ +#ifndef CALIBRATIONMAINFORM_H +#define CALIBRATIONMAINFORM_H + +#include + +namespace Ui { +class CalibrationMainForm; +} + +class CalibrationMainForm : public QWidget +{ + Q_OBJECT + +public: + explicit CalibrationMainForm(QWidget *parent = nullptr); + ~CalibrationMainForm(); + +private: + Ui::CalibrationMainForm *ui; +}; + +#endif // CALIBRATIONMAINFORM_H diff --git a/calibration/CalibrationMainForm.ui b/calibration/CalibrationMainForm.ui new file mode 100644 index 0000000..9b5a9c2 --- /dev/null +++ b/calibration/CalibrationMainForm.ui @@ -0,0 +1,21 @@ + + + + + CalibrationMainForm + + + + 0 + 0 + 400 + 300 + + + + Form + + + + + diff --git a/calibration/calibration.pri b/calibration/calibration.pri index e69de29..f0e9dfb 100644 --- a/calibration/calibration.pri +++ b/calibration/calibration.pri @@ -0,0 +1,4 @@ +HEADERS += $$PWD/CalibrationMainForm.h +SOURCES += $$PWD/CalibrationMainForm.cpp + +FORMS += $$PWD/CalibrationMainForm.ui diff --git a/check/CheckMainForm.cpp b/check/CheckMainForm.cpp new file mode 100644 index 0000000..1725277 --- /dev/null +++ b/check/CheckMainForm.cpp @@ -0,0 +1,14 @@ +#include "CheckMainForm.h" +#include "ui_CheckMainForm.h" + +CheckMainForm::CheckMainForm(QWidget *parent) : + QWidget(parent), + ui(new Ui::CheckMainForm) +{ + ui->setupUi(this); +} + +CheckMainForm::~CheckMainForm() +{ + delete ui; +} diff --git a/check/CheckMainForm.h b/check/CheckMainForm.h new file mode 100644 index 0000000..c71001e --- /dev/null +++ b/check/CheckMainForm.h @@ -0,0 +1,22 @@ +#ifndef CHECKMAINFORM_H +#define CHECKMAINFORM_H + +#include + +namespace Ui { +class CheckMainForm; +} + +class CheckMainForm : public QWidget +{ + Q_OBJECT + +public: + explicit CheckMainForm(QWidget *parent = nullptr); + ~CheckMainForm(); + +private: + Ui::CheckMainForm *ui; +}; + +#endif // CHECKMAINFORM_H diff --git a/check/CheckMainForm.ui b/check/CheckMainForm.ui new file mode 100644 index 0000000..76ca74d --- /dev/null +++ b/check/CheckMainForm.ui @@ -0,0 +1,21 @@ + + + + + CheckMainForm + + + + 0 + 0 + 400 + 300 + + + + Form + + + + + diff --git a/check/check.pri b/check/check.pri index e69de29..624bd3f 100644 --- a/check/check.pri +++ b/check/check.pri @@ -0,0 +1,4 @@ +HEADERS += $$PWD/CheckMainForm.h +SOURCES += $$PWD/CheckMainForm.cpp + +FORMS += $$PWD/CheckMainForm.ui diff --git a/frame/FramelessWindow.cpp b/frame/FramelessWindow.cpp index d323ae5..5727866 100644 --- a/frame/FramelessWindow.cpp +++ b/frame/FramelessWindow.cpp @@ -1,4 +1,8 @@ -#include "FramelessWindow.h" +#include +#include +#include + +#include "FramelessWindow.h" #ifdef Q_OS_WIN #include "windows.h" @@ -63,6 +67,12 @@ resizeEnable = false; } + if (!isMaximized()) { + QRect screenRect = QApplication::screens().at(0)->availableGeometry(); + resize(screenRect.width() * 0.9, screenRect.height() * 0.9); + move(QRandomGenerator::global()->bounded(10, 100), QRandomGenerator::global()->bounded(10, 50)); + } + //发出最大化最小化等改变事件,以便界面上更改对应的信息比如右上角图标和文字 Q_EMIT windowStateChange(!moveEnable); diff --git a/frame/MainWindowForm.cpp b/frame/MainWindowForm.cpp index cb98f69..0791c77 100644 --- a/frame/MainWindowForm.cpp +++ b/frame/MainWindowForm.cpp @@ -1,8 +1,6 @@ #include "MainWindowForm.h" #include "ui_MainWindowForm.h" -#include - MainWindowForm::MainWindowForm(QWidget *parent) : FramelessWindow(parent), ui(new Ui::MainWindowForm) @@ -18,8 +16,8 @@ connect(TimeCounterUtil::getInstance().clockTimer, &QTimer::timeout, this, &MainWindowForm::onUpdateTimestampHandler); TimeCounterUtil::getInstance().clockTimer->start(1000); - /** 临时调试代码 **/ - emit ui->btnInfomation->clicked(); + // 自动加载第一个页面 + emit ui->btnCalibration->clicked(); } MainWindowForm::~MainWindowForm() @@ -37,7 +35,7 @@ { setWindowFlags(Qt::FramelessWindowHint); // 设置全屏 setWindowState(Qt::WindowState::WindowMaximized); - this->setTitleBar(ui->wdgtTop); + // 设置窗口位置和大小 move(0, 0); @@ -46,42 +44,31 @@ qint16 screenHeight = screenRect.height(); resize(screenWidth, screenHeight); + // 设置标题栏 以绑定和触发鼠标双击事件 + this->setTitleBar(ui->wdgtTop); + connect(this, &MainWindowForm::titleDblClick, this, &MainWindowForm::titleDblClickHandler); + // 加载样式表 QString qssStyle = QssFileUtils::loadQssFileContent(":/qss/mainForm.css"); if (qssStyle.isEmpty() == false) { ui->wdgtTop->setStyleSheet(qssStyle); // 仅本窗口生效 + ui->wdgtContent->setStyleSheet("QWidget{background: #FFFFFF;}"); } - // 设置标题 + // 设置标题文字 ui->labelTitle->setText(SettingConfig::getInstance().CLIENT_TITLE); setWindowTitle(SettingConfig::getInstance().CLIENT_TITLE); - // 设置最小尺寸(宽度, 高度) lxc - QScreen *screen = QGuiApplication::primaryScreen(); - QRect screenSize = screen->availableGeometry(); // 可用区域(排除任务栏) - // 设置最小尺寸为屏幕宽度的 80%,高度 600 - int minWidth = screenSize.width() * 0.8; + int minWidth = screenWidth * 0.8; this->setMinimumSize(minWidth, 600); } void MainWindowForm::initMenuWidgets() { + wdgtCaliMain = new CalibrationMainForm(this); + wdgtCheckMain = new CheckMainForm(this); wdgtInfoMain = new InfoMainForm(this); -// wdgtInfo = new TF_InfoManag(this); -// wdgtCheckMethod = new CheckMethodManage(this); -// wdgtCheck = new CheckWindow(this); -// wdgtData = new TF_TextDataManag(this); -// wdgtCert = new TF_CertificateApproval(this); -// wdgtUserMan = new TF_UserManag(this); -// wdgtTestDev = new TF_TextDevice(this); -// wdgtStandDev = new tf_StandardDevice(this); - -// wdgtStdDevForm = new StandardDeviceForm(this); -// wdgtEqptDevForm = new TestDeviceForm(this); -// wdgtFileResForm = new FileResourcesForm(this); - -// wdgtCalibrationForm = new CalibrationForm(this); // 绑定事件 // connect(wdgtCalibrationForm, &CalibrationForm::enableMenuButtons, this, &MainWindowForm::onMenuButtonsEabled); @@ -89,18 +76,9 @@ // connect(wdgtCheck, &CheckWindow::BarsetEnabled, this, &MainWindowForm::onMenuButtonsEabled); // 添加到stackWidget中 + ui->wdgtContent->insertWidget(0, wdgtCaliMain); + ui->wdgtContent->insertWidget(1, wdgtCheckMain); ui->wdgtContent->insertWidget(2, wdgtInfoMain); -// ui->wdgtContent->insertWidget(0, wdgtCalibrationForm); -// ui->wdgtContent->insertWidget(1, wdgtStdDevForm); -// ui->wdgtContent->insertWidget(1, wdgtStandDev); -// ui->wdgtContent->insertWidget(2, wdgtTestDev); -// ui->wdgtContent->insertWidget(2, wdgtEqptDevForm); -// ui->wdgtContent->insertWidget(3, wdgtCheckMethod); -// ui->wdgtContent->insertWidget(4, wdgtCheck); -// ui->wdgtContent->insertWidget(5, wdgtData); -// ui->wdgtContent->insertWidget(6, wdgtCert); -// ui->wdgtContent->insertWidget(7, wdgtFileResForm); -// ui->wdgtContent->insertWidget(8, wdgtUserMan); } void MainWindowForm::initFunctionButtons() @@ -115,7 +93,6 @@ funcButtGroup->addButton(funcButt); connect(funcButt, &QToolButton::clicked, this, &MainWindowForm::onFunctionButtonsAction); } - connect(this, SIGNAL(titleDblClick()), this, SLOT(titleDblClick())); } void MainWindowForm::on_btnMinWin_clicked() @@ -125,17 +102,12 @@ 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(); + ui->btnMaxWin->setToolTip("最大化"); } else { - resize(screenSize.width(), screenSize.height()); - move(0, 0); this->showMaximized(); + ui->btnMaxWin->setToolTip("还原"); } } @@ -165,7 +137,7 @@ ui->labelTime->setText(now.toString("yyyy-MM-dd HH:mm:ss")); } -void MainWindowForm::titleDblClick() +void MainWindowForm::titleDblClickHandler() { on_btnMaxWin_clicked(); } diff --git a/frame/MainWindowForm.h b/frame/MainWindowForm.h index 9b4eae4..aa5330c 100644 --- a/frame/MainWindowForm.h +++ b/frame/MainWindowForm.h @@ -13,21 +13,8 @@ #include "frame/FramelessWindow.h" #include "infomation/InfoMainForm.h" - -//#include "infomation/standDev/StandardDeviceForm.h" -//#include "infomation/testDev/TestDeviceForm.h" -//#include "infomation/fileRes/FileResourcesForm.h" - -//#include "calibration/CalibrationForm.h" - -//#include "TimeFreq/tf_standarddevice.h" -//#include "TimeFreq/tf_certificateapproval.h" -//#include "TimeFreq/tf_infomanag.h" -//#include "TimeFreq/tf_textdatamanag.h" -//#include "TimeFreq/tf_textdevice.h" -//#include "TimeFreq/tf_usermanag.h" -//#include "checkmethodmanage.h" -//#include "checkwindow.h" +#include "calibration/CalibrationMainForm.h" +#include "check/CheckMainForm.h" namespace Ui { class MainWindowForm; @@ -50,29 +37,16 @@ void onFunctionButtonsAction(); void onUpdateTimestampHandler(); - void titleDblClick(); + void titleDblClickHandler(); void onMenuButtonsEabled(bool enable); private: Ui::MainWindowForm *ui; + CalibrationMainForm * wdgtCaliMain; + CheckMainForm * wdgtCheckMain; InfoMainForm * wdgtInfoMain; -// TF_InfoManag * wdgtInfo; -// CheckMethodManage * wdgtCheckMethod; -// CheckWindow * wdgtCheck; -// TF_TextDataManag * wdgtData; -// TF_CertificateApproval * wdgtCert; -// TF_UserManag * wdgtUserMan; -// tf_StandardDevice * wdgtStandDev; -// TF_TextDevice * wdgtTestDev; - -// StandardDeviceForm * wdgtStdDevForm; -// TestDeviceForm * wdgtEqptDevForm; -// FileResourcesForm * wdgtFileResForm; - -// CalibrationForm * wdgtCalibrationForm; - void initForm(); void initMenuWidgets(); void initFunctionButtons(); diff --git a/frame/MainWindowForm.ui b/frame/MainWindowForm.ui index d3fd4fe..e0638e1 100644 --- a/frame/MainWindowForm.ui +++ b/frame/MainWindowForm.ui @@ -271,6 +271,18 @@ + + + 0 + 0 + + + + + 240 + 0 + + 240 @@ -295,6 +307,18 @@ + + + 0 + 0 + + + + + 0 + 40 + + @@ -392,6 +416,18 @@ + + + 0 + 0 + + + + + 240 + 0 + + 240 @@ -422,6 +458,12 @@ 0 + + + 0 + 40 + + 5 @@ -459,6 +501,9 @@ 24 + + 设置 + @@ -509,7 +554,7 @@ - 最小化 + 还原 diff --git a/infomation/task/DeptTaskForm.cpp b/infomation/task/DeptTaskForm.cpp index 208973c..b7d771b 100644 --- a/infomation/task/DeptTaskForm.cpp +++ b/infomation/task/DeptTaskForm.cpp @@ -33,7 +33,7 @@ void DeptTaskForm::initForm() { // 加载样式表 - QString qssStyle = QssFileUtils::loadQssFileContent(QApplication::applicationDirPath() + "/qss/infoTable.css"); + QString qssStyle = QssFileUtils::loadQssFileContent(":/qss/infoTable.css"); if (qssStyle.isEmpty() == false) { this->setStyleSheet(qssStyle); // 仅本窗口生效 } diff --git a/res/image/main/calibration.png b/res/image/main/calibration.png deleted file mode 100644 index 9d6de19..0000000 --- a/res/image/main/calibration.png +++ /dev/null Binary files differ diff --git a/res/image/main/certApproval.png b/res/image/main/certApproval.png deleted file mode 100644 index 45147a6..0000000 --- a/res/image/main/certApproval.png +++ /dev/null Binary files differ diff --git a/res/image/main/checkDevice.png b/res/image/main/checkDevice.png deleted file mode 100644 index 3e9307a..0000000 --- a/res/image/main/checkDevice.png +++ /dev/null Binary files differ diff --git a/res/image/main/checkProgram.png b/res/image/main/checkProgram.png deleted file mode 100644 index e75ef50..0000000 --- a/res/image/main/checkProgram.png +++ /dev/null Binary files differ diff --git a/res/image/main/fileRes.png b/res/image/main/fileRes.png deleted file mode 100644 index 99b9b45..0000000 --- a/res/image/main/fileRes.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_menu_calibration.png b/res/image/main/icon_menu_calibration.png index 6fca8be..cbc7bfc 100644 --- a/res/image/main/icon_menu_calibration.png +++ 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 index 17f918f..3f140c6 100644 --- a/res/image/main/icon_menu_calibration_selected.png +++ 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 index c3db5fa..0a714a4 100644 --- a/res/image/main/icon_menu_check.png +++ 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 index 9794c43..9546177 100644 --- a/res/image/main/icon_menu_check_selected.png +++ 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 index e272f4c..73f2a24 100644 --- a/res/image/main/icon_menu_infomation.png +++ 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 index 6122c7b..bcb8e30 100644 --- a/res/image/main/icon_menu_infomation_checked.png +++ b/res/image/main/icon_menu_infomation_checked.png Binary files differ diff --git a/res/image/main/info.png b/res/image/main/info.png deleted file mode 100644 index a762db4..0000000 --- a/res/image/main/info.png +++ /dev/null Binary files differ diff --git a/res/image/main/rawDataRecord.png b/res/image/main/rawDataRecord.png deleted file mode 100644 index dd25617..0000000 --- a/res/image/main/rawDataRecord.png +++ /dev/null Binary files differ diff --git a/res/image/main/staff.png b/res/image/main/staff.png deleted file mode 100644 index a581e5f..0000000 --- a/res/image/main/staff.png +++ /dev/null Binary files differ diff --git a/res/image/main/standDevice.png b/res/image/main/standDevice.png deleted file mode 100644 index 48cbce1..0000000 --- a/res/image/main/standDevice.png +++ /dev/null Binary files differ diff --git a/res/image/msgbox/icon_box_confirm.png b/res/image/msgbox/icon_box_confirm.png index fda20c4..39c8969 100644 --- a/res/image/msgbox/icon_box_confirm.png +++ b/res/image/msgbox/icon_box_confirm.png Binary files differ diff --git a/calibration/CalibrationMainForm.cpp b/calibration/CalibrationMainForm.cpp new file mode 100644 index 0000000..9b778a5 --- /dev/null +++ b/calibration/CalibrationMainForm.cpp @@ -0,0 +1,14 @@ +#include "CalibrationMainForm.h" +#include "ui_CalibrationMainForm.h" + +CalibrationMainForm::CalibrationMainForm(QWidget *parent) : + QWidget(parent), + ui(new Ui::CalibrationMainForm) +{ + ui->setupUi(this); +} + +CalibrationMainForm::~CalibrationMainForm() +{ + delete ui; +} diff --git a/calibration/CalibrationMainForm.h b/calibration/CalibrationMainForm.h new file mode 100644 index 0000000..7d75014 --- /dev/null +++ b/calibration/CalibrationMainForm.h @@ -0,0 +1,22 @@ +#ifndef CALIBRATIONMAINFORM_H +#define CALIBRATIONMAINFORM_H + +#include + +namespace Ui { +class CalibrationMainForm; +} + +class CalibrationMainForm : public QWidget +{ + Q_OBJECT + +public: + explicit CalibrationMainForm(QWidget *parent = nullptr); + ~CalibrationMainForm(); + +private: + Ui::CalibrationMainForm *ui; +}; + +#endif // CALIBRATIONMAINFORM_H diff --git a/calibration/CalibrationMainForm.ui b/calibration/CalibrationMainForm.ui new file mode 100644 index 0000000..9b5a9c2 --- /dev/null +++ b/calibration/CalibrationMainForm.ui @@ -0,0 +1,21 @@ + + + + + CalibrationMainForm + + + + 0 + 0 + 400 + 300 + + + + Form + + + + + diff --git a/calibration/calibration.pri b/calibration/calibration.pri index e69de29..f0e9dfb 100644 --- a/calibration/calibration.pri +++ b/calibration/calibration.pri @@ -0,0 +1,4 @@ +HEADERS += $$PWD/CalibrationMainForm.h +SOURCES += $$PWD/CalibrationMainForm.cpp + +FORMS += $$PWD/CalibrationMainForm.ui diff --git a/check/CheckMainForm.cpp b/check/CheckMainForm.cpp new file mode 100644 index 0000000..1725277 --- /dev/null +++ b/check/CheckMainForm.cpp @@ -0,0 +1,14 @@ +#include "CheckMainForm.h" +#include "ui_CheckMainForm.h" + +CheckMainForm::CheckMainForm(QWidget *parent) : + QWidget(parent), + ui(new Ui::CheckMainForm) +{ + ui->setupUi(this); +} + +CheckMainForm::~CheckMainForm() +{ + delete ui; +} diff --git a/check/CheckMainForm.h b/check/CheckMainForm.h new file mode 100644 index 0000000..c71001e --- /dev/null +++ b/check/CheckMainForm.h @@ -0,0 +1,22 @@ +#ifndef CHECKMAINFORM_H +#define CHECKMAINFORM_H + +#include + +namespace Ui { +class CheckMainForm; +} + +class CheckMainForm : public QWidget +{ + Q_OBJECT + +public: + explicit CheckMainForm(QWidget *parent = nullptr); + ~CheckMainForm(); + +private: + Ui::CheckMainForm *ui; +}; + +#endif // CHECKMAINFORM_H diff --git a/check/CheckMainForm.ui b/check/CheckMainForm.ui new file mode 100644 index 0000000..76ca74d --- /dev/null +++ b/check/CheckMainForm.ui @@ -0,0 +1,21 @@ + + + + + CheckMainForm + + + + 0 + 0 + 400 + 300 + + + + Form + + + + + diff --git a/check/check.pri b/check/check.pri index e69de29..624bd3f 100644 --- a/check/check.pri +++ b/check/check.pri @@ -0,0 +1,4 @@ +HEADERS += $$PWD/CheckMainForm.h +SOURCES += $$PWD/CheckMainForm.cpp + +FORMS += $$PWD/CheckMainForm.ui diff --git a/frame/FramelessWindow.cpp b/frame/FramelessWindow.cpp index d323ae5..5727866 100644 --- a/frame/FramelessWindow.cpp +++ b/frame/FramelessWindow.cpp @@ -1,4 +1,8 @@ -#include "FramelessWindow.h" +#include +#include +#include + +#include "FramelessWindow.h" #ifdef Q_OS_WIN #include "windows.h" @@ -63,6 +67,12 @@ resizeEnable = false; } + if (!isMaximized()) { + QRect screenRect = QApplication::screens().at(0)->availableGeometry(); + resize(screenRect.width() * 0.9, screenRect.height() * 0.9); + move(QRandomGenerator::global()->bounded(10, 100), QRandomGenerator::global()->bounded(10, 50)); + } + //发出最大化最小化等改变事件,以便界面上更改对应的信息比如右上角图标和文字 Q_EMIT windowStateChange(!moveEnable); diff --git a/frame/MainWindowForm.cpp b/frame/MainWindowForm.cpp index cb98f69..0791c77 100644 --- a/frame/MainWindowForm.cpp +++ b/frame/MainWindowForm.cpp @@ -1,8 +1,6 @@ #include "MainWindowForm.h" #include "ui_MainWindowForm.h" -#include - MainWindowForm::MainWindowForm(QWidget *parent) : FramelessWindow(parent), ui(new Ui::MainWindowForm) @@ -18,8 +16,8 @@ connect(TimeCounterUtil::getInstance().clockTimer, &QTimer::timeout, this, &MainWindowForm::onUpdateTimestampHandler); TimeCounterUtil::getInstance().clockTimer->start(1000); - /** 临时调试代码 **/ - emit ui->btnInfomation->clicked(); + // 自动加载第一个页面 + emit ui->btnCalibration->clicked(); } MainWindowForm::~MainWindowForm() @@ -37,7 +35,7 @@ { setWindowFlags(Qt::FramelessWindowHint); // 设置全屏 setWindowState(Qt::WindowState::WindowMaximized); - this->setTitleBar(ui->wdgtTop); + // 设置窗口位置和大小 move(0, 0); @@ -46,42 +44,31 @@ qint16 screenHeight = screenRect.height(); resize(screenWidth, screenHeight); + // 设置标题栏 以绑定和触发鼠标双击事件 + this->setTitleBar(ui->wdgtTop); + connect(this, &MainWindowForm::titleDblClick, this, &MainWindowForm::titleDblClickHandler); + // 加载样式表 QString qssStyle = QssFileUtils::loadQssFileContent(":/qss/mainForm.css"); if (qssStyle.isEmpty() == false) { ui->wdgtTop->setStyleSheet(qssStyle); // 仅本窗口生效 + ui->wdgtContent->setStyleSheet("QWidget{background: #FFFFFF;}"); } - // 设置标题 + // 设置标题文字 ui->labelTitle->setText(SettingConfig::getInstance().CLIENT_TITLE); setWindowTitle(SettingConfig::getInstance().CLIENT_TITLE); - // 设置最小尺寸(宽度, 高度) lxc - QScreen *screen = QGuiApplication::primaryScreen(); - QRect screenSize = screen->availableGeometry(); // 可用区域(排除任务栏) - // 设置最小尺寸为屏幕宽度的 80%,高度 600 - int minWidth = screenSize.width() * 0.8; + int minWidth = screenWidth * 0.8; this->setMinimumSize(minWidth, 600); } void MainWindowForm::initMenuWidgets() { + wdgtCaliMain = new CalibrationMainForm(this); + wdgtCheckMain = new CheckMainForm(this); wdgtInfoMain = new InfoMainForm(this); -// wdgtInfo = new TF_InfoManag(this); -// wdgtCheckMethod = new CheckMethodManage(this); -// wdgtCheck = new CheckWindow(this); -// wdgtData = new TF_TextDataManag(this); -// wdgtCert = new TF_CertificateApproval(this); -// wdgtUserMan = new TF_UserManag(this); -// wdgtTestDev = new TF_TextDevice(this); -// wdgtStandDev = new tf_StandardDevice(this); - -// wdgtStdDevForm = new StandardDeviceForm(this); -// wdgtEqptDevForm = new TestDeviceForm(this); -// wdgtFileResForm = new FileResourcesForm(this); - -// wdgtCalibrationForm = new CalibrationForm(this); // 绑定事件 // connect(wdgtCalibrationForm, &CalibrationForm::enableMenuButtons, this, &MainWindowForm::onMenuButtonsEabled); @@ -89,18 +76,9 @@ // connect(wdgtCheck, &CheckWindow::BarsetEnabled, this, &MainWindowForm::onMenuButtonsEabled); // 添加到stackWidget中 + ui->wdgtContent->insertWidget(0, wdgtCaliMain); + ui->wdgtContent->insertWidget(1, wdgtCheckMain); ui->wdgtContent->insertWidget(2, wdgtInfoMain); -// ui->wdgtContent->insertWidget(0, wdgtCalibrationForm); -// ui->wdgtContent->insertWidget(1, wdgtStdDevForm); -// ui->wdgtContent->insertWidget(1, wdgtStandDev); -// ui->wdgtContent->insertWidget(2, wdgtTestDev); -// ui->wdgtContent->insertWidget(2, wdgtEqptDevForm); -// ui->wdgtContent->insertWidget(3, wdgtCheckMethod); -// ui->wdgtContent->insertWidget(4, wdgtCheck); -// ui->wdgtContent->insertWidget(5, wdgtData); -// ui->wdgtContent->insertWidget(6, wdgtCert); -// ui->wdgtContent->insertWidget(7, wdgtFileResForm); -// ui->wdgtContent->insertWidget(8, wdgtUserMan); } void MainWindowForm::initFunctionButtons() @@ -115,7 +93,6 @@ funcButtGroup->addButton(funcButt); connect(funcButt, &QToolButton::clicked, this, &MainWindowForm::onFunctionButtonsAction); } - connect(this, SIGNAL(titleDblClick()), this, SLOT(titleDblClick())); } void MainWindowForm::on_btnMinWin_clicked() @@ -125,17 +102,12 @@ 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(); + ui->btnMaxWin->setToolTip("最大化"); } else { - resize(screenSize.width(), screenSize.height()); - move(0, 0); this->showMaximized(); + ui->btnMaxWin->setToolTip("还原"); } } @@ -165,7 +137,7 @@ ui->labelTime->setText(now.toString("yyyy-MM-dd HH:mm:ss")); } -void MainWindowForm::titleDblClick() +void MainWindowForm::titleDblClickHandler() { on_btnMaxWin_clicked(); } diff --git a/frame/MainWindowForm.h b/frame/MainWindowForm.h index 9b4eae4..aa5330c 100644 --- a/frame/MainWindowForm.h +++ b/frame/MainWindowForm.h @@ -13,21 +13,8 @@ #include "frame/FramelessWindow.h" #include "infomation/InfoMainForm.h" - -//#include "infomation/standDev/StandardDeviceForm.h" -//#include "infomation/testDev/TestDeviceForm.h" -//#include "infomation/fileRes/FileResourcesForm.h" - -//#include "calibration/CalibrationForm.h" - -//#include "TimeFreq/tf_standarddevice.h" -//#include "TimeFreq/tf_certificateapproval.h" -//#include "TimeFreq/tf_infomanag.h" -//#include "TimeFreq/tf_textdatamanag.h" -//#include "TimeFreq/tf_textdevice.h" -//#include "TimeFreq/tf_usermanag.h" -//#include "checkmethodmanage.h" -//#include "checkwindow.h" +#include "calibration/CalibrationMainForm.h" +#include "check/CheckMainForm.h" namespace Ui { class MainWindowForm; @@ -50,29 +37,16 @@ void onFunctionButtonsAction(); void onUpdateTimestampHandler(); - void titleDblClick(); + void titleDblClickHandler(); void onMenuButtonsEabled(bool enable); private: Ui::MainWindowForm *ui; + CalibrationMainForm * wdgtCaliMain; + CheckMainForm * wdgtCheckMain; InfoMainForm * wdgtInfoMain; -// TF_InfoManag * wdgtInfo; -// CheckMethodManage * wdgtCheckMethod; -// CheckWindow * wdgtCheck; -// TF_TextDataManag * wdgtData; -// TF_CertificateApproval * wdgtCert; -// TF_UserManag * wdgtUserMan; -// tf_StandardDevice * wdgtStandDev; -// TF_TextDevice * wdgtTestDev; - -// StandardDeviceForm * wdgtStdDevForm; -// TestDeviceForm * wdgtEqptDevForm; -// FileResourcesForm * wdgtFileResForm; - -// CalibrationForm * wdgtCalibrationForm; - void initForm(); void initMenuWidgets(); void initFunctionButtons(); diff --git a/frame/MainWindowForm.ui b/frame/MainWindowForm.ui index d3fd4fe..e0638e1 100644 --- a/frame/MainWindowForm.ui +++ b/frame/MainWindowForm.ui @@ -271,6 +271,18 @@ + + + 0 + 0 + + + + + 240 + 0 + + 240 @@ -295,6 +307,18 @@ + + + 0 + 0 + + + + + 0 + 40 + + @@ -392,6 +416,18 @@ + + + 0 + 0 + + + + + 240 + 0 + + 240 @@ -422,6 +458,12 @@ 0 + + + 0 + 40 + + 5 @@ -459,6 +501,9 @@ 24 + + 设置 + @@ -509,7 +554,7 @@ - 最小化 + 还原 diff --git a/infomation/task/DeptTaskForm.cpp b/infomation/task/DeptTaskForm.cpp index 208973c..b7d771b 100644 --- a/infomation/task/DeptTaskForm.cpp +++ b/infomation/task/DeptTaskForm.cpp @@ -33,7 +33,7 @@ void DeptTaskForm::initForm() { // 加载样式表 - QString qssStyle = QssFileUtils::loadQssFileContent(QApplication::applicationDirPath() + "/qss/infoTable.css"); + QString qssStyle = QssFileUtils::loadQssFileContent(":/qss/infoTable.css"); if (qssStyle.isEmpty() == false) { this->setStyleSheet(qssStyle); // 仅本窗口生效 } diff --git a/res/image/main/calibration.png b/res/image/main/calibration.png deleted file mode 100644 index 9d6de19..0000000 --- a/res/image/main/calibration.png +++ /dev/null Binary files differ diff --git a/res/image/main/certApproval.png b/res/image/main/certApproval.png deleted file mode 100644 index 45147a6..0000000 --- a/res/image/main/certApproval.png +++ /dev/null Binary files differ diff --git a/res/image/main/checkDevice.png b/res/image/main/checkDevice.png deleted file mode 100644 index 3e9307a..0000000 --- a/res/image/main/checkDevice.png +++ /dev/null Binary files differ diff --git a/res/image/main/checkProgram.png b/res/image/main/checkProgram.png deleted file mode 100644 index e75ef50..0000000 --- a/res/image/main/checkProgram.png +++ /dev/null Binary files differ diff --git a/res/image/main/fileRes.png b/res/image/main/fileRes.png deleted file mode 100644 index 99b9b45..0000000 --- a/res/image/main/fileRes.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_menu_calibration.png b/res/image/main/icon_menu_calibration.png index 6fca8be..cbc7bfc 100644 --- a/res/image/main/icon_menu_calibration.png +++ 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 index 17f918f..3f140c6 100644 --- a/res/image/main/icon_menu_calibration_selected.png +++ 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 index c3db5fa..0a714a4 100644 --- a/res/image/main/icon_menu_check.png +++ 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 index 9794c43..9546177 100644 --- a/res/image/main/icon_menu_check_selected.png +++ 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 index e272f4c..73f2a24 100644 --- a/res/image/main/icon_menu_infomation.png +++ 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 index 6122c7b..bcb8e30 100644 --- a/res/image/main/icon_menu_infomation_checked.png +++ b/res/image/main/icon_menu_infomation_checked.png Binary files differ diff --git a/res/image/main/info.png b/res/image/main/info.png deleted file mode 100644 index a762db4..0000000 --- a/res/image/main/info.png +++ /dev/null Binary files differ diff --git a/res/image/main/rawDataRecord.png b/res/image/main/rawDataRecord.png deleted file mode 100644 index dd25617..0000000 --- a/res/image/main/rawDataRecord.png +++ /dev/null Binary files differ diff --git a/res/image/main/staff.png b/res/image/main/staff.png deleted file mode 100644 index a581e5f..0000000 --- a/res/image/main/staff.png +++ /dev/null Binary files differ diff --git a/res/image/main/standDevice.png b/res/image/main/standDevice.png deleted file mode 100644 index 48cbce1..0000000 --- a/res/image/main/standDevice.png +++ /dev/null Binary files differ diff --git a/res/image/msgbox/icon_box_confirm.png b/res/image/msgbox/icon_box_confirm.png index fda20c4..39c8969 100644 --- a/res/image/msgbox/icon_box_confirm.png +++ b/res/image/msgbox/icon_box_confirm.png Binary files differ diff --git a/res/image/msgbox/icon_box_info.png b/res/image/msgbox/icon_box_info.png index 5215e44..d3a4158 100644 --- a/res/image/msgbox/icon_box_info.png +++ b/res/image/msgbox/icon_box_info.png Binary files differ diff --git a/calibration/CalibrationMainForm.cpp b/calibration/CalibrationMainForm.cpp new file mode 100644 index 0000000..9b778a5 --- /dev/null +++ b/calibration/CalibrationMainForm.cpp @@ -0,0 +1,14 @@ +#include "CalibrationMainForm.h" +#include "ui_CalibrationMainForm.h" + +CalibrationMainForm::CalibrationMainForm(QWidget *parent) : + QWidget(parent), + ui(new Ui::CalibrationMainForm) +{ + ui->setupUi(this); +} + +CalibrationMainForm::~CalibrationMainForm() +{ + delete ui; +} diff --git a/calibration/CalibrationMainForm.h b/calibration/CalibrationMainForm.h new file mode 100644 index 0000000..7d75014 --- /dev/null +++ b/calibration/CalibrationMainForm.h @@ -0,0 +1,22 @@ +#ifndef CALIBRATIONMAINFORM_H +#define CALIBRATIONMAINFORM_H + +#include + +namespace Ui { +class CalibrationMainForm; +} + +class CalibrationMainForm : public QWidget +{ + Q_OBJECT + +public: + explicit CalibrationMainForm(QWidget *parent = nullptr); + ~CalibrationMainForm(); + +private: + Ui::CalibrationMainForm *ui; +}; + +#endif // CALIBRATIONMAINFORM_H diff --git a/calibration/CalibrationMainForm.ui b/calibration/CalibrationMainForm.ui new file mode 100644 index 0000000..9b5a9c2 --- /dev/null +++ b/calibration/CalibrationMainForm.ui @@ -0,0 +1,21 @@ + + + + + CalibrationMainForm + + + + 0 + 0 + 400 + 300 + + + + Form + + + + + diff --git a/calibration/calibration.pri b/calibration/calibration.pri index e69de29..f0e9dfb 100644 --- a/calibration/calibration.pri +++ b/calibration/calibration.pri @@ -0,0 +1,4 @@ +HEADERS += $$PWD/CalibrationMainForm.h +SOURCES += $$PWD/CalibrationMainForm.cpp + +FORMS += $$PWD/CalibrationMainForm.ui diff --git a/check/CheckMainForm.cpp b/check/CheckMainForm.cpp new file mode 100644 index 0000000..1725277 --- /dev/null +++ b/check/CheckMainForm.cpp @@ -0,0 +1,14 @@ +#include "CheckMainForm.h" +#include "ui_CheckMainForm.h" + +CheckMainForm::CheckMainForm(QWidget *parent) : + QWidget(parent), + ui(new Ui::CheckMainForm) +{ + ui->setupUi(this); +} + +CheckMainForm::~CheckMainForm() +{ + delete ui; +} diff --git a/check/CheckMainForm.h b/check/CheckMainForm.h new file mode 100644 index 0000000..c71001e --- /dev/null +++ b/check/CheckMainForm.h @@ -0,0 +1,22 @@ +#ifndef CHECKMAINFORM_H +#define CHECKMAINFORM_H + +#include + +namespace Ui { +class CheckMainForm; +} + +class CheckMainForm : public QWidget +{ + Q_OBJECT + +public: + explicit CheckMainForm(QWidget *parent = nullptr); + ~CheckMainForm(); + +private: + Ui::CheckMainForm *ui; +}; + +#endif // CHECKMAINFORM_H diff --git a/check/CheckMainForm.ui b/check/CheckMainForm.ui new file mode 100644 index 0000000..76ca74d --- /dev/null +++ b/check/CheckMainForm.ui @@ -0,0 +1,21 @@ + + + + + CheckMainForm + + + + 0 + 0 + 400 + 300 + + + + Form + + + + + diff --git a/check/check.pri b/check/check.pri index e69de29..624bd3f 100644 --- a/check/check.pri +++ b/check/check.pri @@ -0,0 +1,4 @@ +HEADERS += $$PWD/CheckMainForm.h +SOURCES += $$PWD/CheckMainForm.cpp + +FORMS += $$PWD/CheckMainForm.ui diff --git a/frame/FramelessWindow.cpp b/frame/FramelessWindow.cpp index d323ae5..5727866 100644 --- a/frame/FramelessWindow.cpp +++ b/frame/FramelessWindow.cpp @@ -1,4 +1,8 @@ -#include "FramelessWindow.h" +#include +#include +#include + +#include "FramelessWindow.h" #ifdef Q_OS_WIN #include "windows.h" @@ -63,6 +67,12 @@ resizeEnable = false; } + if (!isMaximized()) { + QRect screenRect = QApplication::screens().at(0)->availableGeometry(); + resize(screenRect.width() * 0.9, screenRect.height() * 0.9); + move(QRandomGenerator::global()->bounded(10, 100), QRandomGenerator::global()->bounded(10, 50)); + } + //发出最大化最小化等改变事件,以便界面上更改对应的信息比如右上角图标和文字 Q_EMIT windowStateChange(!moveEnable); diff --git a/frame/MainWindowForm.cpp b/frame/MainWindowForm.cpp index cb98f69..0791c77 100644 --- a/frame/MainWindowForm.cpp +++ b/frame/MainWindowForm.cpp @@ -1,8 +1,6 @@ #include "MainWindowForm.h" #include "ui_MainWindowForm.h" -#include - MainWindowForm::MainWindowForm(QWidget *parent) : FramelessWindow(parent), ui(new Ui::MainWindowForm) @@ -18,8 +16,8 @@ connect(TimeCounterUtil::getInstance().clockTimer, &QTimer::timeout, this, &MainWindowForm::onUpdateTimestampHandler); TimeCounterUtil::getInstance().clockTimer->start(1000); - /** 临时调试代码 **/ - emit ui->btnInfomation->clicked(); + // 自动加载第一个页面 + emit ui->btnCalibration->clicked(); } MainWindowForm::~MainWindowForm() @@ -37,7 +35,7 @@ { setWindowFlags(Qt::FramelessWindowHint); // 设置全屏 setWindowState(Qt::WindowState::WindowMaximized); - this->setTitleBar(ui->wdgtTop); + // 设置窗口位置和大小 move(0, 0); @@ -46,42 +44,31 @@ qint16 screenHeight = screenRect.height(); resize(screenWidth, screenHeight); + // 设置标题栏 以绑定和触发鼠标双击事件 + this->setTitleBar(ui->wdgtTop); + connect(this, &MainWindowForm::titleDblClick, this, &MainWindowForm::titleDblClickHandler); + // 加载样式表 QString qssStyle = QssFileUtils::loadQssFileContent(":/qss/mainForm.css"); if (qssStyle.isEmpty() == false) { ui->wdgtTop->setStyleSheet(qssStyle); // 仅本窗口生效 + ui->wdgtContent->setStyleSheet("QWidget{background: #FFFFFF;}"); } - // 设置标题 + // 设置标题文字 ui->labelTitle->setText(SettingConfig::getInstance().CLIENT_TITLE); setWindowTitle(SettingConfig::getInstance().CLIENT_TITLE); - // 设置最小尺寸(宽度, 高度) lxc - QScreen *screen = QGuiApplication::primaryScreen(); - QRect screenSize = screen->availableGeometry(); // 可用区域(排除任务栏) - // 设置最小尺寸为屏幕宽度的 80%,高度 600 - int minWidth = screenSize.width() * 0.8; + int minWidth = screenWidth * 0.8; this->setMinimumSize(minWidth, 600); } void MainWindowForm::initMenuWidgets() { + wdgtCaliMain = new CalibrationMainForm(this); + wdgtCheckMain = new CheckMainForm(this); wdgtInfoMain = new InfoMainForm(this); -// wdgtInfo = new TF_InfoManag(this); -// wdgtCheckMethod = new CheckMethodManage(this); -// wdgtCheck = new CheckWindow(this); -// wdgtData = new TF_TextDataManag(this); -// wdgtCert = new TF_CertificateApproval(this); -// wdgtUserMan = new TF_UserManag(this); -// wdgtTestDev = new TF_TextDevice(this); -// wdgtStandDev = new tf_StandardDevice(this); - -// wdgtStdDevForm = new StandardDeviceForm(this); -// wdgtEqptDevForm = new TestDeviceForm(this); -// wdgtFileResForm = new FileResourcesForm(this); - -// wdgtCalibrationForm = new CalibrationForm(this); // 绑定事件 // connect(wdgtCalibrationForm, &CalibrationForm::enableMenuButtons, this, &MainWindowForm::onMenuButtonsEabled); @@ -89,18 +76,9 @@ // connect(wdgtCheck, &CheckWindow::BarsetEnabled, this, &MainWindowForm::onMenuButtonsEabled); // 添加到stackWidget中 + ui->wdgtContent->insertWidget(0, wdgtCaliMain); + ui->wdgtContent->insertWidget(1, wdgtCheckMain); ui->wdgtContent->insertWidget(2, wdgtInfoMain); -// ui->wdgtContent->insertWidget(0, wdgtCalibrationForm); -// ui->wdgtContent->insertWidget(1, wdgtStdDevForm); -// ui->wdgtContent->insertWidget(1, wdgtStandDev); -// ui->wdgtContent->insertWidget(2, wdgtTestDev); -// ui->wdgtContent->insertWidget(2, wdgtEqptDevForm); -// ui->wdgtContent->insertWidget(3, wdgtCheckMethod); -// ui->wdgtContent->insertWidget(4, wdgtCheck); -// ui->wdgtContent->insertWidget(5, wdgtData); -// ui->wdgtContent->insertWidget(6, wdgtCert); -// ui->wdgtContent->insertWidget(7, wdgtFileResForm); -// ui->wdgtContent->insertWidget(8, wdgtUserMan); } void MainWindowForm::initFunctionButtons() @@ -115,7 +93,6 @@ funcButtGroup->addButton(funcButt); connect(funcButt, &QToolButton::clicked, this, &MainWindowForm::onFunctionButtonsAction); } - connect(this, SIGNAL(titleDblClick()), this, SLOT(titleDblClick())); } void MainWindowForm::on_btnMinWin_clicked() @@ -125,17 +102,12 @@ 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(); + ui->btnMaxWin->setToolTip("最大化"); } else { - resize(screenSize.width(), screenSize.height()); - move(0, 0); this->showMaximized(); + ui->btnMaxWin->setToolTip("还原"); } } @@ -165,7 +137,7 @@ ui->labelTime->setText(now.toString("yyyy-MM-dd HH:mm:ss")); } -void MainWindowForm::titleDblClick() +void MainWindowForm::titleDblClickHandler() { on_btnMaxWin_clicked(); } diff --git a/frame/MainWindowForm.h b/frame/MainWindowForm.h index 9b4eae4..aa5330c 100644 --- a/frame/MainWindowForm.h +++ b/frame/MainWindowForm.h @@ -13,21 +13,8 @@ #include "frame/FramelessWindow.h" #include "infomation/InfoMainForm.h" - -//#include "infomation/standDev/StandardDeviceForm.h" -//#include "infomation/testDev/TestDeviceForm.h" -//#include "infomation/fileRes/FileResourcesForm.h" - -//#include "calibration/CalibrationForm.h" - -//#include "TimeFreq/tf_standarddevice.h" -//#include "TimeFreq/tf_certificateapproval.h" -//#include "TimeFreq/tf_infomanag.h" -//#include "TimeFreq/tf_textdatamanag.h" -//#include "TimeFreq/tf_textdevice.h" -//#include "TimeFreq/tf_usermanag.h" -//#include "checkmethodmanage.h" -//#include "checkwindow.h" +#include "calibration/CalibrationMainForm.h" +#include "check/CheckMainForm.h" namespace Ui { class MainWindowForm; @@ -50,29 +37,16 @@ void onFunctionButtonsAction(); void onUpdateTimestampHandler(); - void titleDblClick(); + void titleDblClickHandler(); void onMenuButtonsEabled(bool enable); private: Ui::MainWindowForm *ui; + CalibrationMainForm * wdgtCaliMain; + CheckMainForm * wdgtCheckMain; InfoMainForm * wdgtInfoMain; -// TF_InfoManag * wdgtInfo; -// CheckMethodManage * wdgtCheckMethod; -// CheckWindow * wdgtCheck; -// TF_TextDataManag * wdgtData; -// TF_CertificateApproval * wdgtCert; -// TF_UserManag * wdgtUserMan; -// tf_StandardDevice * wdgtStandDev; -// TF_TextDevice * wdgtTestDev; - -// StandardDeviceForm * wdgtStdDevForm; -// TestDeviceForm * wdgtEqptDevForm; -// FileResourcesForm * wdgtFileResForm; - -// CalibrationForm * wdgtCalibrationForm; - void initForm(); void initMenuWidgets(); void initFunctionButtons(); diff --git a/frame/MainWindowForm.ui b/frame/MainWindowForm.ui index d3fd4fe..e0638e1 100644 --- a/frame/MainWindowForm.ui +++ b/frame/MainWindowForm.ui @@ -271,6 +271,18 @@ + + + 0 + 0 + + + + + 240 + 0 + + 240 @@ -295,6 +307,18 @@ + + + 0 + 0 + + + + + 0 + 40 + + @@ -392,6 +416,18 @@ + + + 0 + 0 + + + + + 240 + 0 + + 240 @@ -422,6 +458,12 @@ 0 + + + 0 + 40 + + 5 @@ -459,6 +501,9 @@ 24 + + 设置 + @@ -509,7 +554,7 @@ - 最小化 + 还原 diff --git a/infomation/task/DeptTaskForm.cpp b/infomation/task/DeptTaskForm.cpp index 208973c..b7d771b 100644 --- a/infomation/task/DeptTaskForm.cpp +++ b/infomation/task/DeptTaskForm.cpp @@ -33,7 +33,7 @@ void DeptTaskForm::initForm() { // 加载样式表 - QString qssStyle = QssFileUtils::loadQssFileContent(QApplication::applicationDirPath() + "/qss/infoTable.css"); + QString qssStyle = QssFileUtils::loadQssFileContent(":/qss/infoTable.css"); if (qssStyle.isEmpty() == false) { this->setStyleSheet(qssStyle); // 仅本窗口生效 } diff --git a/res/image/main/calibration.png b/res/image/main/calibration.png deleted file mode 100644 index 9d6de19..0000000 --- a/res/image/main/calibration.png +++ /dev/null Binary files differ diff --git a/res/image/main/certApproval.png b/res/image/main/certApproval.png deleted file mode 100644 index 45147a6..0000000 --- a/res/image/main/certApproval.png +++ /dev/null Binary files differ diff --git a/res/image/main/checkDevice.png b/res/image/main/checkDevice.png deleted file mode 100644 index 3e9307a..0000000 --- a/res/image/main/checkDevice.png +++ /dev/null Binary files differ diff --git a/res/image/main/checkProgram.png b/res/image/main/checkProgram.png deleted file mode 100644 index e75ef50..0000000 --- a/res/image/main/checkProgram.png +++ /dev/null Binary files differ diff --git a/res/image/main/fileRes.png b/res/image/main/fileRes.png deleted file mode 100644 index 99b9b45..0000000 --- a/res/image/main/fileRes.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_menu_calibration.png b/res/image/main/icon_menu_calibration.png index 6fca8be..cbc7bfc 100644 --- a/res/image/main/icon_menu_calibration.png +++ 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 index 17f918f..3f140c6 100644 --- a/res/image/main/icon_menu_calibration_selected.png +++ 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 index c3db5fa..0a714a4 100644 --- a/res/image/main/icon_menu_check.png +++ 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 index 9794c43..9546177 100644 --- a/res/image/main/icon_menu_check_selected.png +++ 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 index e272f4c..73f2a24 100644 --- a/res/image/main/icon_menu_infomation.png +++ 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 index 6122c7b..bcb8e30 100644 --- a/res/image/main/icon_menu_infomation_checked.png +++ b/res/image/main/icon_menu_infomation_checked.png Binary files differ diff --git a/res/image/main/info.png b/res/image/main/info.png deleted file mode 100644 index a762db4..0000000 --- a/res/image/main/info.png +++ /dev/null Binary files differ diff --git a/res/image/main/rawDataRecord.png b/res/image/main/rawDataRecord.png deleted file mode 100644 index dd25617..0000000 --- a/res/image/main/rawDataRecord.png +++ /dev/null Binary files differ diff --git a/res/image/main/staff.png b/res/image/main/staff.png deleted file mode 100644 index a581e5f..0000000 --- a/res/image/main/staff.png +++ /dev/null Binary files differ diff --git a/res/image/main/standDevice.png b/res/image/main/standDevice.png deleted file mode 100644 index 48cbce1..0000000 --- a/res/image/main/standDevice.png +++ /dev/null Binary files differ diff --git a/res/image/msgbox/icon_box_confirm.png b/res/image/msgbox/icon_box_confirm.png index fda20c4..39c8969 100644 --- a/res/image/msgbox/icon_box_confirm.png +++ b/res/image/msgbox/icon_box_confirm.png Binary files differ diff --git a/res/image/msgbox/icon_box_info.png b/res/image/msgbox/icon_box_info.png index 5215e44..d3a4158 100644 --- a/res/image/msgbox/icon_box_info.png +++ b/res/image/msgbox/icon_box_info.png Binary files differ diff --git a/res/images.qrc b/res/images.qrc index dcb8ac5..4dd6e12 100644 --- a/res/images.qrc +++ b/res/images.qrc @@ -59,15 +59,6 @@ image/Index/menuMax.png image/Index/u118.png image/login/bg_login.png - image/main/calibration.png - image/main/certApproval.png - image/main/checkDevice.png - image/main/checkProgram.png - image/main/info.png - image/main/rawDataRecord.png - image/main/staff.png - image/main/standDevice.png - image/main/fileRes.png image/login/icon_pass.png image/login/icon_user.png image/login/icon_close.png diff --git a/calibration/CalibrationMainForm.cpp b/calibration/CalibrationMainForm.cpp new file mode 100644 index 0000000..9b778a5 --- /dev/null +++ b/calibration/CalibrationMainForm.cpp @@ -0,0 +1,14 @@ +#include "CalibrationMainForm.h" +#include "ui_CalibrationMainForm.h" + +CalibrationMainForm::CalibrationMainForm(QWidget *parent) : + QWidget(parent), + ui(new Ui::CalibrationMainForm) +{ + ui->setupUi(this); +} + +CalibrationMainForm::~CalibrationMainForm() +{ + delete ui; +} diff --git a/calibration/CalibrationMainForm.h b/calibration/CalibrationMainForm.h new file mode 100644 index 0000000..7d75014 --- /dev/null +++ b/calibration/CalibrationMainForm.h @@ -0,0 +1,22 @@ +#ifndef CALIBRATIONMAINFORM_H +#define CALIBRATIONMAINFORM_H + +#include + +namespace Ui { +class CalibrationMainForm; +} + +class CalibrationMainForm : public QWidget +{ + Q_OBJECT + +public: + explicit CalibrationMainForm(QWidget *parent = nullptr); + ~CalibrationMainForm(); + +private: + Ui::CalibrationMainForm *ui; +}; + +#endif // CALIBRATIONMAINFORM_H diff --git a/calibration/CalibrationMainForm.ui b/calibration/CalibrationMainForm.ui new file mode 100644 index 0000000..9b5a9c2 --- /dev/null +++ b/calibration/CalibrationMainForm.ui @@ -0,0 +1,21 @@ + + + + + CalibrationMainForm + + + + 0 + 0 + 400 + 300 + + + + Form + + + + + diff --git a/calibration/calibration.pri b/calibration/calibration.pri index e69de29..f0e9dfb 100644 --- a/calibration/calibration.pri +++ b/calibration/calibration.pri @@ -0,0 +1,4 @@ +HEADERS += $$PWD/CalibrationMainForm.h +SOURCES += $$PWD/CalibrationMainForm.cpp + +FORMS += $$PWD/CalibrationMainForm.ui diff --git a/check/CheckMainForm.cpp b/check/CheckMainForm.cpp new file mode 100644 index 0000000..1725277 --- /dev/null +++ b/check/CheckMainForm.cpp @@ -0,0 +1,14 @@ +#include "CheckMainForm.h" +#include "ui_CheckMainForm.h" + +CheckMainForm::CheckMainForm(QWidget *parent) : + QWidget(parent), + ui(new Ui::CheckMainForm) +{ + ui->setupUi(this); +} + +CheckMainForm::~CheckMainForm() +{ + delete ui; +} diff --git a/check/CheckMainForm.h b/check/CheckMainForm.h new file mode 100644 index 0000000..c71001e --- /dev/null +++ b/check/CheckMainForm.h @@ -0,0 +1,22 @@ +#ifndef CHECKMAINFORM_H +#define CHECKMAINFORM_H + +#include + +namespace Ui { +class CheckMainForm; +} + +class CheckMainForm : public QWidget +{ + Q_OBJECT + +public: + explicit CheckMainForm(QWidget *parent = nullptr); + ~CheckMainForm(); + +private: + Ui::CheckMainForm *ui; +}; + +#endif // CHECKMAINFORM_H diff --git a/check/CheckMainForm.ui b/check/CheckMainForm.ui new file mode 100644 index 0000000..76ca74d --- /dev/null +++ b/check/CheckMainForm.ui @@ -0,0 +1,21 @@ + + + + + CheckMainForm + + + + 0 + 0 + 400 + 300 + + + + Form + + + + + diff --git a/check/check.pri b/check/check.pri index e69de29..624bd3f 100644 --- a/check/check.pri +++ b/check/check.pri @@ -0,0 +1,4 @@ +HEADERS += $$PWD/CheckMainForm.h +SOURCES += $$PWD/CheckMainForm.cpp + +FORMS += $$PWD/CheckMainForm.ui diff --git a/frame/FramelessWindow.cpp b/frame/FramelessWindow.cpp index d323ae5..5727866 100644 --- a/frame/FramelessWindow.cpp +++ b/frame/FramelessWindow.cpp @@ -1,4 +1,8 @@ -#include "FramelessWindow.h" +#include +#include +#include + +#include "FramelessWindow.h" #ifdef Q_OS_WIN #include "windows.h" @@ -63,6 +67,12 @@ resizeEnable = false; } + if (!isMaximized()) { + QRect screenRect = QApplication::screens().at(0)->availableGeometry(); + resize(screenRect.width() * 0.9, screenRect.height() * 0.9); + move(QRandomGenerator::global()->bounded(10, 100), QRandomGenerator::global()->bounded(10, 50)); + } + //发出最大化最小化等改变事件,以便界面上更改对应的信息比如右上角图标和文字 Q_EMIT windowStateChange(!moveEnable); diff --git a/frame/MainWindowForm.cpp b/frame/MainWindowForm.cpp index cb98f69..0791c77 100644 --- a/frame/MainWindowForm.cpp +++ b/frame/MainWindowForm.cpp @@ -1,8 +1,6 @@ #include "MainWindowForm.h" #include "ui_MainWindowForm.h" -#include - MainWindowForm::MainWindowForm(QWidget *parent) : FramelessWindow(parent), ui(new Ui::MainWindowForm) @@ -18,8 +16,8 @@ connect(TimeCounterUtil::getInstance().clockTimer, &QTimer::timeout, this, &MainWindowForm::onUpdateTimestampHandler); TimeCounterUtil::getInstance().clockTimer->start(1000); - /** 临时调试代码 **/ - emit ui->btnInfomation->clicked(); + // 自动加载第一个页面 + emit ui->btnCalibration->clicked(); } MainWindowForm::~MainWindowForm() @@ -37,7 +35,7 @@ { setWindowFlags(Qt::FramelessWindowHint); // 设置全屏 setWindowState(Qt::WindowState::WindowMaximized); - this->setTitleBar(ui->wdgtTop); + // 设置窗口位置和大小 move(0, 0); @@ -46,42 +44,31 @@ qint16 screenHeight = screenRect.height(); resize(screenWidth, screenHeight); + // 设置标题栏 以绑定和触发鼠标双击事件 + this->setTitleBar(ui->wdgtTop); + connect(this, &MainWindowForm::titleDblClick, this, &MainWindowForm::titleDblClickHandler); + // 加载样式表 QString qssStyle = QssFileUtils::loadQssFileContent(":/qss/mainForm.css"); if (qssStyle.isEmpty() == false) { ui->wdgtTop->setStyleSheet(qssStyle); // 仅本窗口生效 + ui->wdgtContent->setStyleSheet("QWidget{background: #FFFFFF;}"); } - // 设置标题 + // 设置标题文字 ui->labelTitle->setText(SettingConfig::getInstance().CLIENT_TITLE); setWindowTitle(SettingConfig::getInstance().CLIENT_TITLE); - // 设置最小尺寸(宽度, 高度) lxc - QScreen *screen = QGuiApplication::primaryScreen(); - QRect screenSize = screen->availableGeometry(); // 可用区域(排除任务栏) - // 设置最小尺寸为屏幕宽度的 80%,高度 600 - int minWidth = screenSize.width() * 0.8; + int minWidth = screenWidth * 0.8; this->setMinimumSize(minWidth, 600); } void MainWindowForm::initMenuWidgets() { + wdgtCaliMain = new CalibrationMainForm(this); + wdgtCheckMain = new CheckMainForm(this); wdgtInfoMain = new InfoMainForm(this); -// wdgtInfo = new TF_InfoManag(this); -// wdgtCheckMethod = new CheckMethodManage(this); -// wdgtCheck = new CheckWindow(this); -// wdgtData = new TF_TextDataManag(this); -// wdgtCert = new TF_CertificateApproval(this); -// wdgtUserMan = new TF_UserManag(this); -// wdgtTestDev = new TF_TextDevice(this); -// wdgtStandDev = new tf_StandardDevice(this); - -// wdgtStdDevForm = new StandardDeviceForm(this); -// wdgtEqptDevForm = new TestDeviceForm(this); -// wdgtFileResForm = new FileResourcesForm(this); - -// wdgtCalibrationForm = new CalibrationForm(this); // 绑定事件 // connect(wdgtCalibrationForm, &CalibrationForm::enableMenuButtons, this, &MainWindowForm::onMenuButtonsEabled); @@ -89,18 +76,9 @@ // connect(wdgtCheck, &CheckWindow::BarsetEnabled, this, &MainWindowForm::onMenuButtonsEabled); // 添加到stackWidget中 + ui->wdgtContent->insertWidget(0, wdgtCaliMain); + ui->wdgtContent->insertWidget(1, wdgtCheckMain); ui->wdgtContent->insertWidget(2, wdgtInfoMain); -// ui->wdgtContent->insertWidget(0, wdgtCalibrationForm); -// ui->wdgtContent->insertWidget(1, wdgtStdDevForm); -// ui->wdgtContent->insertWidget(1, wdgtStandDev); -// ui->wdgtContent->insertWidget(2, wdgtTestDev); -// ui->wdgtContent->insertWidget(2, wdgtEqptDevForm); -// ui->wdgtContent->insertWidget(3, wdgtCheckMethod); -// ui->wdgtContent->insertWidget(4, wdgtCheck); -// ui->wdgtContent->insertWidget(5, wdgtData); -// ui->wdgtContent->insertWidget(6, wdgtCert); -// ui->wdgtContent->insertWidget(7, wdgtFileResForm); -// ui->wdgtContent->insertWidget(8, wdgtUserMan); } void MainWindowForm::initFunctionButtons() @@ -115,7 +93,6 @@ funcButtGroup->addButton(funcButt); connect(funcButt, &QToolButton::clicked, this, &MainWindowForm::onFunctionButtonsAction); } - connect(this, SIGNAL(titleDblClick()), this, SLOT(titleDblClick())); } void MainWindowForm::on_btnMinWin_clicked() @@ -125,17 +102,12 @@ 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(); + ui->btnMaxWin->setToolTip("最大化"); } else { - resize(screenSize.width(), screenSize.height()); - move(0, 0); this->showMaximized(); + ui->btnMaxWin->setToolTip("还原"); } } @@ -165,7 +137,7 @@ ui->labelTime->setText(now.toString("yyyy-MM-dd HH:mm:ss")); } -void MainWindowForm::titleDblClick() +void MainWindowForm::titleDblClickHandler() { on_btnMaxWin_clicked(); } diff --git a/frame/MainWindowForm.h b/frame/MainWindowForm.h index 9b4eae4..aa5330c 100644 --- a/frame/MainWindowForm.h +++ b/frame/MainWindowForm.h @@ -13,21 +13,8 @@ #include "frame/FramelessWindow.h" #include "infomation/InfoMainForm.h" - -//#include "infomation/standDev/StandardDeviceForm.h" -//#include "infomation/testDev/TestDeviceForm.h" -//#include "infomation/fileRes/FileResourcesForm.h" - -//#include "calibration/CalibrationForm.h" - -//#include "TimeFreq/tf_standarddevice.h" -//#include "TimeFreq/tf_certificateapproval.h" -//#include "TimeFreq/tf_infomanag.h" -//#include "TimeFreq/tf_textdatamanag.h" -//#include "TimeFreq/tf_textdevice.h" -//#include "TimeFreq/tf_usermanag.h" -//#include "checkmethodmanage.h" -//#include "checkwindow.h" +#include "calibration/CalibrationMainForm.h" +#include "check/CheckMainForm.h" namespace Ui { class MainWindowForm; @@ -50,29 +37,16 @@ void onFunctionButtonsAction(); void onUpdateTimestampHandler(); - void titleDblClick(); + void titleDblClickHandler(); void onMenuButtonsEabled(bool enable); private: Ui::MainWindowForm *ui; + CalibrationMainForm * wdgtCaliMain; + CheckMainForm * wdgtCheckMain; InfoMainForm * wdgtInfoMain; -// TF_InfoManag * wdgtInfo; -// CheckMethodManage * wdgtCheckMethod; -// CheckWindow * wdgtCheck; -// TF_TextDataManag * wdgtData; -// TF_CertificateApproval * wdgtCert; -// TF_UserManag * wdgtUserMan; -// tf_StandardDevice * wdgtStandDev; -// TF_TextDevice * wdgtTestDev; - -// StandardDeviceForm * wdgtStdDevForm; -// TestDeviceForm * wdgtEqptDevForm; -// FileResourcesForm * wdgtFileResForm; - -// CalibrationForm * wdgtCalibrationForm; - void initForm(); void initMenuWidgets(); void initFunctionButtons(); diff --git a/frame/MainWindowForm.ui b/frame/MainWindowForm.ui index d3fd4fe..e0638e1 100644 --- a/frame/MainWindowForm.ui +++ b/frame/MainWindowForm.ui @@ -271,6 +271,18 @@ + + + 0 + 0 + + + + + 240 + 0 + + 240 @@ -295,6 +307,18 @@ + + + 0 + 0 + + + + + 0 + 40 + + @@ -392,6 +416,18 @@ + + + 0 + 0 + + + + + 240 + 0 + + 240 @@ -422,6 +458,12 @@ 0 + + + 0 + 40 + + 5 @@ -459,6 +501,9 @@ 24 + + 设置 + @@ -509,7 +554,7 @@ - 最小化 + 还原 diff --git a/infomation/task/DeptTaskForm.cpp b/infomation/task/DeptTaskForm.cpp index 208973c..b7d771b 100644 --- a/infomation/task/DeptTaskForm.cpp +++ b/infomation/task/DeptTaskForm.cpp @@ -33,7 +33,7 @@ void DeptTaskForm::initForm() { // 加载样式表 - QString qssStyle = QssFileUtils::loadQssFileContent(QApplication::applicationDirPath() + "/qss/infoTable.css"); + QString qssStyle = QssFileUtils::loadQssFileContent(":/qss/infoTable.css"); if (qssStyle.isEmpty() == false) { this->setStyleSheet(qssStyle); // 仅本窗口生效 } diff --git a/res/image/main/calibration.png b/res/image/main/calibration.png deleted file mode 100644 index 9d6de19..0000000 --- a/res/image/main/calibration.png +++ /dev/null Binary files differ diff --git a/res/image/main/certApproval.png b/res/image/main/certApproval.png deleted file mode 100644 index 45147a6..0000000 --- a/res/image/main/certApproval.png +++ /dev/null Binary files differ diff --git a/res/image/main/checkDevice.png b/res/image/main/checkDevice.png deleted file mode 100644 index 3e9307a..0000000 --- a/res/image/main/checkDevice.png +++ /dev/null Binary files differ diff --git a/res/image/main/checkProgram.png b/res/image/main/checkProgram.png deleted file mode 100644 index e75ef50..0000000 --- a/res/image/main/checkProgram.png +++ /dev/null Binary files differ diff --git a/res/image/main/fileRes.png b/res/image/main/fileRes.png deleted file mode 100644 index 99b9b45..0000000 --- a/res/image/main/fileRes.png +++ /dev/null Binary files differ diff --git a/res/image/main/icon_menu_calibration.png b/res/image/main/icon_menu_calibration.png index 6fca8be..cbc7bfc 100644 --- a/res/image/main/icon_menu_calibration.png +++ 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 index 17f918f..3f140c6 100644 --- a/res/image/main/icon_menu_calibration_selected.png +++ 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 index c3db5fa..0a714a4 100644 --- a/res/image/main/icon_menu_check.png +++ 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 index 9794c43..9546177 100644 --- a/res/image/main/icon_menu_check_selected.png +++ 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 index e272f4c..73f2a24 100644 --- a/res/image/main/icon_menu_infomation.png +++ 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 index 6122c7b..bcb8e30 100644 --- a/res/image/main/icon_menu_infomation_checked.png +++ b/res/image/main/icon_menu_infomation_checked.png Binary files differ diff --git a/res/image/main/info.png b/res/image/main/info.png deleted file mode 100644 index a762db4..0000000 --- a/res/image/main/info.png +++ /dev/null Binary files differ diff --git a/res/image/main/rawDataRecord.png b/res/image/main/rawDataRecord.png deleted file mode 100644 index dd25617..0000000 --- a/res/image/main/rawDataRecord.png +++ /dev/null Binary files differ diff --git a/res/image/main/staff.png b/res/image/main/staff.png deleted file mode 100644 index a581e5f..0000000 --- a/res/image/main/staff.png +++ /dev/null Binary files differ diff --git a/res/image/main/standDevice.png b/res/image/main/standDevice.png deleted file mode 100644 index 48cbce1..0000000 --- a/res/image/main/standDevice.png +++ /dev/null Binary files differ diff --git a/res/image/msgbox/icon_box_confirm.png b/res/image/msgbox/icon_box_confirm.png index fda20c4..39c8969 100644 --- a/res/image/msgbox/icon_box_confirm.png +++ b/res/image/msgbox/icon_box_confirm.png Binary files differ diff --git a/res/image/msgbox/icon_box_info.png b/res/image/msgbox/icon_box_info.png index 5215e44..d3a4158 100644 --- a/res/image/msgbox/icon_box_info.png +++ b/res/image/msgbox/icon_box_info.png Binary files differ diff --git a/res/images.qrc b/res/images.qrc index dcb8ac5..4dd6e12 100644 --- a/res/images.qrc +++ b/res/images.qrc @@ -59,15 +59,6 @@ image/Index/menuMax.png image/Index/u118.png image/login/bg_login.png - image/main/calibration.png - image/main/certApproval.png - image/main/checkDevice.png - image/main/checkProgram.png - image/main/info.png - image/main/rawDataRecord.png - image/main/staff.png - image/main/standDevice.png - image/main/fileRes.png image/login/icon_pass.png image/login/icon_user.png image/login/icon_close.png diff --git a/res/qss/infoTable.css b/res/qss/infoTable.css index 137dd01..4b17ee3 100644 --- a/res/qss/infoTable.css +++ b/res/qss/infoTable.css @@ -6,6 +6,15 @@ font-size: 16px; } +/** 表格分页按钮样式 **/ +QWidget[class=pageBtnGroup] { + background: #2F6FC6; + border-radius: 6px; +} +QWidget[class=pageBtnGroup] QToolButton { + background: transparent; +} + /** 查询条件 **/ QWidget#wdgtQueryBox QLineEdit[class=queryBox] { border: 1px solid #E3E3E3; @@ -29,50 +38,7 @@ border: 1px solid #E3E3E3; font-size: 16px; } - -/** 普通按钮 **/ -QToolButton[class="btnDefault"] { - border-radius: 12px; - background-color: #2F6FC6; - color: #FFFFFF; - font-family: "Microsoft YaHei"; - font-size: 18px; -} -/** 查询重置按钮 **/ -QToolButton[class="btnOpposite"] { - border-radius: 12px; - border: 1px solid #2F6FC6; - background-color: #FFFFFF; - color: #2F6FC6; - font-family: "Microsoft YaHei"; - font-size: 18px; -} - -/** 表格顶端的标题栏 **/ -QLabel[class="frameLabel"]{ - background-color: #2F6FC6; - border: 0px; - border-radius: 0px; - border-top-left-radius: 10px; - border-top-right-radius: 10px; - padding: 10px; - font-size: 16px; - color: #FFFFFF; - font-family: "Microsoft YaHei"; -} - -/** 查询条件输入框 **/ -QLineEdit[class="gridInput"] { - border-radius: 10px; - font-family: "Microsoft YaHei"; - color: #333333; - border: 1px solid #CCCCCC; - font-size: 16px; - background-color: #DFEBF2; - padding-left: 10px; -} - -QComboBox[class="defaultSelect"] { +QWidget#wdgtQueryBox QComboBox[class=queryBox] { border-radius: 6px; font-family: "Microsoft YaHei"; padding-left: 16px; @@ -80,55 +46,55 @@ border: 1px solid #CCCCCC; font-size: 16px; } -QComboBox[class="defaultSelect"]::down-arrow { +QWidget#wdgtQueryBox QComboBox[class=queryBox]::down-arrow { image: url(":/image/main/arrow_down.png"); } -QComboBox[class="defaultSelect"]::down-arrow::on { +QWidget#wdgtQueryBox QComboBox[class=queryBox]::down-arrow::on { image: url(":/image/main/arrow_up.png"); } -QComboBox[class="defaultSelect"]::drop-down { +QWidget#wdgtQueryBox QComboBox[class=queryBox]::drop-down { subcontrol-origin: padding; subcontrol-position: top right; width: 20px; border: 0px; padding-right: 15px; } -QComboBox[class="defaultSelect"] QAbstractItemView { +QWidget#wdgtQueryBox QComboBox[class=queryBox] QAbstractItemView { color: #333333; background-color: #E1E1ED; font-family: "Microsoft YaHei"; font-size: 16px; outline: 0px; } -QComboBox[class="defaultSelect"] QAbstractItemView::item{ +QWidget#wdgtQueryBox QComboBox[class=queryBox] QAbstractItemView::item{ height: 40px; font-family: "Microsoft YaHei"; color: #333333; padding-left: 9px; background-color: #FFFFFF; } -QComboBox[class="defaultSelect"] QAbstractItemView::item:hover{ +QWidget#wdgtQueryBox QComboBox[class=queryBox] QAbstractItemView::item:hover{ color: #FFFFFF; background-color: #2F6FC6; } -QComboBox[class="defaultSelect"] QAbstractItemView::item:selected{ +QWidget#wdgtQueryBox QComboBox[class=queryBox] QAbstractItemView::item:selected{ color: #FFFFFF; background-color: #2F6FC6; } -QComboBox[class="defaultSelect"] QScrollBar::vertical { +QWidget#wdgtQueryBox QComboBox[class=queryBox] QScrollBar::vertical { width: 5px; background: #FFFFFF; border: none; } -QComboBox[class="defaultSelect"] QScrollBar::handle::vertical { +QWidget#wdgtQueryBox QComboBox[class=queryBox] QScrollBar::handle::vertical { width: 5px; background: #2F6FC6; border: none; } -QComboBox[class="defaultSelect"] QScrollBar::add-line::vertical { +QWidget#wdgtQueryBox QComboBox[class=queryBox] QScrollBar::add-line::vertical { border: none; } -QComboBox[class="defaultSelect"] QScrollBar::sub-line::vertical { +QWidget#wdgtQueryBox QComboBox[class=queryBox] QScrollBar::sub-line::vertical { border: none; } @@ -150,169 +116,7 @@ font-size: 18px; } -/** 表格部分通用样式 **/ -QTableWidget { - border: 0px; - font-size: 18px; - color: #333333; -} - -QTableWidget QHeaderView::section { - background-color: #2F6FC6; - border: 1px solid #FFFFFF; - color: #FFFFFF; - font-size: 18px; - min-height: 50px; -} - -QTableWidget::item { - padding-left: 10px; - padding-right: 10px; - border: 0px; -} - -QTableWidget::item::selected { - /*background: #FFFFFF; */ - color: #2F6FC6; -} - -QTableWidget QWidget[class="wdgtOper"] { - background: transparent; -} - -QLabel[class="urlText"] { - color: #0000FF; - text-decoration: underline; -} - -QToolTip { - font-family: "Microsoft Yahei"; - font-size: 18px; - padding: 10px; -} - -QPushButton[class="tableBtnDetail"] { - background: transparent; - color: #2F6FC6; - border: 0px; - font-size: 16px; - font-family: "Microsoft YaHei"; - text-decoration: underline; -} -QPushButton[class="tableBtnDelete"] { - background: transparent; - color: #F56C6C; - border: 0px; - font-size: 16px; - font-family: "Microsoft YaHei"; - text-decoration: underline; -} - - -/** 分页组件 **/ -QWidget[class="wdgtPageBtn"] { - background: #2F6FC6; - border-radius: 6px; -} -QWidget[class="wdgtPageBtn"] QToolButton { - background: transparent; -} -QWidget[class="wdgtPage"] QLabel { - color: #333333; - font-size: 16px; - font-family: "Microsoft YaHei"; -} - -/** 对话框弹窗顶端的标题栏 **/ -QWidget[class="dlgTitle"]{ - background-color: #2F6FC6; - border: 0px; - padding: 10px; -} -QWidget[class="dlgTitle"] QLabel{ - background: transparent; - border: 0px; - padding: 10px; - font-size: 20px; - color: #FFFFFF; - font-family: "Microsoft YaHei"; -} - -/** 详情表格 **/ -QWidget[class="detailTable"] QLabel{ - font-size: 18px; - color: #333333; - font-family: "Microsoft YaHei"; -} -QWidget[class="detailTable"] QLabel[class="urlText"] { - color: #0000FF; - text-decoration: underline; -} -/** 文本输入框 **/ -QWidget[class="detailTable"] QLineEdit{ - border-radius: 10px; - font-family: "Microsoft YaHei"; - color: #333333; - border: 1px solid #CCCCCC; - font-size: 16px; - background-color: #DFEBF2; - padding-left: 10px; -} -/** 日期选择器 **/ -QWidget[class="detailTable"] QDateEdit { - border-radius: 10px; - font-family: "Microsoft YaHei"; - color: #333333; - border: 1px solid #CCCCCC; - font-size: 16px; - padding-left: 10px; -} - -/** 下拉列表框的样式 **/ -QWidget[class="detailTable"] QComboBox { - border-radius: 6px; - font-family: "Microsoft YaHei"; - padding-left: 16px; - color: #333333; - border: 1px solid #CCCCCC; - font-size: 16px; -} -QWidget[class="detailTable"] QComboBox::down-arrow { - image: url(":/image/main/arrow_down.png"); -} -QWidget[class="detailTable"] QComboBox::down-arrow::on { - image: url(":/image/main/arrow_up.png"); -} -QWidget[class="detailTable"] QComboBox::drop-down { - subcontrol-origin: padding; - subcontrol-position: top right; - width: 20px; - border: 0px; - padding-right: 15px; -} -QWidget[class="detailTable"] QComboBox QAbstractItemView { - color: #333333; - background-color: #E1E1ED; - font-family: "Microsoft YaHei"; - font-size: 16px; - outline: 0px; -} -QWidget[class="detailTable"] QComboBox QAbstractItemView::item{ - height: 40px; - font-family: "Microsoft YaHei"; - color: #333333; - padding-left: 9px; - background-color: #FFFFFF; -} -QWidget[class="detailTable"] QComboBox QAbstractItemView::item:hover{ - color: #FFFFFF; - background-color: #2F6FC6; -} -QWidget[class="detailTable"] QComboBox QAbstractItemView::item:selected{ - color: #FFFFFF; - background-color: #2F6FC6; -} - +/** 复选框 **/ QCheckBox[class="defaultSolid"] { color: #333333; font-family: "Microsoft YaHei"; @@ -333,193 +137,69 @@ background: #2F6FC6; } -/* -QWidget#wdgtQueryBox QLineEdit { - border: 1px solid #E3E3E3; - border-radius: 6px; - padding-left: 10px; - font-family: Microsoft YaHei; - font-size: 16px; -} -QWidget#wdgtQueryBox QLineEdit::read-only { - border: 1px solid #E3E3E3; - border-radius: 6px; - padding-left: 10px; - font-family: Microsoft YaHei; - font-size: 16px; - background-color: #F3F3F3; -} -QWidget#wdgtQueryBox QDateEdit { - border: 1px solid #E3E3E3; - border-radius: 6px; - padding-left: 10px; - font-family: Microsoft YaHei; - font-size: 16px; -} - -QWidget#wdgtQueryBox QComboBox { - border-radius: 6px; - font-family: Microsoft YaHei; - padding-left: 10px; - color: #333333; - border: 1px solid #E3E3E3; - font-size: 16px; -} - -QWidget#wdgtQueryBox QComboBox::down-arrow { - image: url(":/image/Index/arrowDown.png"); -} -QWidget#wdgtQueryBox QComboBox::down-arrow::on { - image: url(":/image/Index/arrowUp.png"); -} - -QWidget#wdgtQueryBox QComboBox::drop-down { - subcontrol-origin: padding; - subcontrol-position: top right; - width: 20px; +/** 表格部分通用样式 **/ +QTableWidget[class=defaultTable] { border: 0px; - padding-right: 15px; -} - -QWidget#wdgtQueryBox QComboBox QAbstractItemView { - color: #333333; - background-color: #E1E1ED; - selection-background-color: #2F6FC6; - selection-color: #FFFFFF; - font-family: "Microsoft YaHei"; - outline: 0px; font-size: 16px; -} - -QWidget#wdgtQueryBox QComboBox QAbstractItemView::item { - height: 30px; color: #333333; - background-color: #FFFFFF; - font-size: 16px; -} -QWidget#wdgtQueryBox QComboBox QAbstractItemView::item:hover { - color: #FFFFFF; - background-color: #2F6FC6; } -QWidget#wdgtQueryBox QComboBox QAbstractItemView::item:selected { - color: #FFFFFF; - background-color: #2F6FC6; -} - - -QWidget#wdgtQueryBox QComboBox QScrollBar::vertical { - width: 10px; - background: #FFFFFF; - border: none; -} - -QWidget#wdgtQueryBox QComboBox QScrollBar::handle::vertical { - width: 10px; - background: #2F6FC6; - border: none; -} - -QWidget#wdgtQueryBox QComboBox QScrollBar::add-line::vertical { - border: none; -} -QWidget#wdgtQueryBox QComboBox QScrollBar::sub-line::vertical { - border: none; -} - - - -QWidget#wdgtFooter QToolButton { - border-radius: 6px; - background-color: #2F6FC6; - color: #FFFFFF; - font-family: "Microsoft YaHei"; - font-size: 18px; - font-weight: bold; -} - -QComboBox[class="defaultSelect"] { - border-radius: 6px; - font-family: Microsoft YaHei; - padding-left: 10px; - color: #333333; - border: 1px solid #E3E3E3; - font-size: 16px; -} -QComboBox[class="defaultSelect"]::down-arrow { - image: url(":/image/Index/arrowDown.png"); -} -QComboBox[class="defaultSelect"]::down-arrow::on { - image: url(":/image/Index/arrowUp.png"); -} -QComboBox[class="defaultSelect"]::drop-down { - subcontrol-origin: padding; - subcontrol-position: top right; - width: 20px; - border: 0px; - padding-right: 15px; -} -QComboBox[class="defaultSelect"] QAbstractItemView { - color: #333333; - background-color: #E1E1ED; - selection-background-color: #2F6FC6; - selection-color: #FFFFFF; - font-family: "Microsoft YaHei"; - outline: 0px; - font-size: 16px; -} -QComboBox[class="defaultSelect"] QAbstractItemView::item { - height: 30px; - color: #333333; - background-color: #FFFFFF; - font-size: 16px; -} -QComboBox[class="defaultSelect"] QAbstractItemView::item:hover { - color: #FFFFFF; - background-color: #2F6FC6; -} -QComboBox[class="defaultSelect"] QAbstractItemView::item:selected { - color: #FFFFFF; - background-color: #2F6FC6; -} - -QPushButton#btnDetailCategory, QPushButton#btnSaveAddr { - border-radius: 6px; - background-color: #2F6FC6; - color: #FFFFFF; - font-family: "Microsoft YaHei"; - font-size: 18px; - font-weight: bold; -} -*/ - -/* 页面整体背景设置为灰色 */ -QFrame#wdgtStateMain { +QTableWidget[class=defaultTable] QHeaderView::section { background-color: #E3E3E3; + border: 1px solid #FFFFFF; + color: #000000; + font-size: 18px; } -/* 信息块使用白色背景 用于区域分割 */ -QFrame[class="infoBlock"] { - background-color: #FFFFFF; + +QTableWidget[class=defaultTable]::item { + padding-left: 10px; + padding-right: 10px; + border: 0px; } -/* 子标题样式 */ -QWidget[class="subTitle"] QLabel { + +QTableWidget[class=defaultTable]::item::selected { + background: #FFFFFF; color: #2F6FC6; font-weight: bold; - font-size: 20px; - min-height: 40px; + font-size: 18px; } -QLabel[class="gridLabel"] { - font-size: 18px; - padding: 10px 20px; +QTableWidget[class=defaultTable] QScrollBar::vertical { + width: 4px; + background: #F3F3F3; + border: 0px; } -/* -QLineEdit[class="gridInput"] { - border-radius: 6px; - font-family: "Microsoft YaHei"; - color: #333333; - border: 1px solid #CCCCCC; - font-size: 18px; +QTableWidget[class=defaultTable] QScrollBar::handle::vertical { + background: #E3E3E3; + border: 0px; } -*/ + +QLabel[class="urlText"] { + color: #0000FF; + text-decoration: underline; +} +QLabel[class="colRed"] { + color: #FF0000; +} + +QToolTip { + font-family: "Microsoft Yahei"; + font-size: 18px; + padding: 10px; +} + + +/** 分页组件 **/ +QWidget[class="wdgtPageBtn"] { + background: #2F6FC6; + border-radius: 6px; +} +QWidget[class="wdgtPageBtn"] QToolButton { + background: transparent; +} +QWidget[class="wdgtPage"] QLabel { + color: #333333; + font-size: 16px; + font-family: "Microsoft YaHei"; +}