QGIS API Documentation 3.28.0-Firenze (ed3ad0430f)
qgslayermetadataresultsproxymodel.h
Go to the documentation of this file.
1/***************************************************************************
2 qgslayermetadataresultsproxymodel.h - QgsLayerMetadataResultsProxyModel
3
4 ---------------------
5 begin : 1.9.2022
6 copyright : (C) 2022 by Alessandro Pasotti
7 email : elpaso at itopen dot it
8 ***************************************************************************
9 * *
10 * This program is free software; you can redistribute it and/or modify *
11 * it under the terms of the GNU General Public License as published by *
12 * the Free Software Foundation; either version 2 of the License, or *
13 * (at your option) any later version. *
14 * *
15 ***************************************************************************/
16#ifndef QGSLAYERMETADATARESULTSPROXYMODEL_H
17#define QGSLAYERMETADATARESULTSPROXYMODEL_H
18
19#include <QSortFilterProxyModel>
20#include <QObject>
21#include "qgis_gui.h"
22#include "qgsrectangle.h"
23#include "qgswkbtypes.h"
24
31class GUI_EXPORT QgsLayerMetadataResultsProxyModel : public QSortFilterProxyModel
32{
33 Q_OBJECT
34
35 public:
36
40 explicit QgsLayerMetadataResultsProxyModel( QObject *parent = nullptr );
41
45 const QString filterString() const;
46
50 void setFilterGeometryTypeEnabled( bool enabled );
51
55 void setFilterMapLayerTypeEnabled( bool enabled );
56
57 public slots:
58
62 void setFilterExtent( const QgsRectangle &extent );
63
67 void setFilterGeometryType( const QgsWkbTypes::GeometryType geometryType );
68
72 void setFilterString( const QString &filterString );
73
77 void setFilterMapLayerType( const QgsMapLayerType mapLayerType );
78
79 // QSortFilterProxyModel interface
80 protected:
81 bool filterAcceptsRow( int sourceRow, const QModelIndex &sourceParent ) const override;
82
83
84 private:
85
86 QgsRectangle mFilterExtent;
87 QString mFilterString;
88 QgsWkbTypes::GeometryType mFilterGeometryType = QgsWkbTypes::GeometryType::PointGeometry;
90 bool mFilterGeometryTypeEnabled = false;
91 bool mFilterMapLayerTypeEnabled = false;
92};
93
94#endif // QGSLAYERMETADATARESULTSPROXYMODEL_H
The QgsLayerMetadataResultsProxyModel class is a proxy model for QgsLayerMetadataResultsModel,...
A rectangle specified with double values.
Definition: qgsrectangle.h:42
GeometryType
The geometry types are used to group QgsWkbTypes::Type in a coarse way.
Definition: qgswkbtypes.h:141
QgsMapLayerType
Types of layers that can be added to a map.
Definition: qgis.h:47
@ VectorLayer
Vector layer.