mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-19 14:50:53 +01:00
Don't clear the texts of pasted elements.
For report element, clear the function and tension-protocol texts git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4598 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -180,9 +180,19 @@ void PasteDiagramCommand::redo()
|
||||
|
||||
//Reset the text of report element
|
||||
if (e -> linkType() & Element::AllReport) {
|
||||
if (e->texts().size())
|
||||
|
||||
//Befor commit 3559 there isn't text field tagged label,
|
||||
//so if not found we take the first text field
|
||||
if (ElementTextItem *eti = e->taggedText("label"))
|
||||
eti->setPlainText("/");
|
||||
else if (e->texts().size())
|
||||
e->texts().first()->setPlainText("/");
|
||||
} else {
|
||||
|
||||
if (ElementTextItem *eti = e->taggedText("function"))
|
||||
eti->setPlainText("_");
|
||||
if (ElementTextItem *eti = e->taggedText("tension-protocol"))
|
||||
eti->setPlainText("_");
|
||||
} /*else {
|
||||
//Reset the information about the label, the comment and location
|
||||
e -> rElementInformations().addValue("label", "");
|
||||
e -> rElementInformations().addValue("comment", "");
|
||||
@@ -191,7 +201,7 @@ void PasteDiagramCommand::redo()
|
||||
//Reset the text field tagged "label
|
||||
if (ElementTextItem *eti = e ->taggedText("label"))
|
||||
eti -> setPlainText("_");
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
//Reset the text of conductors
|
||||
@@ -201,12 +211,13 @@ void PasteDiagramCommand::redo()
|
||||
c -> setProperties(cp);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
foreach (QGraphicsItem *item, content.items(filter))
|
||||
diagram->addItem(item);
|
||||
}
|
||||
foreach (QGraphicsItem *qgi, content.items()) qgi -> setSelected(true);
|
||||
|
||||
foreach (QGraphicsItem *qgi, content.items())
|
||||
qgi -> setSelected(true);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1077,6 +1077,8 @@ ElementTextItem* CustomElement::setTaggedText(const QString &tagg, const QString
|
||||
/**
|
||||
* @brief CustomElement::taggedText
|
||||
* return the text field tagged with @tagg or NULL if text field isn't found
|
||||
* Some of available taggs :
|
||||
* function, tension-protocol, label, comment, location
|
||||
* @param tagg
|
||||
*/
|
||||
ElementTextItem* CustomElement::taggedText(const QString &tagg) const {
|
||||
|
||||
Reference in New Issue
Block a user