20#ifndef LIBREPCB_EDITOR_ASSEMBLYVARIANTLISTMODEL_H
21#define LIBREPCB_EDITOR_ASSEMBLYVARIANTLISTMODEL_H
72 void copy(const QPersistentModelIndex& itemIndex) noexcept;
73 void remove(const QPersistentModelIndex& itemIndex) noexcept;
74 void moveUp(const QPersistentModelIndex& itemIndex) noexcept;
75 void moveDown(const QPersistentModelIndex& itemIndex) noexcept;
78 int rowCount(const QModelIndex& parent = QModelIndex()) const override;
79 int columnCount(const QModelIndex& parent = QModelIndex()) const override;
80 QVariant
data(const QModelIndex& index,
81 int role = Qt::DisplayRole) const override;
82 QVariant
headerData(
int section, Qt::Orientation orientation,
83 int role = Qt::DisplayRole) const override;
84 Qt::ItemFlags
flags(const QModelIndex& index) const override;
85 bool setData(const QModelIndex& index, const QVariant& value,
86 int role = Qt::EditRole) override;
The AssemblyVariant class.
Definition: assemblyvariant.h:45
The Circuit class represents all electrical connections in a project (drawn in the schematics)
Definition: circuit.h:70
The AssemblyVariantListModel class.
Definition: assemblyvariantlistmodel.h:49
void listEdited(const AssemblyVariantList &list, int index, const std::shared_ptr< const AssemblyVariant > &obj, AssemblyVariantList::Event event) noexcept
Definition: assemblyvariantlistmodel.cpp:296
QPointer< Circuit > mCircuit
Definition: assemblyvariantlistmodel.h:100
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
Definition: assemblyvariantlistmodel.cpp:219
void execCmd(UndoCommand *cmd)
Definition: assemblyvariantlistmodel.cpp:322
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Definition: assemblyvariantlistmodel.cpp:169
void moveDown(const QPersistentModelIndex &itemIndex) noexcept
Definition: assemblyvariantlistmodel.cpp:148
Qt::ItemFlags flags(const QModelIndex &index) const override
Definition: assemblyvariantlistmodel.cpp:245
QPointer< QWidget > mParentWidget
Definition: assemblyvariantlistmodel.h:99
AssemblyVariantListModel(const AssemblyVariantListModel &other)=delete
void setCircuit(Circuit *circuit) noexcept
Definition: assemblyvariantlistmodel.cpp:61
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
Definition: assemblyvariantlistmodel.cpp:183
void copy(const QPersistentModelIndex &itemIndex) noexcept
Definition: assemblyvariantlistmodel.cpp:89
void setUndoStack(UndoStack *stack) noexcept
Definition: assemblyvariantlistmodel.cpp:77
void moveUp(const QPersistentModelIndex &itemIndex) noexcept
Definition: assemblyvariantlistmodel.cpp:131
void remove(const QPersistentModelIndex &itemIndex) noexcept
Definition: assemblyvariantlistmodel.cpp:114
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
Definition: assemblyvariantlistmodel.cpp:253
int columnCount(const QModelIndex &parent=QModelIndex()) const override
Definition: assemblyvariantlistmodel.cpp:176
AssemblyVariantListModel()=delete
UndoStack * mUndoStack
Definition: assemblyvariantlistmodel.h:101
Column
Definition: assemblyvariantlistmodel.h:53
@ _COLUMN_COUNT
Definition: assemblyvariantlistmodel.h:57
@ COLUMN_DESCRIPTION
Definition: assemblyvariantlistmodel.h:55
@ COLUMN_NAME
Definition: assemblyvariantlistmodel.h:54
@ COLUMN_ACTIONS
Definition: assemblyvariantlistmodel.h:56
void setParentWidget(QWidget *widget) noexcept
Definition: assemblyvariantlistmodel.cpp:81
AssemblyVariantList::OnEditedSlot mOnEditedSlot
Definition: assemblyvariantlistmodel.h:104
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:77