QElectroTech  0.8-dev
Public Types | Signals | Public Member Functions | Protected Member Functions | Properties | Private Member Functions | Private Attributes | List of all members
PartRectangle Class Reference

#include <partrectangle.h>

Inheritance diagram for PartRectangle:
Inheritance graph
Collaboration diagram for PartRectangle:
Collaboration graph

Public Types

enum  { Type = UserType + 1109 }
 
- Public Types inherited from CustomElementGraphicPart
enum  LineStyle { NormalStyle, DashedStyle, DottedStyle, DashdottedStyle }
 
enum  LineWeight {
  NoneWeight, ThinWeight, NormalWeight, UltraWeight,
  BigWeight
}
 
enum  Filling {
  NoneFilling, BlackFilling, WhiteFilling, GreenFilling,
  RedFilling, BlueFilling, GrayFilling, BrunFilling,
  YellowFilling, CyanFilling, MagentaFilling, LightgrayFilling,
  OrangeFilling, PurpleFilling, HTMLPinkPinkFilling, HTMLPinkLightPinkFilling,
  HTMLPinkHotPinkFilling, HTMLPinkDeepPinkFilling, HTMLPinkPaleVioletRedFilling, HTMLPinkMediumVioletRedFilling,
  HTMLRedLightSalmonFilling, HTMLRedSalmonFilling, HTMLRedDarkSalmonFilling, HTMLRedLightCoralFilling,
  HTMLRedIndianRedFilling, HTMLRedCrimsonFilling, HTMLRedFirebrickFilling, HTMLRedDarkRedFilling,
  HTMLRedRedFilling, HTMLOrangeOrangeRedFilling, HTMLOrangeTomatoFilling, HTMLOrangeCoralFilling,
  HTMLOrangeDarkOrangeFilling, HTMLOrangeOrangeFilling, HTMLYellowYellowFilling, HTMLYellowLightYellowFilling,
  HTMLYellowLemonChiffonFilling, HTMLYellowLightGoldenrodYellowFilling, HTMLYellowPapayaWhipFilling, HTMLYellowMoccasinFilling,
  HTMLYellowPeachPuffFilling, HTMLYellowPaleGoldenrodFilling, HTMLYellowKhakiFilling, HTMLYellowDarkKhakiFilling,
  HTMLYellowGoldFilling, HTMLBrownCornsilkFilling, HTMLBrownBlanchedAlmondFilling, HTMLBrownBisqueFilling,
  HTMLBrownNavajoWhiteFilling, HTMLBrownWheatFilling, HTMLBrownBurlywoodFilling, HTMLBrownTanFilling,
  HTMLBrownRosyBrownFilling, HTMLBrownSandyBrownFilling, HTMLBrownGoldenrodFilling, HTMLBrownDarkGoldenrodFilling,
  HTMLBrownPeruFilling, HTMLBrownChocolateFilling, HTMLBrownSaddleBrownFilling, HTMLBrownSiennaFilling,
  HTMLBrownBrownFilling, HTMLBrownMaroonFilling, HTMLGreenDarkOliveGreenFilling, HTMLGreenOliveFilling,
  HTMLGreenOliveDrabFilling, HTMLGreenYellowGreenFilling, HTMLGreenLimeGreenFilling, HTMLGreenLimeFilling,
  HTMLGreenLawnGreenFilling, HTMLGreenChartreuseFilling, HTMLGreenGreenYellowFilling, HTMLGreenSpringGreenFilling,
  HTMLGreenMediumSpringGreenFilling, HTMLGreenLightGreenFilling, HTMLGreenPaleGreenFilling, HTMLGreenDarkSeaGreenFilling,
  HTMLGreenMediumAquamarineFilling, HTMLGreenMediumSeaGreenFilling, HTMLGreenSeaGreenFilling, HTMLGreenForestGreenFilling,
  HTMLGreenGreenFilling, HTMLGreenDarkGreenFilling, HTMLCyanAquaFilling, HTMLCyanCyanFilling,
  HTMLCyanLightCyanFilling, HTMLCyanPaleTurquoiseFilling, HTMLCyanAquamarineFilling, HTMLCyanTurquoiseFilling,
  HTMLCyanMediumTurquoiseFilling, HTMLCyanDarkTurquoiseFilling, HTMLCyanLightSeaGreenFilling, HTMLCyanCadetBlueFilling,
  HTMLCyanDarkCyanFilling, HTMLCyanTealFilling, HTMLBlueLightSteelBlueFilling, HTMLBluePowderBlueFilling,
  HTMLBlueLightBlueFilling, HTMLBlueSkyBlueFilling, HTMLBlueLightSkyBlueFilling, HTMLBlueDeepSkyBlueFilling,
  HTMLBlueDodgerBlueFilling, HTMLBlueCornflowerBlueFilling, HTMLBlueSteelBlueFilling, HTMLBlueRoyalBlueFilling,
  HTMLBlueBlueFilling, HTMLBlueMediumBlueFilling, HTMLBlueDarkBlueFilling, HTMLBlueNavyFilling,
  HTMLBlueMidnightBlueFilling, HTMLPurpleLavenderFilling, HTMLPurpleThistleFilling, HTMLPurplePlumFilling,
  HTMLPurpleVioletFilling, HTMLPurpleOrchidFilling, HTMLPurpleFuchsiaFilling, HTMLPurpleMagentaFilling,
  HTMLPurpleMediumOrchidFilling, HTMLPurpleMediumPurpleFilling, HTMLPurpleBlueVioletFilling, HTMLPurpleDarkVioletFilling,
  HTMLPurpleDarkOrchidFilling, HTMLPurpleDarkMagentaFilling, HTMLPurplePurpleFilling, HTMLPurpleIndigoFilling,
  HTMLPurpleDarkSlateBlueFilling, HTMLPurpleSlateBlueFilling, HTMLPurpleMediumSlateBlueFilling, HTMLWhiteWhiteFilling,
  HTMLWhiteSnowFilling, HTMLWhiteHoneydewFilling, HTMLWhiteMintCreamFilling, HTMLWhiteAzureFilling,
  HTMLWhiteAliceBlueFilling, HTMLWhiteGhostWhiteFilling, HTMLWhiteWhiteSmokeFilling, HTMLWhiteSeashellFilling,
  HTMLWhiteBeigeFilling, HTMLWhiteOldLaceFilling, HTMLWhiteFloralWhiteFilling, HTMLWhiteIvoryFilling,
  HTMLWhiteAntiqueWhiteFilling, HTMLWhiteLinenFilling, HTMLWhiteLavenderBlushFilling, HTMLWhiteMistyRoseFilling,
  HTMLGrayGainsboroFilling, HTMLGrayLightGrayFilling, HTMLGraySilverFilling, HTMLGrayDarkGrayFilling,
  HTMLGrayGrayFilling, HTMLGrayDimGrayFilling, HTMLGrayLightSlateGrayFilling, HTMLGraySlateGrayFilling,
  HTMLGrayDarkSlateGrayFilling, HTMLGrayBlackFilling, HorFilling, VerFilling,
  BdiagFilling, FdiagFilling
}
 
enum  Color {
  BlackColor, WhiteColor, GreenColor, RedColor,
  BlueColor, GrayColor, BrunColor, YellowColor,
  CyanColor, MagentaColor, LightgrayColor, OrangeColor,
  PurpleColor, HTMLPinkPinkColor, HTMLPinkLightPinkColor, HTMLPinkHotPinkColor,
  HTMLPinkDeepPinkColor, HTMLPinkPaleVioletRedColor, HTMLPinkMediumVioletRedColor, HTMLRedLightSalmonColor,
  HTMLRedSalmonColor, HTMLRedDarkSalmonColor, HTMLRedLightCoralColor, HTMLRedIndianRedColor,
  HTMLRedCrimsonColor, HTMLRedFirebrickColor, HTMLRedDarkRedColor, HTMLRedRedColor,
  HTMLOrangeOrangeRedColor, HTMLOrangeTomatoColor, HTMLOrangeCoralColor, HTMLOrangeDarkOrangeColor,
  HTMLOrangeOrangeColor, HTMLYellowYellowColor, HTMLYellowLightYellowColor, HTMLYellowLemonChiffonColor,
  HTMLYellowLightGoldenrodYellowColor, HTMLYellowPapayaWhipColor, HTMLYellowMoccasinColor, HTMLYellowPeachPuffColor,
  HTMLYellowPaleGoldenrodColor, HTMLYellowKhakiColor, HTMLYellowDarkKhakiColor, HTMLYellowGoldColor,
  HTMLBrownCornsilkColor, HTMLBrownBlanchedAlmondColor, HTMLBrownBisqueColor, HTMLBrownNavajoWhiteColor,
  HTMLBrownWheatColor, HTMLBrownBurlywoodColor, HTMLBrownTanColor, HTMLBrownRosyBrownColor,
  HTMLBrownSandyBrownColor, HTMLBrownGoldenrodColor, HTMLBrownDarkGoldenrodColor, HTMLBrownPeruColor,
  HTMLBrownChocolateColor, HTMLBrownSaddleBrownColor, HTMLBrownSiennaColor, HTMLBrownBrownColor,
  HTMLBrownMaroonColor, HTMLGreenDarkOliveGreenColor, HTMLGreenOliveColor, HTMLGreenOliveDrabColor,
  HTMLGreenYellowGreenColor, HTMLGreenLimeGreenColor, HTMLGreenLimeColor, HTMLGreenLawnGreenColor,
  HTMLGreenChartreuseColor, HTMLGreenGreenYellowColor, HTMLGreenSpringGreenColor, HTMLGreenMediumSpringGreenColor,
  HTMLGreenLightGreenColor, HTMLGreenPaleGreenColor, HTMLGreenDarkSeaGreenColor, HTMLGreenMediumAquamarineColor,
  HTMLGreenMediumSeaGreenColor, HTMLGreenSeaGreenColor, HTMLGreenForestGreenColor, HTMLGreenGreenColor,
  HTMLGreenDarkGreenColor, HTMLCyanAquaColor, HTMLCyanCyanColor, HTMLCyanLightCyanColor,
  HTMLCyanPaleTurquoiseColor, HTMLCyanAquamarineColor, HTMLCyanTurquoiseColor, HTMLCyanMediumTurquoiseColor,
  HTMLCyanDarkTurquoiseColor, HTMLCyanLightSeaGreenColor, HTMLCyanCadetBlueColor, HTMLCyanDarkCyanColor,
  HTMLCyanTealColor, HTMLBlueLightSteelBlueColor, HTMLBluePowderBlueColor, HTMLBlueLightBlueColor,
  HTMLBlueSkyBlueColor, HTMLBlueLightSkyBlueColor, HTMLBlueDeepSkyBlueColor, HTMLBlueDodgerBlueColor,
  HTMLBlueCornflowerBlueColor, HTMLBlueSteelBlueColor, HTMLBlueRoyalBlueColor, HTMLBlueBlueColor,
  HTMLBlueMediumBlueColor, HTMLBlueDarkBlueColor, HTMLBlueNavyColor, HTMLBlueMidnightBlueColor,
  HTMLPurpleLavenderColor, HTMLPurpleThistleColor, HTMLPurplePlumColor, HTMLPurpleVioletColor,
  HTMLPurpleOrchidColor, HTMLPurpleFuchsiaColor, HTMLPurpleMagentaColor, HTMLPurpleMediumOrchidColor,
  HTMLPurpleMediumPurpleColor, HTMLPurpleBlueVioletColor, HTMLPurpleDarkVioletColor, HTMLPurpleDarkOrchidColor,
  HTMLPurpleDarkMagentaColor, HTMLPurplePurpleColor, HTMLPurpleIndigoColor, HTMLPurpleDarkSlateBlueColor,
  HTMLPurpleSlateBlueColor, HTMLPurpleMediumSlateBlueColor, HTMLWhiteWhiteColor, HTMLWhiteSnowColor,
  HTMLWhiteHoneydewColor, HTMLWhiteMintCreamColor, HTMLWhiteAzureColor, HTMLWhiteAliceBlueColor,
  HTMLWhiteGhostWhiteColor, HTMLWhiteWhiteSmokeColor, HTMLWhiteSeashellColor, HTMLWhiteBeigeColor,
  HTMLWhiteOldLaceColor, HTMLWhiteFloralWhiteColor, HTMLWhiteIvoryColor, HTMLWhiteAntiqueWhiteColor,
  HTMLWhiteLinenColor, HTMLWhiteLavenderBlushColor, HTMLWhiteMistyRoseColor, HTMLGrayGainsboroColor,
  HTMLGrayLightGrayColor, HTMLGraySilverColor, HTMLGrayDarkGrayColor, HTMLGrayGrayColor,
  HTMLGrayDimGrayColor, HTMLGrayLightSlateGrayColor, HTMLGraySlateGrayColor, HTMLGrayDarkSlateGrayColor,
  HTMLGrayBlackColor, NoneColor
}
 

Signals

void rectChanged ()
 
void XRadiusChanged ()
 
void YRadiusChanged ()
 

Public Member Functions

 PartRectangle (QETElementEditor *, QGraphicsItem *parent=nullptr)
 PartRectangle::PartRectangle Constructor. More...
 
 ~PartRectangle () override
 PartRectangle::~PartRectangle. More...
 
int type () const override
 
void paint (QPainter *, const QStyleOptionGraphicsItem *, QWidget *=nullptr) override
 PartRectangle::paint Draw this Rectangle. More...
 
QString name () const override
 
QString xmlName () const override
 
const QDomElement toXml (QDomDocument &) const override
 PartRectangle::toXml Export this rectangle in xml. More...
 
void fromXml (const QDomElement &) override
 PartRectangle::fromXml Import the properties of this rectangle from a xml element. More...
 
QRectF rect () const
 PartRectangle::rect. More...
 
void setRect (const QRectF &rect)
 PartRectangle::setRect Sets the item's rectangle to be the given rectangle. More...
 
qreal XRadius () const
 
void setXRadius (qreal X)
 
qreal YRadius () const
 
void setYRadius (qreal Y)
 
QRectF sceneGeometricRect () const override
 PartRectangle::sceneGeometricRect. More...
 
virtual QPointF sceneTopLeft () const
 PartRectangle::sceneTopLeft. More...
 
