mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-21 00:30:53 +01:00
Factorisation de code : reunion des 3 proprietes (type, singleLineProperties et texte) au sein d'une meme classe ConductorProperties
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@177 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -44,6 +44,19 @@ void DiagramTextItem::focusOutEvent(QFocusEvent *e) {
|
||||
if (Diagram *dia = diagram()) {
|
||||
dia -> undoStack().push(new ChangeDiagramTextCommand(this, previous_text, toPlainText()));
|
||||
previous_text = toPlainText();
|
||||
|
||||
// si l'object parent est un conducteur, previent celui-ci du changement de texte
|
||||
Conductor *c;
|
||||
if (parentItem() && (c = qgraphicsitem_cast<Conductor *>(parentItem()))) {
|
||||
ConductorProperties cp = c -> properties();
|
||||
cp.text = toPlainText();
|
||||
c -> setProperties(cp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// deselectionne le texte
|
||||
QTextCursor cursor = textCursor();
|
||||
cursor.clearSelection();
|
||||
setTextCursor(cursor);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user