|
QElectroTech
0.8-dev
|
Go to the documentation of this file.
18 #ifndef PART_RECTANGLE_H
19 #define PART_RECTANGLE_H
53 enum {
Type = UserType + 1109 };
59 void paint (QPainter *,
const QStyleOptionGraphicsItem *, QWidget * =
nullptr)
override;
60 QString
name ()
const override {
return(
QObject::tr(
"rectangle",
"element part name")); }
62 QString
xmlName ()
const override {
return(QString(
"rect")); }
63 const QDomElement
toXml (QDomDocument &)
const override;
64 void fromXml (
const QDomElement &)
override;
76 QPainterPath
shape ()
const override;
86 QVariant
itemChange(GraphicsItemChange change,
const QVariant &value)
override;
QVector< QetGraphicsHandlerItem * > m_handler_vector
Definition: partrectangle.h:106
QPointF snapToGrid(QPointF point)
ElementScene::snapToGrid Rounds the coordinates of the point passed as a parameter so that this point...
Definition: elementscene.cpp:1270
QRectF sceneGeometricRect() const override
PartRectangle::sceneGeometricRect.
Definition: partrectangle.cpp:170
@ Type
Definition: qetgraphicshandleritem.h:42
void sceneSelectionChanged()
PartRectangle::sceneSelectionChanged When the scene selection change, if there are several primitive ...
Definition: partrectangle.cpp:502
void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *=nullptr) override
PartRectangle::paint Draw this Rectangle.
Definition: partrectangle.cpp:48
QUndoStack & undoStack()
ElementScene::undoStack.
Definition: elementscene.cpp:603
qreal m_old_xRadius
Definition: partrectangle.h:109
static void drawCross(const QPointF ¢er, QPainter *painter)
CustomElementGraphicPart::drawCross Draw a cross at pos center.
Definition: customelementgraphicpart.cpp:60
void fromXml(const QDomElement &) override
PartRectangle::fromXml Import the properties of this rectangle from a xml element.
Definition: partrectangle.cpp:111
QRectF m_old_rect
Definition: partrectangle.h:102
void setYRadius(qreal Y)
Definition: partrectangle.cpp:155
The CustomElementGraphicPart class This class is the base for all home-made primitive like line,...
Definition: customelementgraphicpart.h:36
void setRect(const QRectF &rect)
PartRectangle::setRect Sets the item's rectangle to be the given rectangle.
Definition: partrectangle.cpp:138
@ Type
Definition: partrectangle.h:53
void handlerMousePressEvent(QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event)
PartRectangle::handlerMousePressEvent.
Definition: partrectangle.cpp:424
qreal m_old_yRadius
Definition: partrectangle.h:110
QList< QPointF > saved_points_
Definition: partrectangle.h:103
static QVector< QPointF > pointForRadiusRect(const QRectF &rect, qreal xRadius, qreal yRadius, Qt::SizeMode mode=Qt::AbsoluteSize)
QetGraphicsHandlerUtility::pointForRadiusRect.
Definition: qetgraphicshandlerutility.cpp:276
void stylesToXml(QDomElement &) const
CustomElementGraphicPart::stylesToXml Write the curent style to xml element. The style are stored lik...
Definition: customelementgraphicpart.cpp:162
QVariant itemChange(GraphicsItemChange change, const QVariant &value) override
PartRectangle::itemChange.
Definition: partrectangle.cpp:280
void adjusteHandlerPos()
PartRectangle::adjusteHandlerPos.
Definition: partrectangle.cpp:390
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override
Definition: customelementgraphicpart.cpp:1318
void switchResizeMode()
PartRectangle::switchResizeMode.
Definition: partrectangle.cpp:357
qreal YRadius() const
Definition: partrectangle.h:70
static qreal radiusForPosAtIndex(const QRectF &rect, const QPointF &pos, int index, Qt::SizeMode mode=Qt::AbsoluteSize)
QetGraphicsHandlerUtility::radiusForPosAtIndex.
Definition: qetgraphicshandlerutility.cpp:316
PartRectangle(QETElementEditor *, QGraphicsItem *parent=nullptr)
PartRectangle::PartRectangle Constructor.
Definition: partrectangle.cpp:30
int m_vector_index
Definition: partrectangle.h:105
QRectF m_rect
Definition: partrectangle.h:101
QRectF boundingRect() const override
PartRectangle::boundingRect.
Definition: partrectangle.cpp:213
bool m_modifie_radius_equaly
Definition: partrectangle.h:111
void handlerMouseReleaseEvent(QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event)
Definition: partrectangle.cpp:473
void startUserTransformation(const QRectF &) override
PartRectangle::startUserTransformation Start the user-induced transformation, provided this primitive...
Definition: partrectangle.cpp:241
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
int m_resize_mode
Definition: partrectangle.h:104
QPainterPath shadowShape() const override
Definition: partrectangle.cpp:198
void handleUserTransformation(const QRectF &, const QRectF &) override
PartRectangle::handleUserTransformation Handle the user-induced transformation from initial_selection...
Definition: partrectangle.cpp:255
static QVector< QPointF > pointsForRect(const QRectF &rect)
QetGraphicsHandlerUtility::pointsForRect Return the keys points of the rectangle, stored in a vector....
Definition: qetgraphicshandlerutility.cpp:36
const QDomElement toXml(QDomDocument &) const override
PartRectangle::toXml Export this rectangle in xml.
Definition: partrectangle.cpp:80
QString xmlName() const override
Definition: partrectangle.h:62
qreal m_yRadius
Definition: partrectangle.h:108
qreal XRadius() const
Definition: partrectangle.h:68
void handlerMouseMoveEvent(QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event)
PartRectangle::handlerMouseMoveEvent.
Definition: partrectangle.cpp:442
QPainterPath shape() const override
PartRectangle::shape.
Definition: partrectangle.cpp:186
void addHandler()
PartRectangle::addHandler Add handlers for this item.
Definition: partrectangle.cpp:514
void removeHandler()
PartRectangle::removeHandler Remove the handlers of this item.
Definition: partrectangle.cpp:544
bool isUseless() const override
PartRectangle::isUseless.
Definition: partrectangle.cpp:231
bool sceneEventFilter(QGraphicsItem *watched, QEvent *event) override
PartRectangle::sceneEventFilter.
Definition: partrectangle.cpp:320
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
The QetGraphicsHandlerItem class This graphics item represents a point, destined to be used as an han...
Definition: qetgraphicshandleritem.h:37
QRectF rect
Definition: partrectangle.h:34
void setAnimated(bool animate=true, bool first_time=true)
QPropertyUndoCommand::setAnimated.
Definition: qpropertyundocommand.cpp:103
bool m_hovered
Definition: customelementgraphicpart.h:323
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override
PartRectangle::mouseReleaseEvent Handle mouse release event.
Definition: partrectangle.cpp:266
~PartRectangle() override
PartRectangle::~PartRectangle.
Definition: partrectangle.cpp:37
int type() const override
Definition: partrectangle.h:58
#define SHADOWS_HEIGHT
Definition: customelementgraphicpart.h:37
Color color
Definition: customelementgraphicpart.h:44
Definition: partrectangle.h:31
qreal xRadius
Definition: partrectangle.h:35
virtual ElementScene * elementScene() const
Definition: customelementpart.cpp:37
QList< QPointF > mapPoints(const QRectF &, const QRectF &, const QList< QPointF > &)
Definition: customelementpart.cpp:69
void setXRadius(qreal X)
Definition: partrectangle.cpp:147
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
qreal yRadius
Definition: partrectangle.h:36
qreal m_xRadius
Definition: partrectangle.h:107
The QPropertyUndoCommand class This undo command manage QProperty of a QObject. This undo command can...
Definition: qpropertyundocommand.h:34
static QVector< QetGraphicsHandlerItem * > handlerForPoint(const QVector< QPointF > &points, int size=10)
QetGraphicsHandlerItem::handlerForPoint.
Definition: qetgraphicshandleritem.cpp:87
QIcon tr
Definition: qeticons.cpp:206
virtual QPointF sceneTopLeft() const
PartRectangle::sceneTopLeft.
Definition: partrectangle.cpp:178
Definition: qetelementeditor.h:33
PartRectangle(const PartRectangle &)
void drawShadowShape(QPainter *painter)
CustomElementGraphicPart::drawShadowShape Draw a transparent blue shadow arround the shape of this it...
Definition: customelementgraphicpart.cpp:1240
QString name() const override
Definition: partrectangle.h:60