add HMI item property visiblity setting
This commit is contained in:
parent
f0c7a7a9e6
commit
789ba990d4
|
|
@ -128,8 +128,8 @@ public:
|
||||||
int customImageRefExist(QUuid uid,QByteArray hash256);
|
int customImageRefExist(QUuid uid,QByteArray hash256);
|
||||||
void updateHMIRef(QUuid hmiId,QString model,QByteArray hash256,int slot); //更新img引用
|
void updateHMIRef(QUuid hmiId,QString model,QByteArray hash256,int slot); //更新img引用
|
||||||
void updateHMICustomRef(QUuid hmiId,QString model,QUuid itemId,QByteArray hash256); //更新customImg引用
|
void updateHMICustomRef(QUuid hmiId,QString model,QUuid itemId,QByteArray hash256); //更新customImg引用
|
||||||
|
void updateItemPropertyVisibleLst(); //更新对象的属性可见性列表(属性栏使用)
|
||||||
void updatePannelProperty(); //更新界面的属性信息
|
QMap<QUuid, QMap<QString, bool*>> getProVisibleRef(){return _mapSelectedRefs;}
|
||||||
/************************数据显示*************************/
|
/************************数据显示*************************/
|
||||||
void setCurItemPropertyDlg(ItemPropertyDlg* p) {m_curPropertyDlg = p;}
|
void setCurItemPropertyDlg(ItemPropertyDlg* p) {m_curPropertyDlg = p;}
|
||||||
ItemPropertyDlg* getCurItemPropertyDlg() {return m_curPropertyDlg;}
|
ItemPropertyDlg* getCurItemPropertyDlg() {return m_curPropertyDlg;}
|
||||||
|
|
@ -208,6 +208,7 @@ private:
|
||||||
|
|
||||||
QList<HMIImageRef> _HMIimageRef; //当前HMI中图片的引用关系
|
QList<HMIImageRef> _HMIimageRef; //当前HMI中图片的引用关系
|
||||||
QList<HMICustomImageRef> _HMICustomImageRef; //当前HMI中图片项的引用
|
QList<HMICustomImageRef> _HMICustomImageRef; //当前HMI中图片项的引用
|
||||||
|
QMap<QUuid, QMap<QString, bool*>> _mapSelectedRefs; //item属性可见性(属性栏使用)
|
||||||
public:
|
public:
|
||||||
static bool _dataInitialised;
|
static bool _dataInitialised;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -6,9 +6,14 @@
|
||||||
class GraphicsFunctionModelItem : public GraphicsProjectModelItem //功能模item
|
class GraphicsFunctionModelItem : public GraphicsProjectModelItem //功能模item
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
Q_PROPERTY(QMap<QString,bool> PropertyVisible READ getMap WRITE setMap)
|
||||||
public:
|
public:
|
||||||
GraphicsFunctionModelItem(QGraphicsItem *parent);
|
GraphicsFunctionModelItem(QGraphicsItem *parent);
|
||||||
virtual ~GraphicsFunctionModelItem();
|
virtual ~GraphicsFunctionModelItem();
|
||||||
|
|
||||||
|
QMap<QString,bool> getMap();
|
||||||
|
void setMap(QMap<QString,bool>);
|
||||||
protected:
|
protected:
|
||||||
virtual void paint(QPainter*, const QStyleOptionGraphicsItem*, QWidget*) override;
|
virtual void paint(QPainter*, const QStyleOptionGraphicsItem*, QWidget*) override;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ public:
|
||||||
const QStyleOptionGraphicsItem *option,
|
const QStyleOptionGraphicsItem *option,
|
||||||
QWidget *widget = nullptr) override;
|
QWidget *widget = nullptr) override;
|
||||||
|
|
||||||
virtual QRectF boundingRect() const override;
|
//virtual QRectF boundingRect() const override;
|
||||||
virtual QPainterPath shape() const override;
|
virtual QPainterPath shape() const override;
|
||||||
|
|
||||||
// 几何操作
|
// 几何操作
|
||||||
|
|
@ -39,15 +39,13 @@ protected:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ICanvasItem *m_pluginItem = nullptr;
|
ICanvasItem *m_pluginItem = nullptr;
|
||||||
QRectF m_cachedBounds;
|
//QRectF m_cachedBounds;
|
||||||
|
|
||||||
void updateCache();
|
|
||||||
void connectSignals();
|
void connectSignals();
|
||||||
QVariantMap saveState() const;
|
QVariantMap saveState() const;
|
||||||
bool loadStateIntoPluginItem(ICanvasItem *pluginItem, const QVariantMap &state) const;
|
bool loadStateIntoPluginItem(ICanvasItem *pluginItem, const QVariantMap &state) const;
|
||||||
void copyPropertiesFrom(const PluginSvgItemWrapper *source);
|
void copyPropertiesFrom(const PluginSvgItemWrapper *source);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void onPluginBoundsChanged(const QRectF &newBounds);
|
|
||||||
void onPluginPropertyChanged(const QString &key, const QVariant &value);
|
void onPluginPropertyChanged(const QString &key, const QVariant &value);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,6 @@ public:
|
||||||
|
|
||||||
void initial();
|
void initial();
|
||||||
void updateSelectedItems();
|
void updateSelectedItems();
|
||||||
void updateRecommandLst(QStringList); //更新当前推荐列表
|
|
||||||
public slots:
|
public slots:
|
||||||
void onOkClicked();
|
void onOkClicked();
|
||||||
void onCancelClicked();
|
void onCancelClicked();
|
||||||
|
|
@ -35,10 +34,6 @@ public slots:
|
||||||
void onItemSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected); //选中设备事件
|
void onItemSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected); //选中设备事件
|
||||||
void onPropertyCheckChanged(QStandardItem *item); //属性勾选改变信号
|
void onPropertyCheckChanged(QStandardItem *item); //属性勾选改变信号
|
||||||
void onPropertySelectionChanged(const QModelIndex ¤t, const QModelIndex &previous); //属性选中事件
|
void onPropertySelectionChanged(const QModelIndex ¤t, const QModelIndex &previous); //属性选中事件
|
||||||
|
|
||||||
void onConnectParamChanged(const QString&); //连接参数变化事件(发送推荐查询)
|
|
||||||
protected:
|
|
||||||
bool eventFilter(QObject *obj, QEvent *event) override;
|
|
||||||
private:
|
private:
|
||||||
void savePropertyData(const QModelIndex ¤t,QUuid uid); //保存属性到uid的属性
|
void savePropertyData(const QModelIndex ¤t,QUuid uid); //保存属性到uid的属性
|
||||||
void loadPropertyData(const QModelIndex ¤t,QUuid uid);
|
void loadPropertyData(const QModelIndex ¤t,QUuid uid);
|
||||||
|
|
@ -50,9 +45,6 @@ private:
|
||||||
QStandardItemModel* _curItemModel;
|
QStandardItemModel* _curItemModel;
|
||||||
QUuid _curUuid;
|
QUuid _curUuid;
|
||||||
QStringList _curRecommandLst; //当前推荐列表
|
QStringList _curRecommandLst; //当前推荐列表
|
||||||
QCompleter* _recommandCompleter; //自动填充器
|
|
||||||
QStringListModel* _strLstModel; //自动填充模型
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -89,18 +89,13 @@ void DiagramCavas::passRecommmandHttpData(HttpRecommandInfo info)
|
||||||
{
|
{
|
||||||
auto pMonitor = dynamic_cast<MonitorPanel*>(pPanel);
|
auto pMonitor = dynamic_cast<MonitorPanel*>(pPanel);
|
||||||
if(pMonitor){
|
if(pMonitor){
|
||||||
auto pDlg = pMonitor->getMonitorConfigDlg();
|
QStringList lst;
|
||||||
if(pDlg){
|
for(auto &str:info.lstRecommand){
|
||||||
|
QString sCompleteName = info.sInput+str;
|
||||||
QStringList lst;
|
if(!lst.contains(sCompleteName))
|
||||||
for(auto &str:info.lstRecommand){
|
lst.append(sCompleteName);
|
||||||
QString sCompleteName = info.sInput+str;
|
|
||||||
if(!lst.contains(sCompleteName))
|
|
||||||
lst.append(sCompleteName);
|
|
||||||
}
|
|
||||||
pDlg->updateRecommandLst(lst);
|
|
||||||
}
|
}
|
||||||
//FixedPortsModel* pModel = pMonitor->getModelController();
|
//todo:推荐列表的使用
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -52,6 +52,7 @@
|
||||||
#include "bayMeasureDlg.h"
|
#include "bayMeasureDlg.h"
|
||||||
#include "basePannelPropertyProxy.h"
|
#include "basePannelPropertyProxy.h"
|
||||||
#include "common/core_model/types.h"
|
#include "common/core_model/types.h"
|
||||||
|
#include "graphicsItem/pluginSvgItemWrapper.h"
|
||||||
|
|
||||||
bool FixedPortsModel::_dataInitialised = false;
|
bool FixedPortsModel::_dataInitialised = false;
|
||||||
|
|
||||||
|
|
@ -748,6 +749,14 @@ QString FixedPortsModel::addNodeItem(QUuid id,QPointF pos,double width,double he
|
||||||
auto pluginItem = PluginItemFactory::instance()->createItem(shapeInfo.shapeName);
|
auto pluginItem = PluginItemFactory::instance()->createItem(shapeInfo.shapeName);
|
||||||
if(pluginItem){
|
if(pluginItem){
|
||||||
item = pluginItem;
|
item = pluginItem;
|
||||||
|
if(width != 0 && height != 0){
|
||||||
|
pluginItem->setBoundingRect(QRect(-width*0.5, -height*0.5, width, height));
|
||||||
|
}
|
||||||
|
PropertyModel model = ProjectModelManager::instance().getData()[sMeta][sProModel];
|
||||||
|
QByteArray svg = DataBase::GetInstance()->ModelType()[type].icon;
|
||||||
|
PluginSvgItemWrapper* pSvg = dynamic_cast<PluginSvgItemWrapper*>(pluginItem);
|
||||||
|
if(pSvg)
|
||||||
|
pSvg->loadSvg(svg);
|
||||||
QJsonArray portArr = pro->context()["port"].toArray();
|
QJsonArray portArr = pro->context()["port"].toArray();
|
||||||
addPortsToItem_json(P_const,portArr,item);
|
addPortsToItem_json(P_const,portArr,item);
|
||||||
}
|
}
|
||||||
|
|
@ -2598,7 +2607,22 @@ void FixedPortsModel::updateHMICustomRef(QUuid hmiId,QString model,QUuid itemId,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void FixedPortsModel::updatePannelProperty()
|
void FixedPortsModel::updateItemPropertyVisibleLst()
|
||||||
{
|
{
|
||||||
_cavas->onTargetSelected(_widget->getPropertyProxy());
|
auto it = m_monitorPara.begin();
|
||||||
|
while (it != m_monitorPara.end())
|
||||||
|
{
|
||||||
|
const QUuid& uid = it.key();
|
||||||
|
const QList<MonitorItemAttributeInfo>& infoList = it.value();
|
||||||
|
|
||||||
|
QMap<QString, bool*> innerMap;
|
||||||
|
|
||||||
|
for (const MonitorItemAttributeInfo& info : infoList)
|
||||||
|
{
|
||||||
|
innerMap.insert(info.sName, &const_cast<MonitorItemAttributeInfo&>(info).bSelected);
|
||||||
|
}
|
||||||
|
|
||||||
|
_mapSelectedRefs.insert(uid, innerMap);
|
||||||
|
++it;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
#include "graphicsItem/functionModelItem/graphicsFunctionModelItem.h"
|
#include "graphicsItem/functionModelItem/graphicsFunctionModelItem.h"
|
||||||
|
#include "baseProperty.h"
|
||||||
|
#include "graphicsDataModel/fixedPortsModel.h"
|
||||||
|
|
||||||
GraphicsFunctionModelItem::GraphicsFunctionModelItem(QGraphicsItem *parent)
|
GraphicsFunctionModelItem::GraphicsFunctionModelItem(QGraphicsItem *parent)
|
||||||
: GraphicsProjectModelItem(parent)
|
: GraphicsProjectModelItem(parent)
|
||||||
|
|
@ -10,6 +12,35 @@ GraphicsFunctionModelItem::~GraphicsFunctionModelItem()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QMap<QString,bool> GraphicsFunctionModelItem::getMap()
|
||||||
|
{
|
||||||
|
QMap<QString,bool> mapBool;
|
||||||
|
QUuid id = getProperty()->uuid();
|
||||||
|
auto mapPtr = _pHandle->getProVisibleRef().value(id);
|
||||||
|
for (const QString& key : mapPtr.keys()) {
|
||||||
|
bool* valuePtr = mapPtr.value(key);
|
||||||
|
if (valuePtr) {
|
||||||
|
mapBool[key] = *valuePtr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return mapBool;
|
||||||
|
}
|
||||||
|
|
||||||
|
void GraphicsFunctionModelItem::setMap(QMap<QString,bool> boolMap)
|
||||||
|
{
|
||||||
|
QUuid id = getProperty()->uuid();
|
||||||
|
auto boolPtrMap = _pHandle->getProVisibleRef().value(id);
|
||||||
|
|
||||||
|
for (auto it = boolMap.begin(); it != boolMap.end(); ++it) {
|
||||||
|
if (boolPtrMap.contains(it.key())) {
|
||||||
|
bool* ptr = boolPtrMap.value(it.key());
|
||||||
|
if (ptr) { // 安全检查
|
||||||
|
*ptr = it.value(); // 修改指针指向的值
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void GraphicsFunctionModelItem::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget)
|
void GraphicsFunctionModelItem::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget)
|
||||||
{
|
{
|
||||||
Q_UNUSED(option)
|
Q_UNUSED(option)
|
||||||
|
|
|
||||||
|
|
@ -25,9 +25,6 @@ PluginSvgItemWrapper::PluginSvgItemWrapper(ICanvasItem *pluginItem, QGraphicsIte
|
||||||
// 连接信号
|
// 连接信号
|
||||||
connectSignals();
|
connectSignals();
|
||||||
|
|
||||||
// 初始化缓存
|
|
||||||
updateCache();
|
|
||||||
|
|
||||||
// 更新坐标
|
// 更新坐标
|
||||||
updateCoordinate();
|
updateCoordinate();
|
||||||
|
|
||||||
|
|
@ -137,18 +134,18 @@ void PluginSvgItemWrapper::paint(QPainter *painter,
|
||||||
|
|
||||||
painter->save();
|
painter->save();
|
||||||
// 让插件绘制
|
// 让插件绘制
|
||||||
m_pluginItem->draw(painter, m_cachedBounds);
|
m_pluginItem->draw(painter, m_boundingRect);
|
||||||
|
|
||||||
ElectricFunctionModelSvgItem::paint(painter,option,widget); //调用默认绘制
|
ElectricFunctionModelSvgItem::paint(painter,option,widget); //调用默认绘制
|
||||||
|
|
||||||
painter->restore();
|
painter->restore();
|
||||||
}
|
}
|
||||||
|
|
||||||
QRectF PluginSvgItemWrapper::boundingRect() const
|
/* PluginSvgItemWrapper::boundingRect() const
|
||||||
{
|
{
|
||||||
qreal margin = 4.0; // 为控制点留出空间
|
qreal margin = 4.0; // 为控制点留出空间
|
||||||
return m_cachedBounds.adjusted(-margin, -margin, margin, margin);
|
return m_cachedBounds.adjusted(-margin, -margin, margin, margin);
|
||||||
}
|
}*/
|
||||||
|
|
||||||
QPainterPath PluginSvgItemWrapper::shape() const
|
QPainterPath PluginSvgItemWrapper::shape() const
|
||||||
{
|
{
|
||||||
|
|
@ -160,7 +157,7 @@ QPainterPath PluginSvgItemWrapper::shape() const
|
||||||
|
|
||||||
// 创建简单的矩形路径
|
// 创建简单的矩形路径
|
||||||
// 插件可以提供更精确的形状,这里简化处理
|
// 插件可以提供更精确的形状,这里简化处理
|
||||||
path.addRect(m_cachedBounds);
|
path.addRect(m_boundingRect);
|
||||||
|
|
||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
@ -311,13 +308,6 @@ QVariant PluginSvgItemWrapper::itemChange(GraphicsItemChange change, const QVari
|
||||||
return GraphicsFunctionModelItem::itemChange(change, value);
|
return GraphicsFunctionModelItem::itemChange(change, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PluginSvgItemWrapper::updateCache()
|
|
||||||
{
|
|
||||||
if (m_pluginItem) {
|
|
||||||
m_cachedBounds = m_pluginItem->bounds();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void PluginSvgItemWrapper::connectSignals()
|
void PluginSvgItemWrapper::connectSignals()
|
||||||
{
|
{
|
||||||
if (!m_pluginItem) {
|
if (!m_pluginItem) {
|
||||||
|
|
@ -425,17 +415,6 @@ void PluginSvgItemWrapper::copyPropertiesFrom(const PluginSvgItemWrapper *source
|
||||||
setItemId(QUuid::createUuid());
|
setItemId(QUuid::createUuid());
|
||||||
}
|
}
|
||||||
|
|
||||||
void PluginSvgItemWrapper::onPluginBoundsChanged(const QRectF &newBounds)
|
|
||||||
{
|
|
||||||
m_cachedBounds = newBounds;
|
|
||||||
|
|
||||||
// 更新坐标
|
|
||||||
updateCoordinate();
|
|
||||||
|
|
||||||
// 通知变化
|
|
||||||
emit itemChanged();
|
|
||||||
}
|
|
||||||
|
|
||||||
void PluginSvgItemWrapper::onPluginPropertyChanged(const QString &key, const QVariant &value)
|
void PluginSvgItemWrapper::onPluginPropertyChanged(const QString &key, const QVariant &value)
|
||||||
{
|
{
|
||||||
Q_UNUSED(key);
|
Q_UNUSED(key);
|
||||||
|
|
|
||||||
|
|
@ -12,8 +12,6 @@ MonitorConfigDlg::MonitorConfigDlg(QWidget *parent)
|
||||||
, ui(new Ui::monitorConfigDlg)
|
, ui(new Ui::monitorConfigDlg)
|
||||||
,_parent(nullptr)
|
,_parent(nullptr)
|
||||||
,_curItemModel(nullptr)
|
,_curItemModel(nullptr)
|
||||||
,_recommandCompleter(nullptr)
|
|
||||||
,_strLstModel(nullptr)
|
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
this->setWindowFlags(Qt::FramelessWindowHint | windowFlags());
|
this->setWindowFlags(Qt::FramelessWindowHint | windowFlags());
|
||||||
|
|
@ -42,21 +40,6 @@ void MonitorConfigDlg::initial()
|
||||||
connect(_curItemModel,&QStandardItemModel::itemChanged, this,&MonitorConfigDlg::onPropertyCheckChanged);
|
connect(_curItemModel,&QStandardItemModel::itemChanged, this,&MonitorConfigDlg::onPropertyCheckChanged);
|
||||||
connect(ui->treeView_para->selectionModel(), &QItemSelectionModel::currentChanged,
|
connect(ui->treeView_para->selectionModel(), &QItemSelectionModel::currentChanged,
|
||||||
this, &MonitorConfigDlg::onPropertySelectionChanged);
|
this, &MonitorConfigDlg::onPropertySelectionChanged);
|
||||||
_recommandCompleter = new QCompleter(this);
|
|
||||||
_recommandCompleter->setCaseSensitivity(Qt::CaseInsensitive);
|
|
||||||
_recommandCompleter->setFilterMode(Qt::MatchContains);
|
|
||||||
_recommandCompleter->setCompletionMode(QCompleter::PopupCompletion);
|
|
||||||
_strLstModel = new QStringListModel(this);
|
|
||||||
|
|
||||||
_recommandCompleter->setModel(_strLstModel);
|
|
||||||
ui->le_query->setCompleter(_recommandCompleter);
|
|
||||||
ui->le_query->installEventFilter(this);
|
|
||||||
ui->le_query->setPlaceholderText("输入空格获取初始值");
|
|
||||||
connect(ui->le_query, &QLineEdit::textChanged, this, [=](const QString &text) {
|
|
||||||
if (text.endsWith(".")) {
|
|
||||||
onConnectParamChanged(text);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MonitorConfigDlg::updateSelectedItems()
|
void MonitorConfigDlg::updateSelectedItems()
|
||||||
|
|
@ -65,22 +48,6 @@ void MonitorConfigDlg::updateSelectedItems()
|
||||||
_tempConfig = _parent->getModelController()->getMonitorPara();
|
_tempConfig = _parent->getModelController()->getMonitorPara();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MonitorConfigDlg::updateRecommandLst(QStringList lst)
|
|
||||||
{
|
|
||||||
for(auto& newName:lst){
|
|
||||||
if(!newName.isEmpty()){
|
|
||||||
if(!_curRecommandLst.contains(newName)){
|
|
||||||
_curRecommandLst.append(newName);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
_strLstModel->setStringList(_curRecommandLst);
|
|
||||||
if (_recommandCompleter->popup()->isVisible()) {
|
|
||||||
_recommandCompleter->popup()->hide();
|
|
||||||
}
|
|
||||||
_recommandCompleter->complete(); // 重新显示补全列表
|
|
||||||
}
|
|
||||||
|
|
||||||
void MonitorConfigDlg::onOkClicked()
|
void MonitorConfigDlg::onOkClicked()
|
||||||
{
|
{
|
||||||
if (ui->treeView_para->currentIndex().isValid()) { //确定前先保存当前属性
|
if (ui->treeView_para->currentIndex().isValid()) { //确定前先保存当前属性
|
||||||
|
|
@ -183,33 +150,6 @@ void MonitorConfigDlg::onPropertySelectionChanged(const QModelIndex ¤t, co
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MonitorConfigDlg::onConnectParamChanged(const QString& str)
|
|
||||||
{
|
|
||||||
QVariantMap map;
|
|
||||||
map.insert("input",str);
|
|
||||||
UiCommunicationBus::instance()->sendHttpRequest("/measurement/recommend",QVariant(),"GET",map);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool MonitorConfigDlg::eventFilter(QObject *obj, QEvent *event)
|
|
||||||
{
|
|
||||||
if (obj == ui->le_query && event->type() == QEvent::KeyPress) {
|
|
||||||
QKeyEvent *keyEvent = static_cast<QKeyEvent*>(event);
|
|
||||||
|
|
||||||
if (keyEvent->key() == Qt::Key_Space) {
|
|
||||||
qDebug() << "eventFilter:space";
|
|
||||||
onConnectParamChanged(ui->le_query->text());
|
|
||||||
_recommandCompleter->complete();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (keyEvent->text() == ".") {
|
|
||||||
qDebug() << "eventFilter:dot";
|
|
||||||
// 返回false让事件继续传播
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return QDialog::eventFilter(obj, event);
|
|
||||||
}
|
|
||||||
|
|
||||||
void MonitorConfigDlg::savePropertyData(const QModelIndex &previous,QUuid uid)
|
void MonitorConfigDlg::savePropertyData(const QModelIndex &previous,QUuid uid)
|
||||||
{
|
{
|
||||||
if(_tempConfig.contains(uid)){
|
if(_tempConfig.contains(uid)){
|
||||||
|
|
@ -218,7 +158,6 @@ void MonitorConfigDlg::savePropertyData(const QModelIndex &previous,QUuid uid)
|
||||||
for(auto &info:_tempConfig[uid]){
|
for(auto &info:_tempConfig[uid]){
|
||||||
if(info.sName == itemText){
|
if(info.sName == itemText){
|
||||||
info.sTag = ui->le_name->text();
|
info.sTag = ui->le_name->text();
|
||||||
info.sConnectPara = ui->le_query->text();
|
|
||||||
info.nShowType = ui->cb_type->currentIndex();
|
info.nShowType = ui->cb_type->currentIndex();
|
||||||
info.bShowDiagram = ui->cb_outVisible->currentIndex();
|
info.bShowDiagram = ui->cb_outVisible->currentIndex();
|
||||||
info.nGraphType = ui->cb_graphType->currentIndex();
|
info.nGraphType = ui->cb_graphType->currentIndex();
|
||||||
|
|
@ -241,7 +180,6 @@ void MonitorConfigDlg::loadPropertyData(const QModelIndex ¤t,QUuid uid)
|
||||||
for(auto &info:lst){
|
for(auto &info:lst){
|
||||||
if(info.sName == itemText){
|
if(info.sName == itemText){
|
||||||
ui->le_name->setText(info.sTag);
|
ui->le_name->setText(info.sTag);
|
||||||
ui->le_query->setText(info.sConnectPara);
|
|
||||||
ui->cb_type->setCurrentIndex(info.nShowType);
|
ui->cb_type->setCurrentIndex(info.nShowType);
|
||||||
if(info.nShowType == 0){ //字符
|
if(info.nShowType == 0){ //字符
|
||||||
ui->cb_outVisible->setCurrentIndex(info.bShowDiagram);
|
ui->cb_outVisible->setCurrentIndex(info.bShowDiagram);
|
||||||
|
|
@ -257,7 +195,6 @@ void MonitorConfigDlg::loadPropertyData(const QModelIndex ¤t,QUuid uid)
|
||||||
void MonitorConfigDlg::clearProperty()
|
void MonitorConfigDlg::clearProperty()
|
||||||
{
|
{
|
||||||
ui->le_name->clear();
|
ui->le_name->clear();
|
||||||
ui->le_query->clear();
|
|
||||||
ui->cb_type->setCurrentIndex(0);
|
ui->cb_type->setCurrentIndex(0);
|
||||||
ui->cb_outVisible->setCurrentIndex(0);
|
ui->cb_outVisible->setCurrentIndex(0);
|
||||||
ui->cb_graphType->setCurrentIndex(0);
|
ui->cb_graphType->setCurrentIndex(0);
|
||||||
|
|
|
||||||
|
|
@ -372,6 +372,8 @@ void MonitorPanel::loadNodes(QJsonObject obj)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_pModel->updateItemPropertyVisibleLst(); //更新item属性visible引用列表
|
||||||
|
|
||||||
QJsonArray displayArr = obj["displaySetting"].toArray();
|
QJsonArray displayArr = obj["displaySetting"].toArray();
|
||||||
QMap<MonitorItemTypeStruct, QMap<MonitorItemStateStruct, MonitorItemDisplayInfo>> mapDisplay;
|
QMap<MonitorItemTypeStruct, QMap<MonitorItemStateStruct, MonitorItemDisplayInfo>> mapDisplay;
|
||||||
deserializeDisplayFromJsonArray(displayArr,mapDisplay);
|
deserializeDisplayFromJsonArray(displayArr,mapDisplay);
|
||||||
|
|
|
||||||
|
|
@ -193,6 +193,9 @@ QTabBar::tab:selected {
|
||||||
<string>配置详情</string>
|
<string>配置详情</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout_3">
|
<layout class="QGridLayout" name="gridLayout_3">
|
||||||
|
<item row="0" column="1" colspan="2">
|
||||||
|
<widget class="QLineEdit" name="le_name"/>
|
||||||
|
</item>
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QLabel" name="label_2">
|
<widget class="QLabel" name="label_2">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
|
@ -200,66 +203,7 @@ QTabBar::tab:selected {
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="1" colspan="2">
|
<item row="2" column="0" colspan="3">
|
||||||
<widget class="QLineEdit" name="le_name"/>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="0">
|
|
||||||
<widget class="QLabel" name="label_3">
|
|
||||||
<property name="text">
|
|
||||||
<string>查询参数:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="1" colspan="2">
|
|
||||||
<widget class="QLineEdit" name="le_query">
|
|
||||||
<property name="font">
|
|
||||||
<font>
|
|
||||||
<pointsize>9</pointsize>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="0">
|
|
||||||
<widget class="QLabel" name="label_4">
|
|
||||||
<property name="text">
|
|
||||||
<string>展示类型:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="1">
|
|
||||||
<widget class="QComboBox" name="cb_type">
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>60</width>
|
|
||||||
<height>0</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>字符</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>图表</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="2">
|
|
||||||
<spacer name="horizontalSpacer_5">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Orientation::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>526</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item row="3" column="0" colspan="3">
|
|
||||||
<widget class="QStackedWidget" name="stackedWidget">
|
<widget class="QStackedWidget" name="stackedWidget">
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
|
|
@ -411,6 +355,46 @@ QTabBar::tab:selected {
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QLabel" name="label_4">
|
||||||
|
<property name="text">
|
||||||
|
<string>展示类型:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="2">
|
||||||
|
<spacer name="horizontalSpacer_5">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Orientation::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>526</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="1">
|
||||||
|
<widget class="QComboBox" name="cb_type">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>60</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>字符</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>图表</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue