20#ifndef LIBREPCB_EDITOR_ATTRIBUTELISTMODELLEGACY_H
21#define LIBREPCB_EDITOR_ATTRIBUTELISTMODELLEGACY_H
26#include "../modelview/comboboxdelegate.h"
72 void add(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 Attribute class.
Definition attribute.h:46
The AttributeType class.
Definition attributetype.h:42
The AttributeUnit class.
Definition attributeunit.h:40
The AttributeListModelLegacy class.
Definition attributelistmodellegacy.h:48
AttributeListModelLegacy(const AttributeListModelLegacy &other)=delete
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
Definition attributelistmodellegacy.cpp:267
void attributeListEdited(const AttributeList &list, int index, const std::shared_ptr< const Attribute > &attribute, AttributeList::Event event) noexcept
Definition attributelistmodellegacy.cpp:395
void execCmd(UndoCommand *cmd)
Definition attributelistmodellegacy.cpp:421
AttributeListModelLegacy()=delete
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Definition attributelistmodellegacy.cpp:166
void moveDown(const QPersistentModelIndex &itemIndex) noexcept
Definition attributelistmodellegacy.cpp:145
Qt::ItemFlags flags(const QModelIndex &index) const override
Definition attributelistmodellegacy.cpp:299
void setAttributeList(AttributeList *list) noexcept
Definition attributelistmodellegacy.cpp:69
void add(const QPersistentModelIndex &itemIndex) noexcept
Definition attributelistmodellegacy.cpp:93
const AttributeUnit * mNewUnit
Definition attributelistmodellegacy.h:108
QString mNewValue
Definition attributelistmodellegacy.h:107
AttributeKey validateKeyOrThrow(const QString &key) const
Definition attributelistmodellegacy.cpp:430
AttributeList * mAttributeList
Definition attributelistmodellegacy.h:102
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
Definition attributelistmodellegacy.cpp:180
void setUndoStack(UndoStack *stack) noexcept
Definition attributelistmodellegacy.cpp:85
void moveUp(const QPersistentModelIndex &itemIndex) noexcept
Definition attributelistmodellegacy.cpp:128
void remove(const QPersistentModelIndex &itemIndex) noexcept
Definition attributelistmodellegacy.cpp:113
QString mNewKey
Definition attributelistmodellegacy.h:105
AttributeList::OnEditedSlot mOnEditedSlot
Definition attributelistmodellegacy.h:111
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
Definition attributelistmodellegacy.cpp:315
ComboBoxDelegate::Items mTypeComboBoxItems
Definition attributelistmodellegacy.h:104
const AttributeType * mNewType
Definition attributelistmodellegacy.h:106
int columnCount(const QModelIndex &parent=QModelIndex()) const override
Definition attributelistmodellegacy.cpp:173
UndoStack * mUndoStack
Definition attributelistmodellegacy.h:103
static ComboBoxDelegate::Items buildUnitComboBoxData(const AttributeType &type) noexcept
Definition attributelistmodellegacy.cpp:440
Column
Definition attributelistmodellegacy.h:52
@ COLUMN_TYPE
Definition attributelistmodellegacy.h:54
@ COLUMN_VALUE
Definition attributelistmodellegacy.h:55
@ _COLUMN_COUNT
Definition attributelistmodellegacy.h:58
@ COLUMN_KEY
Definition attributelistmodellegacy.h:53
@ COLUMN_UNIT
Definition attributelistmodellegacy.h:56
@ COLUMN_ACTIONS
Definition attributelistmodellegacy.h:57
Subclass of QStyledItemDelegate which uses QComboBox as item editor.
Definition comboboxdelegate.h:42
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
type_safe::constrained_type< QString, AttributeKeyConstraint, AttributeKeyVerifier > AttributeKey
Definition attributekey.h:78