0515更新
parent
39df8979bc
commit
fed228d7a5
@ -1,18 +1,9 @@
|
||||
|
||||
#include "MainWindow.h"
|
||||
#include "./ui_MainWindow.h"
|
||||
//#include "./ui_MainWindow.h"
|
||||
|
||||
|
||||
|
||||
MainWindow::MainWindow(QWidget *parent)
|
||||
: QMainWindow(parent)
|
||||
, ui(new Ui::MainWindow)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
}
|
||||
|
||||
MainWindow::~MainWindow()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,26 +1,173 @@
|
||||
#include <QtCore/QVariant>
|
||||
#include <QtGui/QIcon>
|
||||
#include <QtWidgets/QApplication>
|
||||
#include <QtWidgets/QHBoxLayout>
|
||||
#include <QtWidgets/QMainWindow>
|
||||
#include <QtWidgets/QPushButton>
|
||||
#include <QtWidgets/QSpacerItem>
|
||||
#include <QtWidgets/QStackedWidget>
|
||||
#include <QtWidgets/QVBoxLayout>
|
||||
#include <QtWidgets/QWidget>
|
||||
|
||||
#ifndef MAINWINDOW_H
|
||||
#define MAINWINDOW_H
|
||||
#include "./MonitorUI/MonitorUI.h"
|
||||
#include "./AnalyticUI/ClearanceAnalyticUI.h"
|
||||
#include "./AnalyticUI/FlangeAnalyticUI.h"
|
||||
#include "./AnalyticUI/GyroscopeAnalyticUI.h"
|
||||
|
||||
#include <QMainWindow>
|
||||
|
||||
|
||||
class MainWindow:public QMainWindow
|
||||
{
|
||||
public:
|
||||
QWidget *centralwidget;
|
||||
QVBoxLayout *verticalLayout;
|
||||
QWidget *titleWidget;
|
||||
QHBoxLayout *horizontalLayout;
|
||||
QSpacerItem *horizontalSpacer;
|
||||
QPushButton *minButton;
|
||||
QPushButton *closeButton;
|
||||
QHBoxLayout *tabLayout;
|
||||
QPushButton *monitorButton;
|
||||
QPushButton *flangeButton;
|
||||
QPushButton *clearanceButton;
|
||||
QPushButton *gyroscopeButton;
|
||||
QStackedWidget *stackedWidget;
|
||||
Ui::MonitorWidget *monitorPage;
|
||||
Ui::ClearanceAnalyticWidget *clearancePage;
|
||||
Ui::FlangeAnalyticWidget *flangePage;
|
||||
Ui::GyroscopeAnalyticWidget *gyroscopePage;
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
namespace Ui { class MainWindow; }
|
||||
QT_END_NAMESPACE
|
||||
|
||||
class MainWindow : public QMainWindow
|
||||
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
MainWindow(QWidget *parent = nullptr);
|
||||
~MainWindow();
|
||||
void setupUi(QMainWindow *MainWindow)
|
||||
{
|
||||
if (MainWindow->objectName().isEmpty())
|
||||
MainWindow->setObjectName(QString::fromUtf8("MainWindow"));
|
||||
MainWindow->resize(1920, 1080);
|
||||
|
||||
centralwidget = new QWidget(MainWindow);
|
||||
centralwidget->setObjectName(QString::fromUtf8("centralwidget"));
|
||||
verticalLayout = new QVBoxLayout(centralwidget);
|
||||
verticalLayout->setSpacing(0);
|
||||
verticalLayout->setObjectName(QString::fromUtf8("verticalLayout"));
|
||||
verticalLayout->setContentsMargins(0, 0, 0, 0);
|
||||
titleWidget = new QWidget(centralwidget);
|
||||
titleWidget->setObjectName(QString::fromUtf8("titleWidget"));
|
||||
horizontalLayout = new QHBoxLayout(titleWidget);
|
||||
horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout"));
|
||||
horizontalLayout->setContentsMargins(0, 0, 0, 0);
|
||||
horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
|
||||
|
||||
horizontalLayout->addItem(horizontalSpacer);
|
||||
|
||||
minButton = new QPushButton(titleWidget);
|
||||
minButton->setObjectName(QString::fromUtf8("minButton"));
|
||||
QIcon icon;
|
||||
icon.addFile(QString::fromUtf8(":/Static/min.png"), QSize(), QIcon::Normal, QIcon::On);
|
||||
minButton->setIcon(icon);
|
||||
|
||||
horizontalLayout->addWidget(minButton);
|
||||
|
||||
closeButton = new QPushButton(titleWidget);
|
||||
closeButton->setObjectName(QString::fromUtf8("closeButton"));
|
||||
QIcon icon1;
|
||||
icon1.addFile(QString::fromUtf8(":/Static/close.png"), QSize(), QIcon::Normal, QIcon::On);
|
||||
closeButton->setIcon(icon1);
|
||||
|
||||
horizontalLayout->addWidget(closeButton);
|
||||
|
||||
|
||||
verticalLayout->addWidget(titleWidget);
|
||||
|
||||
tabLayout = new QHBoxLayout();
|
||||
tabLayout->setObjectName(QString::fromUtf8("tabLayout"));
|
||||
monitorButton = new QPushButton(centralwidget);
|
||||
monitorButton->setObjectName(QString::fromUtf8("monitorButton"));
|
||||
|
||||
|
||||
|
||||
tabLayout->addWidget(monitorButton);
|
||||
|
||||
flangeButton = new QPushButton(centralwidget);
|
||||
flangeButton->setObjectName(QString::fromUtf8("flangeButton"));
|
||||
|
||||
tabLayout->addWidget(flangeButton);
|
||||
|
||||
clearanceButton = new QPushButton(centralwidget);
|
||||
clearanceButton->setObjectName(QString::fromUtf8("clearanceButton"));
|
||||
|
||||
tabLayout->addWidget(clearanceButton);
|
||||
|
||||
gyroscopeButton = new QPushButton(centralwidget);
|
||||
gyroscopeButton->setObjectName(QString::fromUtf8("gyroscopeButton"));
|
||||
|
||||
tabLayout->addWidget(gyroscopeButton);
|
||||
|
||||
|
||||
verticalLayout->addLayout(tabLayout);
|
||||
|
||||
stackedWidget = new QStackedWidget(centralwidget);
|
||||
stackedWidget->setObjectName(QString::fromUtf8("stackedWidget"));
|
||||
|
||||
monitorPage = new Ui::MonitorWidget();
|
||||
monitorPage->setObjectName(QString::fromUtf8("monitorPage"));
|
||||
stackedWidget->addWidget(monitorPage);
|
||||
|
||||
flangePage = new Ui::FlangeAnalyticWidget();
|
||||
flangePage->setObjectName(QString::fromUtf8("flangePage"));
|
||||
stackedWidget->addWidget(flangePage);
|
||||
clearancePage = new Ui::ClearanceAnalyticWidget();
|
||||
clearancePage->setObjectName(QString::fromUtf8("clearancePage"));
|
||||
stackedWidget->addWidget(clearancePage);
|
||||
gyroscopePage = new Ui::GyroscopeAnalyticWidget();
|
||||
gyroscopePage->setObjectName(QString::fromUtf8("gyroscopePage"));
|
||||
stackedWidget->addWidget(gyroscopePage);
|
||||
|
||||
verticalLayout->addWidget(stackedWidget);
|
||||
|
||||
verticalLayout->setStretch(0, 2);
|
||||
verticalLayout->setStretch(1, 3);
|
||||
verticalLayout->setStretch(2, 40);
|
||||
MainWindow->setCentralWidget(centralwidget);
|
||||
|
||||
retranslateUi(MainWindow);
|
||||
|
||||
// 设置按钮点击跳转窗口
|
||||
connect(monitorButton, &QPushButton::clicked, this, [=](){this->stackedWidget->setCurrentIndex(0); });
|
||||
connect(flangeButton, &QPushButton::clicked, this, [=](){this->stackedWidget->setCurrentIndex(1); });
|
||||
connect(clearanceButton, &QPushButton::clicked, this, [=](){this->stackedWidget->setCurrentIndex(2); });
|
||||
connect(gyroscopeButton, &QPushButton::clicked, this, [=](){this->stackedWidget->setCurrentIndex(3); });
|
||||
|
||||
connect(closeButton, &QPushButton::clicked, MainWindow, &QMainWindow::close);
|
||||
|
||||
// 设置无边框窗口
|
||||
MainWindow->setWindowFlags(Qt::FramelessWindowHint);
|
||||
|
||||
QMetaObject::connectSlotsByName(MainWindow);
|
||||
} // setupUi
|
||||
|
||||
void retranslateUi(QMainWindow *MainWindow)
|
||||
{
|
||||
MainWindow->setWindowTitle(QCoreApplication::translate("MainWindow", "MainWindow", nullptr));
|
||||
minButton->setText(QString());
|
||||
closeButton->setText(QString());
|
||||
monitorButton->setText(QCoreApplication::translate("MainWindow", "\347\233\221\346\216\247\346\200\273\350\247\210", nullptr));
|
||||
flangeButton->setText(QCoreApplication::translate("MainWindow", "\346\263\225\345\205\260\345\210\206\346\236\220", nullptr));
|
||||
clearanceButton->setText(QCoreApplication::translate("MainWindow", "\345\207\200\347\251\272\345\210\206\346\236\220", nullptr));
|
||||
gyroscopeButton->setText(QCoreApplication::translate("MainWindow", "\351\231\200\350\236\272\344\273\252\347\233\221\346\265\213", nullptr));
|
||||
} // retranslateUi
|
||||
|
||||
MainWindow(){
|
||||
this->setupUi(this);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
Ui::MainWindow *ui;
|
||||
};
|
||||
|
||||
#endif // MAINWINDOW_H
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,13 @@
|
||||
QWidget#MonitorTag{
|
||||
|
||||
background-color: #374065;
|
||||
border-radius: 10px;
|
||||
border: 3px solid;
|
||||
border-color: #1E6C92;
|
||||
}
|
||||
|
||||
QLabel#speedLabel{
|
||||
|
||||
color: #DDDDE9;
|
||||
|
||||
}
|
@ -1,171 +0,0 @@
|
||||
/********************************************************************************
|
||||
** Form generated from reading UI file 'MainWindowwurXHg.ui'
|
||||
**
|
||||
** Created by: Qt User Interface Compiler version 5.14.2
|
||||
**
|
||||
** WARNING! All changes made in this file will be lost when recompiling UI file!
|
||||
********************************************************************************/
|
||||
|
||||
#ifndef MAINWINDOWWURXHG_H
|
||||
#define MAINWINDOWWURXHG_H
|
||||
|
||||
#include <QtCore/QVariant>
|
||||
#include <QtGui/QIcon>
|
||||
#include <QtWidgets/QApplication>
|
||||
#include <QtWidgets/QHBoxLayout>
|
||||
#include <QtWidgets/QMainWindow>
|
||||
#include <QtWidgets/QPushButton>
|
||||
#include <QtWidgets/QSpacerItem>
|
||||
#include <QtWidgets/QStackedWidget>
|
||||
#include <QtWidgets/QVBoxLayout>
|
||||
#include <QtWidgets/QWidget>
|
||||
|
||||
#include "./MonitorUI/MonitorUI.h"
|
||||
#include "./AnalyticUI/ClearanceAnalyticUI.h"
|
||||
#include "./AnalyticUI/FlangeAnalyticUI.h"
|
||||
#include "./AnalyticUI/GyroscopeAnalyticUI.h"
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
class Ui_MainWindow:public QMainWindow
|
||||
{
|
||||
public:
|
||||
QWidget *centralwidget;
|
||||
QVBoxLayout *verticalLayout;
|
||||
QWidget *titleWidget;
|
||||
QHBoxLayout *horizontalLayout;
|
||||
QSpacerItem *horizontalSpacer;
|
||||
QPushButton *minButton;
|
||||
QPushButton *maxButton;
|
||||
QHBoxLayout *tabLayout;
|
||||
QPushButton *monitorButton;
|
||||
QPushButton *flangeButton;
|
||||
QPushButton *clearanceButton;
|
||||
QPushButton *gyroscopeButton;
|
||||
QStackedWidget *stackedWidget;
|
||||
Ui::MonitorWidget *monitorPage;
|
||||
Ui::ClearanceAnalyticWidget *clearancePage;
|
||||
Ui::FlangeAnalyticWidget *flangePage;
|
||||
Ui::GyroscopeAnalyticWidget *gyroscopePage;
|
||||
|
||||
void setupUi(QMainWindow *MainWindow)
|
||||
{
|
||||
if (MainWindow->objectName().isEmpty())
|
||||
MainWindow->setObjectName(QString::fromUtf8("MainWindow"));
|
||||
MainWindow->resize(1920, 1080);
|
||||
|
||||
centralwidget = new QWidget(MainWindow);
|
||||
centralwidget->setObjectName(QString::fromUtf8("centralwidget"));
|
||||
verticalLayout = new QVBoxLayout(centralwidget);
|
||||
verticalLayout->setSpacing(0);
|
||||
verticalLayout->setObjectName(QString::fromUtf8("verticalLayout"));
|
||||
verticalLayout->setContentsMargins(0, 0, 0, 0);
|
||||
titleWidget = new QWidget(centralwidget);
|
||||
titleWidget->setObjectName(QString::fromUtf8("titleWidget"));
|
||||
horizontalLayout = new QHBoxLayout(titleWidget);
|
||||
horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout"));
|
||||
horizontalLayout->setContentsMargins(0, 0, 0, 0);
|
||||
horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
|
||||
|
||||
horizontalLayout->addItem(horizontalSpacer);
|
||||
|
||||
minButton = new QPushButton(titleWidget);
|
||||
minButton->setObjectName(QString::fromUtf8("minButton"));
|
||||
QIcon icon;
|
||||
icon.addFile(QString::fromUtf8(":/Static/min.png"), QSize(), QIcon::Normal, QIcon::On);
|
||||
minButton->setIcon(icon);
|
||||
|
||||
horizontalLayout->addWidget(minButton);
|
||||
|
||||
maxButton = new QPushButton(titleWidget);
|
||||
maxButton->setObjectName(QString::fromUtf8("maxButton"));
|
||||
QIcon icon1;
|
||||
icon1.addFile(QString::fromUtf8(":/Static/close.png"), QSize(), QIcon::Normal, QIcon::On);
|
||||
maxButton->setIcon(icon1);
|
||||
|
||||
horizontalLayout->addWidget(maxButton);
|
||||
|
||||
|
||||
verticalLayout->addWidget(titleWidget);
|
||||
|
||||
tabLayout = new QHBoxLayout();
|
||||
tabLayout->setObjectName(QString::fromUtf8("tabLayout"));
|
||||
monitorButton = new QPushButton(centralwidget);
|
||||
monitorButton->setObjectName(QString::fromUtf8("monitorButton"));
|
||||
|
||||
|
||||
|
||||
tabLayout->addWidget(monitorButton);
|
||||
|
||||
flangeButton = new QPushButton(centralwidget);
|
||||
flangeButton->setObjectName(QString::fromUtf8("flangeButton"));
|
||||
|
||||
tabLayout->addWidget(flangeButton);
|
||||
|
||||
clearanceButton = new QPushButton(centralwidget);
|
||||
clearanceButton->setObjectName(QString::fromUtf8("clearanceButton"));
|
||||
|
||||
tabLayout->addWidget(clearanceButton);
|
||||
|
||||
gyroscopeButton = new QPushButton(centralwidget);
|
||||
gyroscopeButton->setObjectName(QString::fromUtf8("gyroscopeButton"));
|
||||
|
||||
tabLayout->addWidget(gyroscopeButton);
|
||||
|
||||
|
||||
verticalLayout->addLayout(tabLayout);
|
||||
|
||||
stackedWidget = new QStackedWidget(centralwidget);
|
||||
stackedWidget->setObjectName(QString::fromUtf8("stackedWidget"));
|
||||
|
||||
monitorPage = new Ui::MonitorWidget();
|
||||
monitorPage->setObjectName(QString::fromUtf8("monitorPage"));
|
||||
stackedWidget->addWidget(monitorPage);
|
||||
|
||||
flangePage = new Ui::FlangeAnalyticWidget();
|
||||
flangePage->setObjectName(QString::fromUtf8("flangePage"));
|
||||
stackedWidget->addWidget(flangePage);
|
||||
clearancePage = new Ui::ClearanceAnalyticWidget();
|
||||
clearancePage->setObjectName(QString::fromUtf8("clearancePage"));
|
||||
stackedWidget->addWidget(clearancePage);
|
||||
gyroscopePage = new Ui::GyroscopeAnalyticWidget();
|
||||
gyroscopePage->setObjectName(QString::fromUtf8("gyroscopePage"));
|
||||
stackedWidget->addWidget(gyroscopePage);
|
||||
|
||||
verticalLayout->addWidget(stackedWidget);
|
||||
|
||||
verticalLayout->setStretch(0, 2);
|
||||
verticalLayout->setStretch(1, 3);
|
||||
verticalLayout->setStretch(2, 40);
|
||||
MainWindow->setCentralWidget(centralwidget);
|
||||
|
||||
retranslateUi(MainWindow);
|
||||
|
||||
connect(monitorButton, &QPushButton::clicked, this, [=](){this->stackedWidget->setCurrentIndex(0); });
|
||||
connect(flangeButton, &QPushButton::clicked, this, [=](){this->stackedWidget->setCurrentIndex(1); });
|
||||
connect(clearanceButton, &QPushButton::clicked, this, [=](){this->stackedWidget->setCurrentIndex(2); });
|
||||
connect(gyroscopeButton, &QPushButton::clicked, this, [=](){this->stackedWidget->setCurrentIndex(3); });
|
||||
|
||||
QMetaObject::connectSlotsByName(MainWindow);
|
||||
} // setupUi
|
||||
|
||||
void retranslateUi(QMainWindow *MainWindow)
|
||||
{
|
||||
MainWindow->setWindowTitle(QCoreApplication::translate("MainWindow", "MainWindow", nullptr));
|
||||
minButton->setText(QString());
|
||||
maxButton->setText(QString());
|
||||
monitorButton->setText(QCoreApplication::translate("MainWindow", "\347\233\221\346\216\247\346\200\273\350\247\210", nullptr));
|
||||
flangeButton->setText(QCoreApplication::translate("MainWindow", "\346\263\225\345\205\260\345\210\206\346\236\220", nullptr));
|
||||
clearanceButton->setText(QCoreApplication::translate("MainWindow", "\345\207\200\347\251\272\345\210\206\346\236\220", nullptr));
|
||||
gyroscopeButton->setText(QCoreApplication::translate("MainWindow", "\351\231\200\350\236\272\344\273\252\347\233\221\346\265\213", nullptr));
|
||||
} // retranslateUi
|
||||
|
||||
};
|
||||
|
||||
namespace Ui {
|
||||
class MainWindow: public Ui_MainWindow {};
|
||||
} // namespace Ui
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // MAINWINDOWWURXHG_H
|
Loading…
Reference in New Issue