QPainterPath shape () const override
 PartRectangle::shape. More...
 
QPainterPath shadowShape () const override
 
QRectF boundingRect () const override
 PartRectangle::boundingRect. More...
 
bool isUseless () const override
 PartRectangle::isUseless. More...
 
void startUserTransformation (const QRectF &) override
 PartRectangle::startUserTransformation Start the user-induced transformation, provided this primitive is contained within the initial_selection_rect bounding rectangle. More...
 
void handleUserTransformation (const QRectF &, const QRectF &) override
 PartRectangle::handleUserTransformation Handle the user-induced transformation from initial_selection_rect to new_selection_rect. More...
 
- Public Member Functions inherited from CustomElementGraphicPart
 CustomElementGraphicPart (QETElementEditor *editor, QGraphicsItem *parent=nullptr)
 CustomElementGraphicPart::CustomElementGraphicPart Default constructor. By default, item is selectable, send geometry change (Qt > 4.6), accept mouse left button and accept hover event. More...
 
 ~CustomElementGraphicPart () override
 CustomElementGraphicPart::~CustomElementGraphicPart Destructor. More...
 
LineStyle lineStyle () const
 
void setLineStyle (const LineStyle ls)
 CustomElementGraphicPart::setLineStyle Set line style to ls. More...
 
LineWeight lineWeight () const
 
void setLineWeight (const LineWeight lw)
 CustomElementGraphicPart::setLineWeight Set line weight to lw. More...
 
qreal penWeight () const
 CustomElementGraphicPart::penWeight. More...
 
Filling filling () const
 
void setFilling (const Filling f)
 CustomElementGraphicPart::setFilling Set filling to f. More...
 
Color color () const
 
void setColor (const Color c)
 CustomElementGraphicPart::setColor Set color to c. More...
 
bool antialiased () const
 
void setAntialiased (const bool b)
 CustomElementGraphicPart::setAntialiased Set antialias to b. More...
 
void setProperty (const char *name, const QVariant &value) override
 
QVariant property (const char *name) const override
 
virtual void setHandlerColor (QPointF, const QColor &)
 
virtual void resetAllHandlerColor ()
 
- Public Member Functions inherited from CustomElementPart
 CustomElementPart (QETElementEditor *editor)
 CustomElementPart Constructor. More...
 
virtual ~CustomElementPart ()
 ~CustomElementPart Destructor More...
 
virtual QETElementEditorelementEditor () const
 
virtual void updateCurrentPartEditor () const
 
virtual ElementSceneelementScene () const
 
virtual QUndoStack & undoStack () const
 
virtual QGraphicsItem * toItem ()
 
virtual QET::ScalingMethod preferredScalingMethod () const
 

Protected Member Functions

void mouseReleaseEvent (QGraphicsSceneMouseEvent *event) override
 PartRectangle::mouseReleaseEvent Handle mouse release event. More...
 
QVariant itemChange (GraphicsItemChange change, const QVariant &value) override
 PartRectangle::itemChange. More...
 
