QElectroTech
0.70
|
#include <customelementpart.h>
Public Member Functions | |
CustomElementPart (QETElementEditor *editor) | |
virtual | ~CustomElementPart () |
Destructor. More... | |
virtual void | fromXml (const QDomElement &)=0 |
virtual const QDomElement | toXml (QDomDocument &) const =0 |
virtual void | setProperty (const char *name, const QVariant &value)=0 |
virtual QVariant | property (const char *name) const =0 |
virtual bool | isUseless () const =0 |
virtual QRectF | sceneGeometricRect () const =0 |
virtual void | startUserTransformation (const QRectF &)=0 |
virtual void | handleUserTransformation (const QRectF &, const QRectF &)=0 |
virtual QETElementEditor * | elementEditor () const |
virtual void | updateCurrentPartEditor () const |
virtual ElementScene * | elementScene () const |
virtual QUndoStack & | undoStack () const |
virtual QString | name () const =0 |
virtual QString | xmlName () const =0 |
virtual QGraphicsItem * | toItem () |
virtual QET::ScalingMethod | preferredScalingMethod () const |
Protected Member Functions | |
QList< QPointF > | mapPoints (const QRectF &, const QRectF &, const QList< QPointF > &) |
Private Member Functions | |
CustomElementPart (const CustomElementPart &) | |
Private Attributes | |
QETElementEditor * | element_editor |
This abstract class represents a primitive of the visual representation of an electrical element. The Element, FixedElement and CustomElement classes do not embed its attributes and methods in order to remain lightweight; indeed, there is no point for those classes to store their visual representation with anything more complex than a QImage.
Definition at line 38 of file customelementpart.h.
|
inline |
Constructor
Definition at line 45 of file customelementpart.h.
|
inlinevirtual |
Destructor.
Definition at line 47 of file customelementpart.h.
|
private |
|
virtual |
Definition at line 22 of file customelementpart.cpp.
References element_editor.
|
virtual |
Definition at line 37 of file customelementpart.cpp.
References element_editor.
Referenced by PartPolygon::contextMenuEvent(), PartDynamicTextField::elementInfoChanged(), PartEllipse::handlerMouseMoveEvent(), PartArc::handlerMouseMoveEvent(), PartRectangle::handlerMouseMoveEvent(), PartPolygon::handlerMouseMoveEvent(), PartLine::handlerMouseMoveEvent(), PartEllipse::handlerMouseReleaseEvent(), PartArc::handlerMouseReleaseEvent(), PartRectangle::handlerMouseReleaseEvent(), PartPolygon::handlerMouseReleaseEvent(), PartLine::handlerMouseReleaseEvent(), PartPolygon::insertPoint(), PartDynamicTextField::itemChange(), PartText::mouseMoveEvent(), PartDynamicTextField::mouseMoveEvent(), CustomElementGraphicPart::mouseMoveEvent(), PartText::mouseReleaseEvent(), PartDynamicTextField::mouseReleaseEvent(), CustomElementGraphicPart::mouseReleaseEvent(), PartPolygon::removePoint(), PartDynamicTextField::setCompositeText(), PartDynamicTextField::setInfoName(), and undoStack().
|
pure virtual |
Load the primitive from an XML element that describes it
Implemented in PartDynamicTextField, PartLine, PartPolygon, PartRectangle, PartTerminal, PartText, PartEllipse, and PartArc.
Referenced by ElementScene::loadContent().
|
pure virtual |
Make this part fit into the provided rectangle.
Implemented in PartLine, PartRectangle, PartDynamicTextField, PartPolygon, PartTerminal, PartText, and AbstractPartEllipse.
|
pure virtual |
Implemented in PartLine, PartRectangle, PartDynamicTextField, PartPolygon, PartTerminal, AbstractPartEllipse, and PartText.
|
protected |
Helper method to map points in CustomElementPart::handleUserTransformation()
initial_selection_rect | Selection rectangle when the movement started, in scene coordinates |
new_selection_rect | New selection rectangle, in scene coordinates |
points | List of points when the movement started, in scene coordinates. |
Definition at line 69 of file customelementpart.cpp.
Referenced by AbstractPartEllipse::handleUserTransformation(), PartText::handleUserTransformation(), PartTerminal::handleUserTransformation(), PartPolygon::handleUserTransformation(), PartDynamicTextField::handleUserTransformation(), PartRectangle::handleUserTransformation(), and PartLine::handleUserTransformation().
|
pure virtual |
Implemented in PartLine, PartDynamicTextField, PartPolygon, PartRectangle, PartTerminal, PartText, PartEllipse, and PartArc.
Referenced by CustomElementGraphicPart::property(), and CustomElementGraphicPart::setProperty().
|
virtual |
This method is called by the decorator when it needs to determine the best way to interactively scale a primitive. It is typically called when only a single primitive is being scaled. The default implementation systematically returns QET::SnapScalingPointToGrid
Reimplemented in PartPolygon.
Definition at line 58 of file customelementpart.cpp.
References QET::SnapScalingPointToGrid.
|
pure virtual |
Get the current value of a specific primitive property
Implemented in CustomElementGraphicPart, PartText, and PartDynamicTextField.
|
pure virtual |
Implemented in PartLine, PartDynamicTextField, PartRectangle, PartPolygon, PartTerminal, PartText, and AbstractPartEllipse.
|
pure virtual |
Set a specific property of the primitive
Implemented in CustomElementGraphicPart, PartText, and PartDynamicTextField.
|
pure virtual |
Inform this part a user-induced transformation is about to begin. This method can be used to save data required by handleUserTransformation().
Implemented in PartLine, PartRectangle, PartDynamicTextField, PartPolygon, PartTerminal, PartText, and AbstractPartEllipse.
|
virtual |
Definition at line 47 of file customelementpart.cpp.
Referenced by DynamicTextFieldEditor::setPart().
|
pure virtual |
Export the primitive as an XML element
Implemented in PartDynamicTextField, PartLine, PartPolygon, PartRectangle, PartTerminal, PartText, PartEllipse, and PartArc.
|
virtual |
Definition at line 42 of file customelementpart.cpp.
References elementScene().
Referenced by PartText::endEdition().
|
virtual |
Call the updateCurrentPartEditor() slot of the editor
Appelle le slot updateCurrentPartEditor de l'editeur
Definition at line 30 of file customelementpart.cpp.
References element_editor.
Referenced by PartText::itemChange(), CustomElementGraphicPart::itemChange(), and PartDynamicTextField::itemChange().
|
pure virtual |
Implemented in PartLine, PartDynamicTextField, PartPolygon, PartRectangle, PartTerminal, PartText, PartEllipse, and PartArc.
|
private |
Definition at line 54 of file customelementpart.h.
Referenced by elementEditor(), elementScene(), and updateCurrentPartEditor().