mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 12:40:35 +01:00
Fix wrong behavior when edit the element information
In the diagram editor, when we edit the element information in the side panel, each time we tip something in the text field the cursor always go to the end if the "label" information is empty.
This commit is contained in:
@@ -1347,9 +1347,13 @@ void Element::setElementInformations(DiagramContext dc)
|
||||
return;
|
||||
}
|
||||
|
||||
DiagramContext old_info = m_data.m_informations;
|
||||
const auto old_info = m_data.m_informations;
|
||||
m_data.m_informations = dc;
|
||||
m_data.m_informations.addValue(QStringLiteral("label"), actualLabel()); //Update the label if there is a formula
|
||||
|
||||
const auto actual_label{actualLabel()};
|
||||
if (!actual_label.isEmpty()) {
|
||||
m_data.m_informations.addValue(QStringLiteral("label"), actual_label); //Update the label if there is a formula
|
||||
}
|
||||
emit elementInfoChange(old_info, m_data.m_informations);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user