QGIS API Documentation 3.34.0-Prizren (ffbdd678812)
|
The QgsDataSourceSelectDialog class embeds the browser view to select an existing data source. More...
#include <qgsdatasourceselectdialog.h>
Public Member Functions | |
QgsDataSourceSelectDialog (QgsBrowserGuiModel *browserModel=nullptr, bool setFilterByLayerType=false, Qgis::LayerType layerType=Qgis::LayerType::Vector, QWidget *parent=nullptr) | |
Constructs a QgsDataSourceSelectDialog, optionally filtering by layer type. | |
void | expandPath (const QString &path) |
Expands out a file path in the view. | |
void | setCaseSensitive (bool caseSensitive) |
Sets filter case sensitivity. | |
void | setDescription (const QString &description) |
Sets a description label. | |
void | setFilter () |
Apply filter to the model. | |
void | setFilterSyntax (QAction *) |
Sets filter syntax. | |
void | setLayerTypeFilter (Qgis::LayerType layerType) |
Sets layer type filter to layerType and activates the filtering. | |
void | showFilterWidget (bool visible) |
Show/hide filter widget. | |
QgsMimeDataUtils::Uri | uri () const |
Returns the (possibly invalid) uri of the selected data source. | |
The QgsDataSourceSelectDialog class embeds the browser view to select an existing data source.
By default any layer type can be chosen, the valid layer type can be restricted by setting a layer type filter with setLayerTypeFilter(layerType) or by activating the filter directly from the constructor.
To retrieve the selected data source, uri() can be called and it will return a (possibly invalid) QgsMimeDataUtils::Uri.
Definition at line 161 of file qgsdatasourceselectdialog.h.
QgsDataSourceSelectDialog::QgsDataSourceSelectDialog | ( | QgsBrowserGuiModel * | browserModel = nullptr , |
bool | setFilterByLayerType = false , |
||
Qgis::LayerType | layerType = Qgis::LayerType::Vector , |
||
QWidget * | parent = nullptr |
||
) |
Constructs a QgsDataSourceSelectDialog, optionally filtering by layer type.
browserModel | an existing browser model (typically from app), if nullptr an instance will be created |
setFilterByLayerType | activates filtering by layer type |
layerType | sets the layer type filter, this is in effect only if filtering by layer type is also active |
parent | the object |
Definition at line 321 of file qgsdatasourceselectdialog.cpp.
void QgsDataSourceSelectDialog::expandPath | ( | const QString & | path | ) |
Expands out a file path in the view.
The path must correspond to a valid directory existing on the file system.
Definition at line 357 of file qgsdatasourceselectdialog.cpp.
void QgsDataSourceSelectDialog::setCaseSensitive | ( | bool | caseSensitive | ) |
Sets filter case sensitivity.
Definition at line 377 of file qgsdatasourceselectdialog.cpp.
void QgsDataSourceSelectDialog::setDescription | ( | const QString & | description | ) |
Sets a description label.
description | a description string |
Definition at line 352 of file qgsdatasourceselectdialog.cpp.
void QgsDataSourceSelectDialog::setFilter | ( | ) |
Apply filter to the model.
Definition at line 382 of file qgsdatasourceselectdialog.cpp.
void QgsDataSourceSelectDialog::setFilterSyntax | ( | QAction * | syntax | ) |
Sets filter syntax.
Definition at line 372 of file qgsdatasourceselectdialog.cpp.
void QgsDataSourceSelectDialog::setLayerTypeFilter | ( | Qgis::LayerType | layerType | ) |
Sets layer type filter to layerType and activates the filtering.
Definition at line 347 of file qgsdatasourceselectdialog.cpp.
void QgsDataSourceSelectDialog::showFilterWidget | ( | bool | visible | ) |
Show/hide filter widget.
Definition at line 367 of file qgsdatasourceselectdialog.cpp.
QgsMimeDataUtils::Uri QgsDataSourceSelectDialog::uri | ( | ) | const |
Returns the (possibly invalid) uri of the selected data source.
Definition at line 362 of file qgsdatasourceselectdialog.cpp.