mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 12:40:35 +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:
@@ -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));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user