20 #ifndef LIBREPCB_ATTRIBUTELISTMODEL_H 21 #define LIBREPCB_ATTRIBUTELISTMODEL_H 26 #include "../model/comboboxdelegate.h" 75 int rowCount(const QModelIndex& parent = QModelIndex()) const override;
76 int columnCount(const QModelIndex& parent = QModelIndex()) const override;
77 QVariant
data(const QModelIndex& index,
78 int role = Qt::DisplayRole) const override;
79 QVariant
headerData(
int section, Qt::Orientation orientation,
80 int role = Qt::DisplayRole) const override;
81 Qt::ItemFlags
flags(const QModelIndex& index) const override;
82 bool setData(const QModelIndex& index, const QVariant& value,
83 int role = Qt::EditRole) override;
90 const std::shared_ptr<const
Attribute>& attribute,
116 #endif // LIBREPCB_ATTRIBUTELISTMODEL_H AttributeList::OnEditedSlot mOnEditedSlot
Definition: attributelistmodel.h:107
void addAttribute(const QVariant &editData) noexcept
Definition: attributelistmodel.cpp:92
const AttributeUnit * mNewUnit
Definition: attributelistmodel.h:104
Definition: attributelistmodel.h:50
void execCmd(UndoCommand *cmd)
Definition: attributelistmodel.cpp:423
Definition: attributelistmodel.h:55
Subclass of QStyledItemDelegate which uses QComboBox as item editor.
Definition: comboboxdelegate.h:43
Definition: airwiresbuilder.cpp:32
type_safe::constrained_type< QString, AttributeKeyConstraint, AttributeKeyVerifier > AttributeKey
Definition: attributekey.h:83
void setAttributeList(AttributeList *list) noexcept
Definition: attributelistmodel.cpp:68
The UndoStack class holds UndoCommand objects and provides undo/redo commands.
Definition: undostack.h:107
QString mNewValue
Definition: attributelistmodel.h:103
Definition: attributelistmodel.h:54
UndoStack * mUndoStack
Definition: attributelistmodel.h:99
The AttributeUnit class.
Definition: attributeunit.h:42
AttributeKey validateKeyOrThrow(const QString &key) const
Definition: attributelistmodel.cpp:432
void moveAttributeUp(const QVariant &editData) noexcept
Definition: attributelistmodel.cpp:125
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
Definition: attributelistmodel.cpp:318
Column
Definition: attributelistmodel.h:49
QString mNewKey
Definition: attributelistmodel.h:101
The AttributeListModel class.
Definition: attributelistmodel.h:45
Definition: attributelistmodel.h:51
AttributeListModel()=delete
ComboBoxDelegate::Items mTypeComboBoxItems
Definition: attributelistmodel.h:100
The Attribute class.
Definition: attribute.h:49
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
Definition: attributelistmodel.cpp:261
The UndoCommand class represents a command which you can undo/redo.
Definition: undocommand.h:47
Definition: attributelistmodel.h:52
Definition: attributelistmodel.h:53
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Definition: attributelistmodel.cpp:161
static ComboBoxDelegate::Items buildUnitComboBoxData(const AttributeType &type) noexcept
Definition: attributelistmodel.cpp:441
void removeAttribute(const QVariant &editData) noexcept
Definition: attributelistmodel.cpp:111
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
Definition: attributelistmodel.cpp:175
void setUndoStack(UndoStack *stack) noexcept
Definition: attributelistmodel.cpp:84
void moveAttributeDown(const QVariant &editData) noexcept
Definition: attributelistmodel.cpp:141
int columnCount(const QModelIndex &parent=QModelIndex()) const override
Definition: attributelistmodel.cpp:168
Qt::ItemFlags flags(const QModelIndex &index) const override
Definition: attributelistmodel.cpp:302
const AttributeType * mNewType
Definition: attributelistmodel.h:102
AttributeList * mAttributeList
Definition: attributelistmodel.h:98
The AttributeType class.
Definition: attributetype.h:44
void attributeListEdited(const AttributeList &list, int index, const std::shared_ptr< const Attribute > &attribute, AttributeList::Event event) noexcept
Definition: attributelistmodel.cpp:398