|
QElectroTech
0.8-dev
|
Go to the documentation of this file.
18 #ifndef PART_ELLIPSE_H
19 #define PART_ELLIPSE_H
44 enum {
Type = UserType + 1103 };
50 void paint(QPainter *,
const QStyleOptionGraphicsItem *, QWidget * =
nullptr)
override;
53 QString
name()
const override {
return(
QObject::tr(
"ellipse",
"element part name")); }
54 QString
xmlName()
const override {
return(QString(
"ellipse")); }
55 const QDomElement
toXml (QDomDocument &)
const override;
56 void fromXml (
const QDomElement &)
override;
57 QPainterPath
shape()
const override;
63 QVariant
itemChange(GraphicsItemChange change,
const QVariant &value)
override;
void fromXml(const QDomElement &) override
PartEllipse::fromXml Import the properties of this ellipse from a xml element.
Definition: partellipse.cpp:108
void enableAnimation(bool animate=true)
QPropertyUndoCommand::enableAnimation True to enable animation.
Definition: qpropertyundocommand.cpp:92
QPointF snapToGrid(QPointF point)
ElementScene::snapToGrid Rounds the coordinates of the point passed as a parameter so that this point...
Definition: elementscene.cpp:1270
@ Type
Definition: qetgraphicshandleritem.h:42
void handlerMouseMoveEvent(QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event)
PartEllipse::handlerMouseMoveEvent.
Definition: partellipse.cpp:301
QUndoStack & undoStack()
ElementScene::undoStack.
Definition: elementscene.cpp:603
QPropertyUndoCommand * m_undo_command
Definition: partellipse.h:78
static void drawCross(const QPointF ¢er, QPainter *painter)
CustomElementGraphicPart::drawCross Draw a cross at pos center.
Definition: customelementgraphicpart.cpp:60
void setRect(const QRectF &rect) override
AbstractPartEllipse::setRect Sets the item's ellipse geometry to rect. The rectangle's left edge defi...
Definition: partellipse.h:59
void removeHandler()
PartEllipse::removeHandler Remove the handlers of this item.
Definition: partellipse.cpp:374
QString name() const override
Definition: partellipse.h:53
void stylesToXml(QDomElement &) const
CustomElementGraphicPart::stylesToXml Write the curent style to xml element. The style are stored lik...
Definition: customelementgraphicpart.cpp:162
void setNewValue(const QVariant &new_value)
QPropertyUndoCommand::setNewValue Set the new value of the property (set with redo) to new_value.
Definition: qpropertyundocommand.cpp:83
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override
Definition: customelementgraphicpart.cpp:1318
virtual void setRect(const QRectF &rect)
AbstractPartEllipse::setRect Sets the item's ellipse geometry to rect. The rectangle's left edge defi...
Definition: abstractpartellipse.cpp:119
const QDomElement toXml(QDomDocument &) const override
PartEllipse::toXml Export this ellipse in xml.
Definition: partellipse.cpp:79
void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *=nullptr) override
PartEllipse::paint Draw this ellpise.
Definition: partellipse.cpp:52
bool sceneEventFilter(QGraphicsItem *watched, QEvent *event) override
PartEllipse::sceneEventFilter.
Definition: partellipse.cpp:212
void handlerMouseReleaseEvent(QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event)
PartEllipse::handlerMouseReleaseEvent.
Definition: partellipse.cpp:323
int m_vector_index
Definition: partellipse.h:80
~PartEllipse() override
PartEllipse::~PartEllipse Destructor.
Definition: partellipse.cpp:39
void stylesFromXml(const QDomElement &)
CustomElementGraphicPart::stylesFromXml Read the style used by this, from a xml element.
Definition: customelementgraphicpart.cpp:508
static QRectF mirrorRectForPosAtIndex(const QRectF &old_rect, const QPointF &pos, int index)
QetGraphicsHandlerUtility::mirrorRectForPosAtIndex Return a rectangle after modification of the point...
Definition: qetgraphicshandlerutility.cpp:139
QVariant itemChange(GraphicsItemChange change, const QVariant &value) override
PartEllipse::itemChange.
Definition: partellipse.cpp:172
PartEllipse(QETElementEditor *editor, QGraphicsItem *parent=nullptr)
PartEllipse::PartEllipse Constructor.
Definition: partellipse.cpp:30
The PartEllipse class This class represents an ellipse primitive which may be used to compose the dra...
Definition: partellipse.h:31
static QVector< QPointF > pointsForRect(const QRectF &rect)
QetGraphicsHandlerUtility::pointsForRect Return the keys points of the rectangle, stored in a vector....
Definition: qetgraphicshandlerutility.cpp:36
@ Type
Definition: partellipse.h:44
virtual QPointF sceneTopLeft() const
AbstractPartEllipse::sceneTopLeft.
Definition: abstractpartellipse.cpp:98
void handlerMousePressEvent(QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event)
PartEllipse::handlerMousePressEvent.
Definition: partellipse.cpp:285
The AbstractPartEllipse class This is the base class for all ellipse based item like ellipse,...
Definition: abstractpartellipse.h:40
void addHandler()
PartEllipse::addHandler Add handlers for this item.
Definition: partellipse.cpp:350
static QRectF rectForPosAtIndex(const QRectF &old_rect, const QPointF &pos, int index)
QetGraphicsHandlerUtility::rectForPosAtIndex Return a rectangle after modification of the point 'pos'...
Definition: qetgraphicshandlerutility.cpp:106
void switchResizeMode()
Definition: partellipse.cpp:246
QVector< QetGraphicsHandlerItem * > m_handler_vector
Definition: abstractpartellipse.h:84
The QetGraphicsHandlerItem class This graphics item represents a point, destined to be used as an han...
Definition: qetgraphicshandleritem.h:37
int m_resize_mode
Definition: partellipse.h:79
bool m_hovered
Definition: customelementgraphicpart.h:323
QRectF rect
Definition: abstractpartellipse.h:44
#define SHADOWS_HEIGHT
Definition: customelementgraphicpart.h:37
int type() const override
Definition: partellipse.h:49
Color color
Definition: customelementgraphicpart.h:44
void adjusteHandlerPos()
PartEllipse::adjusteHandlerPos.
Definition: partellipse.cpp:265
QPainterPath shadowShape() const override
Definition: partellipse.cpp:142
virtual ElementScene * elementScene() const
Definition: customelementpart.cpp:37
void applyStylesToQPainter(QPainter &) const
CustomElementGraphicPart::applyStylesToQPainter Apply the current style to the QPainter.
Definition: customelementgraphicpart.cpp:885
qreal penWeight() const
CustomElementGraphicPart::penWeight.
Definition: customelementgraphicpart.cpp:109
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override
PartEllipse::mouseReleaseEvent Handle mouse release event.
Definition: partellipse.cpp:158
QRectF m_rect
Definition: abstractpartellipse.h:81
The QPropertyUndoCommand class This undo command manage QProperty of a QObject. This undo command can...
Definition: qpropertyundocommand.h:34
PartEllipse(const PartEllipse &)
static QVector< QetGraphicsHandlerItem * > handlerForPoint(const QVector< QPointF > &points, int size=10)
QetGraphicsHandlerItem::handlerForPoint.
Definition: qetgraphicshandleritem.cpp:87
QPainterPath shape() const override
PartEllipse::shape.
Definition: partellipse.cpp:130
QIcon tr
Definition: qeticons.cpp:206
QString xmlName() const override
Definition: partellipse.h:54
Definition: qetelementeditor.h:33
void drawShadowShape(QPainter *painter)
CustomElementGraphicPart::drawShadowShape Draw a transparent blue shadow arround the shape of this it...
Definition: customelementgraphicpart.cpp:1240
void sceneSelectionChanged()
PartEllipse::sceneSelectionChanged When the scene selection change, if there are several primitive se...
Definition: partellipse.cpp:338