备份
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
#include <global.h>
|
||||
#include <nlohmannJson.hpp>
|
||||
#include <qlayout.h>
|
||||
#include <qtBridge.h>
|
||||
|
||||
class plcValueViewer :public QWidget{
|
||||
public:
|
||||
QPalette palette;
|
||||
@@ -9,7 +11,7 @@ public:
|
||||
QFont font2 = QFont("微软雅黑", 10, QFont::Bold);
|
||||
QFont font3 = QFont("微软雅黑", 6, QFont::Bold);
|
||||
plcValueViewer(const QString& groupNameIN,
|
||||
const std::vector<PlcValueViewerStruct>& viewerNameAndAddress,
|
||||
const std::vector<std::pair<QString, int>>& viewerNameAndAddress,
|
||||
QMap<int, std::vector<QLabel*>>& plcViwerLineedits)
|
||||
:groupName(groupNameIN){
|
||||
|
||||
@@ -20,7 +22,7 @@ public:
|
||||
|
||||
layout->addWidget(groupNameLabel);
|
||||
for (auto& data : viewerNameAndAddress) {
|
||||
plcViwerLineedits[data.valueAddr].push_back(addViewer(data.valueName));
|
||||
plcViwerLineedits[data.second].push_back(addViewer(data.first));
|
||||
}
|
||||
widget->setMaximumHeight(100);
|
||||
}
|
||||
@@ -91,7 +93,7 @@ public slots:
|
||||
}
|
||||
});
|
||||
}
|
||||
void addPlcValueViewer(const QString& groupName,std::vector<PlcValueViewerStruct> viewerNameAndAddress) {
|
||||
void addPlcValueViewer(QString groupName, std::vector<std::pair<QString, int>> viewerNameAndAddress) {
|
||||
auto widget = new plcValueViewer(groupName, viewerNameAndAddress, plcViwerLineedits);
|
||||
plcValueViewerLayout->addWidget(widget->widget,Qt::AlignTop);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user