Used for showing Layers in a table using the QAbstractItemModel interface.
More...
|
| | LayerModel (QTModelManager *manager) |
| | Constructs a LayerModel backed by the given model manager.
|
| QVector< int > | cacheObject (UUID id) |
| | Updates the cached display data for the given layer and returns changed roles.
|
| int | columnCount (const QModelIndex &parent=QModelIndex()) const override |
| | Returns the number of columns for the given parent.
|
| QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const override |
| | Returns the display data for the given index and role.
|
| bool | hasChildren (const QModelIndex &parent=QModelIndex()) const override |
| | Returns whether the given parent has any children.
|
| QModelIndex | index (int row, int column, const QModelIndex &parent=QModelIndex()) const override |
| | Returns the model index for the given row, column, and parent.
|
| const Buffer< UUID > & | layers () const |
| | Returns the list of layer UUIDs managed by this model.
|
| QTModelManager * | manager () const |
| | Returns the model manager backing this layer model.
|
| QModelIndex | parent (const QModelIndex &child) const override |
| | Returns the parent index of the given child index.
|
| int | rowCount (const QModelIndex &parent=QModelIndex()) const override |
| | Returns the number of rows under the given parent.
|
| bool | setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override |
| | Sets data for the given index and role.
|
|
| void | layerAddedSlot (Buffer< UUID > layer) |
| | Slot called when new layers are added to the scene.
|
| void | layerUpdatedSlot (Buffer< UUID > objects) |
| | Slot called when existing layers are updated.
|
|
void | onClearAllSlot () |
| | Slot called when all layers are cleared from the scene.
|
Used for showing Layers in a table using the QAbstractItemModel interface.
Definition at line 22 of file LayerCombo.h.
◆ LayerModel()
Constructs a LayerModel backed by the given model manager.
- Parameters
-
| [in] | manager | The model manager providing layer data. |
References manager().
◆ cacheObject()
| QVector< int > LayerModel::cacheObject |
( |
UUID | id | ) |
|
Updates the cached display data for the given layer and returns changed roles.
- Parameters
-
| [in] | id | The UUID of the layer to re-cache. |
- Returns
- A vector of Qt item data roles that changed.
◆ columnCount()
| int LayerModel::columnCount |
( |
const QModelIndex & | parent = QModelIndex() | ) |
const |
|
override |
Returns the number of columns for the given parent.
- Parameters
-
| [in] | parent | The parent model index. |
- Returns
- The number of columns.
References parent().
◆ data()
| QVariant LayerModel::data |
( |
const QModelIndex & | index, |
|
|
int | role = Qt::DisplayRole ) const |
|
override |
Returns the display data for the given index and role.
- Parameters
-
| [in] | index | The model index to query. |
| [in] | role | The Qt item data role. |
- Returns
- The data as a QVariant.
References index().
◆ hasChildren()
| bool LayerModel::hasChildren |
( |
const QModelIndex & | parent = QModelIndex() | ) |
const |
|
override |
Returns whether the given parent has any children.
- Parameters
-
| [in] | parent | The parent model index. |
- Returns
- True if the parent has child rows.
References parent().
◆ index()
| QModelIndex LayerModel::index |
( |
int | row, |
|
|
int | column, |
|
|
const QModelIndex & | parent = QModelIndex() ) const |
|
override |
Returns the model index for the given row, column, and parent.
- Parameters
-
| [in] | row | The row index. |
| [in] | column | The column index. |
| [in] | parent | The parent model index. |
- Returns
- The QModelIndex for the specified cell.
References parent().
Referenced by data(), and setData().
◆ layerAddedSlot()
| void LayerModel::layerAddedSlot |
( |
Buffer< UUID > | layer | ) |
|
|
protected |
Slot called when new layers are added to the scene.
- Parameters
-
| [in] | layer | The UUIDs of the newly added layers. |
◆ layers()
| const Buffer< UUID > & LayerModel::layers |
( |
| ) |
const |
|
inline |
Returns the list of layer UUIDs managed by this model.
- Returns
- A reference to the buffer of layer UUIDs.
Definition at line 73 of file LayerCombo.h.
References m_layers.
◆ layerUpdatedSlot()
| void LayerModel::layerUpdatedSlot |
( |
Buffer< UUID > | objects | ) |
|
|
protected |
Slot called when existing layers are updated.
- Parameters
-
| [in] | objects | The UUIDs of the updated layers. |
◆ manager()
◆ parent()
| QModelIndex LayerModel::parent |
( |
const QModelIndex & | child | ) |
const |
|
override |
◆ rowCount()
| int LayerModel::rowCount |
( |
const QModelIndex & | parent = QModelIndex() | ) |
const |
|
override |
Returns the number of rows under the given parent.
- Parameters
-
| [in] | parent | The parent model index. |
- Returns
- The number of child rows.
References parent().
◆ setData()
| bool LayerModel::setData |
( |
const QModelIndex & | index, |
|
|
const QVariant & | value, |
|
|
int | role = Qt::EditRole ) |
|
override |
Sets data for the given index and role.
- Parameters
-
| [in] | index | The model index to modify. |
| [in] | value | The new value to set. |
| [in] | role | The Qt item data role. |
- Returns
- True if the data was successfully set.
References index().
The documentation for this class was generated from the following file: