LibrePCB Developers Documentation
PackagePadListModel Class Referencefinal

The PackagePadListModel class. More...

#include <packagepadlistmodel.h>

Inherits QAbstractTableModel.

+ Collaboration diagram for PackagePadListModel:

Public Types

enum  Column
 

Public Member Functions

 PackagePadListModel ()=delete
 
 PackagePadListModel (const PackagePadListModel &other)=delete
 
 PackagePadListModel (QObject *parent=nullptr) noexcept
 
 ~PackagePadListModel () noexcept
 
void setPadList (PackagePadList *list) noexcept
 
void setUndoStack (UndoStack *stack) noexcept
 
void add (const QPersistentModelIndex &itemIndex) noexcept
 
void remove (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
 
PackagePadListModeloperator= (const PackagePadListModel &rhs) noexcept
 

Private Member Functions

void padListEdited (const PackagePadList &list, int index, const std::shared_ptr< const PackagePad > &pad, PackagePadList::Event event) noexcept
 
void execCmd (UndoCommand *cmd)
 
CircuitIdentifier validateNameOrThrow (const QString &name) const
 
QString getNextPadNameProposal () const noexcept
 

Private Attributes

PackagePadListmPadList
 
UndoStackmUndoStack
 
QString mNewName
 
PackagePadList::OnEditedSlot mOnEditedSlot
 

Detailed Description

Member Enumeration Documentation

◆ Column

enum Column
Enumerator
COLUMN_NAME 
COLUMN_ACTIONS 
_COLUMN_COUNT 

Constructor & Destructor Documentation

◆ PackagePadListModel() [1/3]

PackagePadListModel ( )
delete

◆ PackagePadListModel() [2/3]

PackagePadListModel ( const PackagePadListModel other)
delete

◆ PackagePadListModel() [3/3]

PackagePadListModel ( QObject *  parent = nullptr)
explicitnoexcept

◆ ~PackagePadListModel()

~PackagePadListModel ( )
noexcept

Member Function Documentation

◆ setPadList()

void setPadList ( PackagePadList 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:

◆ 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=()

PackagePadListModel & operator= ( const PackagePadListModel rhs)
noexcept

◆ padListEdited()

void padListEdited ( const PackagePadList list,
int  index,
const std::shared_ptr< const PackagePad > &  pad,
PackagePadList::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()

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

◆ getNextPadNameProposal()

QString getNextPadNameProposal ( ) const
privatenoexcept
+ Here is the call graph for this function:

Member Data Documentation

◆ mPadList

PackagePadList* mPadList
private

◆ mUndoStack

UndoStack* mUndoStack
private

◆ mNewName

QString mNewName
private

◆ mOnEditedSlot

PackagePadList::OnEditedSlot mOnEditedSlot
private

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