Merge branch 'terminal_strip' into merge_confli_master_terminal_strip

* terminal_strip:
  User can edit the label of terminal inside the terminal strip editor
  Code refactoring
  Double click on Xref cell show the terminal in the diagram
  terminal function can be edited, edted value is applied to element
  Table widget : led and type is editable
  Minor gui change
  Remove position section of terminalStripModel
This commit is contained in:
joshua
2021-09-10 23:31:26 +02:00
13 changed files with 871 additions and 222 deletions

View File

@@ -1314,6 +1314,26 @@ ElementData Element::elementData() const
return m_data;
}
/**
* @brief Element::setElementData
* Set new data for this element.
* If m_information of \p data is changed, emit elementInfoChange
* @param data
*/
void Element::setElementData(ElementData data)
{
auto old_info = m_data.m_informations;
m_data = data;
if (old_info != m_data.m_informations) {
m_data.m_informations.addValue(QStringLiteral("label"), actualLabel()); //Update the label if there is a formula
if (diagram()) {
diagram()->project()->dataBase()->elementInfoChanged(this);
}
emit elementInfoChange(old_info, m_data.m_informations);
}
}
/**
@brief comparPos
Compare position of the two elements. Compare 3 points: