20#ifndef LIBREPCB_EDITOR_COMPONENTSYMBOLVARIANTLISTMODEL_H
21#define LIBREPCB_EDITOR_COMPONENTSYMBOLVARIANTLISTMODEL_H
71 void add(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;
The ComponentSymbolVariant class represents a symbol variant of a component.
Definition componentsymbolvariant.h:53
The ComponentSymbolVariantListModel class.
Definition componentsymbolvariantlistmodel.h:46
void setSymbolVariantList(ComponentSymbolVariantList *list) noexcept
Definition componentsymbolvariantlistmodel.cpp:60
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
Definition componentsymbolvariantlistmodel.cpp:256
QString mNewName
Definition componentsymbolvariantlistmodel.h:102
void execCmd(UndoCommand *cmd)
Definition componentsymbolvariantlistmodel.cpp:386
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Definition componentsymbolvariantlistmodel.cpp:161
ComponentSymbolVariantListModel(const ComponentSymbolVariantListModel &other)=delete
void moveDown(const QPersistentModelIndex &itemIndex) noexcept
Definition componentsymbolvariantlistmodel.cpp:139
Qt::ItemFlags flags(const QModelIndex &index) const override
Definition componentsymbolvariantlistmodel.cpp:289
void add(const QPersistentModelIndex &itemIndex) noexcept
Definition componentsymbolvariantlistmodel.cpp:85
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
Definition componentsymbolvariantlistmodel.cpp:176
void setUndoStack(UndoStack *stack) noexcept
Definition componentsymbolvariantlistmodel.cpp:77
void moveUp(const QPersistentModelIndex &itemIndex) noexcept
Definition componentsymbolvariantlistmodel.cpp:121
void remove(const QPersistentModelIndex &itemIndex) noexcept
Definition componentsymbolvariantlistmodel.cpp:106
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
Definition componentsymbolvariantlistmodel.cpp:299
ElementName validateNameOrThrow(const QString &name) const
Definition componentsymbolvariantlistmodel.cpp:395
ComponentSymbolVariantList * mSymbolVariantList
Definition componentsymbolvariantlistmodel.h:100
QString mNewNorm
Definition componentsymbolvariantlistmodel.h:104
int columnCount(const QModelIndex &parent=QModelIndex()) const override
Definition componentsymbolvariantlistmodel.cpp:168
ComponentSymbolVariantListModel()=delete
UndoStack * mUndoStack
Definition componentsymbolvariantlistmodel.h:101
QString mNewDescription
Definition componentsymbolvariantlistmodel.h:103
void symbolVariantListEdited(const ComponentSymbolVariantList &list, int index, const std::shared_ptr< const ComponentSymbolVariant > &variant, ComponentSymbolVariantList::Event event) noexcept
Definition componentsymbolvariantlistmodel.cpp:359
Column
Definition componentsymbolvariantlistmodel.h:50
@ _COLUMN_COUNT
Definition componentsymbolvariantlistmodel.h:56
@ COLUMN_NORM
Definition componentsymbolvariantlistmodel.h:53
@ COLUMN_DESCRIPTION
Definition componentsymbolvariantlistmodel.h:52
@ COLUMN_NAME
Definition componentsymbolvariantlistmodel.h:51
@ COLUMN_SYMBOLCOUNT
Definition componentsymbolvariantlistmodel.h:54
@ COLUMN_ACTIONS
Definition componentsymbolvariantlistmodel.h:55
ComponentSymbolVariantList::OnEditedSlot mOnEditedSlot
Definition componentsymbolvariantlistmodel.h:107
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, ElementNameConstraint, ElementNameVerifier > ElementName
Definition elementname.h:84