mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-01-26 04:29:59 +01:00
Element editor : add rounded rect
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@5444 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -20,7 +20,6 @@
|
||||
|
||||
#include "customelementgraphicpart.h"
|
||||
|
||||
class QPropertyUndoCommand;
|
||||
class QetGraphicsHandlerItem;
|
||||
|
||||
/**
|
||||
@@ -33,6 +32,8 @@ class PartRectangle : public CustomElementGraphicPart
|
||||
Q_OBJECT
|
||||
|
||||
Q_PROPERTY(QRectF rect READ rect WRITE setRect)
|
||||
Q_PROPERTY(qreal xRadius READ XRadius WRITE setXRadius NOTIFY XRadiusChanged)
|
||||
Q_PROPERTY(qreal yRadius READ YRadius WRITE setYRadius NOTIFY YRadiusChanged)
|
||||
|
||||
// constructors, destructor
|
||||
public:
|
||||
@@ -44,6 +45,8 @@ class PartRectangle : public CustomElementGraphicPart
|
||||
|
||||
signals:
|
||||
void rectChanged();
|
||||
void XRadiusChanged();
|
||||
void YRadiusChanged();
|
||||
|
||||
// methods
|
||||
public:
|
||||
@@ -62,6 +65,10 @@ class PartRectangle : public CustomElementGraphicPart
|
||||
|
||||
QRectF rect() const;
|
||||
void setRect(const QRectF &rect);
|
||||
qreal XRadius() const {return m_xRadius;}
|
||||
void setXRadius(qreal X);
|
||||
qreal YRadius() const {return m_yRadius;}
|
||||
void setYRadius(qreal Y);
|
||||
|
||||
QRectF sceneGeometricRect() const override;
|
||||
virtual QPointF sceneTopLeft() const;
|
||||
@@ -91,11 +98,16 @@ class PartRectangle : public CustomElementGraphicPart
|
||||
void removeHandler();
|
||||
|
||||
private:
|
||||
QRectF m_rect;
|
||||
QRectF m_rect,
|
||||
m_old_rect;
|
||||
QList<QPointF> saved_points_;
|
||||
QPropertyUndoCommand *m_undo_command;
|
||||
int m_resize_mode = 1,
|
||||
m_vector_index = -1;
|
||||
QVector<QetGraphicsHandlerItem *> m_handler_vector;
|
||||
qreal m_xRadius = 0,
|
||||
m_yRadius = 0,
|
||||
m_old_xRadius,
|
||||
m_old_yRadius;
|
||||
bool m_modifie_radius_equaly = false;
|
||||
};
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user