代码拉取完成,页面将自动刷新
同步操作将从 Acreate/gamePlanTool 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#include <QPushButton>
#include "AlgorithmItem.h"
#include "XmlDataUnit.h"
#include "XmlDataDoc.h"
#include <qstyle.h>
#include <qapplication.h>
#include <QCheckBox>
#include <qicon.h>
#include <QLabel>
#include <qdebug.h>
#include "AlgorithmTopItemWidget.h"
widgetUI::AlgorithmItem::~AlgorithmItem( ) {
delete xmlDataUnit;
}
widgetUI::AlgorithmItem::AlgorithmItem(const QString& itemName
, const QString& path
, QWidget* parent
, const Qt::WindowFlags& f): AAlgorithmItem(parent, f) {
layout = new QVBoxLayout;
setLayout(layout);
layout->setContentsMargins(0, 0, 0, 0);
layout->addSpacing(0);
filePath = path;
QLabel* label = new QLabel(filePath + "\n--------------------------------------------", this);
layout->addWidget(label);
layout->addSpacerItem(new QSpacerItem(20, 40, QSizePolicy::Expanding, QSizePolicy::Expanding));
xmlDataUnit = new dXml::XmlDataUnit;
this->itemName = itemName;
}
void widgetUI::AlgorithmItem::setExpression(const QString& express) { }
const QString widgetUI::AlgorithmItem::getItemName( ) {
return itemName;
}
const dXml::XmlDataDoc widgetUI::AlgorithmItem::getXmlData( ) const {
dXml::XmlDataDoc doc;
auto&& iterator = itemMap.begin( );
auto&& end = itemMap.end( );
for( ;iterator != end;++iterator ) {
// 遍历对象存储
AlgorithmTopItemWidgetItem* const item = iterator.value( );
QString nodeName = item->checkBox->text( );
QString text = item->expressLabel->text( );
dXml::XmlDataUnit* unit = new dXml::XmlDataUnit;
unit->setName(nodeName);
unit->setText(text);
doc.appendChildren(unit);
}
return doc;
return doc;
}
const QIcon widgetUI::AlgorithmItem::getIcon( ) {
static QIcon icon = QApplication::style( )->standardIcon(( QStyle::StandardPixmap )30);
return icon;
}
QVBoxLayout* widgetUI::AlgorithmItem::mainLayout( ) {
return layout;
}
QWidget* widgetUI::AlgorithmItem::mainWidget( ) {
return widget;
}
void widgetUI::AlgorithmItem::appItem(const QString& name
, const QString& expree) {
// 校验是否存在同样的公式
if( name.isEmpty( ) || expree.isEmpty( ) || itemMap.contains(name) )
return;
AlgorithmTopItemWidgetItem* item = new AlgorithmTopItemWidgetItem(name, expree, this);
connect(item, &AlgorithmTopItemWidgetItem::sigCheckChicked, this, &widgetUI::AlgorithmItem::stateChanged);
connect(item, &AlgorithmTopItemWidgetItem::sigPushChicked, this, &widgetUI::AlgorithmItem::stateBtnChanged);
dXml::XmlDataUnit* children = new dXml::XmlDataUnit;
children->setName(name);
children->setText(expree);
layout->insertWidget(0, item);
itemMap.insert(name, item);
}
void widgetUI::AlgorithmItem::stateChanged(AlgorithmTopItemWidgetItem* item
, bool status) {}
void widgetUI::AlgorithmItem::stateBtnChanged(AlgorithmTopItemWidgetItem* item
, int status) {
layout->removeWidget(item);
itemMap.remove(item->checkBox->text( ));
delete item;
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。