LibrePCB Developers Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PrimitiveTextGraphicsItem Class Reference

The PrimitiveTextGraphicsItem class is the graphical representation of a text. More...

#include <primitivetextgraphicsitem.h>

+ Inheritance diagram for PrimitiveTextGraphicsItem:
+ Collaboration diagram for PrimitiveTextGraphicsItem:

Public Types

enum  Font
 

Public Member Functions

 PrimitiveTextGraphicsItem (const PrimitiveTextGraphicsItem &other)=delete
 
 PrimitiveTextGraphicsItem (QGraphicsItem *parent=nullptr) noexcept
 
virtual ~PrimitiveTextGraphicsItem () noexcept
 
void setPosition (const Point &pos) noexcept
 
void setRotation (const Angle &rot) noexcept
 
void setText (const QString &text) noexcept
 
void setHeight (const PositiveLength &height) noexcept
 
void setAlignment (const Alignment &align) noexcept
 
void setFont (Font font) noexcept
 
void setLayer (const GraphicsLayer *layer) noexcept
 
void layerColorChanged (const GraphicsLayer &layer, const QColor &newColor) noexceptoverride
 
void layerHighlightColorChanged (const GraphicsLayer &layer, const QColor &newColor) noexceptoverride
 
void layerVisibleChanged (const GraphicsLayer &layer, bool newVisible) noexceptoverride
 
void layerEnabledChanged (const GraphicsLayer &layer, bool newEnabled) noexceptoverride
 
void layerDestroyed (const GraphicsLayer &layer) noexceptoverride
 
QRectF boundingRect () const noexceptoverride
 
QPainterPath shape () const noexceptoverride
 
void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0) noexceptoverride
 
PrimitiveTextGraphicsItemoperator= (const PrimitiveTextGraphicsItem &rhs)=delete
 
- Public Member Functions inherited from IF_GraphicsLayerObserver
virtual ~IF_GraphicsLayerObserver ()
 

Private Member Functions

void updateBoundingRectAndShape () noexcept
 

Private Attributes

const GraphicsLayermLayer
 
QString mText
 
Alignment mAlignment
 
QFont mFont
 
QPen mPen
 
QPen mPenHighlighted
 
int mTextFlags
 
QRectF mBoundingRect
 
QPainterPath mShape
 

Detailed Description

The PrimitiveTextGraphicsItem class is the graphical representation of a text.

Todo:
Would QStaticText improve the performance?
Author
ubruhin
Date
2017-05-28

Member Enumeration Documentation

enum Font
strong
Enumerator
SansSerif 
Monospace 

Constructor & Destructor Documentation

PrimitiveTextGraphicsItem ( QGraphicsItem *  parent = nullptr)
explicitnoexcept
~PrimitiveTextGraphicsItem ( )
virtualnoexcept

+ Here is the call graph for this function:

Member Function Documentation

void setPosition ( const Point pos)
noexcept
void setRotation ( const Angle rot)
noexcept
void setText ( const QString &  text)
noexcept
void setHeight ( const PositiveLength height)
noexcept
void setAlignment ( const Alignment align)
noexcept
void setFont ( Font  font)
noexcept
void setLayer ( const GraphicsLayer layer)
noexcept

+ Here is the caller graph for this function:

void layerColorChanged ( const GraphicsLayer layer,
const QColor &  newColor 
)
overridevirtualnoexcept
void layerHighlightColorChanged ( const GraphicsLayer layer,
const QColor &  newColor 
)
overridevirtualnoexcept
void layerVisibleChanged ( const GraphicsLayer layer,
bool  newVisible 
)
overridevirtualnoexcept
void layerEnabledChanged ( const GraphicsLayer layer,
bool  newEnabled 
)
overridevirtualnoexcept
void layerDestroyed ( const GraphicsLayer layer)
overridevirtualnoexcept
QRectF boundingRect ( ) const
inlineoverridenoexcept
QPainterPath shape ( ) const
inlineoverridenoexcept
void paint ( QPainter *  painter,
const QStyleOptionGraphicsItem *  option,
QWidget *  widget = 0 
)
overridenoexcept
PrimitiveTextGraphicsItem& operator= ( const PrimitiveTextGraphicsItem rhs)
delete
void updateBoundingRectAndShape ( )
privatenoexcept

+ Here is the call graph for this function:

Member Data Documentation

const GraphicsLayer* mLayer
private
QString mText
private
Alignment mAlignment
private
QFont mFont
private
QPen mPen
private
QPen mPenHighlighted
private
int mTextFlags
private
QRectF mBoundingRect
private
QPainterPath mShape
private

The documentation for this class was generated from the following files: