LibrePCB Developers Documentation
ComponentSymbolVariantItemListModel Class Referencefinal

The ComponentSymbolVariantItemListModel class. More...

#include <componentsymbolvariantitemlistmodel.h>

Inherits QAbstractTableModel.

+ Collaboration diagram for ComponentSymbolVariantItemListModel:

Public Types

enum  Column
 

Public Member Functions

 ComponentSymbolVariantItemListModel ()=delete
 
 ComponentSymbolVariantItemListModel (const ComponentSymbolVariantItemListModel &other) noexcept
 
 ComponentSymbolVariantItemListModel (QObject *parent=nullptr) noexcept
 
 ~ComponentSymbolVariantItemListModel () noexcept
 
void setItemList (ComponentSymbolVariantItemList *list) noexcept
 
void setSymbolsCache (const std::shared_ptr< const LibraryElementCache > &cache) noexcept
 
void setUndoStack (UndoStack *stack) noexcept
 
void addItem (const QVariant &editData) noexcept
 
void removeItem (const QVariant &editData) noexcept
 
void moveItemUp (const QVariant &editData) noexcept
 
void moveItemDown (const QVariant &editData) noexcept
 
void changeSymbol (const QVariant &editData, const Uuid &symbol) 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
 
ComponentSymbolVariantItemListModeloperator= (const ComponentSymbolVariantItemListModel &rhs) noexcept
 

Private Member Functions

void itemListEdited (const ComponentSymbolVariantItemList &list, int index, const std::shared_ptr< const ComponentSymbolVariantItem > &item, ComponentSymbolVariantItemList::Event event) noexcept
 
void execCmd (UndoCommand *cmd)
 

Private Attributes

ComponentSymbolVariantItemListmItemList
 
std::shared_ptr< const LibraryElementCachemSymbolsCache
 
UndoStackmUndoStack
 
tl::optional< UuidmNewSymbolUuid
 
QString mNewSuffix
 
bool mNewIsRequired
 
Point mNewPosition
 
Angle mNewRotation
 
ComponentSymbolVariantItemList::OnEditedSlot mOnEditedSlot
 

Detailed Description

Member Enumeration Documentation

◆ Column

enum Column
Enumerator
COLUMN_NUMBER 
COLUMN_SYMBOL 
COLUMN_SUFFIX 
COLUMN_ISREQUIRED 
COLUMN_X 
COLUMN_Y 
COLUMN_ROTATION 
COLUMN_ACTIONS 
_COLUMN_COUNT 

Constructor & Destructor Documentation

◆ ComponentSymbolVariantItemListModel() [1/3]

◆ ComponentSymbolVariantItemListModel() [2/3]

◆ ComponentSymbolVariantItemListModel() [3/3]

ComponentSymbolVariantItemListModel ( QObject *  parent = nullptr)
explicitnoexcept
+ Here is the call graph for this function:

◆ ~ComponentSymbolVariantItemListModel()

+ Here is the caller graph for this function:

Member Function Documentation

◆ setItemList()

void setItemList ( ComponentSymbolVariantItemList list)
noexcept
+ Here is the call graph for this function:

◆ setSymbolsCache()

void setSymbolsCache ( const std::shared_ptr< const LibraryElementCache > &  cache)
noexcept
+ Here is the call graph for this function:

◆ setUndoStack()

void setUndoStack ( UndoStack stack)
noexcept

◆ addItem()

void addItem ( const QVariant &  editData)
noexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ removeItem()

void removeItem ( const QVariant &  editData)
noexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ moveItemUp()

void moveItemUp ( const QVariant &  editData)
noexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ moveItemDown()

void moveItemDown ( const QVariant &  editData)
noexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ changeSymbol()

void changeSymbol ( const QVariant &  editData,
const Uuid symbol 
)
noexcept
+ Here is the call graph for this function:

◆ rowCount()

int rowCount ( const QModelIndex &  parent = QModelIndex()) const
override
+ Here is the call graph for this function:
+ Here is the caller 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=()

◆ itemListEdited()

void itemListEdited ( const ComponentSymbolVariantItemList list,
int  index,
const std::shared_ptr< const ComponentSymbolVariantItem > &  item,
ComponentSymbolVariantItemList::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:

Member Data Documentation

◆ mItemList

ComponentSymbolVariantItemList* mItemList
private

◆ mSymbolsCache

std::shared_ptr<const LibraryElementCache> mSymbolsCache
private

◆ mUndoStack

UndoStack* mUndoStack
private

◆ mNewSymbolUuid

tl::optional<Uuid> mNewSymbolUuid
private

◆ mNewSuffix

QString mNewSuffix
private

◆ mNewIsRequired

bool mNewIsRequired
private

◆ mNewPosition

Point mNewPosition
private

◆ mNewRotation

Angle mNewRotation
private

◆ mOnEditedSlot


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