QGIS API Documentation 3.99.0-Master (26c88405ac0)
Loading...
Searching...
No Matches
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 "ui_qgslayermetadatasearchwidget.h"
20
21#include "qgis_gui.h"
24#include "qgsfeedback.h"
25
26#include <QWidget>
27
28class QgsMapCanvas;
30class QgsLayerMetadataResultsModel;
31
39class GUI_EXPORT QgsLayerMetadataSearchWidget : public QgsAbstractDataSourceWidget, private Ui::QgsLayerMetadataSearchWidget
40{
41 Q_OBJECT
42 public:
43
47 explicit QgsLayerMetadataSearchWidget( QWidget *parent = nullptr, Qt::WindowFlags fl = Qt::WindowFlags(), QgsProviderRegistry::WidgetMode widgetMode = QgsProviderRegistry::WidgetMode::Standalone );
48
49 void setMapCanvas( QgsMapCanvas *mapCanvas ) override;
50
51 public slots:
52
54 void updateExtentFilter( int index );
55
56 void refresh() override;
57 void addButtonClicked() override;
58 void reset() override;
59
60 private slots:
61 void showHelp();
62
63 private:
64 QgsLayerMetadataResultsProxyModel *mProxyModel = nullptr;
65 bool mIsLoading = false;
66 bool mReloadRequired = true;
67 QgsLayerMetadataResultsModel *mSourceModel = nullptr;
68
69 void refreshInternal();
70
71 // QWidget interface
72 protected:
73 void showEvent( QShowEvent *event ) override;
74};
75
76#endif // QGSLAYERMETADATASEARCHWIDGET_H
virtual QgsMapCanvas * mapCanvas()
Returns the dialog map canvas.
virtual void setMapCanvas(QgsMapCanvas *mapCanvas)
Sets the dialog map canvas.
QgsAbstractDataSourceWidget(QWidget *parent=nullptr, Qt::WindowFlags fl=QgsGuiUtils::ModalDialogFlags, QgsProviderRegistry::WidgetMode widgetMode=QgsProviderRegistry::WidgetMode::Standalone)
Constructor.
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...
QgsProviderRegistry::WidgetMode widgetMode() const
Returns the widget mode.
virtual void reset()
Called when this source select widget is being shown in a "new and clean" dialog.
A proxy model for QgsLayerMetadataResultsModel, handling text and extent filtering.
void updateExtentFilter(int index)
Updates the extent filter based on the combo box current item index.
QgsLayerMetadataSearchWidget(QWidget *parent=nullptr, Qt::WindowFlags fl=Qt::WindowFlags(), QgsProviderRegistry::WidgetMode widgetMode=QgsProviderRegistry::WidgetMode::Standalone)
Creates a new QgsLayerMetadataSearchWidget.
void showEvent(QShowEvent *event) override
Map canvas is a class for displaying all GIS data types on a canvas.
WidgetMode
Different ways a source select dialog can be used.
@ Standalone
Basic mode when the widget is used as a standalone dialog.