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