LibrePCB Developers Documentation
PartListModel Class Referencefinal

The PartListModel class. More...

#include <partlistmodel.h>

Inherits QAbstractTableModel.

+ Collaboration diagram for PartListModel:

Public Types

enum  Column
 

Public Member Functions

 PartListModel ()=delete
 
 PartListModel (const PartListModel &other)=delete
 
 PartListModel (QObject *parent=nullptr) noexcept
 
 ~PartListModel () noexcept
 
void setInitialManufacturer (const SimpleString &value) noexcept
 
void setPartList (PartList *list) 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
 
PartListModeloperator= (const PartListModel &rhs) noexcept
 

Private Member Functions

void partListEdited (const PartList &list, int index, const std::shared_ptr< const Part > &part, PartList::Event event) noexcept
 
void execCmd (UndoCommand *cmd)
 

Private Attributes

PartListmPartList
 
UndoStackmUndoStack
 
QString mNewMpn
 
QString mNewManufacturer
 
PartList::OnEditedSlot mOnEditedSlot
 

Detailed Description

The PartListModel class.

Member Enumeration Documentation

◆ Column

enum Column
Enumerator
COLUMN_MPN 
COLUMN_MANUFACTURER 
COLUMN_ATTRIBUTES 
COLUMN_ACTIONS 
_COLUMN_COUNT 

Constructor & Destructor Documentation

◆ PartListModel() [1/3]

PartListModel ( )
delete

◆ PartListModel() [2/3]

PartListModel ( const PartListModel other)
delete

◆ PartListModel() [3/3]

PartListModel ( QObject *  parent = nullptr)
explicitnoexcept

◆ ~PartListModel()

~PartListModel ( )
noexcept

Member Function Documentation

◆ setInitialManufacturer()

void setInitialManufacturer ( const SimpleString value)
noexcept

◆ setPartList()

void setPartList ( PartList 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:

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

PartListModel & operator= ( const PartListModel rhs)
noexcept

◆ partListEdited()

void partListEdited ( const PartList list,
int  index,
const std::shared_ptr< const Part > &  part,
PartList::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

◆ mPartList

PartList* mPartList
private

◆ mUndoStack

UndoStack* mUndoStack
private

◆ mNewMpn

QString mNewMpn
private

◆ mNewManufacturer

QString mNewManufacturer
private

◆ mOnEditedSlot

PartList::OnEditedSlot mOnEditedSlot
private

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