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)=delete
 
 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 add (const QPersistentModelIndex &itemIndex) noexcept
 
void remove (const QPersistentModelIndex &itemIndex) noexcept
 
void moveUp (const QPersistentModelIndex &itemIndex) noexcept
 
void moveDown (const QPersistentModelIndex &itemIndex) noexcept
 
void browse (const QPersistentModelIndex &itemIndex, 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_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

◆ ~ComponentSymbolVariantItemListModel()

Member Function Documentation

◆ setItemList()

void setItemList ( ComponentSymbolVariantItemList list)
noexcept

◆ setSymbolsCache()

void setSymbolsCache ( const std::shared_ptr< const LibraryElementCache > &  cache)
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:

◆ browse()

void browse ( const QPersistentModelIndex &  itemIndex,
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:

◆ 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: