LibrePCB Developers Documentation
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)=delete
 
 FootprintListModel (QObject *parent=nullptr) noexcept
 
 ~FootprintListModel () noexcept
 
void setPackage (Package *package) noexcept
 
void setUndoStack (UndoStack *stack) noexcept
 
void add (const QPersistentModelIndex &itemIndex) noexcept
 
void copy (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
 
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

QPointer< PackagemPackage
 
UndoStackmUndoStack
 
QString mNewName
 
Point3D mNewModelPosition
 
Angle3D mNewModelRotation
 
FootprintList::OnEditedSlot mOnEditedSlot
 

Detailed Description

The FootprintListModel class.

Member Enumeration Documentation

◆ Column

enum Column
Enumerator
COLUMN_NAME 
COLUMN_MODEL_POSITION_X 
COLUMN_MODEL_POSITION_Y 
COLUMN_MODEL_POSITION_Z 
COLUMN_MODEL_ROTATION_X 
COLUMN_MODEL_ROTATION_Y 
COLUMN_MODEL_ROTATION_Z 
COLUMN_ACTIONS 
_COLUMN_COUNT 

Constructor & Destructor Documentation

◆ FootprintListModel() [1/3]

FootprintListModel ( )
delete

◆ FootprintListModel() [2/3]

FootprintListModel ( const FootprintListModel other)
delete

◆ FootprintListModel() [3/3]

FootprintListModel ( QObject *  parent = nullptr)
explicitnoexcept

◆ ~FootprintListModel()

~FootprintListModel ( )
noexcept

Member Function Documentation

◆ setPackage()

void setPackage ( Package package)
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:

◆ copy()

void copy ( 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

◆ columnCount()

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

◆ data()

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

◆ headerData()

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

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

FootprintListModel& operator= ( const FootprintListModel rhs)
noexcept

◆ footprintListEdited()

void footprintListEdited ( const FootprintList list,
int  index,
const std::shared_ptr< const Footprint > &  footprint,
FootprintList::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 caller graph for this function:

Member Data Documentation

◆ mPackage

QPointer<Package> mPackage
private

◆ mUndoStack

UndoStack* mUndoStack
private

◆ mNewName

QString mNewName
private

◆ mNewModelPosition

Point3D mNewModelPosition
private

◆ mNewModelRotation

Angle3D mNewModelRotation
private

◆ mOnEditedSlot

FootprintList::OnEditedSlot mOnEditedSlot
private

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