Diagram editor : add a new widget in the "curent selection dock" for edit the independent text. WIP

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@5737 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
blacksun
2019-02-19 16:42:07 +00:00
parent 2300314bf5
commit 33d757e0d8
12 changed files with 533 additions and 74 deletions

View File

@@ -1068,14 +1068,9 @@ void Diagram::addItem(QGraphicsItem *item)
conductor->terminal1->addConductor(conductor);
conductor->terminal2->addConductor(conductor);
conductor->calculateTextItemPosition();
}
break;
case IndependentTextItem::Type:
{
const IndependentTextItem *text = static_cast<const IndependentTextItem *>(item);
connect(text, &IndependentTextItem::diagramTextChanged, this, &Diagram::diagramTextChanged);
}
default: {break;}
}
}
@@ -1095,21 +1090,16 @@ void Diagram::removeItem(QGraphicsItem *item)
{
Element *elmt = static_cast<Element*>(item);
elmt->unlinkAllElements();
}
break;
}
case Conductor::Type:
{
Conductor *conductor = static_cast<Conductor *>(item);
conductor->terminal1->removeConductor(conductor);
conductor->terminal2->removeConductor(conductor);
}
break;
case IndependentTextItem::Type:
{
const IndependentTextItem *text = static_cast<const IndependentTextItem *>(item);
disconnect(text, &IndependentTextItem::diagramTextChanged, this, &Diagram::diagramTextChanged);
}
default: {break;}
}
QGraphicsScene::removeItem(item);
@@ -1119,17 +1109,6 @@ void Diagram::titleChanged(const QString &title) {
emit(diagramTitleChanged(this, title));
}
/**
Gere le fait qu'un texte du schema ait ete modifie
@param text_item Texte modifie
@param old_text Ancien texte
@param new_text Nouveau texte
*/
void Diagram::diagramTextChanged(DiagramTextItem *text_item, const QString &old_text, const QString &new_text) {
if (!text_item) return;
undoStack().push(new ChangeDiagramTextCommand(text_item, old_text, new_text));
}
/**
This slot may be used to inform the diagram object that the given title
block template has changed. The diagram will thus flush its title