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

The AttributeListModel class. More...

#include <attributelistmodel.h>

Inherits QObject, and Model< ui::AttributeData >.

+ Collaboration diagram for AttributeListModel:

Public Member Functions

 AttributeListModel (const AttributeListModel &other)=delete
 
 AttributeListModel (QObject *parent=nullptr) noexcept
 
 ~AttributeListModel () noexcept
 
void setReferences (AttributeList *list, UndoStack *stack) noexcept
 
void apply ()
 
std::size_t row_count () const override
 
std::optional< ui::AttributeData > row_data (std::size_t i) const override
 
void set_row_data (std::size_t i, const ui::AttributeData &data) noexcept override
 
AttributeListModeloperator= (const AttributeListModel &rhs)=delete
 

Private Member Functions

ui::AttributeData createItem (const Attribute &obj) noexcept
 
void trigger (int index, std::shared_ptr< Attribute > obj, ui::AttributeAction a) noexcept
 
void listEdited (const AttributeList &list, int index, const std::shared_ptr< const Attribute > &item, AttributeList::Event event) noexcept
 
void execCmd (UndoCommand *cmd)
 
AttributeKey validateKeyOrThrow (const QString &name) const
 

Static Private Member Functions

static ui::AttributeData createLastItem () noexcept
 

Private Attributes

AttributeListmList
 
QPointer< UndoStackmUndoStack
 
QList< ui::AttributeData > mItems
 
AttributeList::OnEditedSlot mOnEditedSlot
 

Detailed Description

The AttributeListModel class.

Constructor & Destructor Documentation

◆ AttributeListModel() [1/2]

AttributeListModel ( const AttributeListModel other)
delete

◆ AttributeListModel() [2/2]

AttributeListModel ( QObject *  parent = nullptr)
explicitnoexcept

◆ ~AttributeListModel()

~AttributeListModel ( )
noexcept

Member Function Documentation

◆ setReferences()

void setReferences ( AttributeList list,
UndoStack stack 
)
noexcept

◆ apply()

void apply ( )
+ Here is the call graph for this function:

◆ row_count()

std::size_t row_count ( ) const
override

◆ row_data()

std::optional< ui::AttributeData > row_data ( std::size_t  i) const
override

◆ set_row_data()

void set_row_data ( std::size_t  i,
const ui::AttributeData &  data 
)
overridenoexcept
+ Here is the call graph for this function:

◆ operator=()

AttributeListModel & operator= ( const AttributeListModel rhs)
delete

◆ createItem()

ui::AttributeData createItem ( const Attribute obj)
privatenoexcept
+ Here is the call graph for this function:

◆ createLastItem()

ui::AttributeData createLastItem ( )
staticprivatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ trigger()

void trigger ( int  index,
std::shared_ptr< Attribute obj,
ui::AttributeAction  a 
)
privatenoexcept
+ Here is the call graph for this function:

◆ listEdited()

void listEdited ( const AttributeList list,
int  index,
const std::shared_ptr< const Attribute > &  item,
AttributeList::Event  event 
)
privatenoexcept

◆ execCmd()

void execCmd ( UndoCommand cmd)
private
+ Here is the caller graph for this function:

◆ validateKeyOrThrow()

AttributeKey validateKeyOrThrow ( const QString &  name) const
private
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ mList

AttributeList* mList
private

◆ mUndoStack

QPointer<UndoStack> mUndoStack
private

◆ mItems

QList<ui::AttributeData> mItems
private

◆ mOnEditedSlot

AttributeList::OnEditedSlot mOnEditedSlot
private

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