| QGIS API Documentation
    3.20.0-Odense (decaadbb31)
    | 
The QgsDataSourceSelectWidget class embeds the browser view to select an existing data source. More...
#include <qgsdatasourceselectdialog.h>

| Signals | |
| void | itemTriggered (const QgsMimeDataUtils::Uri &uri) | 
| Emitted when an item is triggered, e.g.  More... | |
| void | selectionChanged () | 
| Emitted when the current selection changes in the widget.  More... | |
| void | validationChanged (bool isValid) | 
| This signal is emitted whenever the validation status of the widget changes.  More... | |
|  Signals inherited from QgsPanelWidget | |
| void | panelAccepted (QgsPanelWidget *panel) | 
| Emitted when the panel is accepted by the user.  More... | |
| void | showPanel (QgsPanelWidget *panel) | 
| Emit when you require a panel to be show in the interface.  More... | |
| void | widgetChanged () | 
| Emitted when the widget state changes.  More... | |
| Public Member Functions | |
| QgsDataSourceSelectWidget (QgsBrowserGuiModel *browserModel=nullptr, bool setFilterByLayerType=false, QgsMapLayerType layerType=QgsMapLayerType::VectorLayer, QWidget *parent=nullptr) | |
| Constructs a QgsDataSourceSelectWidget, optionally filtering by layer type.  More... | |
| ~QgsDataSourceSelectWidget () override | |
| void | setCaseSensitive (bool caseSensitive) | 
| Sets filter case sensitivity.  More... | |
| void | setDescription (const QString &description) | 
| Sets a description label.  More... | |
| void | setFilter () | 
| Apply filter to the model.  More... | |
| void | setFilterSyntax (QAction *) | 
| Sets filter syntax.  More... | |
| void | setLayerTypeFilter (QgsMapLayerType 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... | |
|  Public Member Functions inherited from QgsPanelWidget | |
| QgsPanelWidget (QWidget *parent=nullptr) | |
| Base class for any widget that can be shown as a inline panel.  More... | |
| virtual bool | applySizeConstraintsToStack () const | 
| Returns trueif the size constraints and hints for the panel widget should be applied to the parent QgsPanelWidgetStack which this panel is shown in.  More... | |
| bool | autoDelete () | 
| The the auto delete property on the widget.  More... | |
| void | connectChildPanel (QgsPanelWidget *panel) | 
| Connect the given sub panel widgets showPanel signals to this current panels main showPanel event to bubble up to the user.  More... | |
| void | connectChildPanels (const QList< QgsPanelWidget * > &panels) | 
| Connect the given sub panel widgets showPanel signals to this current panels main showPanel event to bubble up to the user.  More... | |
| bool | dockMode () | 
| Returns the dock mode state.  More... | |
| virtual QMenu * | menuButtonMenu () | 
| Returns the menu to use for the menu button for this panel, or nullptrif no menu button is required.  More... | |
| virtual QString | menuButtonTooltip () const | 
| Returns the (translated) tooltip text to use for the menu button for this panel.  More... | |
| QString | panelTitle () | 
| The title of the panel.  More... | |
| void | setAutoDelete (bool autoDelete) | 
| The the auto delete property on the widget.  More... | |
| virtual void | setDockMode (bool dockMode) | 
| Set the widget in dock mode which tells the widget to emit panel widgets and not open dialogs.  More... | |
| void | setPanelTitle (const QString &panelTitle) | 
| Set the title of the panel when shown in the interface.  More... | |
| Additional Inherited Members | |
|  Public Slots inherited from QgsPanelWidget | |
| void | acceptPanel () | 
| Accept the panel.  More... | |
| void | openPanel (QgsPanelWidget *panel) | 
| Open a panel or dialog depending on dock mode setting If dock mode is truethis method will emit the showPanel signal for connected slots to handle the open event.  More... | |
|  Static Public Member Functions inherited from QgsPanelWidget | |
| static QgsPanelWidget * | findParentPanel (QWidget *widget) | 
| Traces through the parents of a widget to find if it is contained within a QgsPanelWidget widget.  More... | |
|  Protected Member Functions inherited from QgsPanelWidget | |
| void | keyPressEvent (QKeyEvent *event) override | 
| Overridden key press event to handle the esc event on the widget.  More... | |
The QgsDataSourceSelectWidget 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 46 of file qgsdatasourceselectdialog.h.
| QgsDataSourceSelectWidget::QgsDataSourceSelectWidget | ( | QgsBrowserGuiModel * | browserModel = nullptr, | 
| bool | setFilterByLayerType = false, | ||
| QgsMapLayerType | layerType = QgsMapLayerType::VectorLayer, | ||
| QWidget * | parent = nullptr | ||
| ) | 
Constructs a QgsDataSourceSelectWidget, optionally filtering by layer type.
| browserModel | an existing browser model (typically from app), if nullptran 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 34 of file qgsdatasourceselectdialog.cpp.
| 
 | overridedefault | 
| 
 | signal | 
Emitted when an item is triggered, e.g.
via a double-click.
| 
 | signal | 
Emitted when the current selection changes in the widget.
| void QgsDataSourceSelectWidget::setCaseSensitive | ( | bool | caseSensitive | ) | 
Sets filter case sensitivity.
Definition at line 259 of file qgsdatasourceselectdialog.cpp.
| void QgsDataSourceSelectWidget::setDescription | ( | const QString & | description | ) | 
Sets a description label.
| description | a description string | 
Definition at line 161 of file qgsdatasourceselectdialog.cpp.
| void QgsDataSourceSelectWidget::setFilter | ( | ) | 
Apply filter to the model.
Definition at line 195 of file qgsdatasourceselectdialog.cpp.
| void QgsDataSourceSelectWidget::setFilterSyntax | ( | QAction * | action | ) | 
Sets filter syntax.
Definition at line 252 of file qgsdatasourceselectdialog.cpp.
| void QgsDataSourceSelectWidget::setLayerTypeFilter | ( | QgsMapLayerType | layerType | ) | 
Sets layer type filter to layerType and activates the filtering.
Definition at line 264 of file qgsdatasourceselectdialog.cpp.
| 
 | override | 
Scroll to last selected index and expand it's children.
Definition at line 121 of file qgsdatasourceselectdialog.cpp.
| void QgsDataSourceSelectWidget::showFilterWidget | ( | bool | visible | ) | 
Show/hide filter widget.
Definition at line 146 of file qgsdatasourceselectdialog.cpp.
| QgsMimeDataUtils::Uri QgsDataSourceSelectWidget::uri | ( | ) | const | 
Returns the (possibly invalid) uri of the selected data source.
Definition at line 273 of file qgsdatasourceselectdialog.cpp.
| 
 | signal | 
This signal is emitted whenever the validation status of the widget changes.
| isValid | trueif the current status of the widget is valid |