20#ifndef LIBREPCB_EDITOR_COMPONENTSYMBOLVARIANTITEMLISTMODEL_H
21#define LIBREPCB_EDITOR_COMPONENTSYMBOLVARIANTITEMLISTMODEL_H
36class LibraryElementCache;
67 QObject* parent =
nullptr) noexcept;
77 void add(const QPersistentModelIndex& itemIndex) noexcept;
78 void remove(const QPersistentModelIndex& itemIndex) noexcept;
79 void moveUp(const QPersistentModelIndex& itemIndex) noexcept;
80 void moveDown(const QPersistentModelIndex& itemIndex) noexcept;
81 void browse(const QPersistentModelIndex& itemIndex,
82 const
Uuid& symbol) noexcept;
85 int rowCount(const QModelIndex& parent = QModelIndex()) const override;
86 int columnCount(const QModelIndex& parent = QModelIndex()) const override;
87 QVariant
data(const QModelIndex& index,
88 int role = Qt::DisplayRole) const override;
89 QVariant
headerData(
int section, Qt::Orientation orientation,
90 int role = Qt::DisplayRole) const override;
91 Qt::ItemFlags
flags(const QModelIndex& index) const override;
92 bool setData(const QModelIndex& index, const QVariant& value,
93 int role = Qt::EditRole) override;
The Angle class is used to represent an angle (for example 12.75 degrees)
Definition: angle.h:78
The ComponentSymbolVariantItem class represents one symbol of a component symbol variant.
Definition: componentsymbolvariantitem.h:54
The Point class is used to represent a point/coordinate/vector, for example (1.2mm; 5....
Definition: point.h:79
The Uuid class is a replacement for QUuid to get UUID strings without {} braces.
Definition: uuid.h:58
The ComponentSymbolVariantItemListModel class.
Definition: componentsymbolvariantitemlistmodel.h:47
void browse(const QPersistentModelIndex &itemIndex, const Uuid &symbol) noexcept
Definition: componentsymbolvariantitemlistmodel.cpp:179
ComponentSymbolVariantItemListModel()=delete
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
Definition: componentsymbolvariantitemlistmodel.cpp:345
void execCmd(UndoCommand *cmd)
Definition: componentsymbolvariantitemlistmodel.cpp:491
Angle mNewRotation
Definition: componentsymbolvariantitemlistmodel.h:114
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Definition: componentsymbolvariantitemlistmodel.cpp:216
void moveDown(const QPersistentModelIndex &itemIndex) noexcept
Definition: componentsymbolvariantitemlistmodel.cpp:161
Qt::ItemFlags flags(const QModelIndex &index) const override
Definition: componentsymbolvariantitemlistmodel.cpp:382
void setSymbolsCache(const std::shared_ptr< const LibraryElementCache > &cache) noexcept
Definition: componentsymbolvariantitemlistmodel.cpp:80
void add(const QPersistentModelIndex &itemIndex) noexcept
Definition: componentsymbolvariantitemlistmodel.cpp:96
ComponentSymbolVariantItemList * mItemList
Definition: componentsymbolvariantitemlistmodel.h:107
ComponentSymbolVariantItemList::OnEditedSlot mOnEditedSlot
Definition: componentsymbolvariantitemlistmodel.h:117
std::shared_ptr< const LibraryElementCache > mSymbolsCache
Definition: componentsymbolvariantitemlistmodel.h:108
bool mNewIsRequired
Definition: componentsymbolvariantitemlistmodel.h:112
tl::optional< Uuid > mNewSymbolUuid
Definition: componentsymbolvariantitemlistmodel.h:110
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
Definition: componentsymbolvariantitemlistmodel.cpp:232
void setUndoStack(UndoStack *stack) noexcept
Definition: componentsymbolvariantitemlistmodel.cpp:87
void moveUp(const QPersistentModelIndex &itemIndex) noexcept
Definition: componentsymbolvariantitemlistmodel.cpp:143
void remove(const QPersistentModelIndex &itemIndex) noexcept
Definition: componentsymbolvariantitemlistmodel.cpp:128
Point mNewPosition
Definition: componentsymbolvariantitemlistmodel.h:113
QString mNewSuffix
Definition: componentsymbolvariantitemlistmodel.h:111
ComponentSymbolVariantItemListModel(const ComponentSymbolVariantItemListModel &other)=delete
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
Definition: componentsymbolvariantitemlistmodel.cpp:394
int columnCount(const QModelIndex &parent=QModelIndex()) const override
Definition: componentsymbolvariantitemlistmodel.cpp:224
UndoStack * mUndoStack
Definition: componentsymbolvariantitemlistmodel.h:109
Column
Definition: componentsymbolvariantitemlistmodel.h:51
@ _COLUMN_COUNT
Definition: componentsymbolvariantitemlistmodel.h:59
@ COLUMN_ISREQUIRED
Definition: componentsymbolvariantitemlistmodel.h:54
@ COLUMN_SYMBOL
Definition: componentsymbolvariantitemlistmodel.h:52
@ COLUMN_X
Definition: componentsymbolvariantitemlistmodel.h:55
@ COLUMN_Y
Definition: componentsymbolvariantitemlistmodel.h:56
@ COLUMN_ROTATION
Definition: componentsymbolvariantitemlistmodel.h:57
@ COLUMN_ACTIONS
Definition: componentsymbolvariantitemlistmodel.h:58
@ COLUMN_SUFFIX
Definition: componentsymbolvariantitemlistmodel.h:53
void setItemList(ComponentSymbolVariantItemList *list) noexcept
Definition: componentsymbolvariantitemlistmodel.cpp:67
void itemListEdited(const ComponentSymbolVariantItemList &list, int index, const std::shared_ptr< const ComponentSymbolVariantItem > &item, ComponentSymbolVariantItemList::Event event) noexcept
Definition: componentsymbolvariantitemlistmodel.cpp:465
Cache for fast access to library elements.
Definition: libraryelementcache.h:55
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