[ref]同步711
This commit is contained in:
parent
56b9649be6
commit
7b50cd334d
@ -13,32 +13,15 @@
|
||||
#include <QJsonArray>
|
||||
|
||||
CDevGroupLockWidget::CDevGroupLockWidget(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
CustomUiDialog(parent),
|
||||
ui(new Ui::CDevGroupLockWidget),
|
||||
m_infoForm(Q_NULLPTR),
|
||||
m_pmodel(Q_NULLPTR)
|
||||
{
|
||||
setWindowTitle(tr("设备组内闭锁配置"));
|
||||
|
||||
ui->setupUi(this);
|
||||
qRegisterMetaType<LockInfoPtr>("LockInfoPtr");
|
||||
QString qss = QString();
|
||||
std::string strFullPath = iot_public::CFileStyle::getPathOfStyleFile("public.qss") ;
|
||||
QFile qssfile1(QString::fromStdString(strFullPath));
|
||||
qssfile1.open(QFile::ReadOnly);
|
||||
if (qssfile1.isOpen())
|
||||
{
|
||||
qss += QLatin1String(qssfile1.readAll());
|
||||
//setStyleSheet(qss);
|
||||
qssfile1.close();
|
||||
}
|
||||
else
|
||||
{
|
||||
qDebug() << "public.qss 无法打开!";
|
||||
}
|
||||
|
||||
if(!qss.isEmpty())
|
||||
{
|
||||
setStyleSheet(qss);
|
||||
}
|
||||
|
||||
ui->splitter->setSizes(QList<int>()<<300<<300);
|
||||
initView();
|
||||
@ -46,6 +29,7 @@ CDevGroupLockWidget::CDevGroupLockWidget(QWidget *parent) :
|
||||
m_pmodel->updateData(loadJson());
|
||||
initConnect();
|
||||
|
||||
CustomUiDialog::setAutoLayout(true);
|
||||
}
|
||||
|
||||
CDevGroupLockWidget::~CDevGroupLockWidget()
|
||||
|
||||
@ -5,12 +5,13 @@
|
||||
#include "CDevGroupLockInfoForm.h"
|
||||
#include "CLockTableModel.h"
|
||||
#include "CLockInfo.h"
|
||||
#include "pub_widget/CustomDialog.h"
|
||||
|
||||
namespace Ui {
|
||||
class CDevGroupLockWidget;
|
||||
}
|
||||
|
||||
class CDevGroupLockWidget : public QWidget
|
||||
class CDevGroupLockWidget : public CustomUiDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
||||
@ -15,16 +15,16 @@
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
<number>5</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QFrame" name="frame">
|
||||
|
||||
@ -10,6 +10,7 @@ greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
|
||||
|
||||
TARGET = DevGroupLock
|
||||
TEMPLATE = app
|
||||
#CONFIG += console
|
||||
|
||||
|
||||
|
||||
@ -49,7 +50,7 @@ FORMS += \
|
||||
CDevGroupLockWidget.ui \
|
||||
CDevGroupLockInfoForm.ui
|
||||
|
||||
LIBS += -llog4cplus -lpub_logger_api -lpub_utility_api -lScriptForm
|
||||
LIBS += -llog4cplus -lpub_logger_api -lpub_utility_api -lScriptForm -lpub_widget
|
||||
|
||||
|
||||
COMMON_PRI =$$PWD/../../common.pri
|
||||
|
||||
@ -1,13 +1,41 @@
|
||||
|
||||
|
||||
#include <QApplication>
|
||||
#include "common/QtAppGlobalSet.h"
|
||||
#include "CDevGroupLockWidget.h"
|
||||
#include "pub_utility_api/FileStyle.h"
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
iot_common::doQtAppGlobalSet();
|
||||
|
||||
QApplication a(argc, argv);
|
||||
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("DevGroupLock.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);
|
||||
}
|
||||
|
||||
// qApp->setFont(QFont("Microsoft YaHei",10));
|
||||
|
||||
CDevGroupLockWidget w;
|
||||
w.show();
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user