2025-03-14 17:05:48 +08:00
|
|
|
#include "AlarmManageForm.h"
|
|
|
|
|
#include "ui_AlarmManageForm.h"
|
|
|
|
|
|
|
|
|
|
#include "AlarmManageWidget.h"
|
|
|
|
|
#include <QGridLayout>
|
|
|
|
|
#include "net_msg_bus_api/MsgBusApi.h"
|
|
|
|
|
#include "pub_logger_api/logger.h"
|
|
|
|
|
#include "pub_utility_api/FileStyle.h"
|
|
|
|
|
|
|
|
|
|
AlarmManageForm::AlarmManageForm(QWidget *parent,bool edit) :
|
|
|
|
|
QWidget(parent),
|
|
|
|
|
m_bEdit(edit),
|
|
|
|
|
m_alarmWidget(Q_NULLPTR),
|
|
|
|
|
ui(new Ui::AlarmManageForm)
|
|
|
|
|
{
|
|
|
|
|
ui->setupUi(this);
|
|
|
|
|
QString qss = QString();
|
|
|
|
|
|
2025-03-17 09:23:17 +08:00
|
|
|
std::string strFullPath = iot_public::CFileStyle::getPathOfStyleFile("public.qss") ;
|
2025-03-14 17:05:48 +08:00
|
|
|
QFile qssfile1(QString::fromStdString(strFullPath));
|
|
|
|
|
qssfile1.open(QFile::ReadOnly);
|
|
|
|
|
if (qssfile1.isOpen())
|
|
|
|
|
{
|
|
|
|
|
qss += QLatin1String(qssfile1.readAll());
|
|
|
|
|
//setStyleSheet(qss);
|
|
|
|
|
qssfile1.close();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
qDebug() << "public.qss 无法打开!";
|
|
|
|
|
}
|
|
|
|
|
|
2025-03-17 09:23:17 +08:00
|
|
|
strFullPath = iot_public::CFileStyle::getPathOfStyleFile("alarmmng.qss") ;
|
2025-03-14 17:05:48 +08:00
|
|
|
QFile qssfile2(QString::fromStdString(strFullPath));
|
|
|
|
|
qssfile2.open(QFile::ReadOnly);
|
|
|
|
|
if (qssfile2.isOpen())
|
|
|
|
|
{
|
|
|
|
|
qss += QLatin1String(qssfile2.readAll());
|
|
|
|
|
//setStyleSheet(qss);
|
|
|
|
|
qssfile2.close();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
qDebug() << "alarmmng.qss 无法打开!";
|
|
|
|
|
}
|
|
|
|
|
if(!qss.isEmpty())
|
|
|
|
|
{
|
|
|
|
|
setStyleSheet(qss);
|
|
|
|
|
}
|
|
|
|
|
initLayout();
|
|
|
|
|
initMember();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
AlarmManageForm::~AlarmManageForm()
|
|
|
|
|
{
|
|
|
|
|
if(m_alarmWidget)
|
|
|
|
|
{
|
|
|
|
|
delete m_alarmWidget;
|
|
|
|
|
m_alarmWidget = NULL;
|
|
|
|
|
}
|
|
|
|
|
delete ui;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void AlarmManageForm::initLayout()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void AlarmManageForm::initMember()
|
|
|
|
|
{
|
|
|
|
|
if(m_alarmWidget == NULL)
|
|
|
|
|
{
|
|
|
|
|
m_alarmWidget = new AlarmManageWidget(this,m_bEdit);
|
|
|
|
|
addWidget();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void AlarmManageForm::addWidget()
|
|
|
|
|
{
|
|
|
|
|
QGridLayout *gridLayout = new QGridLayout(ui->widget);
|
|
|
|
|
gridLayout->setSpacing(6);
|
|
|
|
|
gridLayout->setContentsMargins(0, 0, 0, 0);
|
|
|
|
|
gridLayout->addWidget(m_alarmWidget, 0, 0, 1, 1);
|
|
|
|
|
}
|