QElectroTech
0.8-dev
|
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 |
PartDynamicTextField::textFrom. More... | |
void | setTextFrom (DynamicElementTextItem::TextFrom text_from) |
PartDynamicTextField::setTextFrom Set the final text is created from. More... | |
QString | text () const |
PartDynamicTextField::text. More... | |
void | setText (const QString &text) |
PartDynamicTextField::setText Set the text of this text. More... | |
void | setInfoName (const QString &info_name) |
QString | infoName () const |
PartDynamicTextField::infoName. More... | |
void | setCompositeText (const QString &text) |
PartDynamicTextField::setCompositeText Set the composite text of this text item to text. More... | |
QString | compositeText () const |
PartDynamicTextField::compositeText. More... | |
void | setColor (const QColor &color) |
PartDynamicTextField::setColor. More... | |
QColor | color () const |
PartDynamicTextField::color. More... | |
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) | |
CustomElementPart Constructor. More... | |
virtual | ~CustomElementPart () |
~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 |
DynamicElementTextItem::TextFrom | textFrom |
QString | infoName |
QString | compositeText |
QColor | color |
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.
PartDynamicTextField::PartDynamicTextField | ( | QETElementEditor * | editor, |
QGraphicsItem * | parent = nullptr |
||
) |
Qt::Alignment PartDynamicTextField::alignment | ( | ) | const |
|
signal |
QColor PartDynamicTextField::color | ( | ) | const |
|
signal |
QString PartDynamicTextField::compositeText | ( | ) | const |
PartDynamicTextField::compositeText.
|
signal |
|
private |
PartDynamicTextField::elementInfoChanged Used to up to date this text field, when the element information (see elementScene) changed.
|
private |
|
signal |
bool PartDynamicTextField::frame | ( | ) | const |
|
signal |
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 |
|
overridevirtual |
PartDynamicTextField::fromXml.
dom_elmt |
Implements CustomElementPart.
|
overridevirtual |
PartDynamicTextField::handleUserTransformation.
initial_selection_rect | |
new_selection_rect | Handle the user-induced transformation from initial_selection_rect to new_selection_rect |
Implements CustomElementPart.
QString PartDynamicTextField::infoName | ( | ) | const |
PartDynamicTextField::infoName.
|
signal |
|
inlineoverridevirtual |
Implements CustomElementPart.
|
overrideprotected |
PartDynamicTextField::itemChange.
change | |
value |
|
overrideprotected |
|
overrideprotected |
PartDynamicTextField::mousePressEvent.
event |
|
overrideprotected |
|
overridevirtual |
Implements CustomElementPart.
|
overrideprotected |
|
private |
|
inlineoverridevirtual |
Get the current value of a specific primitive property
Implements CustomElementPart.
|
inlineoverridevirtual |
Implements CustomElementPart.
void PartDynamicTextField::setAlignment | ( | Qt::Alignment | alignment | ) |
void PartDynamicTextField::setColor | ( | const QColor & | color | ) |
PartDynamicTextField::setColor.
color | set text color to color |
void PartDynamicTextField::setCompositeText | ( | const QString & | text | ) |
PartDynamicTextField::setCompositeText Set the composite text of this text item to text.
text |
void PartDynamicTextField::setFont | ( | const QFont & | font | ) |
void PartDynamicTextField::setFrame | ( | bool | frame | ) |
void PartDynamicTextField::setInfoName | ( | const QString & | info_name | ) |
void PartDynamicTextField::setPlainText | ( | const QString & | text | ) |
|
inlineoverridevirtual |
void PartDynamicTextField::setText | ( | const QString & | text | ) |
PartDynamicTextField::setText Set the text of this text.
text |
void PartDynamicTextField::setTextFrom | ( | DynamicElementTextItem::TextFrom | text_from | ) |
PartDynamicTextField::setTextFrom Set the final text is created from.
text_from |
void PartDynamicTextField::setTextWidth | ( | qreal | width | ) |
|
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.
|
signal |
QString PartDynamicTextField::text | ( | ) | const |
|
signal |
DynamicElementTextItem::TextFrom PartDynamicTextField::textFrom | ( | ) | const |
PartDynamicTextField::textFrom.
|
signal |
|
signal |
|
overridevirtual |
|
inlineoverride |
|
overridevirtual |
Implements CustomElementPart.
|
inlinestatic |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
readwrite |
|
readwrite |
|
readwrite |
|
readwrite |
|
readwrite |
|
readwrite |
|
readwrite |
|
readwrite |
|
readwrite |