LibrePCB Developers Documentation
Loading...
Searching...
No Matches
PackageModelListModel Class Referencefinal

The PackageModelListModel class. More...

#include <packagemodellistmodel.h>

Inherits QAbstractTableModel.

+ Collaboration diagram for PackageModelListModel:

Public Types

enum  Column
 

Signals

void newModelAdded (int index)
 

Public Member Functions

 PackageModelListModel ()=delete
 
 PackageModelListModel (const PackageModelListModel &other)=delete
 
 PackageModelListModel (QObject *parent=nullptr) noexcept
 
 ~PackageModelListModel () noexcept
 
void setPackage (Package *package) noexcept
 
void setFootprint (std::shared_ptr< Footprint > footprint) noexcept
 
void setUndoStack (UndoStack *stack) noexcept
 
void add (const QPersistentModelIndex &itemIndex) noexcept
 
void remove (const QPersistentModelIndex &itemIndex) noexcept
 
void edit (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
 
PackageModelListModeloperator= (const PackageModelListModel &rhs) noexcept
 

Private Member Functions

void modelListEdited (const PackageModelList &list, int index, const std::shared_ptr< const PackageModel > &obj, PackageModelList::Event event) noexcept
 
void footprintEdited (const Footprint &obj, Footprint::Event event) noexcept
 
void execCmd (UndoCommand *cmd)
 
ElementName validateNameOrThrow (const QString &name) const
 
bool chooseStepFile (QByteArray &content, FilePath *selectedFile=nullptr)
 

Private Attributes

QPointer< PackagemPackage
 
std::shared_ptr< FootprintmFootprint
 
UndoStackmUndoStack
 
bool mNewEnabled
 
QString mNewName
 
PackageModelList::OnEditedSlot mOnEditedSlot
 
Footprint::OnEditedSlot mOnFootprintEditedSlot
 

Detailed Description

Member Enumeration Documentation

◆ Column

enum Column
Enumerator
COLUMN_ENABLED 
COLUMN_NAME 
COLUMN_ACTIONS 
_COLUMN_COUNT 

Constructor & Destructor Documentation

◆ PackageModelListModel() [1/3]

◆ PackageModelListModel() [2/3]

PackageModelListModel ( const PackageModelListModel other)
delete

◆ PackageModelListModel() [3/3]

PackageModelListModel ( QObject *  parent = nullptr)
explicitnoexcept

◆ ~PackageModelListModel()

~PackageModelListModel ( )
noexcept

Member Function Documentation

◆ setPackage()

void setPackage ( Package package)
noexcept

◆ setFootprint()

void setFootprint ( std::shared_ptr< Footprint footprint)
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:

◆ edit()

void edit ( 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=()

PackageModelListModel & operator= ( const PackageModelListModel rhs)
noexcept

◆ newModelAdded

void newModelAdded ( int  index)
signal
+ Here is the caller graph for this function:

◆ modelListEdited()

void modelListEdited ( const PackageModelList list,
int  index,
const std::shared_ptr< const PackageModel > &  obj,
PackageModelList::Event  event 
)
privatenoexcept

◆ footprintEdited()

void footprintEdited ( const Footprint obj,
Footprint::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:

◆ chooseStepFile()

bool chooseStepFile ( QByteArray &  content,
FilePath selectedFile = nullptr 
)
private
+ Here is the call graph for this function:

Member Data Documentation

◆ mPackage

QPointer<Package> mPackage
private

◆ mFootprint

std::shared_ptr<Footprint> mFootprint
private

◆ mUndoStack

UndoStack* mUndoStack
private

◆ mNewEnabled

bool mNewEnabled
private

◆ mNewName

QString mNewName
private

◆ mOnEditedSlot

PackageModelList::OnEditedSlot mOnEditedSlot
private

◆ mOnFootprintEditedSlot

Footprint::OnEditedSlot mOnFootprintEditedSlot
private

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