QGIS API Documentation 3.99.0-Master (2fe06baccd8)
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 "qgis_gui.h"
20#include "qgsrectangle.h"
21
22#include <QObject>
23#include <QSortFilterProxyModel>
24
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:358
@ Point
Points.
Definition qgis.h:359
LayerType
Types of layers that can be added to a map.
Definition qgis.h:190
@ Vector
Vector layer.
Definition qgis.h:191
QgsLayerMetadataResultsProxyModel(QObject *parent=nullptr)
Constructs a QgsLayerMetadataResultsProxyModel with an optional parent.
void setFilterGeometryType(Qgis::GeometryType geometryType)
Sets the geometry type filter to geometryType.
void setFilterString(const QString &filterString)
Sets the text filter to filterString.
void setFilterExtent(const QgsRectangle &extent)
Sets the extent filter to extent.
void setFilterMapLayerTypeEnabled(bool enabled)
Sets the map layer type filter status to enabled.
bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override
void setFilterMapLayerType(const Qgis::LayerType mapLayerType)
Sets the map layer type filter to mapLayerType.
void setFilterGeometryTypeEnabled(bool enabled)
Sets the geometry type filter status to enabled.
const QString filterString() const
Returns the filter string.
A rectangle specified with double values.