bool sceneEventFilter (QGraphicsItem *watched, QEvent *event) override
 PartRectangle::sceneEventFilter. More...
 
- Protected Member Functions inherited from CustomElementGraphicPart
void stylesToXml (QDomElement &) const
 CustomElementGraphicPart::stylesToXml Write the curent style to xml element. The style are stored like this: name-of-style:value;name-of-style:value Each style separate by ; and name-style/value are separate by : More...
 
void stylesFromXml (const QDomElement &)
 CustomElementGraphicPart::stylesFromXml Read the style used by this, from a xml element. More...
 
void resetStyles ()
 CustomElementGraphicPart::resetStyles Reset the curent style to default, same style of default constructor. More...
 
void applyStylesToQPainter (QPainter &) const
 CustomElementGraphicPart::applyStylesToQPainter Apply the current style to the QPainter. More...
 
void drawShadowShape (QPainter *painter)
 CustomElementGraphicPart::drawShadowShape Draw a transparent blue shadow arround the shape of this item. The QPainterPathStroker used to draw shadows have a width of SHADOWS_HEIGHT Be carefull if penWeight of this item is to 0 the outline of strock is bigger of 0.5. More...
 
QVariant itemChange (GraphicsItemChange change, const QVariant &value) override
 CustomElementGraphicPart::itemChange Reimplemented from QGraphicsObject. If the item position change call updateCurrentPartEditor() the change is always send to QGraphicsObject. More...
 
void hoverEnterEvent (QGraphicsSceneHoverEvent *event) override
 CustomElementGraphicPart::hoverEnterEvent Reimplemented from QGraphicsObject. Set m_hovered to true. More...
 
void hoverLeaveEvent (QGraphicsSceneHoverEvent *event) override
 CustomElementGraphicPart::hoverLeaveEvent Reimplemented from QGraphicsObject. Set m_hovered to false. More...
 
void mousePressEvent (QGraphicsSceneMouseEvent *event) override
 
void mouseMoveEvent (QGraphicsSceneMouseEvent *event) override
 
void mouseReleaseEvent (QGraphicsSceneMouseEvent *event) override
 
- Protected Member Functions inherited from CustomElementPart
QList< QPointF > mapPoints (const QRectF &, const QRectF &, const QList< QPointF > &)
 

Properties

QRectF rect
 
qreal xRadius
 
qreal yRadius
 
- Properties inherited from CustomElementGraphicPart
LineStyle line_style
 
LineWeight line_weight
 
Filling filling
 
Color color
 
bool antialias
 

Private Member Functions

 PartRectangle (const PartRectangle &)
 
void switchResizeMode ()
 PartRectangle::switchResizeMode. More...
 
void adjusteHandlerPos ()
 PartRectangle::adjusteHandlerPos. More...
 
void handlerMousePressEvent (QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event)
 PartRectangle::handlerMousePressEvent. More...
 
void handlerMouseMoveEvent (QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event)
 PartRectangle::handlerMouseMoveEvent. More...
 
void handlerMouseReleaseEvent (QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event)
 
void sceneSelectionChanged ()
 PartRectangle::sceneSelectionChanged When the scene selection change, if there are several primitive selected, we remove the handler of this item. More...
 
void addHandler ()
 PartRectangle::addHandler Add handlers for this item. More...
 
void removeHandler ()
 PartRectangle::removeHandler Remove the handlers of this item. More...
 

Private Attributes

QRectF m_rect
 
QRectF m_old_rect
 
QList< QPointF > saved_points_
 
int m_resize_mode = 1
 
int m_vector_index = -1
 
QVector< QetGraphicsHandlerItem * > m_handler_vector
 
qreal m_xRadius = 0
 
qreal m_yRadius = 0
 
qreal m_old_xRadius
 
qreal m_old_yRadius
 
bool m_modifie_radius_equaly = false
 

Additional Inherited Members

- Static Public Member Functions inherited from CustomElementGraphicPart
static void drawCross (const QPointF &center, QPainter *painter)
 CustomElementGraphicPart::drawCross Draw a cross at pos center. More...
 
- Protected Attributes inherited from CustomElementGraphicPart
bool m_hovered
 

Detailed Description

This class represents a rectangle primitive which may be used to compose the drawing of an electrical element within the element editor. All coordinates is in item coordinate, except pos()

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
Type 

Constructor & Destructor Documentation

◆ PartRectangle() [1/2]

