mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-03-04 04:29:58 +01:00
User can edit the label of terminal inside the terminal strip editor
This commit is contained in:
@@ -1327,6 +1327,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:
|
||||
|
||||
@@ -42,7 +42,6 @@ class ElementTextItemGroup;
|
||||
class Element : public QetGraphicsItem
|
||||
{
|
||||
friend class DiagramEventAddElement;
|
||||
friend class ChangeElementDataCommand;
|
||||
|
||||
Q_OBJECT
|
||||
public:
|
||||
@@ -106,6 +105,7 @@ class Element : public QetGraphicsItem
|
||||
virtual void setElementInformations(DiagramContext dc);
|
||||
|
||||
ElementData elementData() const;
|
||||
void setElementData (ElementData data);
|
||||
|
||||
/**
|
||||
* @brief kindInformations
|
||||
|
||||
Reference in New Issue
Block a user