QGIS API Documentation 3.34.0-Prizren (ffbdd678812)
|
Abstract base Data Source Widget to create connections and add layers This class provides common functionality and the interface for all source select dialogs used by data providers to configure data sources and add layers. More...
#include <qgsabstractdatasourcewidget.h>
Public Slots | |
virtual void | addButtonClicked () |
Triggered when the add button is clicked, the add layer signal is emitted Concrete classes should implement the right behavior depending on the layer being added. | |
virtual void | refresh () |
Triggered when the provider's connections need to be refreshed The default implementation does nothing. | |
virtual void | reset () |
Called when this source select widget is being shown in a "new and clean" dialog. | |
Signals | |
void | addDatabaseLayers (const QStringList &paths, const QString &providerKey) |
Emitted when a DB layer has been selected for addition. | |
void | addLayer (Qgis::LayerType type, const QString &url, const QString &baseName, const QString &providerKey) |
Emitted when a layer has been selected for addition. | |
Q_DECL_DEPRECATED void | addMeshLayer (const QString &url, const QString &baseName, const QString &providerKey) |
Emitted when a mesh layer has been selected for addition. | |
Q_DECL_DEPRECATED void | addPointCloudLayer (const QString &url, const QString &baseName, const QString &providerKey) |
Emitted when a point cloud layer has been selected for addition. | |
Q_DECL_DEPRECATED void | addRasterLayer (const QString &rasterLayerPath, const QString &baseName, const QString &providerKey) |
Emitted when a raster layer has been selected for addition. | |
void | addRasterLayers (const QStringList &layersList) |
Emitted when one or more GDAL supported layers are selected for addition. | |
Q_DECL_DEPRECATED void | addVectorLayer (const QString &uri, const QString &layerName, const QString &providerKey=QString()) |
Emitted when a vector layer has been selected for addition. | |
void | addVectorLayers (const QStringList &layerList, const QString &encoding, const QString &dataSourceType) |
Emitted when one or more OGR supported layers are selected for addition. | |
Q_DECL_DEPRECATED void | addVectorTileLayer (const QString &url, const QString &baseName) |
Emitted when a vector tile layer has been selected for addition. | |
void | connectionsChanged () |
Emitted when the provider's connections have changed This signal is normally forwarded the app and used to refresh browser items. | |
void | enableButtons (bool enable) |
Emitted when the ok/add buttons should be enabled/disabled. | |
Q_DECL_DEPRECATED void | progress (int, int) |
Emitted when a progress dialog is shown by the provider dialog. | |
void | progressMessage (QString message) |
Emitted when a progress dialog is shown by the provider dialog. | |
void | pushMessage (const QString &title, const QString &message, const Qgis::MessageLevel level=Qgis::MessageLevel::Info) |
Emitted when a message with title and level must be shown to the user using the parent visible message bar. | |
void | replaceVectorLayer (const QString &oldId, const QString &source, const QString &name, const QString &provider) |
Emitted when a layer needs to be replaced. | |
Public Member Functions | |
virtual QgsMapCanvas * | mapCanvas () |
Returns the dialog map canvas. | |
virtual void | setBrowserModel (QgsBrowserModel *model) |
Sets a browser model to use with the widget. | |
virtual void | setMapCanvas (QgsMapCanvas *mapCanvas) |
Sets the dialog map canvas. | |
Protected Member Functions | |
QgsAbstractDataSourceWidget (QWidget *parent=nullptr, Qt::WindowFlags fl=QgsGuiUtils::ModalDialogFlags, QgsProviderRegistry::WidgetMode widgetMode=QgsProviderRegistry::WidgetMode::None) | |
Constructor. | |
QPushButton * | addButton () const |
Returns the add Button. | |
QgsBrowserModel * | browserModel () |
Returns the associated browser model (may be nullptr ). | |
void | setupButtons (QDialogButtonBox *buttonBox) |
Connect the ok and apply/add buttons to the slots. | |
QgsProviderRegistry::WidgetMode | widgetMode () const |
Returns the widget mode. | |
Abstract base Data Source Widget to create connections and add layers This class provides common functionality and the interface for all source select dialogs used by data providers to configure data sources and add layers.
The implementation is generic enough to handle other layer search and selection widgets.
Definition at line 46 of file qgsabstractdatasourcewidget.h.
|
protected |
Constructor.
Definition at line 22 of file qgsabstractdatasourcewidget.cpp.
|
inlineprotected |
Returns the add Button.
Definition at line 222 of file qgsabstractdatasourcewidget.h.
|
virtualslot |
Triggered when the add button is clicked, the add layer signal is emitted Concrete classes should implement the right behavior depending on the layer being added.
Definition at line 61 of file qgsabstractdatasourcewidget.cpp.
|
signal |
Emitted when a DB layer has been selected for addition.
|
signal |
Emitted when a layer has been selected for addition.
This is a generic method, intended for replacing the specific layer type signals implemented above.
|
signal |
Emitted when a mesh layer has been selected for addition.
|
signal |
Emitted when a point cloud layer has been selected for addition.
|
signal |
Emitted when a raster layer has been selected for addition.
|
signal |
Emitted when one or more GDAL supported layers are selected for addition.
layersList | list of layers protocol URIs |
|
signal |
Emitted when a vector layer has been selected for addition.
If providerKey is not specified, the default provider key associated with the source will be used.
|
signal |
Emitted when one or more OGR supported layers are selected for addition.
layerList | list of layers protocol URIs |
encoding | encoding |
dataSourceType | string (can be "file" or "database") |
|
signal |
Emitted when a vector tile layer has been selected for addition.
|
protected |
Returns the associated browser model (may be nullptr
).
Definition at line 33 of file qgsabstractdatasourcewidget.cpp.
|
signal |
Emitted when the provider's connections have changed This signal is normally forwarded the app and used to refresh browser items.
|
signal |
Emitted when the ok/add buttons should be enabled/disabled.
|
inlinevirtual |
Returns the dialog map canvas.
Definition at line 65 of file qgsabstractdatasourcewidget.h.
|
signal |
Emitted when a progress dialog is shown by the provider dialog.
|
signal |
Emitted when a progress dialog is shown by the provider dialog.
|
signal |
Emitted when a message with title and level must be shown to the user using the parent visible message bar.
|
inlinevirtualslot |
Triggered when the provider's connections need to be refreshed The default implementation does nothing.
Reimplemented in QgsOWSSourceSelect.
Definition at line 79 of file qgsabstractdatasourcewidget.h.
|
signal |
Emitted when a layer needs to be replaced.
oldId | old layer ID |
source | URI of the layer |
name | of the layer |
provider | key |
|
virtualslot |
Called when this source select widget is being shown in a "new and clean" dialog.
The data source manager recycles existing source select widgets but will call this method on every reopening. This should clear any selection that has previously been done.
Reimplemented in QgsOWSSourceSelect.
Definition at line 65 of file qgsabstractdatasourcewidget.cpp.
|
virtual |
Sets a browser model to use with the widget.
Definition at line 56 of file qgsabstractdatasourcewidget.cpp.
|
inlinevirtual |
Sets the dialog map canvas.
Reimplemented in QgsLayerMetadataSearchWidget, and QgsOWSSourceSelect.
Definition at line 71 of file qgsabstractdatasourcewidget.h.
|
protected |
Connect the ok and apply/add buttons to the slots.
Definition at line 38 of file qgsabstractdatasourcewidget.cpp.
|
protected |
Returns the widget mode.
Definition at line 28 of file qgsabstractdatasourcewidget.cpp.