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:
xavier
2009-11-29 21:56:48 +00:00
parent 121bd1f432
commit 5204ffe9ab
7 changed files with 84 additions and 10 deletions

View File

@@ -23,6 +23,7 @@
#include "diagramcommands.h"
#include "diagramposition.h"
#include "conductorpropertieswidget.h"
#include "elementtextitem.h"
#include "insetpropertieswidget.h"
#include "qetapp.h"
#include "qetproject.h"
@@ -114,14 +115,22 @@ void DiagramView::deleteSelection() {
*/
void DiagramView::rotateSelection() {
if (scene -> isReadOnly()) return;
// recupere les elements et les champs de texte a pivoter
QHash<Element *, QET::Orientation> elements_to_rotate;
QList<DiagramTextItem *> texts_to_rotate;
foreach (QGraphicsItem *item, scene -> selectedItems()) {
if (Element *e = qgraphicsitem_cast<Element *>(item)) {
elements_to_rotate.insert(e, e -> orientation().current());
}
} else if (DiagramTextItem *dti = qgraphicsitem_cast<DiagramTextItem *>(item)) {
texts_to_rotate << dti;
} /*else if (ElementTextItem *eti = qgraphicsitem_cast<ElementTextItem *>(item)) {
}*/
}
if (elements_to_rotate.isEmpty()) return;
scene -> undoStack().push(new RotateElementsCommand(elements_to_rotate));
// effectue les rotations s'il y a quelque chose a pivoter
if (elements_to_rotate.isEmpty() && texts_to_rotate.isEmpty()) return;
scene -> undoStack().push(new RotateElementsCommand(elements_to_rotate, texts_to_rotate));
}
/**