|
QElectroTech
0.70
|
#include <partterminal.h>
Public Types | |
| enum | { Type = UserType + 1106 } |
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, HorFilling, VerFilling, BdiagFilling, FdiagFilling } |
| enum | Color { BlackColor, WhiteColor, GreenColor, RedColor, BlueColor, GrayColor, BrunColor, YellowColor, CyanColor, MagentaColor, LightgrayColor, OrangeColor, PurpleColor, NoneColor } |
Signals | |
| void | orientationChanged () |
Public Member Functions | |
| PartTerminal (QETElementEditor *editor, QGraphicsItem *parent=nullptr) | |
| ~PartTerminal () override | |
| Destructeur. More... | |
| int | type () const override |
| QString | name () const override |
| QString | xmlName () const override |
| void | fromXml (const QDomElement &) override |
| const QDomElement | toXml (QDomDocument &) const override |
| void | paint (QPainter *, const QStyleOptionGraphicsItem *, QWidget *) override |
| QPainterPath | shape () const override |
| PartTerminal::shape. More... | |
| QPainterPath | shadowShape () const override |
| QRectF | boundingRect () const override |
| PartTerminal::boundingRect. More... | |
| bool | isUseless () const override |
| QRectF | sceneGeometricRect () const override |
| void | startUserTransformation (const QRectF &) override |
| void | handleUserTransformation (const QRectF &, const QRectF &) override |
| Qet::Orientation | orientation () const |
| void | setOrientation (Qet::Orientation ori) |
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 |
Public Member Functions inherited from CustomElementPart | |
| CustomElementPart (QETElementEditor *editor) | |
| virtual | ~CustomElementPart () |
| Destructor. More... | |
| virtual QETElementEditor * | elementEditor () const |
| virtual void | updateCurrentPartEditor () const |
| virtual ElementScene * | elementScene () const |
| virtual QUndoStack & | undoStack () const |
| virtual QGraphicsItem * | toItem () |
| virtual QET::ScalingMethod | preferredScalingMethod () const |
Properties | |
| Qet::Orientation | orientation |
Properties inherited from CustomElementGraphicPart | |
| LineStyle | line_style |
| LineWeight | line_weight |
| Filling | filling |
| Color | color |
| bool | antialias |
Private Member Functions | |
| PartTerminal (const PartTerminal &) | |
| void | updateSecondPoint () |
Private Attributes | |
| Qet::Orientation | m_orientation |
| QPointF | second_point |
| QPointF | saved_position_ |
Additional Inherited Members | |
Static Public Member Functions inherited from CustomElementGraphicPart | |
| static void | drawCross (const QPointF ¢er, QPainter *painter) |
| CustomElementGraphicPart::drawCross Draw a cross at pos center. 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 > &) |
Protected Attributes inherited from CustomElementGraphicPart | |
| bool | m_hovered |
This class represents a terminal which may be used to compose the drawing of an electrical element within the element editor.
Definition at line 29 of file partterminal.h.
| anonymous enum |
| Enumerator | |
|---|---|
| Type | |
Definition at line 54 of file partterminal.h.
| PartTerminal::PartTerminal | ( | QETElementEditor * | editor, |
| QGraphicsItem * | parent = nullptr |
||
| ) |
Constructeur
| editor | L'editeur d'element concerne |
| parent | Le QGraphicsItem parent de cette borne |
| scene | La scene sur laquelle figure cette borne |
Definition at line 27 of file partterminal.cpp.
References updateSecondPoint().
|
override |
Destructeur.
Definition at line 36 of file partterminal.cpp.
|
private |
|
override |
Definition at line 130 of file partterminal.cpp.
References QET::Icons::br, second_point, and SHADOWS_HEIGHT.
|
overridevirtual |
Importe les proprietes d'une borne depuis un element XML
| xml_elmt | Element XML a lire |
Implements CustomElementPart.
Definition at line 43 of file partterminal.cpp.
References QET::attributeIsAReal(), m_orientation, Qet::orientationFromString(), and updateSecondPoint().
|
overridevirtual |
Handle the user-induced transformation from initial_selection_rect to new_selection_rect
Implements CustomElementPart.
Definition at line 199 of file partterminal.cpp.
References CustomElementPart::mapPoints(), and saved_position_.
|
overridevirtual |
Implements CustomElementPart.
Definition at line 173 of file partterminal.cpp.
|
inlineoverridevirtual |
Implements CustomElementPart.
Definition at line 60 of file partterminal.h.
References QET::Icons::tr.
|
inline |
Definition at line 74 of file partterminal.h.
References m_orientation.
|
signal |
Referenced by setOrientation(), and TerminalEditor::setPart().
|
override |
Dessine la borne
| p | QPainter a utiliser pour rendre le dessin |
| options | Options pour affiner le rendu |
| widget | Widget sur lequel le rendu est effectue |
Definition at line 82 of file partterminal.cpp.
References CustomElementGraphicPart::drawShadowShape(), CustomElementGraphicPart::m_hovered, Terminal::neutralColor, and second_point.
|
overridevirtual |
Implements CustomElementPart.
Definition at line 183 of file partterminal.cpp.
| void PartTerminal::setOrientation | ( | Qet::Orientation | ori | ) |
Definit l'orientation de la borne
| ori | la nouvelle orientation de la borne |
Definition at line 144 of file partterminal.cpp.
References m_orientation, orientationChanged(), and updateSecondPoint().
|
inlineoverridevirtual |
Implements CustomElementGraphicPart.
Definition at line 67 of file partterminal.h.
References shape().
|
override |
Definition at line 115 of file partterminal.cpp.
References second_point.
Referenced by shadowShape().
|
overridevirtual |
Start the user-induced transformation, provided this primitive is contained within the initial_selection_rect bounding rectangle.
Implements CustomElementPart.
Definition at line 191 of file partterminal.cpp.
References saved_position_.
|
overridevirtual |
Exporte la borne en XML
| xml_document | Document XML a utiliser pour creer l'element XML |
Implements CustomElementPart.
Definition at line 61 of file partterminal.cpp.
References m_orientation, and Qet::orientationToString().
|
inlineoverride |
Enable the use of qgraphicsitem_cast to safely cast a QGraphicsItem into a PartTerminal.
Definition at line 59 of file partterminal.h.
References Type.
|
private |
Met a jour la position du second point en fonction de la position et de l'orientation de la borne.
Definition at line 157 of file partterminal.cpp.
References Qet::East, m_orientation, Qet::North, second_point, Qet::South, and Qet::West.
Referenced by fromXml(), PartTerminal(), and setOrientation().
|
inlineoverridevirtual |
Implements CustomElementPart.
Definition at line 61 of file partterminal.h.
|
private |
Definition at line 48 of file partterminal.h.
Referenced by fromXml(), orientation(), setOrientation(), toXml(), and updateSecondPoint().
|
private |
Definition at line 81 of file partterminal.h.
Referenced by handleUserTransformation(), and startUserTransformation().
|
private |
Definition at line 49 of file partterminal.h.
Referenced by boundingRect(), paint(), shape(), and updateSecondPoint().
|
readwrite |
Definition at line 33 of file partterminal.h.
Referenced by ESEventAddTerminal::keyPressEvent().
1.8.15