QGIS API Documentation 3.43.0-Master (c67cf405802)
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
29class GUI_EXPORT QgsLayerMetadataResultsProxyModel : public QSortFilterProxyModel
30{
31 Q_OBJECT
32
33 public:
37 explicit QgsLayerMetadataResultsProxyModel( QObject *parent = nullptr );
38
42 const QString filterString() const;
43
47 void setFilterGeometryTypeEnabled( bool enabled );
48
52 void setFilterMapLayerTypeEnabled( bool enabled );
53
54 public slots:
55
59 void setFilterExtent( const QgsRectangle &extent );
60
64 void setFilterGeometryType( Qgis::GeometryType geometryType );
65
69 void setFilterString( const QString &filterString );
70
74 void setFilterMapLayerType( const Qgis::LayerType mapLayerType );
75
76 // QSortFilterProxyModel interface
77 protected:
78 bool filterAcceptsRow( int sourceRow, const QModelIndex &sourceParent ) const override;
79
80
81 private:
82 QgsRectangle mFilterExtent;
83 QString mFilterString;
85 Qgis::LayerType mFilterMapLayerType = Qgis::LayerType::Vector;
86 bool mFilterGeometryTypeEnabled = false;
87 bool mFilterMapLayerTypeEnabled = false;
88};
89
90#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.
A proxy model for QgsLayerMetadataResultsModel, handling text and extent filtering.
A rectangle specified with double values.