LibrePCB Developers Documentation
AssemblyVariantListModel Class Referencefinal

The AssemblyVariantListModel class. More...

#include <assemblyvariantlistmodel.h>

Inherits QAbstractTableModel.

+ Collaboration diagram for AssemblyVariantListModel:

Public Types

enum  Column
 

Public Member Functions

 AssemblyVariantListModel ()=delete
 
 AssemblyVariantListModel (const AssemblyVariantListModel &other)=delete
 
 AssemblyVariantListModel (QObject *parent=nullptr) noexcept
 
 ~AssemblyVariantListModel () noexcept
 
void setCircuit (Circuit *circuit) noexcept
 
void setUndoStack (UndoStack *stack) noexcept
 
void setParentWidget (QWidget *widget) 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
 
AssemblyVariantListModeloperator= (const AssemblyVariantListModel &rhs) noexcept
 

Private Member Functions

void listEdited (const AssemblyVariantList &list, int index, const std::shared_ptr< const AssemblyVariant > &obj, AssemblyVariantList::Event event) noexcept
 
void execCmd (UndoCommand *cmd)
 

Private Attributes

QPointer< QWidget > mParentWidget
 
QPointer< CircuitmCircuit
 
UndoStackmUndoStack
 
AssemblyVariantList::OnEditedSlot mOnEditedSlot
 

Detailed Description

Member Enumeration Documentation

◆ Column

enum Column
Enumerator
COLUMN_NAME 
COLUMN_DESCRIPTION 
COLUMN_ACTIONS 
_COLUMN_COUNT 

Constructor & Destructor Documentation

◆ AssemblyVariantListModel() [1/3]

◆ AssemblyVariantListModel() [2/3]

◆ AssemblyVariantListModel() [3/3]

AssemblyVariantListModel ( QObject *  parent = nullptr)
explicitnoexcept

◆ ~AssemblyVariantListModel()

~AssemblyVariantListModel ( )
noexcept

Member Function Documentation

◆ setCircuit()

void setCircuit ( Circuit circuit)
noexcept

◆ setUndoStack()

void setUndoStack ( UndoStack stack)
noexcept

◆ setParentWidget()

void setParentWidget ( QWidget *  widget)
noexcept

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

AssemblyVariantListModel & operator= ( const AssemblyVariantListModel rhs)
noexcept

◆ listEdited()

void listEdited ( const AssemblyVariantList list,
int  index,
const std::shared_ptr< const AssemblyVariant > &  obj,
AssemblyVariantList::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

◆ mParentWidget

QPointer<QWidget> mParentWidget
private

◆ mCircuit

QPointer<Circuit> mCircuit
private

◆ mUndoStack

UndoStack* mUndoStack
private

◆ mOnEditedSlot

AssemblyVariantList::OnEditedSlot mOnEditedSlot
private

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