1 完善导联方案的方案加载机制,支持新增方案的加载
2 完善导联方案的删除,在删除时支持方案删除·
This commit is contained in:
parent
615e83ce3c
commit
a72e1e657d
Binary file not shown.
@ -6,6 +6,9 @@
|
|||||||
#include "operatorjson.h"
|
#include "operatorjson.h"
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QScrollArea>
|
#include <QScrollArea>
|
||||||
|
#include <QDir>
|
||||||
|
#include <QFileInfoList>
|
||||||
|
#include <QFileInfo>
|
||||||
#include "logger.h"
|
#include "logger.h"
|
||||||
LeadScheme::LeadScheme(QWidget * parent ):QWidget (parent)
|
LeadScheme::LeadScheme(QWidget * parent ):QWidget (parent)
|
||||||
{
|
{
|
||||||
@ -26,7 +29,7 @@ void LeadScheme::init()
|
|||||||
m_btnNew.setText("新建");
|
m_btnNew.setText("新建");
|
||||||
m_btndelete.setText("删除");
|
m_btndelete.setText("删除");
|
||||||
m_btnCancel.setText("取消");
|
m_btnCancel.setText("取消");
|
||||||
m_btnOK.setText("确认");
|
m_btnOK.setText("修改");
|
||||||
m_btnNew.setStyleSheet("QPushButton{\
|
m_btnNew.setStyleSheet("QPushButton{\
|
||||||
background: white;\
|
background: white;\
|
||||||
border-radius:10px;padding:7px 10px;\
|
border-radius:10px;padding:7px 10px;\
|
||||||
@ -246,7 +249,22 @@ void LeadScheme::initLay()
|
|||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
QStringList Sches;
|
QStringList Sches;
|
||||||
Sches<<"8通道"<<"16通道"<<"64通道"<<"sss"<<"kk";
|
Sches<<"8通道"<<"16通道"<<"64通道";
|
||||||
|
//遍历加载当前已经存在的方案
|
||||||
|
QDir dir(QApplication::applicationDirPath()+"/Scheme/");
|
||||||
|
QStringList fileList;
|
||||||
|
QFileInfoList fileInfoList = dir.entryInfoList(QDir::Files | QDir::NoDotAndDotDot | QDir::Dirs);
|
||||||
|
foreach (auto fileInfo, fileInfoList)
|
||||||
|
{
|
||||||
|
if(fileInfo.isFile())
|
||||||
|
{
|
||||||
|
|
||||||
|
if(!Sches.contains(fileInfo.baseName()) && fileInfo.baseName().compare("0")!=0)
|
||||||
|
{
|
||||||
|
Sches.append(fileInfo.baseName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
gridlayOut->addWidget(labScheme,0,colmn++,Qt::AlignHCenter);
|
gridlayOut->addWidget(labScheme,0,colmn++,Qt::AlignHCenter);
|
||||||
QScrollArea * scroll = new QScrollArea;
|
QScrollArea * scroll = new QScrollArea;
|
||||||
scroll->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding));
|
scroll->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding));
|
||||||
@ -597,4 +615,7 @@ void LeadScheme::slotSave()
|
|||||||
m_listBtnsSchemes.append(btn);
|
m_listBtnsSchemes.append(btn);
|
||||||
}
|
}
|
||||||
m_vlayHH->addStretch();
|
m_vlayHH->addStretch();
|
||||||
|
//4 删除对应的位置文件
|
||||||
|
|
||||||
|
QFile::remove( QApplication::applicationDirPath()+"/Scheme/"+sDeleName+".json");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user