QGIS API Documentation 3.41.0-Master (cea29feecf2)
Loading...
Searching...
No Matches
qgsgeopdflayertreemodel.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsgeopdflayertreemodel.h
3 ---------------------
4 begin : August 2019
5 copyright : (C) 2019 by Nyall Dawson
6 email : nyall dot dawson at gmail dot com
7 ***************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
15#ifndef QGSGEOPDFLAYERTREEMODEL_H
16#define QGSGEOPDFLAYERTREEMODEL_H
17
18// We don't want to expose this in the public API
19#define SIP_NO_FILE
20
21#include <QSortFilterProxyModel>
22#include <QItemDelegate>
23
24#include "qgis_gui.h"
25#include "qgsmaplayermodel.h"
26
27class QgsMapCanvas;
28class QgsProject;
29class QgsVectorLayer;
30
31
40{
41 Q_OBJECT
42
43 public:
46 {
47 LayerColumn = 0,
50 IncludeVectorAttributes
51 };
52
54 QgsGeospatialPdfLayerTreeModel( const QList<QgsMapLayer *> &layers, QObject *parent = nullptr );
55
56 int columnCount( const QModelIndex &parent ) const override;
57 QVariant headerData( int section, Qt::Orientation orientation, int role ) const override;
58 Qt::ItemFlags flags( const QModelIndex &idx ) const override;
59 QVariant data( const QModelIndex &index, int role ) const override;
60 bool setData( const QModelIndex &index, const QVariant &value, int role ) override;
61
65 void checkAll( bool checked, const QModelIndex &parent = QModelIndex(), int column = IncludeVectorAttributes );
66
67 private:
68 QgsMapLayer *mapLayer( const QModelIndex &idx ) const;
69 QgsVectorLayer *vectorLayer( const QModelIndex &idx ) const;
70};
71
72
74class GUI_EXPORT QgsGeospatialPdfLayerFilteredTreeModel : public QSortFilterProxyModel
75{
76 Q_OBJECT
77 public:
78 QgsGeospatialPdfLayerFilteredTreeModel( QgsGeospatialPdfLayerTreeModel *sourceModel, QObject *parent = nullptr );
79
80 bool filterAcceptsRow( int source_row, const QModelIndex &source_parent ) const override;
81
82 private:
83 QgsGeospatialPdfLayerTreeModel *mLayerTreeModel = nullptr;
84};
86
87#endif // QGSGEOPDFLAYERTREEMODEL_H
Layer tree model for Geo-PDF layers.
@ InitiallyVisible
Initial visibility state.
Map canvas is a class for displaying all GIS data types on a canvas.
The QgsMapLayerModel class is a model to display layers in widgets.
Qt::ItemFlags flags(const QModelIndex &index) const override
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
int columnCount(const QModelIndex &parent=QModelIndex()) const override
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
void checkAll(Qt::CheckState checkState)
checkAll changes the checkstate for all the layers
Base class for all map layer types.
Definition qgsmaplayer.h:76
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
Definition qgsproject.h:107
Represents a vector layer which manages a vector based data sets.