QGIS API Documentation 3.40.0-Bratislava (b56115d8743)
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:
35
39 explicit QgsLayerMetadataResultsProxyModel( QObject *parent = nullptr );
40
44 const QString filterString() const;
45
49 void setFilterGeometryTypeEnabled( bool enabled );
50
54 void setFilterMapLayerTypeEnabled( bool enabled );
55
56 public slots:
57
61 void setFilterExtent( const QgsRectangle &extent );
62
66 void setFilterGeometryType( Qgis::GeometryType geometryType );
67
71 void setFilterString( const QString &filterString );
72
76 void setFilterMapLayerType( const Qgis::LayerType mapLayerType );
77
78 // QSortFilterProxyModel interface
79 protected:
80 bool filterAcceptsRow( int sourceRow, const QModelIndex &sourceParent ) const override;
81
82
83 private:
84
85 QgsRectangle mFilterExtent;
86 QString mFilterString;
88 Qgis::LayerType mFilterMapLayerType = Qgis::LayerType::Vector;
89 bool mFilterGeometryTypeEnabled = false;
90 bool mFilterMapLayerTypeEnabled = false;
91};
92
93#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.