|
LibreCAD
|
Model to display a list of layers in a QTableView. More...
#include <layermodel.h>


Public Types | |
| enum | columns { NAME, EDIT, LOCKED, LAST } |
Signals | |
| void | nameChanged (lc::Layer_CSPtr &layer, const std::string &name) |
| Signal when layer name was changed by double clicking. More... | |
Public Member Functions | |
| LayerModel (QObject *parent=0) | |
| Create widget. More... | |
| void | setLayers (std::vector< lc::Layer_CSPtr > layers) |
| Update the list of layers. More... | |
| lc::Layer_CSPtr | layerAt (int row) |
| Get layer at specific row. More... | |
| unsigned int | indexOf (lc::Layer_CSPtr layer) |
| Give the index of the given layer. More... | |
| int | rowCount (const QModelIndex &parent=QModelIndex()) const |
| Get number of layers. More... | |
| int | columnCount (const QModelIndex &parent=QModelIndex()) const |
| QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const |
| Qt::ItemFlags | flags (const QModelIndex &index) const |
| bool | setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) |
Private Attributes | |
| std::vector< lc::Layer_CSPtr > | _layers |
| QIcon | _editIcon |
| QIcon | _lockedIcon |
| QIcon | _unlockedIcon |
Model to display a list of layers in a QTableView.
Definition at line 11 of file layermodel.h.
| enum LayerModel::columns |
| Enumerator | |
|---|---|
| NAME | |
| EDIT | |
| LOCKED | |
| LAST | |
Definition at line 15 of file layermodel.h.
| LayerModel::LayerModel | ( | QObject * | parent = 0 | ) |
Create widget.
| parent | Pointer to parent object |
Definition at line 3 of file layermodel.cpp.
| int LayerModel::columnCount | ( | const QModelIndex & | parent = QModelIndex() | ) | const |
Definition at line 23 of file layermodel.cpp.
| QVariant LayerModel::data | ( | const QModelIndex & | index, |
| int | role = Qt::DisplayRole |
||
| ) | const |
Definition at line 27 of file layermodel.cpp.
| Qt::ItemFlags LayerModel::flags | ( | const QModelIndex & | index | ) | const |
Definition at line 53 of file layermodel.cpp.
| unsigned int LayerModel::indexOf | ( | lc::Layer_CSPtr | layer | ) |
Give the index of the given layer.
| layer |
Definition at line 80 of file layermodel.cpp.
| lc::Layer_CSPtr LayerModel::layerAt | ( | int | row | ) |
Get layer at specific row.
| row | Row in the list |
Definition at line 71 of file layermodel.cpp.
|
signal |
Signal when layer name was changed by double clicking.
| int LayerModel::rowCount | ( | const QModelIndex & | parent = QModelIndex() | ) | const |
| bool LayerModel::setData | ( | const QModelIndex & | index, |
| const QVariant & | value, | ||
| int | role = Qt::EditRole |
||
| ) |
Definition at line 62 of file layermodel.cpp.
| void LayerModel::setLayers | ( | std::vector< lc::Layer_CSPtr > | layers | ) |
Update the list of layers.
| layers | Vector containing new layers |
Definition at line 11 of file layermodel.cpp.
|
private |
Definition at line 67 of file layermodel.h.
|
private |
Definition at line 65 of file layermodel.h.
|
private |
Definition at line 68 of file layermodel.h.
|
private |
Definition at line 69 of file layermodel.h.