mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-18 05:00:33 +01:00
Il est desormais possible de pivoter les textes independants et les textes des conducteurs.
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/branches/0.3@798 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -407,9 +407,10 @@ void ChangeDiagramTextCommand::redo() {
|
||||
@param elements Elements a pivoter associes a leur orientation d'origine
|
||||
@param parent QUndoCommand parent
|
||||
*/
|
||||
RotateElementsCommand::RotateElementsCommand(const QHash<Element *, QET::Orientation> &elements, QUndoCommand *parent) :
|
||||
RotateElementsCommand::RotateElementsCommand(const QHash<Element *, QET::Orientation> &elements, const QList<DiagramTextItem *> &texts, QUndoCommand *parent) :
|
||||
QUndoCommand(parent),
|
||||
elements_to_rotate(elements)
|
||||
elements_to_rotate(elements),
|
||||
texts_to_rotate(texts)
|
||||
{
|
||||
setText(
|
||||
QString(
|
||||
@@ -417,7 +418,7 @@ RotateElementsCommand::RotateElementsCommand(const QHash<Element *, QET::Orienta
|
||||
"pivoter %1",
|
||||
"undo caption - %1 is a sentence listing the rotated content"
|
||||
)
|
||||
).arg(QET::ElementsAndConductorsSentence(elements.count(), 0))
|
||||
).arg(QET::ElementsAndConductorsSentence(elements.count(), 0, texts.count()))
|
||||
);
|
||||
}
|
||||
|
||||
@@ -430,6 +431,9 @@ void RotateElementsCommand::undo() {
|
||||
foreach(Element *e, elements_to_rotate.keys()) {
|
||||
e -> setOrientation(elements_to_rotate[e]);
|
||||
}
|
||||
foreach(DiagramTextItem *dti, texts_to_rotate) {
|
||||
dti -> rotateBy(90.0);
|
||||
}
|
||||
}
|
||||
|
||||
/// refait le pivotement
|
||||
@@ -438,6 +442,9 @@ void RotateElementsCommand::redo() {
|
||||
e -> setOrientation(e -> orientation().next());
|
||||
e -> update();
|
||||
}
|
||||
foreach(DiagramTextItem *dti, texts_to_rotate) {
|
||||
dti -> rotateBy(-90.0);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user