diff --git a/product/src/tools/his_event_del/CCheckUser.cpp b/product/src/tools/his_event_del/CCheckUser.cpp index f5f18022..ffad64bb 100644 --- a/product/src/tools/his_event_del/CCheckUser.cpp +++ b/product/src/tools/his_event_del/CCheckUser.cpp @@ -3,15 +3,20 @@ #include "QMessageBox" #include #include "dbms/db_sysinfo_api/CDbSysInfo.h" +#include "pub_widget/MessageBox.h" + QString CCheckUser::m_userName =""; CCheckUser::CCheckUser(QWidget *parent) : m_ptrPermMngApi(NULL), - QDialog(parent), + CustomUiDialog(parent), m_pReadDb(Q_NULLPTR), ui(new Ui::CCheckUser) { ui->setupUi(this); init(); + + setResizeable(false); + CustomUiDialog::setAutoLayout(true); } CCheckUser::~CCheckUser() @@ -63,8 +68,8 @@ void CCheckUser::initVariable() void CCheckUser::initVeiw() { ui->lineEdit_password->setEchoMode(QLineEdit::EchoMode::Password); - this->setFixedSize(204,150); - this->setWindowTitle(tr("登陆")); +// this->setFixedSize(204,150); + this->setWindowTitle(tr("登录")); } void CCheckUser::initSignalSlot() @@ -100,8 +105,7 @@ void CCheckUser::slot_check() m_userName = userName; if(m_ptrPermMngApi->SysLogin(userName.toStdString(), password.toStdString(), usergId, 12*60*60, "hmi") != 0) { - QMessageBox::about(this,"提示","登陆失败!"); - reject(); + N_MessageBox::about(this,"提示","登陆失败!"); return; } accept(); diff --git a/product/src/tools/his_event_del/CCheckUser.h b/product/src/tools/his_event_del/CCheckUser.h index 490ff663..fe30e66c 100644 --- a/product/src/tools/his_event_del/CCheckUser.h +++ b/product/src/tools/his_event_del/CCheckUser.h @@ -1,14 +1,15 @@ #ifndef CCHECKUSER_H #define CCHECKUSER_H -#include #include "perm_mng_api/PermMngApi.h" #include "db_api_ex/CDbApi.h" +#include "pub_widget/CustomDialog.h" + namespace Ui { class CCheckUser; } -class CCheckUser : public QDialog +class CCheckUser : public CustomUiDialog { Q_OBJECT diff --git a/product/src/tools/his_event_del/CCheckUser.ui b/product/src/tools/his_event_del/CCheckUser.ui index f7469d64..6d3d91a3 100644 --- a/product/src/tools/his_event_del/CCheckUser.ui +++ b/product/src/tools/his_event_del/CCheckUser.ui @@ -13,70 +13,64 @@ Dialog - - - - 10 - 10 - 180 - 136 - - - - - - - - - 用户名 - - - - - - - - - - 密码 - - - - - - - - - - 用户组 - - - - - - - - - - - - - - 验证 - - - - - - - 取消 - - - - - - - + + + + + + + + + 用户名 + + + + + + + + + + 密码 + + + + + + + + + + 用户组 + + + + + + + + + + + + + + 验证 + + + + + + + 取消 + + + + + + + + diff --git a/product/src/tools/his_event_del/CDbOpt.cpp b/product/src/tools/his_event_del/CDbOpt.cpp index 0803fcc8..d68b4068 100644 --- a/product/src/tools/his_event_del/CDbOpt.cpp +++ b/product/src/tools/his_event_del/CDbOpt.cpp @@ -5,7 +5,18 @@ #include "dbms/db_sysinfo_api/CDbSysInfo.h" #include "perm_mng_api/PermMngApi.h" +//< 屏蔽xml_parser编译告警 +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-copy" +#endif + #include "boost/property_tree/xml_parser.hpp" + +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif + #include "boost/typeof/typeof.hpp" #include "boost/filesystem.hpp" #include "Common.h" diff --git a/product/src/tools/his_event_del/CEventFilterDialog.cpp b/product/src/tools/his_event_del/CEventFilterDialog.cpp index f003d190..73c8802e 100644 --- a/product/src/tools/his_event_del/CEventFilterDialog.cpp +++ b/product/src/tools/his_event_del/CEventFilterDialog.cpp @@ -4,15 +4,19 @@ #include "public/pub_sysinfo_api/SysInfoApi.h" CEventFilterDialog::CEventFilterDialog(QWidget *parent) : - QDialog(parent), + CustomUiDialog(parent), ui(new Ui::CEventFilterDialog), m_rtdbAccess(Q_NULLPTR) { + setWindowTitle(tr("过滤条件")); + ui->setupUi(this); setObjectName("event_dialog"); ui->subSystem->setView(new QListView()); ui->deviceType->setView(new QListView()); initialize(); + + setAutoLayout(true); } CEventFilterDialog::~CEventFilterDialog() diff --git a/product/src/tools/his_event_del/CEventFilterDialog.h b/product/src/tools/his_event_del/CEventFilterDialog.h index 453b6ab2..f5552d58 100644 --- a/product/src/tools/his_event_del/CEventFilterDialog.h +++ b/product/src/tools/his_event_del/CEventFilterDialog.h @@ -1,15 +1,15 @@ #ifndef CEVENTFILTERDIALOG_H #define CEVENTFILTERDIALOG_H -#include #include #include "dbms/rdb_api/CRdbAccess.h" +#include "pub_widget/CustomDialog.h" namespace Ui { class CEventFilterDialog; } -class CEventFilterDialog : public QDialog +class CEventFilterDialog : public CustomUiDialog { Q_OBJECT diff --git a/product/src/tools/his_event_del/CEventFilterDialog.ui b/product/src/tools/his_event_del/CEventFilterDialog.ui index 93caeef3..ec9c4c37 100644 --- a/product/src/tools/his_event_del/CEventFilterDialog.ui +++ b/product/src/tools/his_event_del/CEventFilterDialog.ui @@ -26,6 +26,9 @@ 过滤 + + 10 + diff --git a/product/src/tools/his_event_del/CEventForm.cpp b/product/src/tools/his_event_del/CEventForm.cpp index 2f0bb7b8..7f441d79 100644 --- a/product/src/tools/his_event_del/CEventForm.cpp +++ b/product/src/tools/his_event_del/CEventForm.cpp @@ -21,10 +21,12 @@ using namespace iot_public; CEventForm::CEventForm(QWidget *parent) : - QWidget(parent), + CustomUiDialog(parent), m_pHistoryModel(NULL), ui(new Ui::CEventForm) { + setWindowTitle(tr("事件管理工具")); + qRegisterMetaType("CEventMsgInfo"); qRegisterMetaType("EventMsgPtr"); qRegisterMetaType("uint64"); @@ -47,8 +49,11 @@ CEventForm::CEventForm(QWidget *parent) : m_pListWidget2 = new CMyListWidget(this); m_pListWidget3 = new CMyListWidget(this); m_pLineEdit1 = new QLineEdit(this); + m_pLineEdit1->setObjectName("priority"); m_pLineEdit2 = new QLineEdit(this); + m_pLineEdit2->setObjectName("location"); m_pLineEdit3 = new QLineEdit(this); + m_pLineEdit3->setObjectName("event_status"); initFilter(); slotUpdateModel(); ui->eventView->setColumnWidth(0, 250); @@ -88,6 +93,8 @@ CEventForm::CEventForm(QWidget *parent) : connect(m_influxdbThread, &QThread::finished, m_influxdbOpt, &QObject::deleteLater, Qt::QueuedConnection); connect(this, &CEventForm::delInfluxdbOneEvent, m_influxdbOpt, &CInfluxdbOpt::delInfluxdbOneEvent, Qt::QueuedConnection); m_influxdbThread->start(); + + setAutoLayout(true); } CEventForm::~CEventForm() @@ -108,7 +115,7 @@ void CEventForm::initilize() { //< lingdaoyaoqiu { - QSettings columFlags2("KBD_HIS_EVENT_DEL", "eventHis config"); + QSettings columFlags2("IOT_HIS_EVENT_DEL", "eventHis config"); if(!columFlags2.contains(QString("eventHis/colum_0"))) { columFlags2.setValue(QString("eventHis/colum_0"), false); //< 时间 @@ -145,6 +152,7 @@ void CEventForm::initFilter() m_strText1 = tr("请选择优先级"); m_pLineEdit1->setText(tr("请选择优先级")); m_pLineEdit1->setReadOnly(true); + connect(m_pLineEdit1, SIGNAL(textChanged(const QString &)), this, SLOT(textChanged1(const QString &))); for(QMap::iterator it2 = location.begin();it2 != location.end();++it2) { @@ -336,7 +344,7 @@ void CEventForm::slotUpdateModel() connect(m_pHistoryModel, &CEventHistoryModel::sigHISRecordOutOfRangeTips, this, &CEventForm::slotHISRecordOutOfRangeTips); } ui->eventView->setModel(m_pHistoryModel); - QSettings columFlags2("KBD_HIS_EVENT_DEL", "eventHis config"); + QSettings columFlags2("IOT_HIS_EVENT_DEL", "eventHis config"); for(int nColumnIndex(0); nColumnIndex < m_pHistoryModel->columnCount(); nColumnIndex++) { bool visible = columFlags2.value(QString("eventHis/colum_%1").arg(nColumnIndex)).toBool(); @@ -684,7 +692,7 @@ void CEventForm::contextMenuEvent(QContextMenuEvent *event) action->setChecked(!ui->eventView->isColumnHidden(nColumnIndex)); connect(action, &QAction::triggered, [=](){ ui->eventView->setColumnHidden(nColumnIndex, !action->isChecked()); - QSettings columFlags2("KBD_HIS_EVENT_DEL", "eventHis config"); + QSettings columFlags2("IOT_HIS_EVENT_DEL", "eventHis config"); columFlags2.setValue(QString("eventHis/colum_%1").arg(nColumnIndex), !action->isChecked()); }); } diff --git a/product/src/tools/his_event_del/CEventForm.h b/product/src/tools/his_event_del/CEventForm.h index 886fa712..4a0af09d 100644 --- a/product/src/tools/his_event_del/CEventForm.h +++ b/product/src/tools/his_event_del/CEventForm.h @@ -10,6 +10,8 @@ #include #include "CInfluxdbOpt.h" #include "common/DataType.h" +#include "pub_widget/CustomDialog.h" + namespace Ui { class CEventForm; } @@ -21,7 +23,7 @@ class QAbstractTableModel; typedef QList QModelIndexList; -class CEventForm : public QWidget +class CEventForm : public CustomUiDialog { Q_OBJECT diff --git a/product/src/tools/his_event_del/CEventForm.ui b/product/src/tools/his_event_del/CEventForm.ui index 92e0d7f9..4795ba2a 100644 --- a/product/src/tools/his_event_del/CEventForm.ui +++ b/product/src/tools/his_event_del/CEventForm.ui @@ -15,16 +15,16 @@ - 0 + 10 - 0 + 10 - 0 + 10 - 0 + 10 0 @@ -32,7 +32,7 @@ - QFrame::StyledPanel + QFrame::NoFrame QFrame::Sunken @@ -80,13 +80,13 @@ - 120 + 150 0 - 120 + 180 26 @@ -173,13 +173,13 @@ - 40 + 50 0 - 40 + 50 26 @@ -192,13 +192,13 @@ - 100 + 150 0 - 100 + 150 26 @@ -208,13 +208,13 @@ - 100 + 150 0 - 100 + 200 26 @@ -249,7 +249,7 @@ - 170 + 250 26 diff --git a/product/src/tools/his_event_del/his_event_del.pro b/product/src/tools/his_event_del/his_event_del.pro index 714ed30a..741a7cb8 100644 --- a/product/src/tools/his_event_del/his_event_del.pro +++ b/product/src/tools/his_event_del/his_event_del.pro @@ -42,7 +42,7 @@ FORMS += \ RESOURCES += \ resource.qrc -LIBS += -llog4cplus -lboost_system -lboost_chrono -lpub_utility_api -lrdb_api -ldb_base_api -ldb_api_ex -lperm_mng_api -lpub_sysinfo_api -ltsdb_api -ldb_his_query_api +LIBS += -llog4cplus -lboost_system -lboost_chrono -lpub_utility_api -lrdb_api -ldb_base_api -ldb_api_ex -lperm_mng_api -lpub_sysinfo_api -ltsdb_api -ldb_his_query_api -lpub_widget include($$PWD/../../idl_files/idl_files.pri) diff --git a/product/src/tools/his_event_del/main.cpp b/product/src/tools/his_event_del/main.cpp index 6aee094d..df2f00e3 100644 --- a/product/src/tools/his_event_del/main.cpp +++ b/product/src/tools/his_event_del/main.cpp @@ -5,12 +5,43 @@ #include "CEventForm.h" #include "CDbOpt.h" #include "CCheckUser.h" +#include "pub_utility_api/FileStyle.h" + +void loadStyle() +{ + QString qss = QString(); + std::string strFullPath = iot_public::CFileStyle::getPathOfStyleFile("public.qss","zh","light"); + + QFile qssfile1(QString::fromStdString(strFullPath)); + qssfile1.open(QFile::ReadOnly); + if (qssfile1.isOpen()) + { + qss += QLatin1String(qssfile1.readAll()); + qssfile1.close(); + } + + strFullPath = iot_public::CFileStyle::getPathOfStyleFile("his_event_del.qss","zh","light"); + QFile qssfile2(QString::fromStdString(strFullPath)); + qssfile2.open(QFile::ReadOnly); + if (qssfile2.isOpen()) + { + qss += QLatin1String(qssfile2.readAll()); + qssfile2.close(); + } + + if (!qss.isEmpty()) + { + qApp->setStyleSheet(qss); + } +} int main(int argc, char *argv[]) { iot_common::doQtAppGlobalSet(); QApplication app(argc, argv); + loadStyle(); + CCheckUser objCheckUser; if(objCheckUser.exec()) {