* 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:
Adrien Allain
2021-09-13 20:38:39 +02:00
committed by Laurent Trinques
parent 9135099dbf
commit c640d96bca
12 changed files with 204 additions and 5 deletions

View File

@@ -94,6 +94,8 @@ class PartLine : public CustomElementGraphicPart
void setFirstEndLength(const qreal &l);
qreal secondEndLength() const {return second_length;}
void setSecondEndLength(const qreal &l);
void setRotation(qreal angle);
qreal rotation() const;
protected:
QVariant itemChange(GraphicsItemChange change, const QVariant &value) override;
@@ -124,5 +126,6 @@ class PartLine : public CustomElementGraphicPart
int m_vector_index = -1;
QPropertyUndoCommand *m_undo_command;
QVector<QetGraphicsHandlerItem *> m_handler_vector;
qreal m_rot;
};
#endif