PartRectangle::PartRectangle ( QETElementEditor editor,
QGraphicsItem *  parent = nullptr 
)

PartRectangle::PartRectangle Constructor.

Parameters
editorthe QETElementEditor of this item
parentparent item

◆ ~PartRectangle()

PartRectangle::~PartRectangle ( )
override

PartRectangle::~PartRectangle.

Here is the call graph for this function:

◆ PartRectangle() [2/2]

PartRectangle::PartRectangle ( const PartRectangle )
private

Member Function Documentation

◆ addHandler()

void PartRectangle::addHandler ( )
private

PartRectangle::addHandler Add handlers for this item.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ adjusteHandlerPos()

void PartRectangle::adjusteHandlerPos ( )
private

PartRectangle::adjusteHandlerPos.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ boundingRect()

QRectF PartRectangle::boundingRect ( ) const
override

PartRectangle::boundingRect.

Returns
Bounding rectangle this part can fit into
Here is the call graph for this function:
Here is the caller graph for this function:

◆ fromXml()

void PartRectangle::fromXml ( const QDomElement &  qde)
overridevirtual

PartRectangle::fromXml Import the properties of this rectangle from a xml element.

Parameters
qde: Xml document to use.

Implements CustomElementPart.

Here is the call graph for this function:

◆ handlerMouseMoveEvent()

void PartRectangle::handlerMouseMoveEvent ( QetGraphicsHandlerItem qghi,
QGraphicsSceneMouseEvent *  event 
)
private

PartRectangle::handlerMouseMoveEvent.

Parameters
qghi
event
Here is the call graph for this function:
Here is the caller graph for this function:

◆ handlerMousePressEvent()

void PartRectangle::handlerMousePressEvent ( QetGraphicsHandlerItem qghi,
QGraphicsSceneMouseEvent *  event 
)
private

PartRectangle::handlerMousePressEvent.

Parameters
qghi
event
Here is the caller graph for this function:

◆ handlerMouseReleaseEvent()

void PartRectangle::handlerMouseReleaseEvent ( QetGraphicsHandlerItem qghi,
QGraphicsSceneMouseEvent *  event 
)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ handleUserTransformation()

void PartRectangle::handleUserTransformation ( const QRectF &  initial_selection_rect,
const QRectF &  new_selection_rect 
)
overridevirtual

PartRectangle::handleUserTransformation Handle the user-induced transformation from initial_selection_rect to new_selection_rect.

Parameters
initial_selection_rect
new_selection_rect

Implements CustomElementPart.

Here is the call graph for this function:

◆ isUseless()

bool PartRectangle::isUseless ( ) const
overridevirtual

PartRectangle::isUseless.

Returns
true if this part is irrelevant and does not deserve to be Retained / registered. An rectangle is relevant when he's not null.

Implements CustomElementPart.

◆ itemChange()

QVariant PartRectangle::itemChange ( GraphicsItemChange  change,
const QVariant &  value 
)
overrideprotected

PartRectangle::itemChange.

Parameters
change
value
Returns
Here is the call graph for this function:

◆ mouseReleaseEvent()

void PartRectangle::mouseReleaseEvent ( QGraphicsSceneMouseEvent *  event)
overrideprotected

PartRectangle::mouseReleaseEvent Handle mouse release event.

Parameters
event
Here is the call graph for this function:

◆ name()

QString PartRectangle::name ( ) const
inlineoverridevirtual
Returns
the name of the primitive

Implements CustomElementPart.

◆ paint()

void PartRectangle::paint ( QPainter *  painter,
const QStyleOptionGraphicsItem *  options,
QWidget *  widget = nullptr 
)
override

PartRectangle::paint Draw this Rectangle.

Parameters
painter
options
widget
Here is the call graph for this function:

◆ rect()

QRectF PartRectangle::rect ( ) const

PartRectangle::rect.

Returns
: Returns the item's rectangle.

◆ rectChanged

void PartRectangle::rectChanged ( )
signal
Here is the caller graph for this function:

◆ removeHandler()

void PartRectangle::removeHandler ( )
private

PartRectangle::removeHandler Remove the handlers of this item.

Here is the caller graph for this function:

◆ sceneEventFilter()

bool PartRectangle::sceneEventFilter ( QGraphicsItem *  watched,
QEvent *  event 
)
overrideprotected

PartRectangle::sceneEventFilter.

Parameters
watched
event
Returns
Here is the call graph for this function:

◆ sceneGeometricRect()

