mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 20:50:34 +01:00
* Added the m_rotate_action to qetelementeditor.ui * Adding QAction to qetelementeditor.cpp and connecting it to new slot RotateElementsCommand defined in editorcommands.cpp
* Some types of elements need to specialize the setRotation method in order to behave correctly : - PartTerminal needs to call setOrientation - PartLine, PartRectangle and PartPolygon need a different rotation center.
This commit is contained in:
committed by
Laurent Trinques
parent
9135099dbf
commit
c640d96bca
@@ -22,6 +22,19 @@
|
||||
#include "elementcontent.h"
|
||||
#include "elementscene.h"
|
||||
#include "elementview.h"
|
||||
#include "graphicspart/abstractpartellipse.h"
|
||||
#include "graphicspart/customelementgraphicpart.h"
|
||||
#include "graphicspart/customelementpart.h"
|
||||
#include "graphicspart/partarc.h"
|
||||
#include "graphicspart/partdynamictextfield.h"
|
||||
#include "graphicspart/partellipse.h"
|
||||
#include "graphicspart/partline.h"
|
||||
#include "graphicspart/partpolygon.h"
|
||||
#include "graphicspart/partrectangle.h"
|
||||
#include "graphicspart/partterminal.h"
|
||||
#include "graphicspart/parttext.h"
|
||||
#include "../QPropertyUndoCommand/qpropertyundocommand.h"
|
||||
|
||||
|
||||
/**
|
||||
@brief The ElementEditionCommand class
|
||||
@@ -279,4 +292,24 @@ class changeElementDataCommand : public ElementEditionCommand
|
||||
m_new;
|
||||
};
|
||||
|
||||
/**
|
||||
@brief The RotateSelectionInESCommand class
|
||||
Rotate the selected items in the element editor
|
||||
*/
|
||||
|
||||
class RotateElementsCommand : public ElementEditionCommand
|
||||
{
|
||||
|
||||
public:
|
||||
RotateElementsCommand(ElementScene *scene, QUndoCommand *parent=nullptr);
|
||||
void undo() override;
|
||||
void redo() override;
|
||||
|
||||
private:
|
||||
ElementScene *m_scene =nullptr;
|
||||
QList<QGraphicsItem*> m_items;
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user