QGIS API Documentation 3.41.0-Master (cea29feecf2)
Loading...
Searching...
No Matches
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
30class GUI_EXPORT QgsLayerMetadataResultsProxyModel : public QSortFilterProxyModel
31{
32 Q_OBJECT
33
34 public:
38 explicit QgsLayerMetadataResultsProxyModel( QObject *parent = nullptr );
39
43 const QString filterString() const;
44
48 void setFilterGeometryTypeEnabled( bool enabled );
49
53 void setFilterMapLayerTypeEnabled( bool enabled );
54
55 public slots:
56
60 void setFilterExtent( const QgsRectangle &extent );
61
65 void setFilterGeometryType( Qgis::GeometryType geometryType );
66
70 void setFilterString( const QString &filterString );
71
75 void setFilterMapLayerType( const Qgis::LayerType mapLayerType );
76
77 // QSortFilterProxyModel interface
78 protected:
79 bool filterAcceptsRow( int sourceRow, const QModelIndex &sourceParent ) const override;
80
81
82 private:
83 QgsRectangle mFilterExtent;
84 QString mFilterString;
86 Qgis::LayerType mFilterMapLayerType = Qgis::LayerType::Vector;
87 bool mFilterGeometryTypeEnabled = false;
88 bool mFilterMapLayerTypeEnabled = false;
89};
90
91#endif // QGSLAYERMETADATARESULTSPROXYMODEL_H
GeometryType
The geometry types are used to group Qgis::WkbType in a coarse way.
Definition qgis.h:337
LayerType
Types of layers that can be added to a map.
Definition qgis.h:169
@ Vector
Vector layer.
The QgsLayerMetadataResultsProxyModel class is a proxy model for QgsLayerMetadataResultsModel,...
A rectangle specified with double values.