QRectF PartRectangle::sceneGeometricRect ( ) const
overridevirtual

PartRectangle::sceneGeometricRect.

Returns
the minimum, margin-less rectangle this part can fit into, in scene coordinates. It is different from boundingRect() because it is not supposed to imply any margin, and it is different from shape because it is a regular rectangle, not a complex shape.

Implements CustomElementPart.

Here is the call graph for this function:

◆ sceneSelectionChanged()

void PartRectangle::sceneSelectionChanged ( )
private

PartRectangle::sceneSelectionChanged When the scene selection change, if there are several primitive selected, we remove the handler of this item.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sceneTopLeft()

QPointF PartRectangle::sceneTopLeft ( ) const
virtual

PartRectangle::sceneTopLeft.

Returns
the top left of rectangle, in scene coordinate
Here is the caller graph for this function:

◆ setRect()

void PartRectangle::setRect ( const QRectF &  rect)

PartRectangle::setRect Sets the item's rectangle to be the given rectangle.

Parameters
rect
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setXRadius()

void PartRectangle::setXRadius ( qreal  X)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setYRadius()

void PartRectangle::setYRadius ( qreal  Y)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ shadowShape()

QPainterPath PartRectangle::shadowShape ( ) const
overridevirtual

Implements CustomElementGraphicPart.

Here is the call graph for this function:

◆ shape()

QPainterPath PartRectangle::shape ( ) const
override

PartRectangle::shape.

Returns
the shape of this item
Here is the call graph for this function:
Here is the caller graph for this function:

◆ startUserTransformation()

void PartRectangle::startUserTransformation ( const QRectF &  initial_selection_rect)
overridevirtual

PartRectangle::startUserTransformation Start the user-induced transformation, provided this primitive is contained within the initial_selection_rect bounding rectangle.

Parameters
initial_selection_rect

Implements CustomElementPart.

◆ switchResizeMode()

void PartRectangle::switchResizeMode ( )
private

PartRectangle::switchResizeMode.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ toXml()

const QDomElement PartRectangle::toXml ( QDomDocument &  xml_document) const
overridevirtual

PartRectangle::toXml Export this rectangle in xml.

Parameters
xml_document: Xml document to use for create the xml element.
Returns
an xml element that describe this ellipse

Implements CustomElementPart.

Here is the call graph for this function:

◆ type()

int PartRectangle::type ( ) const
inlineoverride

Enable the use of qgraphicsitem_cast to safely cast a QGraphicsItem into a PartRectangle.

Returns
the QGraphicsItem type

◆ xmlName()

QString PartRectangle::xmlName ( ) const
inlineoverridevirtual
Returns
the name that will be used as XML tag when exporting the primitive

Implements CustomElementPart.

◆ XRadius()

qreal PartRectangle::XRadius ( ) const
inline
Here is the caller graph for this function:

◆ XRadiusChanged

void PartRectangle::XRadiusChanged ( )
signal
Here is the caller graph for this function:

◆ YRadius()

qreal PartRectangle::YRadius ( ) const
inline
Here is the caller graph for this function:

◆ YRadiusChanged

void PartRectangle::YRadiusChanged ( )
signal
Here is the caller graph for this function:

Member Data Documentation

◆ m_handler_vector

QVector<QetGraphicsHandlerItem *> PartRectangle::m_handler_vector
private

◆ m_modifie_radius_equaly

bool PartRectangle::m_modifie_radius_equaly = false
private

◆ m_old_rect

QRectF PartRectangle::m_old_rect
private

◆ m_old_xRadius

qreal PartRectangle::m_old_xRadius
private

◆ m_old_yRadius

qreal PartRectangle::m_old_yRadius
private

◆ m_rect

QRectF PartRectangle::m_rect
private

◆ m_resize_mode

int PartRectangle::m_resize_mode = 1
private

◆ m_vector_index

int PartRectangle::m_vector_index = -1
private

◆ m_xRadius

qreal PartRectangle::m_xRadius = 0
private

◆ m_yRadius

qreal PartRectangle::m_yRadius = 0
private

◆ saved_points_

QList<QPointF> PartRectangle::saved_points_
private

Property Documentation

◆ rect

QRectF PartRectangle::rect
readwrite

◆ xRadius

qreal PartRectangle::xRadius
readwrite

◆ yRadius

qreal PartRectangle::yRadius
readwrite

The documentation for this class was generated from the following files: