QGIS API Documentation 3.29.0-Master (694ebda27c)
qgslayermetadatasearchwidget.h
Go to the documentation of this file.
1/***************************************************************************
2 qgslayermetadatasearchwidget.h - QgsLayerMetadataSearchWidget
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 QGSLAYERMETADATASEARCHWIDGET_H
17#define QGSLAYERMETADATASEARCHWIDGET_H
18
19#include "qgis_gui.h"
20#include <QWidget>
21#include "ui_qgslayermetadatasearchwidget.h"
22#include "qgsfeedback.h"
25
26class QgsMapCanvas;
29
36class GUI_EXPORT QgsLayerMetadataSearchWidget : public QgsAbstractDataSourceWidget, private Ui::QgsLayerMetadataSearchWidget
37{
38 Q_OBJECT
39 public:
40
44 explicit QgsLayerMetadataSearchWidget( QWidget *parent = nullptr, Qt::WindowFlags fl = Qt::WindowFlags(), QgsProviderRegistry::WidgetMode widgetMode = QgsProviderRegistry::WidgetMode::None );
45
46 void setMapCanvas( QgsMapCanvas *mapCanvas ) override;
47
48 public slots:
49
51 void updateExtentFilter( int index );
52
53 void refresh() override;
54 void addButtonClicked() override;
55 void reset() override;
56
57 private:
58
59 QgsLayerMetadataResultsProxyModel *mProxyModel = nullptr;
60 bool mIsLoading = false;
61 QgsLayerMetadataResultsModel *mSourceModel = nullptr;
62 unsigned long int mRowCount = 0;
63
64 // QWidget interface
65 protected:
66 void showEvent( QShowEvent *event ) override;
67};
68
69#endif // QGSLAYERMETADATASEARCHWIDGET_H
Abstract base Data Source Widget to create connections and add layers This class provides common func...
virtual void setMapCanvas(QgsMapCanvas *mapCanvas)
Sets the dialog map canvas.
virtual void addButtonClicked()
Triggered when the add button is clicked, the add layer signal is emitted Concrete classes should imp...
virtual void refresh()
Triggered when the provider's connections need to be refreshed The default implementation does nothin...
virtual void reset()
Called when this source select widget is being shown in a "new and clean" dialog.
The QgsLayerMetadataResultsModel class handles the metadata fetching from the registered layer metada...
The QgsLayerMetadataResultsProxyModel class is a proxy model for QgsLayerMetadataResultsModel,...
The QgsLayerMetadataSearchWidget class offers layer metadata search and filtering.
Map canvas is a class for displaying all GIS data types on a canvas.
Definition: qgsmapcanvas.h:90
WidgetMode
Different ways a source select dialog can be used.