LibrePCB Developers Documentation
ComponentSymbolVariantListModel Class Referencefinal

The ComponentSymbolVariantListModel class. More...

#include <componentsymbolvariantlistmodel.h>

Inherits QAbstractTableModel.

+ Collaboration diagram for ComponentSymbolVariantListModel:

Public Types

enum  Column
 

Public Member Functions

 ComponentSymbolVariantListModel ()=delete
 
 ComponentSymbolVariantListModel (const ComponentSymbolVariantListModel &other)=delete
 
 ComponentSymbolVariantListModel (QObject *parent=nullptr) noexcept
 
 ~ComponentSymbolVariantListModel () noexcept
 
void setSymbolVariantList (ComponentSymbolVariantList *list) noexcept
 
void setUndoStack (UndoStack *stack) noexcept
 
void add (const QPersistentModelIndex &itemIndex) noexcept
 
void remove (const QPersistentModelIndex &itemIndex) noexcept
 
void moveUp (const QPersistentModelIndex &itemIndex) noexcept
 
void moveDown (const QPersistentModelIndex &itemIndex) noexcept
 
int rowCount (const QModelIndex &parent=QModelIndex()) const override
 
int columnCount (const QModelIndex &parent=QModelIndex()) const override
 
QVariant data (const QModelIndex &index, int role=Qt::DisplayRole) const override
 
QVariant headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
 
Qt::ItemFlags flags (const QModelIndex &index) const override
 
bool setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
 
ComponentSymbolVariantListModeloperator= (const ComponentSymbolVariantListModel &rhs) noexcept
 

Private Member Functions

void symbolVariantListEdited (const ComponentSymbolVariantList &list, int index, const std::shared_ptr< const ComponentSymbolVariant > &variant, ComponentSymbolVariantList::Event event) noexcept
 
void execCmd (UndoCommand *cmd)
 
ElementName validateNameOrThrow (const QString &name) const
 

Private Attributes

ComponentSymbolVariantListmSymbolVariantList
 
UndoStackmUndoStack
 
QString mNewName
 
QString mNewDescription
 
QString mNewNorm
 
ComponentSymbolVariantList::OnEditedSlot mOnEditedSlot
 

Detailed Description

Member Enumeration Documentation

◆ Column

enum Column
Enumerator
COLUMN_NAME 
COLUMN_DESCRIPTION 
COLUMN_NORM 
COLUMN_SYMBOLCOUNT 
COLUMN_ACTIONS 
_COLUMN_COUNT 

Constructor & Destructor Documentation

◆ ComponentSymbolVariantListModel() [1/3]

◆ ComponentSymbolVariantListModel() [2/3]

◆ ComponentSymbolVariantListModel() [3/3]

ComponentSymbolVariantListModel ( QObject *  parent = nullptr)
explicitnoexcept

◆ ~ComponentSymbolVariantListModel()

Member Function Documentation

◆ setSymbolVariantList()

void setSymbolVariantList ( ComponentSymbolVariantList list)
noexcept

◆ setUndoStack()

void setUndoStack ( UndoStack stack)
noexcept

◆ add()

void add ( const QPersistentModelIndex &  itemIndex)
noexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ remove()

void remove ( const QPersistentModelIndex &  itemIndex)
noexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ moveUp()

void moveUp ( const QPersistentModelIndex &  itemIndex)
noexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ moveDown()

void moveDown ( const QPersistentModelIndex &  itemIndex)
noexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ rowCount()

int rowCount ( const QModelIndex &  parent = QModelIndex()) const
override
+ Here is the call graph for this function:

◆ columnCount()

int columnCount ( const QModelIndex &  parent = QModelIndex()) const
override

◆ data()

QVariant data ( const QModelIndex &  index,
int  role = Qt::DisplayRole 
) const
override
+ Here is the call graph for this function:

◆ headerData()

QVariant headerData ( int  section,
Qt::Orientation  orientation,
int  role = Qt::DisplayRole 
) const
override
+ Here is the call graph for this function:

◆ flags()

Qt::ItemFlags flags ( const QModelIndex &  index) const
override

◆ setData()

bool setData ( const QModelIndex &  index,
const QVariant &  value,
int  role = Qt::EditRole 
)
override
+ Here is the call graph for this function:

◆ operator=()

◆ symbolVariantListEdited()

void symbolVariantListEdited ( const ComponentSymbolVariantList list,
int  index,
const std::shared_ptr< const ComponentSymbolVariant > &  variant,
ComponentSymbolVariantList::Event  event 
)
privatenoexcept

◆ execCmd()

void execCmd ( UndoCommand cmd)
private
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ validateNameOrThrow()

ElementName validateNameOrThrow ( const QString &  name) const
private
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ mSymbolVariantList

ComponentSymbolVariantList* mSymbolVariantList
private

◆ mUndoStack

UndoStack* mUndoStack
private

◆ mNewName

QString mNewName
private

◆ mNewDescription

QString mNewDescription
private

◆ mNewNorm

QString mNewNorm
private

◆ mOnEditedSlot


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