LibrePCB Developers Documentation
SymbolPreviewGraphicsItem Class Referencefinal

The SymbolPreviewGraphicsItem class. More...

#include <symbolpreviewgraphicsitem.h>

+ Inheritance diagram for SymbolPreviewGraphicsItem:
+ Collaboration diagram for SymbolPreviewGraphicsItem:

Classes

struct  CachedTextProperties_t
 

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

 SymbolPreviewGraphicsItem (const IF_GraphicsLayerProvider &layerProvider, const QStringList &localeOrder, const Symbol &symbol, const Component *cmp=nullptr, const tl::optional< Uuid > &symbVarUuid=tl::nullopt, const tl::optional< Uuid > &symbVarItemUuid=tl::nullopt) noexcept
 
 ~SymbolPreviewGraphicsItem () 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

 SymbolPreviewGraphicsItem ()=delete
 
 SymbolPreviewGraphicsItem (const SymbolPreviewGraphicsItem &other)=delete
 
SymbolPreviewGraphicsItemoperator= (const SymbolPreviewGraphicsItem &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 SymbolmSymbol
 
const ComponentmComponent
 
const ComponentSymbolVariantItemmSymbVarItem
 
QFont mFont
 
bool mDrawBoundingRect
 
QStringList mLocaleOrder
 
QRectF mBoundingRect
 
QPainterPath mShape
 
QHash< const Text *, CachedTextProperties_tmCachedTextProperties
 

Detailed Description

Constructor & Destructor Documentation

◆ SymbolPreviewGraphicsItem() [1/3]

SymbolPreviewGraphicsItem ( const IF_GraphicsLayerProvider layerProvider,
const QStringList &  localeOrder,
const Symbol symbol,
const Component cmp = nullptr,
const tl::optional< Uuid > &  symbVarUuid = tl::nullopt,
const tl::optional< Uuid > &  symbVarItemUuid = tl::nullopt 
)
explicitnoexcept
+ Here is the call graph for this function:

◆ ~SymbolPreviewGraphicsItem()

◆ SymbolPreviewGraphicsItem() [2/3]

SymbolPreviewGraphicsItem ( )
privatedelete

◆ SymbolPreviewGraphicsItem() [3/3]

SymbolPreviewGraphicsItem ( const SymbolPreviewGraphicsItem other)
privatedelete

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=()

SymbolPreviewGraphicsItem& operator= ( const SymbolPreviewGraphicsItem 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

◆ mSymbol

const Symbol& mSymbol
private

◆ mComponent

const Component* mComponent
private

◆ mSymbVarItem

const ComponentSymbolVariantItem* mSymbVarItem
private

◆ mFont

QFont mFont
private

◆ mDrawBoundingRect

bool mDrawBoundingRect
private

◆ mLocaleOrder

QStringList mLocaleOrder
private

◆ mBoundingRect

QRectF mBoundingRect
private

◆ mShape

QPainterPath mShape
private

◆ mCachedTextProperties

QHash<const Text*, CachedTextProperties_t> mCachedTextProperties
private

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