LibrePCB Developers Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 noexceptoverride
 
QPainterPath shape () const noexceptoverride
 
void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0) noexceptoverride
 
- 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 noexceptoverride
 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_t
mCachedTextProperties
 

Detailed Description

The SymbolPreviewGraphicsItem class.

Author
ubruhin
Date
2015-04-21

Constructor & Destructor Documentation

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 ( )
privatedelete
SymbolPreviewGraphicsItem ( const SymbolPreviewGraphicsItem other)
privatedelete

Member Function Documentation

void setDrawBoundingRect ( bool  enable)
noexcept

+ Here is the call graph for this function:

void updateCacheAndRepaint ( )
noexcept

+ Here is the call graph for this function:

QRectF boundingRect ( ) const
inlineoverridenoexcept
QPainterPath shape ( ) const
inlineoverridenoexcept
void paint ( QPainter *  painter,
const QStyleOptionGraphicsItem *  option,
QWidget *  widget = 0 
)
overridenoexcept

+ Here is the call graph for this function:

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).

SymbolPreviewGraphicsItem& operator= ( const SymbolPreviewGraphicsItem rhs)
privatedelete
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.

Member Data Documentation

const IF_GraphicsLayerProvider& mLayerProvider
private
const Symbol& mSymbol
private
const Component* mComponent
private
const ComponentSymbolVariantItem* mSymbVarItem
private
QFont mFont
private
bool mDrawBoundingRect
private
QStringList mLocaleOrder
private
QRectF mBoundingRect
private
QPainterPath mShape
private
QHash<const Text*, CachedTextProperties_t> mCachedTextProperties
private

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