20#ifndef LIBREPCB_EDITOR_PARTLISTMODEL_H
21#define LIBREPCB_EDITOR_PARTLISTMODEL_H
70 void add(const QPersistentModelIndex& itemIndex) noexcept;
71 void copy(const QPersistentModelIndex& itemIndex) noexcept;
72 void remove(const QPersistentModelIndex& itemIndex) noexcept;
73 void moveUp(const QPersistentModelIndex& itemIndex) noexcept;
74 void moveDown(const QPersistentModelIndex& itemIndex) noexcept;
77 int rowCount(const QModelIndex& parent = QModelIndex()) const override;
78 int columnCount(const QModelIndex& parent = QModelIndex()) const override;
79 QVariant
data(const QModelIndex& index,
80 int role = Qt::DisplayRole) const override;
81 QVariant
headerData(
int section, Qt::Orientation orientation,
82 int role = Qt::DisplayRole) const override;
83 Qt::ItemFlags
flags(const QModelIndex& index) const override;
84 bool setData(const QModelIndex& index, const QVariant& value,
85 int role = Qt::EditRole) override;
92 const
std::shared_ptr<const
Part>& part,
The Part class.
Definition part.h:46
The PartListModel class.
Definition partlistmodel.h:46
QString mNewManufacturer
Definition partlistmodel.h:100
PartList * mPartList
Definition partlistmodel.h:97
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
Definition partlistmodel.cpp:248
PartList::OnEditedSlot mOnEditedSlot
Definition partlistmodel.h:103
void execCmd(UndoCommand *cmd)
Definition partlistmodel.cpp:367
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Definition partlistmodel.cpp:170
void moveDown(const QPersistentModelIndex &itemIndex) noexcept
Definition partlistmodel.cpp:151
Qt::ItemFlags flags(const QModelIndex &index) const override
Definition partlistmodel.cpp:277
void add(const QPersistentModelIndex &itemIndex) noexcept
Definition partlistmodel.cpp:87
void partListEdited(const PartList &list, int index, const std::shared_ptr< const Part > &part, PartList::Event event) noexcept
Definition partlistmodel.cpp:332
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
Definition partlistmodel.cpp:184
void copy(const QPersistentModelIndex &itemIndex) noexcept
Definition partlistmodel.cpp:104
void setUndoStack(UndoStack *stack) noexcept
Definition partlistmodel.cpp:79
void moveUp(const QPersistentModelIndex &itemIndex) noexcept
Definition partlistmodel.cpp:136
void remove(const QPersistentModelIndex &itemIndex) noexcept
Definition partlistmodel.cpp:121
void setPartList(PartList *list) noexcept
Definition partlistmodel.cpp:63
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
Definition partlistmodel.cpp:286
void setInitialManufacturer(const SimpleString &value) noexcept
Definition partlistmodel.cpp:59
int columnCount(const QModelIndex &parent=QModelIndex()) const override
Definition partlistmodel.cpp:177
PartListModel(const PartListModel &other)=delete
UndoStack * mUndoStack
Definition partlistmodel.h:98
Column
Definition partlistmodel.h:50
@ _COLUMN_COUNT
Definition partlistmodel.h:55
@ COLUMN_MPN
Definition partlistmodel.h:51
@ COLUMN_ATTRIBUTES
Definition partlistmodel.h:53
@ COLUMN_MANUFACTURER
Definition partlistmodel.h:52
@ COLUMN_ACTIONS
Definition partlistmodel.h:54
QString mNewMpn
Definition partlistmodel.h:99
The UndoCommand class represents a command which you can undo/redo.
Definition undocommand.h:46
The UndoStack class holds UndoCommand objects and provides undo/redo commands.
Definition undostack.h:106
Definition occmodel.cpp:76
type_safe::constrained_type< QString, SimpleStringConstraint, SimpleStringVerifier > SimpleString
Definition simplestring.h:79