Class: QgsNewDatabaseTableNameWidget¶
The QgsNewDatabaseTableNameWidget
class embeds the browser
view to select a DB schema and a new table name.
The table name is validated for uniqueness and the selected data item provider, schema and table names can be retrieved with getters.
Warning
The data provider that originated the data item provider must support the connections API
Added in version 3.14.
Class Hierarchy¶
Base classes¶
Base class for any widget that can be shown as a inline panel |
|
Methods
Returns the currently selected data item provider key |
|
Returns |
|
Returns the currently selected schema or file path (in case of filesystem-based DBs like spatialite or GPKG) for the new table |
|
Sets whether the optional "Ok"/accept button should be visible. |
|
Scroll to last selected index and expand it's children |
|
Returns the current name of the new table |
|
Returns the (possibly blank) string representation of the new table data source URI. |
|
Returns the validation error or an empty string is the widget status is valid |
Signals
Emitted when the OK/accept button is clicked. |
|
This signal is emitted when the selects a data provider or a schema name that has a different data provider than the previously selected one. |
|
This signal is emitted when the user selects a schema (or file path for filesystem-based DBs like spatialite or GPKG). |
|
This signal is emitted when the user enters a table name |
|
This signal is emitted when the URI of the new table changes, whether or not it is a valid one. |
|
This signal is emitted whenever the validation status of the widget changes. |
- class qgis.gui.QgsNewDatabaseTableNameWidget[source]¶
Bases:
QgsPanelWidget
- __init__(browserModel: QgsBrowserGuiModel | None = None, providersFilter: Iterable[str | None] = [], parent: QWidget | None = None)
Constructs a new QgsNewDatabaseTableNameWidget
- Parameters:
browserModel (Optional[QgsBrowserGuiModel] = None) – an existing browser model (typically from app), if
None
an instance will be createdprovidersFilter (Iterable[Optional[str]] = []) – optional white list of data provider keys that should be shown in the widget, if not specified all providers data items with database capabilities will be shown
parent (Optional[QWidget] = None) – optional parent for this widget
- dataProviderKey(self) str [source]¶
Returns the currently selected data item provider key
- Return type:
str
- isValid(self) bool [source]¶
Returns
True
if the widget contains a valid new table name- Return type:
bool
- signal providerKeyChanged(providerKey: str)[source]¶
This signal is emitted when the selects a data provider or a schema name that has a different data provider than the previously selected one.
- Parameters:
providerKey (str) – the data provider key of the selected schema
- schema(self) str [source]¶
Returns the currently selected schema or file path (in case of filesystem-based DBs like spatialite or GPKG) for the new table
- Return type:
str
- signal schemaNameChanged(schemaName: str)[source]¶
This signal is emitted when the user selects a schema (or file path for filesystem-based DBs like spatialite or GPKG).
- Parameters:
schemaName (str) – the name of the selected schema
- setAcceptButtonVisible(self, visible: bool)[source]¶
Sets whether the optional “Ok”/accept button should be visible.
By default this is hidden, to better allow the widget to be embedded inside other widgets and dialogs.
- Parameters:
visible (bool)
- showEvent(self, e: QShowEvent | None)[source]¶
Scroll to last selected index and expand it’s children
- Parameters:
e (Optional[QShowEvent])
- signal tableNameChanged(tableName: str)[source]¶
This signal is emitted when the user enters a table name
- Parameters:
tableName (str) – the name of the new table
- uri(self) str [source]¶
Returns the (possibly blank) string representation of the new table data source URI. The URI might be invalid in case the widget is not in a valid state.
- Return type:
str
- signal uriChanged(uri: str)[source]¶
This signal is emitted when the URI of the new table changes, whether or not it is a valid one.
- Parameters:
uri (str) – URI string representation