18#ifndef QGSELEVATIONPROFILELAYERTREEVIEW_H
19#define QGSELEVATIONPROFILELAYERTREEVIEW_H
27#include <QSortFilterProxyModel>
58 QVariant
data(
const QModelIndex &
index,
int role = Qt::DisplayRole )
const override;
59 bool setData(
const QModelIndex &
index,
const QVariant &value,
int role = Qt::EditRole )
override;
60 Qt::ItemFlags
flags(
const QModelIndex &
index )
const override;
61 bool canDropMimeData(
const QMimeData *
data, Qt::DropAction action,
int row,
int column,
const QModelIndex &
parent )
const override;
62 bool dropMimeData(
const QMimeData *
data, Qt::DropAction action,
int row,
int column,
const QModelIndex &
parent )
override;
63 QMimeData *
mimeData(
const QModelIndexList &indexes )
const override;
72 void addLayers(
const QList<QgsMapLayer *> &layers );
99 bool filterAcceptsRow(
int sourceRow,
const QModelIndex &sourceParent )
const override;
A layer tree model subclass for elevation profiles.
void addLayers(const QList< QgsMapLayer * > &layers)
Emitted when layers should be added to the profile, e.g.
QgsElevationProfileLayerTreeModel(QgsLayerTree *rootNode, QObject *parent=nullptr)
Construct a new tree model with given layer tree (root node must not be nullptr).
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
bool canDropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) const override
A proxy model for elevation profiles.
bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override
QgsElevationProfileLayerTreeProxyModel(QgsElevationProfileLayerTreeModel *model, QObject *parent=nullptr)
Constructor for QgsElevationProfileLayerTreeProxyModel.
void populateInitialSources(QgsProject *project)
Initially populates the tree view using layers from a project, as well as sources from the source reg...
QgsElevationProfileLayerTreeProxyModel * proxyModel()
Returns the view's proxy model.
QgsElevationProfileLayerTreeView(QgsLayerTree *rootNode, QWidget *parent=nullptr)
Construct a new tree view with given layer tree (root node must not be nullptr).
void removeNodeForUnregisteredSource(const QString &sourceId)
Removes a custom node from the layer tree corresponding to an unregistered profile source.
void addNodeForRegisteredSource(const QString &sourceId, const QString &sourceName)
Adds a custom node in the layer tree corresponding to a registered profile source.
void populateMissingLayers(QgsProject *project)
Adds any layers from a project which currently aren't within the profile's layer tree.
void resizeEvent(QResizeEvent *event) override
void addLayers(const QList< QgsMapLayer * > &layers)
Emitted when layers should be added to the profile, e.g.
static const QString CUSTOM_NODE_ELEVATION_PROFILE_SOURCE
Flags flags() const
Returns OR-ed combination of model flags.
bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) override
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
QgsLayerTreeModel(QgsLayerTree *rootNode, QObject *parent=nullptr)
Construct a new tree model with given layer tree (root node must not be nullptr).
QModelIndex parent(const QModelIndex &child) const override
QMimeData * mimeData(const QModelIndexList &indexes) const override
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const override
QgsLayerTreeViewBase(QWidget *parent=nullptr)
Constructor for QgsLayerTreeViewBase.
Namespace with helper functions for layer tree operations.
Base class for all map layer types.
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...