#ifndef MONITOROVOZEZ_H #define MONITOROVOZEZ_H #include #include #include #include #include #include #include #include #include #include "MonitorTagUI.h" QT_BEGIN_NAMESPACE class Ui_MonitorWidget:public QWidget { public: QVBoxLayout *verticalLayout; QHBoxLayout *operationLayout; QPushButton *exchangeButton; QSpacerItem *horizontalSpacer; QGridLayout *monitorLayout; QHBoxLayout *filterlLayout; QPushButton *interruptedButton; QPushButton *normalButton; QPushButton *standbyButton; QPushButton *hutdownButton; QPushButton *failureButton; QPushButton *runButton; QWidget *fillWidget; QList> tagList; void setupUi(QWidget *MonitorWidget) { if (MonitorWidget->objectName().isEmpty()) MonitorWidget->setObjectName(QString::fromUtf8("MonitorWidget")); verticalLayout = new QVBoxLayout(MonitorWidget); verticalLayout->setSpacing(0); verticalLayout->setObjectName(QString::fromUtf8("verticalLayout")); verticalLayout->setContentsMargins(0, 0, 0, 0); operationLayout = new QHBoxLayout(); operationLayout->setObjectName(QString::fromUtf8("operationLayout")); exchangeButton = new QPushButton(MonitorWidget); exchangeButton->setObjectName(QString::fromUtf8("exchangeButton")); operationLayout->addWidget(exchangeButton); horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); operationLayout->addItem(horizontalSpacer); verticalLayout->addLayout(operationLayout); monitorLayout = new QGridLayout(); monitorLayout->setObjectName(QString::fromUtf8("monitorLayout")); monitorLayout->setSpacing(30); monitorLayout->setContentsMargins(20, 20, 20, 20); fillWidget = new QWidget(); fillWidget->setLayout(monitorLayout); tagList.clear(); for(int i=0;i<5;i++) { QList tags; for(int j=0;j<5;j++) { Ui::MonitorTag *newTag = new Ui::MonitorTag(); connect(exchangeButton, &QPushButton::clicked, this, [=](){newTag->stackedWidget->setCurrentIndex(1); }); tags.append(newTag); } tagList.append(tags); } for(int i=0;i<5;i++) { for(int j=0;j<5;j++) { //将Tag放入布局 monitorLayout->addWidget(tagList.at(i).at(j), i, j); } } QScrollArea *scrollArea = new QScrollArea(); fillWidget->setFixedHeight(scrollArea->height()); scrollArea->setWidget(fillWidget); scrollArea->setWidgetResizable(true); scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); scrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn); verticalLayout->addWidget(scrollArea); filterlLayout = new QHBoxLayout(); filterlLayout->setObjectName(QString::fromUtf8("filterlLayout")); interruptedButton = new QPushButton(MonitorWidget); interruptedButton->setObjectName(QString::fromUtf8("interruptedButton")); filterlLayout->addWidget(interruptedButton); normalButton = new QPushButton(MonitorWidget); normalButton->setObjectName(QString::fromUtf8("normalButton")); filterlLayout->addWidget(normalButton); standbyButton = new QPushButton(MonitorWidget); standbyButton->setObjectName(QString::fromUtf8("standbyButton")); filterlLayout->addWidget(standbyButton); hutdownButton = new QPushButton(MonitorWidget); hutdownButton->setObjectName(QString::fromUtf8("hutdownButton")); filterlLayout->addWidget(hutdownButton); failureButton = new QPushButton(MonitorWidget); failureButton->setObjectName(QString::fromUtf8("failureButton")); filterlLayout->addWidget(failureButton); runButton = new QPushButton(MonitorWidget); runButton->setObjectName(QString::fromUtf8("runButton")); filterlLayout->addWidget(runButton); verticalLayout->addLayout(filterlLayout); verticalLayout->setStretch(0, 2); verticalLayout->setStretch(1, 30); verticalLayout->setStretch(2, 3); MonitorWidget->setLayout(verticalLayout); retranslateUi(MonitorWidget); // this->setStyleSheet("background-color: blue;"); QMetaObject::connectSlotsByName(MonitorWidget); } // setupUi void retranslateUi(QWidget *MonitorWidget) { MonitorWidget->setWindowTitle(QCoreApplication::translate("MonitorWidget", "Form", nullptr)); exchangeButton->setText(QCoreApplication::translate("MonitorWidget", "\345\244\247\345\260\217\345\233\276\346\240\207\345\210\207\346\215\242", nullptr)); interruptedButton->setText(QCoreApplication::translate("MonitorWidget", "\351\200\232\350\256\257\344\270\255\346\226\255 x\345\217\260", nullptr)); normalButton->setText(QCoreApplication::translate("MonitorWidget", "\346\255\243\345\270\270\350\277\220\350\241\214 x\345\217\260", nullptr)); standbyButton->setText(QCoreApplication::translate("MonitorWidget", "\345\276\205\346\234\272\347\255\211\351\243\216 x\345\217\260", nullptr)); hutdownButton->setText(QCoreApplication::translate("MonitorWidget", "\345\201\234\346\234\272\347\273\264\346\212\244 x\345\217\260", nullptr)); failureButton->setText(QCoreApplication::translate("MonitorWidget", "\346\225\205\351\232\234\345\276\205\346\234\272 x\345\217\260", nullptr)); runButton->setText(QCoreApplication::translate("MonitorWidget", "\345\220\257\345\212\250 x\345\217\260", nullptr)); } // retranslateUi Ui_MonitorWidget() { setupUi(this); } }; namespace Ui { class MonitorWidget: public Ui_MonitorWidget {}; } // namespace Ui QT_END_NAMESPACE #endif // MONITOROVOZEZ_H