|
@@ -27,6 +27,7 @@ void EditNodeWidget::setNode(CNodeData n)
|
|
|
m_node = n;
|
|
|
m_name->setText(n.name);
|
|
|
m_remark->setText(n.remark);
|
|
|
+ m_dimen->setText(n.dimension);
|
|
|
m_confirm->setEnabled(false);
|
|
|
}
|
|
|
|
|
@@ -48,9 +49,11 @@ void EditNodeWidget::initWidgets()
|
|
|
m_name = new LineEdit(this);
|
|
|
m_remarkLabel = new QLabel("内涵:", this);
|
|
|
m_remarkLabel->setContentsMargins(0, 10, 0, 10);
|
|
|
- m_remark = new TextEdit(this);
|
|
|
- m_confirm = new PushButton("保存", this);
|
|
|
- m_cancel = new PushButton("取消", this);
|
|
|
+ m_remark = new TextEdit(this);
|
|
|
+ m_dimen = new LineEdit(this);
|
|
|
+ m_dimenLabel = new QLabel("量纲:", this);
|
|
|
+ m_confirm = new PushButton("保存", this);
|
|
|
+ m_cancel = new PushButton("取消", this);
|
|
|
}
|
|
|
|
|
|
void EditNodeWidget::initLayout()
|
|
@@ -63,12 +66,17 @@ void EditNodeWidget::initLayout()
|
|
|
m_btnLayout = new QHBoxLayout();
|
|
|
m_layout->addLayout(m_btnLayout);
|
|
|
|
|
|
- m_name->setMinimumWidth(280);
|
|
|
- m_remark->setMinimumWidth(280);
|
|
|
+ int minW = 280;
|
|
|
+ m_name->setMinimumWidth(minW);
|
|
|
+ m_remark->setMinimumWidth(minW);
|
|
|
+ m_dimen->setMinimumWidth(minW);
|
|
|
+
|
|
|
m_gridLayout->addWidget(m_nameLabel, 0, 0, 1, 1, Qt::AlignRight);
|
|
|
m_gridLayout->addWidget(m_name, 0, 1, 1, 1, Qt::AlignLeft);
|
|
|
m_gridLayout->addWidget(m_remarkLabel, 1, 0, 1, 1, Qt::AlignRight | Qt::AlignTop);
|
|
|
m_gridLayout->addWidget(m_remark, 1, 1, 1, 1, Qt::AlignLeft);
|
|
|
+ m_gridLayout->addWidget(m_dimenLabel, 2, 0, 1, 1, Qt::AlignRight);
|
|
|
+ m_gridLayout->addWidget(m_dimen, 2, 1, 1, 1, Qt::AlignLeft);
|
|
|
|
|
|
m_btnLayout->addStretch();
|
|
|
m_btnLayout->addWidget(m_confirm);
|
|
@@ -80,6 +88,7 @@ void EditNodeWidget::connectSignalsAndSlots()
|
|
|
{
|
|
|
connect(m_name, &LineEdit::textChanged, this, &EditNodeWidget::slotEditChanged);
|
|
|
connect(m_remark, &TextEdit::textChanged, this, &EditNodeWidget::slotEditChanged);
|
|
|
+ connect(m_dimen, &LineEdit::textChanged, this, &EditNodeWidget::slotEditChanged);
|
|
|
connect(m_confirm, &PushButton::clicked, this, &EditNodeWidget::slotConfirmCLicked);
|
|
|
connect(m_cancel, &PushButton::clicked, this, &EditNodeWidget::slotConcelClicked);
|
|
|
}
|
|
@@ -87,8 +96,9 @@ void EditNodeWidget::connectSignalsAndSlots()
|
|
|
void EditNodeWidget::slotEditChanged()
|
|
|
{
|
|
|
m_confirm->setEnabled(true);
|
|
|
- m_node.name = m_name->text();
|
|
|
- m_node.remark = m_remark->toPlainText();
|
|
|
+ m_node.name = m_name->text();
|
|
|
+ m_node.remark = m_remark->toPlainText();
|
|
|
+ m_node.dimension = m_dimen->text();
|
|
|
}
|
|
|
|
|
|
void EditNodeWidget::slotConfirmCLicked()
|