QElectroTech
0.70
|
The PartDynamicTextField class This class represents an editable dynamic text field which may be used to compose the drawing of an electrical element within the element editor. The field will remain editable once the element is added onto a diagram. More...
#include <partdynamictextfield.h>
Public Types | |
enum | { Type = UserType + 1110 } |
Signals | |
void | taggChanged (QString tagg) |
void | textChanged (QString text) |
void | textFromChanged (DynamicElementTextItem::TextFrom text_from) |
void | infoNameChanged (QString info) |
void | compositeTextChanged (QString text) |
void | colorChanged (QColor color) |
void | frameChanged (bool frame) |
void | textWidthChanged (qreal width) |
void | alignmentChanged (Qt::Alignment alignment) |
void | fontChanged (QFont font) |
Public Member Functions | |
void | setProperty (const char *name, const QVariant &value) override |
PROPERTY. More... | |
QVariant | property (const char *name) const override |
PartDynamicTextField (QETElementEditor *editor, QGraphicsItem *parent=nullptr) | |
int | type () const override |
QString | name () const override |
QString | xmlName () const override |
bool | isUseless () const override |
QRectF | sceneGeometricRect () const override |
void | startUserTransformation (const QRectF &initial_selection_rect) override |
PartDynamicTextField::startUserTransformation. More... | |
void | handleUserTransformation (const QRectF &initial_selection_rect, const QRectF &new_selection_rect) override |
PartDynamicTextField::handleUserTransformation. More... | |
const QDomElement | toXml (QDomDocument &dom_doc) const override |
PartDynamicTextField::toXml. More... | |
void | fromXml (const QDomElement &dom_elmt) override |
PartDynamicTextField::fromXml. More... | |
void | fromTextFieldXml (const QDomElement &dom_element) |
PartDynamicTextField::fromTextFieldXml Setup this text from the xml definition of a text field (The xml tagg of a text field is "input");. More... | |
DynamicElementTextItem::TextFrom | textFrom () const |
void | setTextFrom (DynamicElementTextItem::TextFrom text_from) |
PartDynamicTextField::setTextFrom Set the final text is created from. More... | |
QString | text () const |
void | setText (const QString &text) |
PartDynamicTextField::setText Set the text of this text. More... | |
void | setInfoName (const QString &info_name) |
QString | infoName () const |
void | setCompositeText (const QString &text) |
PartDynamicTextField::setCompositeText Set the composite text of this text item to . More... | |
QString | compositeText () const |
void | setColor (const QColor &color) |
PartDynamicTextField::setColor. More... | |
QColor | color () const |
void | setFrame (bool frame) |
bool | frame () const |
void | setTextWidth (qreal width) |
void | setPlainText (const QString &text) |
void | setAlignment (Qt::Alignment alignment) |
Qt::Alignment | alignment () const |
void | setFont (const QFont &font) |
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 |
Static Public Member Functions | |
static QString | xmlTaggName () |
Protected Member Functions | |
void | mouseMoveEvent (QGraphicsSceneMouseEvent *event) override |
PartDynamicTextField::mouseMoveEvent. More... | |
void | mousePressEvent (QGraphicsSceneMouseEvent *event) override |
PartDynamicTextField::mousePressEvent. More... | |
void | mouseReleaseEvent (QGraphicsSceneMouseEvent *event) override |
PartDynamicTextField::mouseReleaseEvent. More... | |
QVariant | itemChange (GraphicsItemChange change, const QVariant &value) override |
PartDynamicTextField::itemChange. More... | |
void | paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override |
Protected Member Functions inherited from CustomElementPart | |
QList< QPointF > | mapPoints (const QRectF &, const QRectF &, const QList< QPointF > &) |
Properties | |
QString | text |
PartDynamicTextField::text. More... | |
DynamicElementTextItem::TextFrom | textFrom |
PartDynamicTextField::textFrom. More... | |
QString | infoName |
PartDynamicTextField::infoName. More... | |
QString | compositeText |
PartDynamicTextField::compositeText. More... | |
QColor | color |
PartDynamicTextField::color. More... | |
bool | frame |
qreal | textWidth |
Qt::Alignment | alignment |
QFont | font |
Private Member Functions | |
void | elementInfoChanged () |
PartDynamicTextField::elementInfoChanged Used to up to date this text field, when the element information (see elementScene) changed. More... | |
void | prepareAlignment () |
void | finishAlignment () |
Private Attributes | |
QPointF | m_origine_pos |
QPointF | m_saved_point |
QString | m_text |
QString | m_info_name |
QString | m_composite_text |
DynamicElementTextItem::TextFrom | m_text_from = DynamicElementTextItem::UserText |
QUuid | m_uuid |
bool | m_frame = false |
bool | m_first_add = true |
bool | m_block_alignment = false |
qreal | m_text_width = -1 |
Qt::Alignment | m_alignment = Qt::AlignTop|Qt::AlignLeft |
QRectF | m_alignment_rect |
The PartDynamicTextField class This class represents an editable dynamic text field which may be used to compose the drawing of an electrical element within the element editor. The field will remain editable once the element is added onto a diagram.
Definition at line 32 of file partdynamictextfield.h.
anonymous enum |
Enumerator | |
---|---|
Type |
Definition at line 66 of file partdynamictextfield.h.
PartDynamicTextField::PartDynamicTextField | ( | QETElementEditor * | editor, |
QGraphicsItem * | parent = nullptr |
||
) |
Definition at line 27 of file partdynamictextfield.cpp.
References QETApp::dynamicTextsItemFont(), setFont(), setText(), setTextFrom(), setTextWidth(), and DynamicElementTextItem::UserText.
Qt::Alignment PartDynamicTextField::alignment | ( | ) | const |
Referenced by fromXml(), setAlignment(), and toXml().
|
signal |
Referenced by setAlignment().
QColor PartDynamicTextField::color | ( | ) | const |
Referenced by paint(), setColor(), and toXml().
|
signal |
Referenced by setColor(), and DynamicTextFieldEditor::setPart().
QString PartDynamicTextField::compositeText | ( | ) | const |
|
signal |
Referenced by setCompositeText(), and DynamicTextFieldEditor::setPart().
|
private |
PartDynamicTextField::elementInfoChanged Used to up to date this text field, when the element information (see elementScene) changed.
Definition at line 550 of file partdynamictextfield.cpp.
References DynamicElementTextItem::CompositeText, DynamicElementTextItem::ElementInfo, CustomElementPart::elementScene(), m_composite_text, m_info_name, m_text_from, autonum::AssignVariables::replaceVariable(), and setPlainText().
Referenced by itemChange().
|
private |
Definition at line 566 of file partdynamictextfield.cpp.
References m_alignment, m_alignment_rect, and m_block_alignment.
Referenced by setFont(), and setPlainText().
|
signal |
Referenced by setFont(), and DynamicTextFieldEditor::setPart().
bool PartDynamicTextField::frame | ( | ) | const |
Referenced by setFrame().
|
signal |
Referenced by setFrame(), and DynamicTextFieldEditor::setPart().
void PartDynamicTextField::fromTextFieldXml | ( | const QDomElement & | dom_element | ) |
PartDynamicTextField::fromTextFieldXml Setup this text from the xml definition of a text field (The xml tagg of a text field is "input");.
dom_element |
Definition at line 220 of file partdynamictextfield.cpp.
References QETApp::diagramTextsFont(), DynamicElementTextItem::ElementInfo, setFont(), setInfoName(), setText(), setTextFrom(), and DynamicElementTextItem::UserText.
Referenced by ElementScene::loadContent().
|
overridevirtual |
PartDynamicTextField::fromXml.
element |
Implements CustomElementPart.
Definition at line 155 of file partdynamictextfield.cpp.
References alignment(), QETApp::dynamicTextsItemFont(), m_block_alignment, m_composite_text, m_info_name, m_text, m_text_from, m_uuid, setAlignment(), setColor(), setFont(), setFrame(), setPlainText(), setTextWidth(), DynamicElementTextItem::textFromMetaEnum(), and xmlName().
|
overridevirtual |
PartDynamicTextField::handleUserTransformation.
initial_selection_rect | |
new_selection_rect | Handle the user-induced transformation from initial_selection_rect to new_selection_rect |
Implements CustomElementPart.
Definition at line 77 of file partdynamictextfield.cpp.
References m_saved_point, and CustomElementPart::mapPoints().
QString PartDynamicTextField::infoName | ( | ) | const |
|
signal |
Referenced by setInfoName(), and DynamicTextFieldEditor::setPart().
|
inlineoverridevirtual |
Implements CustomElementPart.
Definition at line 72 of file partdynamictextfield.h.
|
overrideprotected |
PartDynamicTextField::itemChange.
change | |
value |
Definition at line 480 of file partdynamictextfield.cpp.
References elementInfoChanged(), ElementScene::elementInfoChanged(), CustomElementPart::elementScene(), m_first_add, and CustomElementPart::updateCurrentPartEditor().
|
overrideprotected |
PartDynamicTextField::mouseMoveEvent.
event |
Definition at line 434 of file partdynamictextfield.cpp.
References CustomElementPart::elementScene(), and m_origine_pos.
|
overrideprotected |
PartDynamicTextField::mousePressEvent.
event |
Definition at line 449 of file partdynamictextfield.cpp.
References m_origine_pos.
|
overrideprotected |
PartDynamicTextField::mouseReleaseEvent.
event |
Definition at line 461 of file partdynamictextfield.cpp.
References CustomElementPart::elementScene(), QPropertyUndoCommand::enableAnimation(), m_origine_pos, QET::Icons::tr, and ElementScene::undoStack().
|
overridevirtual |
Implements CustomElementPart.
Definition at line 49 of file partdynamictextfield.cpp.
References QET::Icons::tr.
Referenced by property(), setProperty(), and toXml().
|
overrideprotected |
Definition at line 499 of file partdynamictextfield.cpp.
References color(), font, m_frame, and QET::Icons::ro.
|
private |
Definition at line 561 of file partdynamictextfield.cpp.
References m_alignment_rect.
Referenced by setFont(), and setPlainText().
|
inlineoverridevirtual |
Get the current value of a specific primitive property
Implements CustomElementPart.
Definition at line 49 of file partdynamictextfield.h.
References name().
|
inlineoverridevirtual |
Implements CustomElementPart.
Definition at line 73 of file partdynamictextfield.h.
void PartDynamicTextField::setAlignment | ( | Qt::Alignment | alignment | ) |
Definition at line 409 of file partdynamictextfield.cpp.
References alignment(), alignmentChanged(), and m_alignment.
Referenced by fromXml().
void PartDynamicTextField::setColor | ( | const QColor & | color | ) |
PartDynamicTextField::setColor.
color | set text color to color |
Definition at line 348 of file partdynamictextfield.cpp.
References color(), and colorChanged().
Referenced by fromXml().
void PartDynamicTextField::setCompositeText | ( | const QString & | text | ) |
PartDynamicTextField::setCompositeText Set the composite text of this text item to .
text |
Definition at line 328 of file partdynamictextfield.cpp.
References DynamicElementTextItem::CompositeText, compositeTextChanged(), CustomElementPart::elementScene(), m_composite_text, m_text_from, autonum::AssignVariables::replaceVariable(), setPlainText(), and text().
Referenced by setTextFrom().
void PartDynamicTextField::setFont | ( | const QFont & | font | ) |
Definition at line 419 of file partdynamictextfield.cpp.
References finishAlignment(), font, fontChanged(), and prepareAlignment().
Referenced by fromTextFieldXml(), fromXml(), and PartDynamicTextField().
void PartDynamicTextField::setFrame | ( | bool | frame | ) |
Definition at line 362 of file partdynamictextfield.cpp.
References frame(), frameChanged(), and m_frame.
Referenced by fromXml().
void PartDynamicTextField::setInfoName | ( | const QString & | info_name | ) |
Definition at line 307 of file partdynamictextfield.cpp.
References DynamicElementTextItem::ElementInfo, CustomElementPart::elementScene(), infoNameChanged(), m_info_name, m_text_from, and setPlainText().
Referenced by fromTextFieldXml(), and setTextFrom().
void PartDynamicTextField::setPlainText | ( | const QString & | text | ) |
Definition at line 386 of file partdynamictextfield.cpp.
References finishAlignment(), m_text_width, prepareAlignment(), and text().
Referenced by elementInfoChanged(), fromXml(), setCompositeText(), setInfoName(), setText(), and setTextFrom().
|
inlineoverridevirtual |
PROPERTY.
Implements CustomElementPart.
Definition at line 48 of file partdynamictextfield.h.
References name().
void PartDynamicTextField::setText | ( | const QString & | text | ) |
PartDynamicTextField::setText Set the text of this text.
text |
Definition at line 300 of file partdynamictextfield.cpp.
References m_text, setPlainText(), text(), and textChanged().
Referenced by fromTextFieldXml(), and PartDynamicTextField().
void PartDynamicTextField::setTextFrom | ( | DynamicElementTextItem::TextFrom | text_from | ) |
PartDynamicTextField::setTextFrom Set the final text is created from.
text_from |
Definition at line 267 of file partdynamictextfield.cpp.
References DynamicElementTextItem::CompositeText, DynamicElementTextItem::ElementInfo, m_composite_text, m_info_name, m_text, m_text_from, setCompositeText(), setInfoName(), setPlainText(), textFromChanged(), and DynamicElementTextItem::UserText.
Referenced by fromTextFieldXml(), and PartDynamicTextField().
void PartDynamicTextField::setTextWidth | ( | qreal | width | ) |
Definition at line 374 of file partdynamictextfield.cpp.
References m_text_width, and textWidthChanged().
Referenced by fromXml(), and PartDynamicTextField().
|
overridevirtual |
PartDynamicTextField::startUserTransformation.
initial_selection_rect | Start the user-induced transformation, provided this primitive is contained within the initial_selection_rect bounding rectangle. |
Implements CustomElementPart.
Definition at line 65 of file partdynamictextfield.cpp.
References m_saved_point.
|
signal |
Referenced by DynamicTextFieldEditor::setPart().
QString PartDynamicTextField::text | ( | ) | const |
Referenced by setCompositeText(), setPlainText(), and setText().
|
signal |
Referenced by DynamicTextFieldEditor::setPart(), and setText().
DynamicElementTextItem::TextFrom PartDynamicTextField::textFrom | ( | ) | const |
|
signal |
Referenced by DynamicTextFieldEditor::setPart(), and setTextFrom().
|
signal |
Referenced by DynamicTextFieldEditor::setPart(), and setTextWidth().
|
overridevirtual |
document |
Implements CustomElementPart.
Definition at line 88 of file partdynamictextfield.cpp.
References alignment(), color(), QET::correctAngle(), font, m_composite_text, m_frame, m_info_name, m_text_from, m_text_width, m_uuid, name(), DynamicElementTextItem::textFromMetaEnum(), and xmlName().
|
inlineoverride |
Definition at line 67 of file partdynamictextfield.h.
References Type.
|
overridevirtual |
Implements CustomElementPart.
Definition at line 54 of file partdynamictextfield.cpp.
|
inlinestatic |
Definition at line 71 of file partdynamictextfield.h.
|
private |
Definition at line 124 of file partdynamictextfield.h.
Referenced by finishAlignment(), and setAlignment().
|
private |
Definition at line 125 of file partdynamictextfield.h.
Referenced by finishAlignment(), and prepareAlignment().
|
private |
Definition at line 122 of file partdynamictextfield.h.
Referenced by finishAlignment(), and fromXml().
|
private |
Definition at line 115 of file partdynamictextfield.h.
Referenced by elementInfoChanged(), fromXml(), setCompositeText(), setTextFrom(), and toXml().
|
private |
Definition at line 121 of file partdynamictextfield.h.
Referenced by itemChange().
|
private |
Definition at line 120 of file partdynamictextfield.h.
Referenced by paint(), setFrame(), and toXml().
|
private |
Definition at line 115 of file partdynamictextfield.h.
Referenced by elementInfoChanged(), fromXml(), setInfoName(), setTextFrom(), and toXml().
|
private |
Definition at line 113 of file partdynamictextfield.h.
Referenced by mouseMoveEvent(), mousePressEvent(), and mouseReleaseEvent().
|
private |
Definition at line 113 of file partdynamictextfield.h.
Referenced by handleUserTransformation(), and startUserTransformation().
|
private |
Definition at line 115 of file partdynamictextfield.h.
Referenced by fromXml(), setText(), and setTextFrom().
|
private |
Definition at line 118 of file partdynamictextfield.h.
Referenced by elementInfoChanged(), fromXml(), setCompositeText(), setInfoName(), setTextFrom(), and toXml().
|
private |
Definition at line 123 of file partdynamictextfield.h.
Referenced by setPlainText(), setTextWidth(), and toXml().
|
private |
Definition at line 119 of file partdynamictextfield.h.
|
readwrite |
Definition at line 43 of file partdynamictextfield.h.
|
readwrite |
Definition at line 40 of file partdynamictextfield.h.
|
readwrite |
PartDynamicTextField::compositeText.
Definition at line 39 of file partdynamictextfield.h.
|
readwrite |
Definition at line 44 of file partdynamictextfield.h.
|
readwrite |
Definition at line 41 of file partdynamictextfield.h.
|
readwrite |
PartDynamicTextField::infoName.
Definition at line 38 of file partdynamictextfield.h.
|
readwrite |
Definition at line 36 of file partdynamictextfield.h.
|
readwrite |
PartDynamicTextField::textFrom.
Definition at line 37 of file partdynamictextfield.h.
|
readwrite |
Definition at line 42 of file partdynamictextfield.h.