20#ifndef LIBREPCB_EDITOR_PATHMODEL_H
21#define LIBREPCB_EDITOR_PATHMODEL_H
58 explicit PathModel(QObject* parent =
nullptr) noexcept;
66 void add(
const QPersistentModelIndex& itemIndex)
noexcept;
67 void copy(
const QPersistentModelIndex& itemIndex)
noexcept;
68 void remove(
const QPersistentModelIndex& itemIndex)
noexcept;
69 void moveUp(
const QPersistentModelIndex& itemIndex)
noexcept;
70 void moveDown(
const QPersistentModelIndex& itemIndex)
noexcept;
73 int rowCount(
const QModelIndex& parent = QModelIndex())
const override;
74 int columnCount(
const QModelIndex& parent = QModelIndex())
const override;
75 QVariant
data(
const QModelIndex& index,
76 int role = Qt::DisplayRole)
const override;
77 QVariant
headerData(
int section, Qt::Orientation orientation,
78 int role = Qt::DisplayRole)
const override;
79 Qt::ItemFlags
flags(
const QModelIndex& index)
const override;
80 bool setData(
const QModelIndex& index,
const QVariant& value,
81 int role = Qt::EditRole)
override;
The Path class represents a list of vertices connected by straight lines or circular arc segments.
Definition: path.h:58
The Vertex class.
Definition: vertex.h:44
The PathModel class implements QAbstractTableModel for librepcb::Path.
Definition: pathmodel.h:43
const Path & getPath() const noexcept
Definition: pathmodel.h:63
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
Definition: pathmodel.cpp:188
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Definition: pathmodel.cpp:121
void moveDown(const QPersistentModelIndex &itemIndex) noexcept
Definition: pathmodel.cpp:105
Qt::ItemFlags flags(const QModelIndex &index) const override
Definition: pathmodel.cpp:222
void add(const QPersistentModelIndex &itemIndex) noexcept
Definition: pathmodel.cpp:62
PathModel(const PathModel &other)=delete
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
Definition: pathmodel.cpp:135
void copy(const QPersistentModelIndex &itemIndex) noexcept
Definition: pathmodel.cpp:71
void setPath(const Path &path) noexcept
Definition: pathmodel.cpp:49
void moveUp(const QPersistentModelIndex &itemIndex) noexcept
Definition: pathmodel.cpp:95
void remove(const QPersistentModelIndex &itemIndex) noexcept
Definition: pathmodel.cpp:83
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
Definition: pathmodel.cpp:230
int columnCount(const QModelIndex &parent=QModelIndex()) const override
Definition: pathmodel.cpp:128
PathModel & operator=(const PathModel &rhs) noexcept
Path mPath
Definition: pathmodel.h:90
Vertex mNewVertex
Definition: pathmodel.h:91
Column
Definition: pathmodel.h:47
@ _COLUMN_COUNT
Definition: pathmodel.h:52
@ COLUMN_X
Definition: pathmodel.h:48
@ COLUMN_Y
Definition: pathmodel.h:49
@ COLUMN_ANGLE
Definition: pathmodel.h:50
@ COLUMN_ACTIONS
Definition: pathmodel.h:51
void pathChanged(const Path &path)
Definition: occmodel.cpp:77