2#include <NDEVR/QCustomComboBox.h>
3#include <QAbstractItemModel>
38 QModelIndex
index(
int row,
int column,
const QModelIndex&
parent = QModelIndex())
const override;
44 QModelIndex
parent(
const QModelIndex& child)
const override;
80 QVariant
data(
const QModelIndex&
index,
int role = Qt::DisplayRole)
const override;
93 bool setData(
const QModelIndex&
index,
const QVariant& value,
int role = Qt::EditRole)
override;
The equivelent of std::vector but with a bit more control.
A hash-based key-value store, useful for quick associative lookups.
QTModelManager * manager() const
Returns the model manager backing this combo box.
void setManager(QTModelManager *manager)
Sets the model manager used to populate the layer list.
void setSelected(UUID id)
Sets the currently selected layer by UUID.
LayerCombo(QWidget *parent=nullptr)
Constructs a LayerCombo with an optional parent widget.
LayerCombo(QTModelManager *manager, QWidget *parent=nullptr)
Constructs a LayerCombo with a model manager and optional parent widget.
void clearSelected()
Clears the current selection so no layer is selected.
UUID currentSelection() const
Returns the UUID of the currently selected layer.
LayerModel * m_model
The layer data model driving the combo box.
Used for showing Layers in a table using the QAbstractItemModel interface.
QTModelManager * m_manager
The model manager providing layer data.
Buffer< UUID > m_layers
The list of layer UUIDs in this model.
QVector< int > cacheObject(UUID id)
Updates the cached display data for the given layer and returns changed roles.
const Buffer< UUID > & layers() const
Returns the list of layer UUIDs managed by this model.
void layerUpdatedSlot(Buffer< UUID > objects)
Slot called when existing layers are updated.
QModelIndex parent(const QModelIndex &child) const override
Returns the parent index of the given child index.
LayerModel(QTModelManager *manager)
Constructs a LayerModel backed by the given model manager.
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const override
Returns the model index for the given row, column, and parent.
void onClearAllSlot()
Slot called when all layers are cleared from the scene.
bool hasChildren(const QModelIndex &parent=QModelIndex()) const override
Returns whether the given parent has any children.
Dictionary< UUID, LayerCacheObject > m_layer_cache
Cached display data for each layer.
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Returns the number of rows under the given parent.
void layerAddedSlot(Buffer< UUID > layer)
Slot called when new layers are added to the scene.
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
Sets data for the given index and role.
QTModelManager * manager() const
Returns the model manager backing this layer model.
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
Returns the display data for the given index and role.
int columnCount(const QModelIndex &parent=QModelIndex()) const override
Returns the number of columns for the given parent.
QCustomComboBox(QWidget *parent=nullptr)
Constructs a QCustomComboBox with the given parent widget.
A wrapper around DesignObjectLookup that provides signal and slot functionality and adds rendering ca...
Represents a color in the RGB space with optional alpha transparency.
A universally unique identifier (UUID) is a 128-bit number used to identify information in computer s...
The primary namespace for the NDEVR SDK.
Stores cached information for the LayerModel.
bool is_selected
Whether the layer is currently selected.
QIcon icon
The icon representing the layer.
bool is_visible
Whether the layer is currently visible.
QString name
The display name of the layer.
RGBColor color
The color associated with the layer.
QString description
A brief description of the layer.