QGIS API Documentation
3.6.0-Noosa (5873452)
|
The QgsDataSourceSelectDialog class embeds the browser view to select an existing data source. More...
#include <qgsdatasourceselectdialog.h>
Public Member Functions | |
QgsDataSourceSelectDialog (QgsBrowserModel *browserModel=nullptr, bool setFilterByLayerType=false, const QgsMapLayer::LayerType &layerType=QgsMapLayer::LayerType::VectorLayer, QWidget *parent=nullptr) | |
Constructs a QgsDataSourceSelectDialog, optionally filtering by layer type. More... | |
~QgsDataSourceSelectDialog () override | |
void | setCaseSensitive (bool caseSensitive) |
Sets filter case sensitivity. More... | |
void | setFilter () |
Apply filter to the model. More... | |
void | setFilterSyntax (QAction *) |
Sets filter syntax. More... | |
void | setLayerTypeFilter (QgsMapLayer::LayerType layerType) |
Sets layer type filter to layerType and activates the filtering. More... | |
void | showEvent (QShowEvent *e) override |
Scroll to last selected index and expand it's children. More... | |
void | showFilterWidget (bool visible) |
Show/hide filter widget. More... | |
QgsMimeDataUtils::Uri | uri () const |
Returns the (possibly invalid) uri of the selected data source. More... | |
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 44 of file qgsdatasourceselectdialog.h.
QgsDataSourceSelectDialog::QgsDataSourceSelectDialog | ( | QgsBrowserModel * | browserModel = nullptr , |
bool | setFilterByLayerType = false , |
||
const QgsMapLayer::LayerType & | layerType = QgsMapLayer::LayerType::VectorLayer , |
||
QWidget * | parent = nullptr |
||
) |
Constructs a QgsDataSourceSelectDialog, optionally filtering by layer type.
browserModel | an existing browser model (typically from app), if null 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 27 of file qgsdatasourceselectdialog.cpp.
|
override |
Definition at line 114 of file qgsdatasourceselectdialog.cpp.
void QgsDataSourceSelectDialog::setCaseSensitive | ( | bool | caseSensitive | ) |
Sets filter case sensitivity.
Definition at line 216 of file qgsdatasourceselectdialog.cpp.
void QgsDataSourceSelectDialog::setFilter | ( | ) |
Apply filter to the model.
Definition at line 161 of file qgsdatasourceselectdialog.cpp.
void QgsDataSourceSelectDialog::setFilterSyntax | ( | QAction * | action | ) |
Sets filter syntax.
Definition at line 209 of file qgsdatasourceselectdialog.cpp.
void QgsDataSourceSelectDialog::setLayerTypeFilter | ( | QgsMapLayer::LayerType | layerType | ) |
Sets layer type filter to layerType and activates the filtering.
Definition at line 221 of file qgsdatasourceselectdialog.cpp.
|
override |
Scroll to last selected index and expand it's children.
Definition at line 121 of file qgsdatasourceselectdialog.cpp.
void QgsDataSourceSelectDialog::showFilterWidget | ( | bool | visible | ) |
Show/hide filter widget.
Definition at line 146 of file qgsdatasourceselectdialog.cpp.
QgsMimeDataUtils::Uri QgsDataSourceSelectDialog::uri | ( | ) | const |
Returns the (possibly invalid) uri of the selected data source.
Definition at line 230 of file qgsdatasourceselectdialog.cpp.