LibrePCB Developers Documentation
FootprintPreviewGraphicsItem Class Referencefinal

The FootprintPreviewGraphicsItem class. More...

#include <footprintpreviewgraphicsitem.h>

+ Inheritance diagram for FootprintPreviewGraphicsItem:
+ Collaboration diagram for FootprintPreviewGraphicsItem:

Signals

void attributesChanged () override
 This signal is emited when the value of attributes has changed. More...
 
- Signals inherited from AttributeProvider
virtual void attributesChanged ()=0
 This signal is emited when the value of attributes has changed. More...
 

Public Member Functions

 FootprintPreviewGraphicsItem (const IF_GraphicsLayerProvider &layerProvider, const QStringList &localeOrder, const Footprint &footprint, const Package *package=nullptr, const Component *component=nullptr, const AttributeProvider *attrProvider=nullptr) noexcept
 
 ~FootprintPreviewGraphicsItem () noexcept
 
void setDrawBoundingRect (bool enable) noexcept
 
void updateCacheAndRepaint () noexcept
 
QRectF boundingRect () const noexcept override
 
QPainterPath shape () const noexcept override
 
void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0) noexcept override
 
- Public Member Functions inherited from AttributeProvider
 AttributeProvider () noexcept
 
 AttributeProvider (const AttributeProvider &other)=delete
 
AttributeProvideroperator= (const AttributeProvider &rhs)=delete
 
virtual ~AttributeProvider () noexcept
 
QString getAttributeValue (const QString &key) const noexcept
 Get the value of an attribute which can be used in texts (like "{{NAME}}") More...
 
virtual QString getUserDefinedAttributeValue (const QString &key) const noexcept
 Get the value of a user defined attribute (if available) More...
 
virtual QVector< const AttributeProvider * > getAttributeProviderParents () const noexcept
 Get all parent attribute providers (fallback if attribute not found) More...
 

Private Member Functions

 FootprintPreviewGraphicsItem ()=delete
 
 FootprintPreviewGraphicsItem (const FootprintPreviewGraphicsItem &other)=delete
 
FootprintPreviewGraphicsItemoperator= (const FootprintPreviewGraphicsItem &rhs)=delete
 
QString getBuiltInAttributeValue (const QString &key) const noexcept override
 Get the value of a built-in attribute (if available) More...
 

Private Attributes

const IF_GraphicsLayerProvidermLayerProvider
 
const FootprintmFootprint
 
const PackagemPackage
 
const ComponentmComponent
 
const AttributeProvidermAttributeProvider
 
bool mDrawBoundingRect
 
QStringList mLocaleOrder
 
StrokeTextList mStrokeTexts
 
QRectF mBoundingRect
 
QPainterPath mShape
 

Detailed Description

Constructor & Destructor Documentation

◆ FootprintPreviewGraphicsItem() [1/3]

FootprintPreviewGraphicsItem ( const IF_GraphicsLayerProvider layerProvider,
const QStringList &  localeOrder,
const Footprint footprint,
const Package package = nullptr,
const Component component = nullptr,
const AttributeProvider attrProvider = nullptr 
)
explicitnoexcept

◆ ~FootprintPreviewGraphicsItem()

◆ FootprintPreviewGraphicsItem() [2/3]

FootprintPreviewGraphicsItem ( )
privatedelete

◆ FootprintPreviewGraphicsItem() [3/3]

Member Function Documentation

◆ setDrawBoundingRect()

void setDrawBoundingRect ( bool  enable)
noexcept
+ Here is the call graph for this function:

◆ updateCacheAndRepaint()

void updateCacheAndRepaint ( )
noexcept
+ Here is the call graph for this function:

◆ boundingRect()

QRectF boundingRect ( ) const
inlineoverridenoexcept

◆ shape()

QPainterPath shape ( ) const
inlineoverridenoexcept
+ Here is the call graph for this function:

◆ paint()

void paint ( QPainter *  painter,
const QStyleOptionGraphicsItem *  option,
QWidget *  widget = 0 
)
overridenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ attributesChanged

void attributesChanged ( )
inlineoverridesignal

This signal is emited when the value of attributes has changed.

All derived classes must emit this signal when some attributes have changed their values (only attributes which can be fetched with getAttributeValue(), inclusive all attributes from all "parent" classes).

◆ operator=()

FootprintPreviewGraphicsItem& operator= ( const FootprintPreviewGraphicsItem rhs)
privatedelete

◆ getBuiltInAttributeValue()

QString getBuiltInAttributeValue ( const QString &  key) const
overrideprivatevirtualnoexcept

Get the value of a built-in attribute (if available)

Parameters
keyThe attribute name (e.g. "NAME" for "{{NAME}}")
Returns
The value of the attribute (empty string if not found)

Reimplemented from AttributeProvider.

+ Here is the call graph for this function:

Member Data Documentation

◆ mLayerProvider

const IF_GraphicsLayerProvider& mLayerProvider
private

◆ mFootprint

const Footprint& mFootprint
private

◆ mPackage

const Package* mPackage
private

◆ mComponent

const Component* mComponent
private

◆ mAttributeProvider

const AttributeProvider* mAttributeProvider
private

◆ mDrawBoundingRect

bool mDrawBoundingRect
private

◆ mLocaleOrder

QStringList mLocaleOrder
private

◆ mStrokeTexts

StrokeTextList mStrokeTexts
private

◆ mBoundingRect

QRectF mBoundingRect
private

◆ mShape

QPainterPath mShape
private

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