mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-01-08 06:42:34 +01:00
Fix : in some condition, dynamic text are not at the same position when open a project.
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@5406 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -1314,31 +1314,43 @@ void DynamicElementTextItem::updateXref()
|
||||
|
||||
void DynamicElementTextItem::setPlainText(const QString &text)
|
||||
{
|
||||
if(toPlainText() == text)
|
||||
if (toPlainText() == text)
|
||||
return;
|
||||
|
||||
prepareAlignment();
|
||||
bool update_alignment = true;
|
||||
if (diagram() && (diagram()->project()->state() == QETProject::ProjectParsingRunning))
|
||||
update_alignment = false;
|
||||
if (m_parent_element.data()->state() == QET::GIBuildingFromXml ||
|
||||
m_parent_element.data()->state() == QET::GILoadingFromXml)
|
||||
update_alignment = false;
|
||||
|
||||
if (update_alignment) {
|
||||
prepareAlignment();
|
||||
}
|
||||
|
||||
DiagramTextItem::setPlainText(text);
|
||||
|
||||
//User define a text width
|
||||
if(m_text_width > 0)
|
||||
if (m_text_width > 0)
|
||||
{
|
||||
if(document()->size().width() > m_text_width)
|
||||
if (document()->size().width() > m_text_width)
|
||||
{
|
||||
document()->setTextWidth(m_text_width);
|
||||
if(document()->size().width() > m_text_width)
|
||||
if (document()->size().width() > m_text_width)
|
||||
{
|
||||
document()->setTextWidth(document()->idealWidth());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
finishAlignment();
|
||||
if (update_alignment) {
|
||||
finishAlignment();
|
||||
}
|
||||
|
||||
if(m_Xref_item)
|
||||
if (m_Xref_item) {
|
||||
m_Xref_item->autoPos();
|
||||
else if(m_slave_Xref_item)
|
||||
}
|
||||
else if (m_slave_Xref_item)
|
||||
{
|
||||
QRectF r = boundingRect();
|
||||
QPointF pos(r.center().x() - m_slave_Xref_item->boundingRect().width()/2,
|
||||
|
||||
Reference in New Issue
Block a user