16 #ifndef QGSMAPLAYERMODEL_H
17 #define QGSMAPLAYERMODEL_H
19 #include <QAbstractItemModel>
20 #include <QSortFilterProxyModel>
21 #include <QStringList>
45 explicit QgsMapLayerModel( QList<QgsMapLayer*> layers, QObject *parent = 0 );
50 void setItemsCheckable(
bool checkable );
54 void checkAll( Qt::CheckState checkState );
58 QList<QgsMapLayer*> layersChecked( Qt::CheckState checkState = Qt::Checked );
65 QModelIndex indexFromLayer(
QgsMapLayer* layer )
const;
69 void removeLayers(
const QStringList layerIds );
70 void addLayers( QList<QgsMapLayer*> layers );
79 QModelIndex
index(
int row,
int column,
const QModelIndex &parent = QModelIndex() )
const override;
80 QModelIndex parent(
const QModelIndex &child )
const override;
81 int rowCount(
const QModelIndex &parent )
const override;
82 int columnCount(
const QModelIndex &parent )
const override;
83 QVariant data(
const QModelIndex &
index,
int role )
const override;
84 bool setData(
const QModelIndex &
index,
const QVariant &value,
int role )
override;
85 Qt::ItemFlags flags(
const QModelIndex &
index )
const override;
88 #endif // QGSMAPLAYERMODEL_H