20#ifndef LIBREPCB_EDITOR_PACKAGEMODELLISTMODEL_H
21#define LIBREPCB_EDITOR_PACKAGEMODELLISTMODEL_H
70 void add(const QPersistentModelIndex& itemIndex) noexcept;
71 void remove(const QPersistentModelIndex& itemIndex) noexcept;
72 void edit(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;
This class represents absolute, well-formatted paths to files or directories.
Definition filepath.h:127
The Package class represents a package of a component (including footprint and 3D model)
Definition package.h:59
Represents a 3D model of a librepcb::Package.
Definition packagemodel.h:43
The PackageModelListModel class.
Definition packagemodellistmodel.h:52
void edit(const QPersistentModelIndex &itemIndex) noexcept
Definition packagemodellistmodel.cpp:153
Footprint::OnEditedSlot mOnFootprintEditedSlot
Definition packagemodellistmodel.h:111
QPointer< Package > mPackage
Definition packagemodellistmodel.h:103
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
Definition packagemodellistmodel.cpp:291
void setPackage(Package *package) noexcept
Definition packagemodellistmodel.cpp:68
QString mNewName
Definition packagemodellistmodel.h:107
void execCmd(UndoCommand *cmd)
Definition packagemodellistmodel.cpp:438
bool mNewEnabled
Definition packagemodellistmodel.h:106
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Definition packagemodellistmodel.cpp:217
void moveDown(const QPersistentModelIndex &itemIndex) noexcept
Definition packagemodellistmodel.cpp:195
void footprintEdited(const Footprint &obj, Footprint::Event event) noexcept
Definition packagemodellistmodel.cpp:429
Qt::ItemFlags flags(const QModelIndex &index) const override
Definition packagemodellistmodel.cpp:326
PackageModelListModel(const PackageModelListModel &other)=delete
void add(const QPersistentModelIndex &itemIndex) noexcept
Definition packagemodellistmodel.cpp:107
bool chooseStepFile(QByteArray &content, FilePath *selectedFile=nullptr)
Definition packagemodellistmodel.cpp:457
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
Definition packagemodellistmodel.cpp:231
void setUndoStack(UndoStack *stack) noexcept
Definition packagemodellistmodel.cpp:99
void moveUp(const QPersistentModelIndex &itemIndex) noexcept
Definition packagemodellistmodel.cpp:177
void remove(const QPersistentModelIndex &itemIndex) noexcept
Definition packagemodellistmodel.cpp:138
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
Definition packagemodellistmodel.cpp:339
void setFootprint(std::shared_ptr< Footprint > footprint) noexcept
Definition packagemodellistmodel.cpp:84
ElementName validateNameOrThrow(const QString &name) const
Definition packagemodellistmodel.cpp:447
PackageModelListModel()=delete
int columnCount(const QModelIndex &parent=QModelIndex()) const override
Definition packagemodellistmodel.cpp:224
std::shared_ptr< Footprint > mFootprint
Definition packagemodellistmodel.h:104
UndoStack * mUndoStack
Definition packagemodellistmodel.h:105
void newModelAdded(int index)
PackageModelList::OnEditedSlot mOnEditedSlot
Definition packagemodellistmodel.h:110
Column
Definition packagemodellistmodel.h:56
@ _COLUMN_COUNT
Definition packagemodellistmodel.h:56
@ COLUMN_NAME
Definition packagemodellistmodel.h:56
@ COLUMN_ACTIONS
Definition packagemodellistmodel.h:56
@ COLUMN_ENABLED
Definition packagemodellistmodel.h:56
void modelListEdited(const PackageModelList &list, int index, const std::shared_ptr< const PackageModel > &obj, PackageModelList::Event event) noexcept
Definition packagemodellistmodel.cpp:403
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