LibrePCB Developers Documentation
GraphicsLayer Class Reference

The GraphicsLayer class represents a graphical layer used in schematics and boards. More...

#include <graphicslayer.h>

+ Collaboration diagram for GraphicsLayer:

Public Types

enum class  Event
 
typedef Slot< GraphicsLayer, EventOnEditedSlot
 

Public Member Functions

 GraphicsLayer ()=delete
 
 GraphicsLayer (const GraphicsLayer &other) noexcept
 
 GraphicsLayer (const QString &name, const QString &nameTr, const QColor &color, const QColor &colorHighlighted, bool visible=true, bool enabled=true) noexcept
 
virtual ~GraphicsLayer () noexcept
 
const QString & getName () const noexcept
 
const QString & getNameTr () const noexcept
 
const QColor & getColor (bool highlighted=false) const noexcept
 
bool getVisible () const noexcept
 
bool isEnabled () const noexcept
 
bool isVisible () const noexcept
 
void setColor (const QColor &color) noexcept
 
void setColorHighlighted (const QColor &color) noexcept
 
void setVisible (bool visible) noexcept
 
void setEnabled (bool enable) noexcept
 
GraphicsLayeroperator= (const GraphicsLayer &rhs)=delete
 

Public Attributes

Signal< GraphicsLayer, EventonEdited
 

Protected Attributes

const QString mName
 Theme color name. More...
 
const QString mNameTr
 Translated layer name as shown in the GUI. More...
 
QColor mColor
 Color of graphics items. More...
 
QColor mColorHighlighted
 Color of highlighted graphics items. More...
 
bool mIsVisible
 Visibility of graphics items on that layer. More...
 
bool mIsEnabled
 Availability of the layer itself. More...
 

Detailed Description

The GraphicsLayer class represents a graphical layer used in schematics and boards.

These layers are used in graphics items (QGraphicsItem) to determine their visibility and colors.

Member Typedef Documentation

◆ OnEditedSlot

Member Enumeration Documentation

◆ Event

enum class Event
strong
Enumerator
ColorChanged 
HighlightColorChanged 
VisibleChanged 
EnabledChanged 

Constructor & Destructor Documentation

◆ GraphicsLayer() [1/3]

GraphicsLayer ( )
delete

◆ GraphicsLayer() [2/3]

GraphicsLayer ( const GraphicsLayer other)
noexcept

◆ GraphicsLayer() [3/3]

GraphicsLayer ( const QString &  name,
const QString &  nameTr,
const QColor &  color,
const QColor &  colorHighlighted,
bool  visible = true,
bool  enabled = true 
)
explicitnoexcept

◆ ~GraphicsLayer()

~GraphicsLayer ( )
virtualnoexcept

Member Function Documentation

◆ getName()

const QString & getName ( ) const
inlinenoexcept

◆ getNameTr()

const QString & getNameTr ( ) const
inlinenoexcept

◆ getColor()

const QColor & getColor ( bool  highlighted = false) const
inlinenoexcept

◆ getVisible()

bool getVisible ( ) const
inlinenoexcept

◆ isEnabled()

bool isEnabled ( ) const
inlinenoexcept

◆ isVisible()

bool isVisible ( ) const
inlinenoexcept

◆ setColor()

void setColor ( const QColor &  color)
noexcept

◆ setColorHighlighted()

void setColorHighlighted ( const QColor &  color)
noexcept

◆ setVisible()

void setVisible ( bool  visible)
noexcept

◆ setEnabled()

void setEnabled ( bool  enable)
noexcept

◆ operator=()

GraphicsLayer & operator= ( const GraphicsLayer rhs)
delete

Member Data Documentation

◆ onEdited

◆ mName

const QString mName
protected

Theme color name.

◆ mNameTr

const QString mNameTr
protected

Translated layer name as shown in the GUI.

◆ mColor

QColor mColor
protected

Color of graphics items.

◆ mColorHighlighted

QColor mColorHighlighted
protected

Color of highlighted graphics items.

◆ mIsVisible

bool mIsVisible
protected

Visibility of graphics items on that layer.

◆ mIsEnabled

bool mIsEnabled
protected

Availability of the layer itself.


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