LibrePCB Developers Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FootprintListModel Class Referencefinal

The FootprintListModel class. More...

#include <footprintlistmodel.h>

Inherits QAbstractTableModel.

+ Collaboration diagram for FootprintListModel:

Public Types

enum  Column
 

Public Member Functions

 FootprintListModel ()=delete
 
 FootprintListModel (const FootprintListModel &other) noexcept
 
 FootprintListModel (QObject *parent=nullptr) noexcept
 
 ~FootprintListModel () noexcept
 
void setFootprintList (FootprintList *list) noexcept
 
void setUndoStack (UndoStack *stack) noexcept
 
void addFootprint (const QVariant &editData) noexcept
 
void copyFootprint (const QVariant &editData) noexcept
 
void removeFootprint (const QVariant &editData) noexcept
 
void moveFootprintUp (const QVariant &editData) noexcept
 
void moveFootprintDown (const QVariant &editData) 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
 
FootprintListModeloperator= (const FootprintListModel &rhs) noexcept
 

Private Member Functions

void footprintListEdited (const FootprintList &list, int index, const std::shared_ptr< const Footprint > &footprint, FootprintList::Event event) noexcept
 
void execCmd (UndoCommand *cmd)
 
ElementName validateNameOrThrow (const QString &name) const
 

Private Attributes

FootprintListmFootprintList
 
UndoStackmUndoStack
 
QString mNewName
 
FootprintList::OnEditedSlot mOnEditedSlot
 

Detailed Description

The FootprintListModel class.

Member Enumeration Documentation

enum Column
Enumerator
COLUMN_NAME 
COLUMN_ACTIONS 
_COLUMN_COUNT 

Constructor & Destructor Documentation

FootprintListModel ( )
delete
FootprintListModel ( const FootprintListModel other)
noexcept
FootprintListModel ( QObject *  parent = nullptr)
explicitnoexcept
~FootprintListModel ( )
noexcept

Member Function Documentation

void setFootprintList ( FootprintList list)
noexcept
void setUndoStack ( UndoStack stack)
noexcept
void addFootprint ( const QVariant &  editData)
noexcept

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void copyFootprint ( const QVariant &  editData)
noexcept

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void removeFootprint ( const QVariant &  editData)
noexcept

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void moveFootprintUp ( const QVariant &  editData)
noexcept

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void moveFootprintDown ( const QVariant &  editData)
noexcept

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

+ Here is the call graph for this function:

int columnCount ( const QModelIndex &  parent = QModelIndex()) const
override
QVariant data ( const QModelIndex &  index,
int  role = Qt::DisplayRole 
) const
override

+ Here is the call graph for this function:

QVariant headerData ( int  section,
Qt::Orientation  orientation,
int  role = Qt::DisplayRole 
) const
override

+ Here is the call graph for this function:

Qt::ItemFlags flags ( const QModelIndex &  index) const
override
bool setData ( const QModelIndex &  index,
const QVariant &  value,
int  role = Qt::EditRole 
)
override

+ Here is the call graph for this function:

FootprintListModel& operator= ( const FootprintListModel rhs)
noexcept
void footprintListEdited ( const FootprintList list,
int  index,
const std::shared_ptr< const Footprint > &  footprint,
FootprintList::Event  event 
)
privatenoexcept
void execCmd ( UndoCommand cmd)
private

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ElementName validateNameOrThrow ( const QString &  name) const
private

+ Here is the caller graph for this function:

Member Data Documentation

FootprintList* mFootprintList
private
UndoStack* mUndoStack
private
QString mNewName
private
FootprintList::OnEditedSlot mOnEditedSlot
private

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