20#ifndef LIBREPCB_EDITOR_PRIMITIVETEXTGRAPHICSITEM_H
21#define LIBREPCB_EDITOR_PRIMITIVETEXTGRAPHICSITEM_H
55 enum class Font { SansSerif, Monospace };
66 void setText(const QString& text,
bool parseOverlines = false) noexcept;
75 QPainterPath
shape() const noexcept override;
76 void paint(QPainter* painter, const QStyleOptionGraphicsItem* option,
77 QWidget* widget = 0) noexcept override;
The Alignment class.
Definition: alignment.h:115
The Angle class is used to represent an angle (for example 12.75 degrees)
Definition: angle.h:78
The Point class is used to represent a point/coordinate/vector, for example (1.2mm; 5....
Definition: point.h:79
The GraphicsLayer class represents a graphical layer used in schematics and boards.
Definition: graphicslayer.h:53
The PrimitiveTextGraphicsItem class is the graphical representation of a text.
Definition: primitivetextgraphicsitem.h:52
QString mDisplayText
Definition: primitivetextgraphicsitem.h:91
void setFont(Font font) noexcept
Definition: primitivetextgraphicsitem.cpp:111
QPen mPenHighlighted
Definition: primitivetextgraphicsitem.h:99
void setShapeEnabled(bool enabled) noexcept
Definition: primitivetextgraphicsitem.h:71
QRectF boundingRect() const noexcept override
Definition: primitivetextgraphicsitem.h:74
bool mRotate180
Definition: primitivetextgraphicsitem.h:96
QVector< QLineF > mOverlines
Definition: primitivetextgraphicsitem.h:93
Alignment mAlignment
Definition: primitivetextgraphicsitem.h:95
void setAlignment(const Alignment &align) noexcept
Definition: primitivetextgraphicsitem.cpp:106
void setLayer(const std::shared_ptr< GraphicsLayer > &layer) noexcept
Definition: primitivetextgraphicsitem.cpp:129
QPainterPath mShape
Definition: primitivetextgraphicsitem.h:102
std::shared_ptr< GraphicsLayer > mLayer
Definition: primitivetextgraphicsitem.h:89
QFont mFont
Definition: primitivetextgraphicsitem.h:97
Font
Definition: primitivetextgraphicsitem.h:55
QPainterPath shape() const noexcept override
Definition: primitivetextgraphicsitem.cpp:150
QString mText
Definition: primitivetextgraphicsitem.h:90
bool mParseOverlines
Definition: primitivetextgraphicsitem.h:92
GraphicsLayer::OnEditedSlot mOnLayerEditedSlot
Definition: primitivetextgraphicsitem.h:106
QRectF mBoundingRect
Definition: primitivetextgraphicsitem.h:101
void layerEdited(const GraphicsLayer &layer, GraphicsLayer::Event event) noexcept
Definition: primitivetextgraphicsitem.cpp:173
PositiveLength mHeight
Definition: primitivetextgraphicsitem.h:94
int mTextFlags
Definition: primitivetextgraphicsitem.h:100
QPen mPen
Definition: primitivetextgraphicsitem.h:98
void setRotation(const Angle &rot) noexcept
Definition: primitivetextgraphicsitem.cpp:76
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0) noexcept override
Definition: primitivetextgraphicsitem.cpp:155
void setText(const QString &text, bool parseOverlines=false) noexcept
Definition: primitivetextgraphicsitem.cpp:89
void setHeight(const PositiveLength &height) noexcept
Definition: primitivetextgraphicsitem.cpp:98
bool mShapeEnabled
Definition: primitivetextgraphicsitem.h:103
PrimitiveTextGraphicsItem(const PrimitiveTextGraphicsItem &other)=delete
void setPosition(const Point &pos) noexcept
Definition: primitivetextgraphicsitem.cpp:72
void updateBoundingRectAndShape() noexcept
Definition: primitivetextgraphicsitem.cpp:196
Definition: occmodel.cpp:77
type_safe::constrained_type< Length, PositiveLengthConstraint, PositiveLengthVerifier > PositiveLength
Definition: length.h:812