Class QfFlatLayerTreeModel
ClassList > QfFlatLayerTreeModel
Inherits the following classes: QSortFilterProxyModel
Public Types
| Type | Name |
|---|---|
| enum | Roles |
| enum | Types |
Public Properties
| Type | Name |
|---|---|
| property bool | hasCollapsibleItems |
| property bool | isCollapsed |
| property bool | isFrozen |
| property bool | isTemporal |
| property QString | mapTheme |
Public Signals
| Type | Name |
|---|---|
| signal void | hasCollapsibleItemsChanged |
| signal void | isCollapsedChanged |
| signal void | isFrozenChanged |
| signal void | isTemporalChanged |
| signal void | layersAdded |
| signal void | layersRemoved |
| signal void | mapThemeChanged |
Public Functions
| Type | Name |
|---|---|
| QfFlatLayerTreeModel (QgsLayerTree * layerTree, QgsProject * project, QObject * parent=nullptr) |
|
| Q_INVOKABLE QVariant | data (const QModelIndex & index, int role) override const |
| Q_INVOKABLE void | freeze () Freezes the model as is, with any source model signals ignored. |
| bool | hasCollapsibleItems () const Returns TRUE if the layer tree has at least one collapsible item. |
| bool | isCollapsed () const Returns TRUE if all collapsible items are currently collapsed. |
| bool | isFrozen () const Returns TRUE if the model is frozen. |
| bool | isTemporal () const |
| QgsLayerTree * | layerTree () const |
| QgsLayerTreeModel * | layerTreeModel () const |
| QString | mapTheme () const |
| Q_INVOKABLE QgsRectangle | nodeExtent (const QModelIndex & index, QgsQuickMapSettings * mapSettings, const float buffer=0.02) Calculate layer tree node extent. |
| QgsProject * | project () const |
| Q_INVOKABLE void | setAllCollapsed (bool collapsed) Collapses or expands all collapsible items in the layer tree. |
| Q_INVOKABLE bool | setData (const QModelIndex & index, const QVariant & value, int role) override |
| void | setLayerInTracking (QgsLayerTreeLayer * nodeLayer, bool tracking) Sets the information if the nodeLayer is currently in__tracking state. |
| void | setMapTheme (const QString & mapTheme) |
| Q_INVOKABLE void | unfreeze (bool resetModel=false) Unfreezes the model and resume listening to source model signals. |
| Q_INVOKABLE void | updateCurrentMapTheme () |
Protected Functions
| Type | Name |
|---|---|
| virtual bool | filterAcceptsRow (int source_row, const QModelIndex & source_parent) override const |
Public Types Documentation
enum Roles
enum QfFlatLayerTreeModel::Roles {
VectorLayerPointer = Qt::UserRole + 1,
MapLayerPointer,
HasSpatialExtent,
LegendImage,
Type,
Name,
Visible,
Trackable,
InTracking,
ReadOnly,
FeatureAdditionLocked,
AttributeEditingLocked,
GeometryEditingLocked,
FeatureDeletionLocked,
TreeLevel,
LayerType,
IsValid,
FeatureCount,
IsCollapsed,
IsParentCollapsed,
HasChildren,
CanReloadData,
HasLabels,
LabelsVisible,
Opacity,
FilterExpression,
Credits,
SnappingEnabled,
HasNotes,
Notes,
Checkable
};
enum Types
enum QfFlatLayerTreeModel::Types {
Layer,
Group,
Image,
Legend
};
Public Properties Documentation
property hasCollapsibleItems [1/2]
bool QfFlatLayerTreeModel::hasCollapsibleItems;
property isCollapsed [1/2]
bool QfFlatLayerTreeModel::isCollapsed;
property isFrozen [1/2]
bool QfFlatLayerTreeModel::isFrozen;
property isTemporal [1/2]
bool QfFlatLayerTreeModel::isTemporal;
property mapTheme [1/2]
QString QfFlatLayerTreeModel::mapTheme;
Public Signals Documentation
signal hasCollapsibleItemsChanged
void QfFlatLayerTreeModel::hasCollapsibleItemsChanged;
signal isCollapsedChanged
void QfFlatLayerTreeModel::isCollapsedChanged;
signal isFrozenChanged
void QfFlatLayerTreeModel::isFrozenChanged;
signal isTemporalChanged
void QfFlatLayerTreeModel::isTemporalChanged;
signal layersAdded
void QfFlatLayerTreeModel::layersAdded;
signal layersRemoved
void QfFlatLayerTreeModel::layersRemoved;
signal mapThemeChanged
void QfFlatLayerTreeModel::mapThemeChanged;
Public Functions Documentation
function QfFlatLayerTreeModel
explicit QfFlatLayerTreeModel::QfFlatLayerTreeModel (
QgsLayerTree * layerTree,
QgsProject * project,
QObject * parent=nullptr
)
function data
Q_INVOKABLE QVariant QfFlatLayerTreeModel::data (
const QModelIndex & index,
int role
) override const
function freeze
Freezes the model as is, with any source model signals ignored.
Q_INVOKABLE void QfFlatLayerTreeModel::freeze ()
function hasCollapsibleItems [2/2]
Returns TRUE if the layer tree has at least one collapsible item.
bool QfFlatLayerTreeModel::hasCollapsibleItems () const
function isCollapsed [2/2]
Returns TRUE if all collapsible items are currently collapsed.
bool QfFlatLayerTreeModel::isCollapsed () const
function isFrozen [2/2]
Returns TRUE if the model is frozen.
bool QfFlatLayerTreeModel::isFrozen () const
function isTemporal [2/2]
bool QfFlatLayerTreeModel::isTemporal () const
function layerTree
QgsLayerTree * QfFlatLayerTreeModel::layerTree () const
function layerTreeModel
QgsLayerTreeModel * QfFlatLayerTreeModel::layerTreeModel () const
function mapTheme [2/2]
QString QfFlatLayerTreeModel::mapTheme () const
function nodeExtent
Calculate layer tree node extent.
Q_INVOKABLE QgsRectangle QfFlatLayerTreeModel::nodeExtent (
const QModelIndex & index,
QgsQuickMapSettings * mapSettings,
const float buffer=0.02
)
function project
QgsProject * QfFlatLayerTreeModel::project () const
function setAllCollapsed
Collapses or expands all collapsible items in the layer tree.
Q_INVOKABLE void QfFlatLayerTreeModel::setAllCollapsed (
bool collapsed
)
function setData
Q_INVOKABLE bool QfFlatLayerTreeModel::setData (
const QModelIndex & index,
const QVariant & value,
int role
) override
function setLayerInTracking
Sets the information if the nodeLayer is currently in__tracking state.
void QfFlatLayerTreeModel::setLayerInTracking (
QgsLayerTreeLayer * nodeLayer,
bool tracking
)
function setMapTheme
void QfFlatLayerTreeModel::setMapTheme (
const QString & mapTheme
)
function unfreeze
Unfreezes the model and resume listening to source model signals.
Q_INVOKABLE void QfFlatLayerTreeModel::unfreeze (
bool resetModel=false
)
function updateCurrentMapTheme
Q_INVOKABLE void QfFlatLayerTreeModel::updateCurrentMapTheme ()
Update map theme as currently used by the model This should be triggered after a project has been loaded
Protected Functions Documentation
function filterAcceptsRow
virtual bool QfFlatLayerTreeModel::filterAcceptsRow (
int source_row,
const QModelIndex & source_parent
) override const
The documentation for this class was generated from the following file src/core/qflayertreemodel.h