3 #include <QAbstractTableModel>
6 #include <cad/meta/layer.h>
32 void setLayers(std::vector<lc::Layer_CSPtr> layers);
39 lc::Layer_CSPtr
layerAt(
int row);
46 unsigned int indexOf(lc::Layer_CSPtr layer);
52 int rowCount(
const QModelIndex& parent = QModelIndex())
const;
53 int columnCount(
const QModelIndex& parent = QModelIndex())
const;
54 QVariant
data(
const QModelIndex& index,
int role = Qt::DisplayRole)
const;
55 Qt::ItemFlags
flags(
const QModelIndex &index)
const;
56 bool setData(
const QModelIndex& index,
const QVariant& value,
int role = Qt::EditRole);
62 void nameChanged(lc::Layer_CSPtr& layer,
const std::string& name);
lc::Layer_CSPtr layerAt(int row)
Get layer at specific row.
Qt::ItemFlags flags(const QModelIndex &index) const
void nameChanged(lc::Layer_CSPtr &layer, const std::string &name)
Signal when layer name was changed by double clicking.
LayerModel(QObject *parent=0)
Create widget.
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const
unsigned int indexOf(lc::Layer_CSPtr layer)
Give the index of the given layer.
std::vector< lc::Layer_CSPtr > _layers
Model to display a list of layers in a QTableView.
int columnCount(const QModelIndex &parent=QModelIndex()) const
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole)
void setLayers(std::vector< lc::Layer_CSPtr > layers)
Update the list of layers.
int rowCount(const QModelIndex &parent=QModelIndex()) const
Get number of layers.