Class: QgsAbstractDbSourceSelect¶
Base class for database source widget selectors.
Added in version 3.24.
Note
This is an abstract class, with methods which must be implemented by a subclass.
The following methods must be implemented: setSql()
Class Hierarchy¶
Base classes¶
Abstract base class for Data Source widgets to create connections and add layers. |
|
Abstract Methods
This is called to define the SQL query and must be re-implemented. |
Methods
Sets the source model for the table and optionally a delegate |
|
Returns the proxy model used to filter the results |
|
Stores the settings made in the gui |
Virtual Methods
In PyQGIS, only methods marked as virtual
can be safely overridden in a Python subclass of QgsAbstractDbSourceSelect. See the FAQ for more details.
Returns the setting path of the derived source select |
|
Called on click for the source index |
|
Called on double-click for the source index |
- class qgis.gui.QgsAbstractDbSourceSelect[source]¶
Bases:
QgsAbstractDataSourceWidget
- __init__(parent: QWidget | None = None, fl: Qt.WindowFlags | Qt.WindowType = QgsGuiUtils.ModalDialogFlags, widgetMode: QgsProviderRegistry.WidgetMode = QgsProviderRegistry.WidgetMode.Standalone)
Constructor
- Parameters:
parent (Optional[QWidget] = None)
fl (Union[Qt.WindowFlags, Qt.WindowType] = QgsGuiUtils.ModalDialogFlags)
widgetMode (QgsProviderRegistry.WidgetMode = QgsProviderRegistry.WidgetMode.Standalone)
- init(self, model: QgsAbstractDbTableModel | None, delegate: QItemDelegate | None = None)[source]¶
Sets the source model for the table and optionally a delegate
- Parameters:
model (Optional[QgsAbstractDbTableModel])
delegate (Optional[QItemDelegate] = None)
- proxyModel(self) QSortFilterProxyModel | None [source]¶
Returns the proxy model used to filter the results
- Return type:
Optional[QSortFilterProxyModel]
- abstract setSql(self, index: QModelIndex)[source]¶
This is called to define the SQL query and must be re-implemented. The implementation should call
QgsAbstractDbTableModel
.setSql The index is in the source model.- Parameters:
index (QModelIndex)
- virtual settingPath(self) str [source]¶
Returns the setting path of the derived source select
- Return type:
str
- Returns:
setting path
Note
Might be pure virtual in QGIS 5.x
Added in version 3.44.