Avogadro::QtGui::LayerModel#
-
class LayerModel : public QAbstractItemModel, public RWLayerManager#
UI for the layer dock.
Public Types
Public Functions
-
explicit LayerModel(QObject *p = nullptr)#
-
void loadIcons(bool darkMode)#
-
QModelIndex parent(const QModelIndex &child) const override#
-
int rowCount(const QModelIndex &parent) const override#
-
int columnCount(const QModelIndex &parent) const override#
-
Qt::ItemFlags flags(const QModelIndex &index) const override#
-
bool setData(const QModelIndex &index, const QVariant &value, int role) override#
-
QVariant data(const QModelIndex &index, int role) const override#
-
QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override#
-
void addItem()#
-
void addLayer(RWMolecule *rwmolecule)#
-
void setActiveLayer(int index, RWMolecule *rwmolecule)#
-
void removeItem(int row, RWMolecule *rwmolecule)#
-
size_t items() const#
-
void flipVisible(size_t row)#
-
void flipLocked(size_t row)#
-
size_t layerCount() const#
-
size_t layerForRow(int row) const#
Translate a Layers dock row — as this model lays them out: one header row per layer, followed by a row for each scene plugin enabled only in that layer, so a row and its layer id can diverge — to the layer id it belongs to.
- Returns:
the layer id, or MaxIndex if
rowdoes not name a layer (negative, the synthetic “+” row, or past it).
-
bool layerVisible(size_t layer) const#
- Returns:
whether
layeris visible. Out-of-range is harmless: it reads back the same default a fresh layer starts with.
-
bool layerLocked(size_t layer) const#
- Returns:
whether
layeris locked. Out-of-range is harmless: it reads back the same default a fresh layer starts with.
-
void setLayerVisible(size_t layer, bool visible)#
Show or hide
layer. A no-op if it already matchesvisible, or iflayeris out of range.
-
void setLayerLocked(size_t layer, bool locked)#
Lock or unlock
layeragainst edits. A no-op if it already matcheslocked, or iflayeris out of range.
-
void setActiveLayerId(size_t layer, RWMolecule *rwmolecule)#
Make
layerthe active layer. A no-op iflayeris out of range.
-
void removeLayerId(size_t layer, RWMolecule *rwmolecule)#
Remove
layer. A no-op iflayeris out of range.
Public Slots
-
void updateRows()#
-
explicit LayerModel(QObject *p = nullptr)#